Loading...
Loading...
Compare original and translation side by side
/ork:fix-issue 123
/ork:fix-issue 456Opus 4.6: Root cause analysis uses native adaptive thinking. Dynamic token budgets scale with context window for thorough investigation.
/ork:fix-issue 123
/ork:fix-issue 456Opus 4.6:根本原因分析采用原生自适应思维。动态token预算会根据上下文窗口调整,以实现全面调查。
AskUserQuestion(
questions=[{
"question": "What approach for this fix?",
"header": "Approach",
"options": [
{"label": "Proper fix (Recommended)", "description": "Full RCA, tests, prevention recommendations"},
{"label": "Quick fix", "description": "Minimal fix to resolve the immediate issue"},
{"label": "Investigate first", "description": "Understand the issue before deciding on approach"},
{"label": "Hotfix", "description": "Emergency patch, minimal testing"}
],
"multiSelect": false
}]
)AskUserQuestion(
questions=[{
"question": "What approach for this fix?",
"header": "Approach",
"options": [
{"label": "Proper fix (Recommended)", "description": "Full RCA, tests, prevention recommendations"},
{"label": "Quick fix", "description": "Minimal fix to resolve the immediate issue"},
{"label": "Investigate first", "description": "Understand the issue before deciding on approach"},
{"label": "Hotfix", "description": "Emergency patch, minimal testing"}
],
"multiSelect": false
}]
)CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1| Aspect | Task Tool | Agent Teams |
|---|---|---|
| Hypothesis sharing | Lead relays between agents | Investigators share hypotheses in real-time |
| Conflicting evidence | Lead resolves | Investigators debate directly |
| Cost | ~250K tokens | ~600K tokens |
| Best for | Single-domain bugs | Cross-cutting bugs with multiple hypotheses |
Fallback: If Agent Teams encounters issues, fall back to Task tool for remaining investigation.
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1| 维度 | 任务工具 | Agent Teams |
|---|---|---|
| 假设共享 | 主导者在Agent间传递信息 | 调查者实时共享假设 |
| 冲突证据处理 | 主导者解决 | 调查者直接讨论 |
| 成本 | ~250K tokens | ~600K tokens |
| 适用场景 | 单一领域漏洞 | 存在多种假设的跨域漏洞 |
降级方案:若Agent Teams出现问题,剩余调查流程切换为任务工具模式。
undefinedundefined
---
---| Phase | Activities | Output |
|---|---|---|
| 1. Understand Issue | Read GitHub issue details | Problem statement |
| 2. Similar Issue Detection | Search for related past issues | Related issues list |
| 3. Hypothesis Formation | Form hypotheses with confidence scores | Ranked hypotheses |
| 4. Root Cause Analysis | 5 parallel agents investigate | Confirmed root cause |
| 5. Fix Design | Design approach based on RCA | Fix specification |
| 6. Implementation | Apply fix with tests | Working code |
| 7. Validation | Verify fix resolves issue | Evidence |
| 8. Prevention | How to prevent recurrence | Prevention plan |
| 9. Runbook | Create/update runbook entry | Runbook |
| 10. Lessons Learned | Capture knowledge | Persisted learnings |
| 11. Commit and PR | Create PR with fix | Merged PR |
| 阶段 | 活动 | 输出 |
|---|---|---|
| 1. 理解问题 | 查看GitHub问题详情 | 问题描述 |
| 2. 相似问题检测 | 搜索过往相关问题 | 相关问题列表 |
| 3. 形成假设 | 生成带置信度评分的假设 | 排序后的假设 |
| 4. 根本原因分析 | 5个并行Agent开展调查 | 确认的根本原因 |
| 5. 修复方案设计 | 基于RCA设计修复方案 | 修复规格说明 |
| 6. 实施修复 | 应用修复并添加测试 | 可运行代码 |
| 7. 验证修复 | 验证修复是否解决问题 | 验证证据 |
| 8. 生成预防措施 | 如何防止问题复发 | 预防计划 |
| 9. 创建操作手册 | 创建/更新操作手册条目 | 操作手册 |
| 10. 经验总结 | 留存知识 | 持久化经验 |
| 11. 提交与PR | 创建包含修复内容的PR | 已合并的PR |
gh issue view $ARGUMENTS --json title,body,labels,assignees,comments
gh pr list --search "issue:$ARGUMENTS"
gh issue view $ARGUMENTS --commentsissue-progress-trackingissue/N-descriptiongh issue view $ARGUMENTS --json title,body,labels,assignees,comments
gh pr list --search "issue:$ARGUMENTS"
gh issue view $ARGUMENTS --commentsissue-progress-trackingissue/N-descriptiongh issue list --search "[key error message]" --state all
mcp__memory__search_nodes(query="issue [error type] fix")| Similar Issue | Similarity | Status | Relevant? |
|---|---|---|---|
| #101 | 85% | Closed | Yes |
gh issue list --search "[key error message]" --state all
mcp__memory__search_nodes(query="issue [error type] fix")| 相似问题 | 相似度 | 状态 | 是否相关 |
|---|---|---|---|
| #101 | 85% | 已关闭 | 是 |
undefinedundefined
| Confidence | Meaning |
|------------|---------|
| 90-100% | Near certain |
| 70-89% | Highly likely |
| 50-69% | Probable |
| 30-49% | Possible |
| 0-29% | Unlikely |
---
| 置信度 | 含义 |
|------------|---------|
| 90-100% | 几乎确定 |
| 70-89% | 极有可能 |
| 50-69% | 可能 |
| 30-49% | 有可能 |
| 0-29% | 不太可能 |
---run_in_background=Truemax_turns=25run_in_background=Truemax_turns=25See references/agent-teams-rca.md for Agent Teams root cause analysis workflow.
Agent Teams根本原因分析工作流请参考references/agent-teams-rca.md。
undefinedundefined| File | Change | Reason |
|---|---|---|
| [file] | MODIFY | [why] |
| 文件 | 变更 | 原因 |
|---|---|---|
| [file] | MODIFY | [原因] |
---
---undefinedundefinedundefinedundefinedundefinedundefined
**Guidelines:**
- Make minimal, focused changes
- Add proper error handling
- Add regression test FIRST (MANDATORY)
- DO NOT over-engineer
- DO NOT commit directly to protected branches
---undefinedundefinedundefined
---| Category | Examples | Effectiveness |
|---|---|---|
| Automated test | Unit/integration test in CI | HIGH - catches before merge |
| Validation rule | Schema check, lint rule | HIGH - catches on save/commit |
| Architecture | Better error boundaries | MEDIUM |
| Process | Review checklist item | LOW - human-dependent |
---undefined| 类别 | 示例 | 有效性 |
|---|---|---|
| 自动化测试 | CI中的单元/集成测试 | 高 - 合并前捕获问题 |
| 验证规则 | Schema检查、Lint规则 | 高 - 保存/提交时捕获问题 |
| 架构优化 | 更完善的错误边界 | 中 |
| 流程优化 | 评审检查项 | 低 - 依赖人工 |
undefined[command][command]
Store in memory for future reference.
---mcp__memory__create_entities(entities=[{
"name": "lessons-issue-$ARGUMENTS",
"entityType": "LessonsLearned",
"observations": [
"root_cause: [brief]",
"key_learning: [most important]",
"prevention: [recommendation]"
]
}])
存储至内存供未来参考。
---git add .
git commit -m "fix(#$ARGUMENTS): [Brief description]
Root cause: [one line]
Prevention: [recommendation]"
git push -u origin issue/$ARGUMENTS-fix
gh pr create --base dev --title "fix(#$ARGUMENTS): [description]"mcp__memory__create_entities(entities=[{
"name": "lessons-issue-$ARGUMENTS",
"entityType": "LessonsLearned",
"observations": [
"root_cause: [brief]",
"key_learning: [most important]",
"prevention: [recommendation]"
]
}])| Decision | Choice | Rationale |
|---|---|---|
| Feature branch | MANDATORY | Never commit to main/dev directly |
| Regression test | MANDATORY | Fix without test is incomplete |
| Hypothesis confidence | 0-100% scale | Quantifies certainty |
| Similar issue search | Before hypothesis | Leverage past solutions |
| Prevention analysis | Mandatory phase | Break recurring issue cycle |
| Runbook generation | Template-based | Consistent documentation |
git add .
git commit -m "fix(#$ARGUMENTS): [Brief description]
Root cause: [one line]
Prevention: [recommendation]"
git push -u origin issue/$ARGUMENTS-fix
gh pr create --base dev --title "fix(#$ARGUMENTS): [description]"See references/cc-enhancements.md for session resume, task metrics, tool guidance, worktree isolation, and adaptive thinking.
| 决策 | 选择 | 理由 |
|---|---|---|
| 功能分支 | 强制要求 | 禁止直接提交到main/dev分支 |
| 回归测试 | 强制要求 | 没有测试的修复是不完整的 |
| 假设置信度 | 0-100%评分体系 | 量化确定性 |
| 相似问题搜索 | 在形成假设前执行 | 借鉴过往解决方案 |
| 预防分析 | 强制阶段 | 打破问题重复出现的循环 |
| 操作手册生成 | 基于模板 | 确保文档一致性 |
| Rule | Impact | What It Covers |
|---|---|---|
| rca-five-whys | HIGH | 5 Whys iterative causal analysis |
| rca-fishbone | MEDIUM | Ishikawa diagram, multi-factor analysis |
| rca-fault-tree | MEDIUM | Fault tree analysis, AND/OR gates, critical systems |
会话恢复、任务指标、工具指引、工作区隔离及自适应思维相关内容请参考references/cc-enhancements.md。
ork:commitdebug-investigatorork:issue-progress-trackingork:remember| 规则 | 影响 | 覆盖范围 |
|---|---|---|
| rca-five-whys | 高 | 5Why迭代因果分析 |
| rca-fishbone | 中 | 鱼骨图、多因素分析 |
| rca-fault-tree | 中 | 故障树分析、AND/OR门、关键系统 |
ork:commitdebug-investigatorork:issue-progress-trackingork:remember