cc-devflow 4.5.10 → 4.5.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/.claude/skills/cc-act/CHANGELOG.md +23 -0
  2. package/.claude/skills/cc-act/PLAYBOOK.md +17 -269
  3. package/.claude/skills/cc-act/SKILL.md +38 -418
  4. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_INDEX_TEMPLATE.md +2 -13
  5. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_TEMPLATE.md +1 -9
  6. package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +21 -177
  7. package/.claude/skills/cc-act/references/closure-contract.md +12 -63
  8. package/.claude/skills/cc-act/references/git-commit-guidelines.md +5 -5
  9. package/.claude/skills/cc-act/scripts/cc-act-common.sh +5 -322
  10. package/.claude/skills/cc-act/scripts/detect-ship-target.sh +11 -2
  11. package/.claude/skills/cc-act/scripts/inspect-git-index.sh +58 -0
  12. package/.claude/skills/cc-act/scripts/render-pr-brief.sh +40 -440
  13. package/.claude/skills/cc-act/scripts/verify-act-gate.sh +10 -50
  14. package/.claude/skills/cc-check/CHANGELOG.md +24 -0
  15. package/.claude/skills/cc-check/PLAYBOOK.md +19 -273
  16. package/.claude/skills/cc-check/SKILL.md +33 -454
  17. package/.claude/skills/cc-check/references/review-contract.md +12 -147
  18. package/.claude/skills/cc-dev/CHANGELOG.md +20 -0
  19. package/.claude/skills/cc-dev/PLAYBOOK.md +1 -1
  20. package/.claude/skills/cc-dev/SKILL.md +52 -130
  21. package/.claude/skills/cc-dev/scripts/resolve-cc-devflow.sh +181 -0
  22. package/.claude/skills/cc-do/CHANGELOG.md +17 -0
  23. package/.claude/skills/cc-do/PLAYBOOK.md +19 -113
  24. package/.claude/skills/cc-do/SKILL.md +39 -236
  25. package/.claude/skills/cc-do/references/execution-recovery.md +15 -109
  26. package/.claude/skills/cc-do/scripts/cc-do-common.sh +5 -57
  27. package/.claude/skills/cc-do/scripts/check-task-status.sh +35 -65
  28. package/.claude/skills/cc-do/scripts/mark-task-complete.sh +9 -46
  29. package/.claude/skills/cc-do/scripts/select-ready-tasks.sh +29 -97
  30. package/.claude/skills/cc-investigate/CHANGELOG.md +23 -0
  31. package/.claude/skills/cc-investigate/PLAYBOOK.md +20 -180
  32. package/.claude/skills/cc-investigate/SKILL.md +65 -513
  33. package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +48 -95
  34. package/.claude/skills/cc-investigate/references/investigation-contract.md +14 -217
  35. package/.claude/skills/cc-next/CHANGELOG.md +6 -0
  36. package/.claude/skills/cc-next/PLAYBOOK.md +12 -8
  37. package/.claude/skills/cc-next/SKILL.md +34 -140
  38. package/.claude/skills/cc-plan/CHANGELOG.md +29 -0
  39. package/.claude/skills/cc-plan/PLAYBOOK.md +22 -161
  40. package/.claude/skills/cc-plan/SKILL.md +47 -640
  41. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +30 -225
  42. package/.claude/skills/cc-plan/references/planning-contract.md +24 -160
  43. package/.claude/skills/cc-plan/scripts/next-change-key.sh +8 -44
  44. package/.claude/skills/cc-plan/scripts/parse-task-dependencies.js +2 -2
  45. package/.claude/skills/cc-plan/scripts/validate-scope.sh +1 -1
  46. package/.claude/skills/cc-pr-land/SKILL.md +14 -114
  47. package/.claude/skills/cc-pr-review/CHANGELOG.md +4 -0
  48. package/.claude/skills/cc-pr-review/SKILL.md +20 -103
  49. package/.claude/skills/cc-review/CHANGELOG.md +17 -0
  50. package/.claude/skills/cc-review/PLAYBOOK.md +13 -86
  51. package/.claude/skills/cc-review/SKILL.md +53 -241
  52. package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +2 -2
  53. package/.claude/skills/cc-review/references/implementation-review-branch.md +7 -147
  54. package/.claude/skills/cc-review/references/plan-review-branch.md +5 -147
  55. package/.claude/skills/cc-review/references/review-methods.md +10 -218
  56. package/.claude/skills/cc-review/scripts/collect-review-context.sh +4 -63
  57. package/.claude/skills/cc-roadmap/PLAYBOOK.md +1 -1
  58. package/.claude/skills/cc-roadmap/SKILL.md +3 -3
  59. package/.claude/skills/cc-simplify/CHANGELOG.md +7 -0
  60. package/.claude/skills/cc-simplify/SKILL.md +26 -21
  61. package/.claude/skills/cc-spec-init/PLAYBOOK.md +12 -48
  62. package/.claude/skills/cc-spec-init/SKILL.md +29 -132
  63. package/.claude/skills/cc-spec-init/references/spec-contract.md +8 -17
  64. package/CHANGELOG.md +27 -0
  65. package/README.md +5 -3
  66. package/README.zh-CN.md +5 -3
  67. package/bin/cc-devflow-cli.js +20 -260
  68. package/bin/cc-devflow.js +44 -7
  69. package/docs/commands/README.md +1 -1
  70. package/docs/commands/README.zh-CN.md +1 -1
  71. package/docs/examples/README.md +1 -1
  72. package/docs/examples/START-HERE.md +14 -14
  73. package/docs/examples/example-bindings.json +11 -11
  74. package/docs/examples/full-design-blocked/README.md +4 -6
  75. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/{planning/tasks.md → task.md} +20 -15
  76. package/docs/examples/local-handoff/README.md +8 -11
  77. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/pr-brief.md +31 -0
  78. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/{planning/tasks.md → task.md} +18 -13
  79. package/docs/examples/pdca-loop/README.md +6 -9
  80. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +9 -11
  81. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/{planning/tasks.md → task.md} +18 -13
  82. package/docs/examples/scripts/check-example-bindings.sh +11 -62
  83. package/docs/guides/artifact-contract.md +10 -36
  84. package/docs/guides/getting-started.md +8 -7
  85. package/docs/guides/getting-started.zh-CN.md +8 -7
  86. package/docs/guides/minimize-artifacts.md +16 -116
  87. package/docs/guides/project-postmortem.md +14 -71
  88. package/lib/compiler/__tests__/skills-registry.test.js +9 -8
  89. package/lib/compiler/resource-copier.js +29 -0
  90. package/lib/skill-runtime/__tests__/archive-change.test.js +2 -2
  91. package/lib/skill-runtime/__tests__/benchmark-skills.test.js +109 -0
  92. package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +14 -4
  93. package/lib/skill-runtime/errors.js +3 -3
  94. package/lib/skill-runtime/index.js +5 -23
  95. package/lib/skill-runtime/paths.js +5 -52
  96. package/lib/skill-runtime/query-registry.js +4 -4
  97. package/lib/skill-runtime/query.js +89 -201
  98. package/lib/skill-runtime/store.js +4 -40
  99. package/lib/skill-runtime/trace.js +2 -2
  100. package/package.json +5 -7
  101. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_PRINCIPLES_TEMPLATE.md +0 -29
  102. package/.claude/skills/cc-act/assets/RELEASE_NOTE_TEMPLATE.md +0 -54
  103. package/.claude/skills/cc-act/scripts/generate-status-report.sh +0 -92
  104. package/.claude/skills/cc-act/scripts/sync-act-docs.sh +0 -355
  105. package/.claude/skills/cc-check/assets/REPORT_CARD_TEMPLATE.json +0 -234
  106. package/.claude/skills/cc-check/scripts/render-report-card.js +0 -438
  107. package/.claude/skills/cc-check/scripts/verify-gate.sh +0 -85
  108. package/.claude/skills/cc-do/scripts/build-task-context.sh +0 -175
  109. package/.claude/skills/cc-do/scripts/record-review-decision.sh +0 -88
  110. package/.claude/skills/cc-do/scripts/recover-workflow.sh +0 -82
  111. package/.claude/skills/cc-do/scripts/run-problem-analysis.sh +0 -70
  112. package/.claude/skills/cc-do/scripts/verify-task-gates.sh +0 -109
  113. package/.claude/skills/cc-do/scripts/write-task-checkpoint.sh +0 -92
  114. package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +0 -225
  115. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +0 -179
  116. package/.claude/skills/cc-spec-init/assets/CHANGE_META_TEMPLATE.json +0 -28
  117. package/.claude/skills/cc-spec-init/scripts/validate-spec-links.sh +0 -45
  118. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +0 -234
  119. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +0 -488
  120. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/review/report-card.json +0 -189
  121. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/resume-index.md +0 -39
  122. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/status.md +0 -29
  123. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +0 -123
  124. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +0 -292
  125. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/review/report-card.json +0 -136
  126. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/status.md +0 -29
  127. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +0 -124
  128. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +0 -292
  129. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/review/report-card.json +0 -136
  130. package/docs/get-shit-done-strategy-audit.md +0 -518
  131. package/docs/skill-runtime-migration.md +0 -46
  132. package/lib/skill-runtime/__tests__/approve.test.js +0 -92
  133. package/lib/skill-runtime/__tests__/autopilot.test.js +0 -253
  134. package/lib/skill-runtime/__tests__/benchmark-artifacts.test.js +0 -165
  135. package/lib/skill-runtime/__tests__/delegation.test.js +0 -97
  136. package/lib/skill-runtime/__tests__/dispatch.test.js +0 -237
  137. package/lib/skill-runtime/__tests__/intent.test.js +0 -203
  138. package/lib/skill-runtime/__tests__/lifecycle.test.js +0 -169
  139. package/lib/skill-runtime/__tests__/planner.tdd.test.js +0 -331
  140. package/lib/skill-runtime/__tests__/prepare-pr.test.js +0 -126
  141. package/lib/skill-runtime/__tests__/query.test.js +0 -860
  142. package/lib/skill-runtime/__tests__/readiness.test.js +0 -53
  143. package/lib/skill-runtime/__tests__/release.test.js +0 -85
  144. package/lib/skill-runtime/__tests__/review-check-integration.test.js +0 -148
  145. package/lib/skill-runtime/__tests__/review-records.test.js +0 -619
  146. package/lib/skill-runtime/__tests__/runtime.integration.test.js +0 -351
  147. package/lib/skill-runtime/__tests__/schemas.test.js +0 -337
  148. package/lib/skill-runtime/__tests__/task-contract-migrate.test.js +0 -137
  149. package/lib/skill-runtime/__tests__/task-contract.test.js +0 -783
  150. package/lib/skill-runtime/__tests__/team-state.test.js +0 -51
  151. package/lib/skill-runtime/__tests__/verify-artifacts.test.js +0 -203
  152. package/lib/skill-runtime/__tests__/worker-run.test.js +0 -275
  153. package/lib/skill-runtime/__tests__/worker.test.js +0 -56
  154. package/lib/skill-runtime/__tests__/workflow-context-legacy-fallback.test.js +0 -31
  155. package/lib/skill-runtime/__tests__/workflow-context.test.js +0 -98
  156. package/lib/skill-runtime/artifacts.js +0 -88
  157. package/lib/skill-runtime/context-index.js +0 -545
  158. package/lib/skill-runtime/delegation.js +0 -533
  159. package/lib/skill-runtime/intent.js +0 -309
  160. package/lib/skill-runtime/lifecycle.js +0 -294
  161. package/lib/skill-runtime/operations/CLAUDE.md +0 -19
  162. package/lib/skill-runtime/operations/approve.js +0 -81
  163. package/lib/skill-runtime/operations/autopilot-core.js +0 -337
  164. package/lib/skill-runtime/operations/autopilot-execution.js +0 -307
  165. package/lib/skill-runtime/operations/autopilot-shared.js +0 -48
  166. package/lib/skill-runtime/operations/autopilot.js +0 -163
  167. package/lib/skill-runtime/operations/dispatch.js +0 -416
  168. package/lib/skill-runtime/operations/init.js +0 -60
  169. package/lib/skill-runtime/operations/janitor.js +0 -61
  170. package/lib/skill-runtime/operations/plan.js +0 -59
  171. package/lib/skill-runtime/operations/prepare-pr.js +0 -25
  172. package/lib/skill-runtime/operations/release.js +0 -99
  173. package/lib/skill-runtime/operations/resume.js +0 -126
  174. package/lib/skill-runtime/operations/review-records.js +0 -265
  175. package/lib/skill-runtime/operations/snapshot.js +0 -45
  176. package/lib/skill-runtime/operations/task-contract.js +0 -524
  177. package/lib/skill-runtime/operations/verify.js +0 -170
  178. package/lib/skill-runtime/operations/worker-run.js +0 -531
  179. package/lib/skill-runtime/operations/worker.js +0 -33
  180. package/lib/skill-runtime/planner.js +0 -539
  181. package/lib/skill-runtime/readiness.js +0 -84
  182. package/lib/skill-runtime/review-records.js +0 -123
  183. package/lib/skill-runtime/review.js +0 -855
  184. package/lib/skill-runtime/schemas.js +0 -746
  185. package/lib/skill-runtime/task-contract.js +0 -187
  186. package/lib/skill-runtime/team-state.js +0 -122
  187. package/lib/skill-runtime/workflow-context.js +0 -748
@@ -1,192 +1,32 @@
1
1
  # CC-Investigate Playbook
2
2
 
3
- ## Visible State Machine
3
+ ## State Machine
4
4
 
5
5
  `cc-investigate -> cc-do -> cc-check`
6
6
 
7
- - Enter from: a bug, regression, or broken requirement whose root cause is still unclear.
8
- - Stay in: `cc-investigate` until `planning/tasks.md#Root Cause Contract` and the repair handoff are both frozen.
9
- - Exit to: `cc-do` only after root cause, repair boundary, and source roadmap progress are explicit in canonical artifacts.
10
- - Reroute to: `cc-plan` for scope/design truth changes, or `roadmap` for project-level priority decisions.
7
+ - Enter when root cause is unknown.
8
+ - Stay until `task.md#Root Cause Contract` is evidence-backed.
9
+ - Exit after the Investigate commit exists.
11
10
 
12
- ## Core Rules
11
+ ## Rules
13
12
 
14
- 1. 先复现,再猜原因。
15
- 2. 先把复现做成快、准、可复跑的 feedback loop。
16
- 3. 先确认 loop 复现的是用户报告的同一个失败。
17
- 4. 先看最近变化,再决定是不是 regression。
18
- 5. 先证伪假设,再冻结根因。
19
- 6. `planning/tasks.md` 必须足够让 `cc-do` 脱离当前会话继续工作。
20
- 7. 调查失败三次后先重建入口,不准继续乱补。
21
- 8. 没有 frozen root-cause contract,不准进入 repair task。
22
- 9. 多组件、深层调用、flaky 问题必须先补边界探针、反向追踪或条件等待证据。
23
- 10. diagnose-only 只能输出根因、owner、风险和 next action,不能把未修复状态标成完成。
24
- 11. workflow forensics 先分类 artifact / git / state / tool / permission / process failure,再决定是否进入修复。
25
- 12. 退出前必须跑 Roadmap Sync Gate:`implementation drift`、`missing spec truth`、`roadmap mismatch` 三种结论都要让 source RM 的状态和 next action 跟上。
26
- 13. Root Cause Proof Ladder 必须证明 symptom site、first bad state、violated contract、original trigger、counterfactual proof 和 escape reason。
27
- 14. 分配 `FIX-*` change key 后立刻执行 Worktree Branch Contract:detached worktree 先挂到 `FIX/<task>`;当前在 `main` / default branch 时停止,不写 investigation artifacts。
28
-
29
- ## Iron Law
30
-
31
- ```text
32
- NO REPAIR WITHOUT A FROZEN ROOT-CAUSE CONTRACT
33
- ```
34
-
35
- root-cause contract 至少包含:稳定复现或缩小后的可验证症状、被破坏的代码 / 配置 / 数据 / 依赖契约、已证伪假设、最小修复边界。
36
-
37
- ## Root Cause Proof Ladder
38
-
39
- 根因要从“看到错误的地方”追到“错误第一次被制造的地方”:
40
-
41
- 1. `L1 Symptom Site`:用户看到的失败。
42
- 2. `L2 First Bad State`:第一个坏字段、坏 artifact、坏队列消息、坏配置或坏状态。
43
- 3. `L3 Violated Contract`:被破坏的 schema、invariant、state transition、权限边界或协议。
44
- 4. `L4 Original Trigger`:制造坏状态的用户动作、命令、事件、recent diff、配置或外部响应。
45
- 5. `L5 Counterfactual Proof`:恢复 contract 或替换输入后,症状变化的实际观察。
46
- 6. `L6 Escape Reason`:为什么测试、类型、review、监控或 artifact gate 没挡住。
47
-
48
- 缺 `L2`、`L4` 或 `L5` 时,`analysis.md` 只能写 `needs-more-evidence`、`Evidence Request` 或 reroute,不能生成 `cc-do` repair task。
49
-
50
- ## Required Outputs
51
-
52
- - `planning/tasks.md`
53
- - `planning/task-manifest.json`
54
- - `change-meta.json`
55
-
56
- ## Investigation Standard
57
-
58
- 1. 先收集 symptom、expected、actual、repro。
59
- 2. 先构造 feedback loop:失败测试、HTTP 脚本、CLI fixture、浏览器脚本、trace replay、throwaway harness、fuzz、bisect、differential,最后才是 HITL。
60
- 3. 记录 loop 的运行时间、确定性、失败率、症状匹配证据和 sharpen 计划。
61
- 4. 先查 prior investigations、TODOS/backlog、report-card finding 和最近变更。
62
- 5. 先沿代码路径定位触点和最近变更。
63
- 6. 先做 pattern analysis,再列 3-5 个候选假设并收敛到 1-3 个 active hypotheses。
64
- 7. 每个假设都要写支持证据、反证、证伪方法、预期观察、实际观察。
65
- 8. 只有被证据钉死的根因才能进入 repair contract。
66
- 9. repair contract 只讲最小修复边界,不顺手发明新范围。
13
+ 1. Reproduce before guessing.
14
+ 2. Prove first bad state before naming root cause.
15
+ 3. Write only `task.md`; Git records the stage.
16
+ 4. No process file beyond `task.md`.
17
+ 5. Reroute instead of mixing feature planning into bug investigation.
67
18
 
68
19
  ## Investigation Modes
69
20
 
70
- | Mode | 什么时候用 | 第一动作 |
71
- | --- | --- | --- |
72
- | `reproduce-first` | 症状真实但不稳定 | 缩小复现命令 / 手动路径 |
73
- | `feedback-loop` | 已有复现但信号慢、松、偶然或不确定是否同一 bug | 记录 loop type、命令、runtime、determinism、failure rate 和 symptom match |
74
- | `diff-trace` | 昨天可用、今天坏了 | `git log --oneline -20 -- <affected-files>` |
75
- | `boundary-probe` | API -> service -> DB、CI -> build -> deploy 这类链路断裂 | 记录每层输入、输出、配置和状态 |
76
- | `backward-trace` | 错误出现在深层堆栈或坏值来源不明 | 从 immediate failure site 反追 original trigger |
77
- | `reference-compare` | 同仓库有相似可用路径 | 列出 working / broken 差异并逐项接受或排除 |
78
- | `condition-wait` | flaky、sleep、timeout、重试后消失 | 找真实等待条件,不先加大延时 |
79
- | `history-trace` | 同一区域反复坏 | 查历史 `analysis.md`、TODO、report-card finding |
80
- | `pattern-research` | 陌生框架 / 依赖 / 平台错误 | 脱敏后查通用错误类型 |
81
- | `contract-check` | 修复边界可能扩大 | 判定 implementation drift / missing spec truth / roadmap mismatch |
82
- | `diagnose-only` | 用户只要问题解释或现在不能修 | 冻结 root cause、owner、risk、next action,不生成实现完成态 |
83
- | `workflow-forensics` | devflow artifact、git、状态、权限或工具链断裂 | 分类 failure owner 和 rescue action,再决定 reroute |
84
-
85
- ## Pattern Analysis
86
-
87
- 至少对照这些模式,不要直接猜:
88
-
89
- - race condition:间歇性、时序相关、共享状态
90
- - null propagation:TypeError / undefined / missing guard
91
- - state corruption:数据不一致、部分更新、hook / transaction 顺序
92
- - integration failure:timeout、协议不匹配、外部服务边界
93
- - configuration drift:本地 / CI / 生产表现不同
94
- - stale cache:清缓存后恢复或旧状态复现
95
- - resource leak:OOM、句柄增长、生命周期未释放
96
- - performance regression:变慢、CPU / IO / 查询耗时升高、吞吐下降
97
- - trust boundary drift:外部输入、LLM 输出、用户输入被当成可信
98
- - timing guess / flaky wait:任意 sleep / timeout / setTimeout 掩盖真实条件
99
-
100
- 性能回归先建 baseline、profiler、query plan 或 bisect,不把普通日志当性能证据。
101
-
102
- ## Boundary And Trace Evidence
103
-
104
- 复杂链路必须在 `analysis.md` 写清:
105
-
106
- - Boundary Probe Matrix:component boundary、input observed、output observed、config/env observed、state observed、verdict
107
- - Backward Trace Chain:immediate failure site、caller chain、bad value origin、original trigger、why symptom-site fix is rejected
108
- - Root Cause Proof Ladder:symptom site、first bad state、violated contract、original trigger、counterfactual proof、escape reason
109
- - Reference Comparison:similar working example、broken path、differences accepted / ruled out
110
- - Diagnostic Instrumentation Plan:probe tag、probe location、question answered、command、expected signal、cleanup requirement
111
- - Feedback Loop Contract:loop type、command、expected / actual signal、symptom match、runtime、determinism、failure rate、sharpening plan
112
- - Correct Test Seam:test seam、public interface exercised、why it reaches the real trigger chain、why shallow tests are rejected
113
- - Persistent Debug Session:session id、active hypothesis、completed probes、cleanup state、next evidence action
114
- - Workflow Forensics:artifact state、git state、runtime state、tool/permission/process failure owner、rescue action
115
- - Diagnose-Only Outcome:root cause, owner, risk, next action, and explicit no-repair verdict
116
-
117
- 这些字段不是装饰。它们的作用是证明根因位于源头,而不是报错点。
118
-
119
- ## Prior Investigation History
120
-
121
- 形成根因前至少查:
122
-
123
- 1. `git log --oneline -20 -- <affected-files>`
124
- 2. `rg -n "<error-keyword>|<module>|<capability>" devflow/changes`
125
- 3. `TODOS.md`、backlog、roadmap 中的相关项
126
- 4. 既有 `planning/analysis.md` 和 `review/report-card.json`
127
-
128
- 命中历史时,写入 `analysis.md` 的 `Prior Investigations`,说明这次是复发、同类结构味道,还是无关历史。
129
-
130
- ## Domain And Decision Context
131
-
132
- 优先读取 cc-devflow 原生上下文:`devflow/specs/INDEX.md`、相关 capability specs、roadmap/backlog handoff、历史 `planning/design.md` / `planning/analysis.md`、`change-meta.json`。调查输出里的领域名、假设名、测试名应沿用项目词汇;如果调查结论违反 capability spec、roadmap decision 或历史 design decision,要显式写入 evidence chain,而不是静默覆盖既有设计决策。
133
-
134
- ## External Research Hygiene
135
-
136
- 只有在本地证据不足、错误类型陌生、或像依赖 / 框架 / 平台问题时才做外部调研。
137
-
138
- - 先删除 host、IP、token、customer id、内部路径、SQL、私有 repo 名。
139
- - 只搜错误类别、框架 / 库名、版本、通用组件名。
140
- - 调研结果只能进入候选假设,必须回到本仓库复现或代码证据验证。
141
-
142
- ## No Code Root Cause
143
-
144
- 如果结论是环境、外部服务或时序窗口:
145
-
146
- - 写 `rootCauseClass`: `code` / `config` / `environment` / `external` / `timing`
147
- - 写明为什么不是 code root cause
148
- - 写明需要什么 monitoring / future evidence
149
- - 写明 operator handling,不要把未知外因包装成代码修复
150
-
151
- ## Scope Lock
152
-
153
- 根因假设形成后,写清:
154
-
155
- - affected module
156
- - allowed files
157
- - forbidden files
158
- - blast radius estimate
159
- - if touches >5 files: split / justify / reroute
160
-
161
- 超过 5 个文件默认是调查信号,不是正常 bug-fix 规模。
162
-
163
- ## Escalation
164
-
165
- 三次假设失败后写 `Escalation Decision`:
166
-
167
- - failed hypothesis count
168
- - attempted evidence
169
- - why current entry is suspect
170
- - next option:continue / instrument-and-wait / human-review / reroute-cc-plan
171
- - evidence request:需要可复现环境、HAR、日志 dump、core dump、带时间戳录屏或临时生产探针权限
172
- - recommendation
173
-
174
- ## Local Kit
175
-
176
- - 默认模板在 `assets/TASKS_TEMPLATE.md` 和 `assets/TASK_MANIFEST_TEMPLATE.json`
177
- - 旧分析模板在 `assets/legacy/`,只用于 legacy fallback / migration
178
- - 调查契约在 `references/investigation-contract.md`
179
- - 需要分析骨架时用 `scripts/bootstrap-analysis.sh`
180
- - Roadmap 回写使用 `../cc-roadmap/scripts/locate-roadmap-item.sh` 和 `../cc-roadmap/scripts/sync-roadmap-progress.sh`
181
-
182
- ## Exit Rule
183
-
184
- 只有当下一位执行者读完 `planning/tasks.md`、`planning/task-manifest.json` 就知道:
21
+ - `reproduce-first`
22
+ - `diff-trace`
23
+ - `boundary-probe`
24
+ - `backward-trace`
25
+ - `condition-wait`
26
+ - `reference-compare`
27
+ - `workflow-forensics`
28
+ - `diagnose-only`
185
29
 
186
- - 为什么坏
187
- - 该修什么
188
- - 不该扩到哪里
189
- - 用什么命令证明修好了
30
+ ## Exit
190
31
 
191
- 这次调查才算合格。
192
- 如果 source RM 仍然停在旧 status、旧 progress 或旧 REQ/FIX 绑定,说明本次 `cc-investigate` 没有真正退出。
32
+ `task.md` must tell `cc-do` what to fix, what not to touch, and what command proves the repair. Commit the Investigate stage before handing off.