api
무료RESTful API design patterns and best practices. Use when creating endpoints, designing APIs, or implementing routes.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Systematic debugging methods, log analysis, and performance diagnostics. Use when debugging issues, analyzing errors, or troubleshooting incidents.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치 방법 보기설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
本技能提供系统化的调试方法和技巧。
问题描述 → 复现问题 → 缩小范围 → 定位原因 → 修复验证 → 记录总结
记录时包含以下要素:
| 要素 | 内容 |
|---|---|
| 问题描述 | 简要描述问题现象 |
| 预期 vs 实际 | 期望行为与实际行为的差异 |
| 复现步骤 | 可稳定复现的最小步骤 |
| 环境信息 | OS、语言版本、依赖版本 |
| 错误信息 | 完整的错误堆栈或日志 |
| 已尝试方案 | 每个方案及其结果 |
// ❌ 无用的日志
console.log("here");
console.log(data);
// ✅ 有信息量的日志
console.log("[UserService.createUser] 开始创建用户:", {
email: user.email,
timestamp: new Date().toISOString(),
});
console.log("[UserService.createUser] 数据库插入成功:", {
userId: result.id,
duration: Date.now() - startTime,
});
console.error("[UserService.createUser] 创建失败:", {
error: error.message,
stack: error.stack,
input: { email: user.email },
});
# ❌ 无用的日志
print("here")
print(data)
# ✅ 有信息量的日志
import logging
logger = logging.getLogger(__name__)
logger.info(f"[create_user] 开始创建用户: email={email}")
logger.info(f"[create_user] 创建成功: user_id={user.id}, duration={duration}ms")
logger.error(f"[create_user] 创建失败: error={str(e)}", exc_info=True)
| 级别 | 用途 | 示例 |
|---|---|---|
| DEBUG | 详细调试信息 | 函数参数、中间状态 |
| INFO | 正常操作信息 | 用户登录、订单创建 |
| WARN | 警告但可继续 | 配置缺失使用默认值 |
| ERROR | 错误但可恢复 | API 调用失败重试 |
| FATAL | 致命错误需退出 | 数据库连接失败 |
.vscode/launch.json)| 场景 | type | 关键配置 |
|---|---|---|
| Node.js | node | program, preLaunchTask, outFiles |
| Python | python | program: "${file}", integratedTerminal |
| Jest 测试 | node | program: jest, args: ["--runInBand"] |
在循环中设置条件表达式 (如 item.id === 'target-id'),仅在满足条件时暂停。
performance.now() / console.time / Python timeit 装饰器process.memoryUsage() / Python tracemallocgroup / table / assert / trace / countdisplayName / useDebugValue## 调试前
- [ ] 能稳定复现问题吗?
- [ ] 最小复现用例是什么?
- [ ] 最近改动了什么?
## 调试中
- [ ] 查看错误日志和堆栈
- [ ] 添加必要的日志输出
- [ ] 使用断点逐步执行
- [ ] 检查输入数据是否正确
- [ ] 检查环境变量和配置
## 调试后
- [ ] 修复是否解决了根本原因?
- [ ] 是否需要添加测试?
- [ ] 是否需要更新文档?
- [ ] 是否有类似问题需要检查?
记住: 调试的第一步是复现——稳定复现问题后,解决方案通常就在眼前。
아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
RESTful API design patterns and best practices. Use when creating endpoints, designing APIs, or implementing routes.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Architecture design skill: ADR records, system design checklists, scalability assessment, architecture patterns. Use for complex system design and architecture decisions.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Backend development patterns for services, error handling, logging, caching. Use when building backend services, APIs, or microservices.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Strategic compaction skill: suggests context compression at logical breakpoints. Use to suggest compaction at logical intervals during development sessions.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Database design, query optimization, migrations, and indexing. Use when designing schemas, writing queries, or managing migrations.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
DevOps patterns: containerization, CI/CD, deployment strategies, monitoring. Use when containerizing apps, setting up pipelines, or deploying services.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.