cc-devflow 4.5.7 → 4.5.9

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 (105) hide show
  1. package/.claude/skills/cc-act/CHANGELOG.md +33 -0
  2. package/.claude/skills/cc-act/PLAYBOOK.md +18 -4
  3. package/.claude/skills/cc-act/SKILL.md +76 -7
  4. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_INDEX_TEMPLATE.md +30 -0
  5. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_PRINCIPLES_TEMPLATE.md +29 -0
  6. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_TEMPLATE.md +103 -0
  7. package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +60 -4
  8. package/.claude/skills/cc-act/references/closure-contract.md +7 -0
  9. package/.claude/skills/cc-act/references/git-commit-guidelines.md +342 -37
  10. package/.claude/skills/cc-act/scripts/cc-act-common.sh +29 -1
  11. package/.claude/skills/cc-act/scripts/detect-ship-target.sh +27 -0
  12. package/.claude/skills/cc-act/scripts/ensure-ship-branch.sh +93 -0
  13. package/.claude/skills/cc-act/scripts/generate-status-report.sh +6 -0
  14. package/.claude/skills/cc-act/scripts/render-pr-brief.sh +170 -0
  15. package/.claude/skills/cc-act/scripts/sync-act-docs.sh +15 -1
  16. package/.claude/skills/cc-dev/CHANGELOG.md +5 -0
  17. package/.claude/skills/cc-dev/PLAYBOOK.md +63 -0
  18. package/.claude/skills/cc-dev/SKILL.md +168 -0
  19. package/.claude/skills/cc-do/CHANGELOG.md +17 -0
  20. package/.claude/skills/cc-do/SKILL.md +41 -13
  21. package/.claude/skills/cc-do/scripts/build-task-context.sh +9 -5
  22. package/.claude/skills/cc-do/scripts/mark-task-complete.sh +0 -6
  23. package/.claude/skills/cc-investigate/CHANGELOG.md +17 -0
  24. package/.claude/skills/cc-investigate/PLAYBOOK.md +15 -0
  25. package/.claude/skills/cc-investigate/SKILL.md +46 -1
  26. package/.claude/skills/cc-investigate/assets/ANALYSIS_TEMPLATE.md +47 -0
  27. package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +21 -2
  28. package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +28 -58
  29. package/.claude/skills/cc-investigate/references/investigation-contract.md +14 -0
  30. package/.claude/skills/cc-next/CHANGELOG.md +11 -0
  31. package/.claude/skills/cc-next/PLAYBOOK.md +74 -0
  32. package/.claude/skills/cc-next/SKILL.md +196 -0
  33. package/.claude/skills/cc-plan/CHANGELOG.md +25 -0
  34. package/.claude/skills/cc-plan/PLAYBOOK.md +25 -20
  35. package/.claude/skills/cc-plan/SKILL.md +116 -13
  36. package/.claude/skills/cc-plan/assets/DESIGN_TEMPLATE.md +67 -0
  37. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +85 -0
  38. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +57 -182
  39. package/.claude/skills/cc-plan/assets/TINY_DESIGN_TEMPLATE.md +46 -0
  40. package/.claude/skills/cc-plan/references/planning-contract.md +51 -26
  41. package/.claude/skills/cc-pr-land/CHANGELOG.md +5 -0
  42. package/.claude/skills/cc-pr-land/PLAYBOOK.md +45 -0
  43. package/.claude/skills/cc-pr-land/SKILL.md +157 -0
  44. package/.claude/skills/cc-pr-review/CHANGELOG.md +5 -0
  45. package/.claude/skills/cc-pr-review/PLAYBOOK.md +46 -0
  46. package/.claude/skills/cc-pr-review/SKILL.md +142 -0
  47. package/.claude/skills/cc-review/CHANGELOG.md +21 -0
  48. package/.claude/skills/cc-review/PLAYBOOK.md +64 -10
  49. package/.claude/skills/cc-review/SKILL.md +185 -18
  50. package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +4 -0
  51. package/.claude/skills/cc-review/references/implementation-review-branch.md +37 -0
  52. package/.claude/skills/cc-review/references/plan-review-branch.md +36 -1
  53. package/.claude/skills/cc-review/references/review-methods.md +98 -3
  54. package/.claude/skills/cc-review/scripts/collect-review-context.sh +80 -0
  55. package/.claude/skills/cc-roadmap/CHANGELOG.md +6 -0
  56. package/.claude/skills/cc-roadmap/PLAYBOOK.md +30 -0
  57. package/.claude/skills/cc-roadmap/SKILL.md +45 -8
  58. package/.claude/skills/cc-roadmap/assets/BACKLOG_TEMPLATE.md +8 -0
  59. package/.claude/skills/cc-roadmap/assets/ROADMAP_TEMPLATE.md +22 -0
  60. package/.claude/skills/cc-roadmap/assets/TRACKING_TEMPLATE.json +32 -1
  61. package/.claude/skills/cc-roadmap/references/roadmap-dialogue.md +14 -14
  62. package/.claude/skills/cc-simplify/CHANGELOG.md +6 -0
  63. package/.claude/skills/cc-simplify/SKILL.md +19 -8
  64. package/CHANGELOG.md +20 -1
  65. package/README.md +60 -9
  66. package/README.zh-CN.md +60 -9
  67. package/config/distributable-skills.json +8 -0
  68. package/docs/assets/cc-devflow-pr-harness-en.svg +153 -0
  69. package/docs/assets/cc-devflow-pr-harness-zh.svg +152 -0
  70. package/docs/assets/wechat-group-qr.jpg +0 -0
  71. package/docs/examples/example-bindings.json +11 -7
  72. package/docs/examples/full-design-blocked/BACKLOG.md +1 -1
  73. package/docs/examples/full-design-blocked/README.md +1 -1
  74. package/docs/examples/full-design-blocked/ROADMAP.md +1 -1
  75. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +1 -1
  76. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +102 -82
  77. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/tasks.md +45 -1
  78. package/docs/examples/full-design-blocked/roadmap.json +1 -1
  79. package/docs/examples/local-handoff/BACKLOG.md +1 -1
  80. package/docs/examples/local-handoff/README.md +1 -1
  81. package/docs/examples/local-handoff/ROADMAP.md +1 -1
  82. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +1 -1
  83. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +70 -61
  84. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/tasks.md +35 -1
  85. package/docs/examples/local-handoff/roadmap.json +1 -1
  86. package/docs/examples/pdca-loop/BACKLOG.md +1 -1
  87. package/docs/examples/pdca-loop/README.md +1 -1
  88. package/docs/examples/pdca-loop/ROADMAP.md +1 -1
  89. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +64 -0
  90. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +1 -1
  91. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +71 -81
  92. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/tasks.md +35 -1
  93. package/docs/examples/pdca-loop/roadmap.json +1 -1
  94. package/docs/examples/scripts/check-example-bindings.sh +24 -2
  95. package/docs/get-shit-done-strategy-audit.md +4 -4
  96. package/docs/guides/artifact-contract.md +44 -0
  97. package/docs/guides/getting-started.md +1 -1
  98. package/docs/guides/getting-started.zh-CN.md +1 -1
  99. package/docs/guides/project-postmortem.md +78 -0
  100. package/lib/skill-runtime/__tests__/planner.tdd.test.js +2 -2
  101. package/lib/skill-runtime/__tests__/schemas.test.js +33 -2
  102. package/lib/skill-runtime/planner.js +1 -2
  103. package/lib/skill-runtime/query.js +1 -1
  104. package/lib/skill-runtime/schemas.js +5 -3
  105. package/package.json +6 -1
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: cc-review
3
- version: 1.0.0
4
- description: Use when a complex requirement, bug fix, plan, or implementation diff needs an optional deep multi-round review beyond cc-check. Routes plan-stage material through strategy/design/engineering/DX review methods, routes execution-stage code through diff/code-quality/E2E review, identifies in-scope code smells, and writes durable cc-review findings before rerouting to cc-plan, cc-do, or cc-check.
3
+ version: 1.3.0
4
+ description: Use when a complex requirement, bug fix, plan, or implementation diff needs optional deep multi-round review beyond cc-check. Builds a review plan from prior records and current git/artifact delta, dispatches independent read-only reviewer agents when available, applies a risk-lane review swarm profile for broad implementation diffs, records node results, identifies in-scope code smells, queues user decisions, and reroutes to cc-plan, cc-do, or cc-check.
5
5
  triggers:
6
6
  - 深度 review 这个方案
7
7
  - review 这个复杂需求
@@ -18,27 +18,50 @@ reads:
18
18
  - references/plan-review-branch.md
19
19
  - references/implementation-review-branch.md
20
20
  - references/e2e-and-plugin-verification.md
21
+ - scripts/collect-review-context.sh
21
22
  writes:
23
+ - path: devflow/changes/<change-key>/review/cc-review-plan.md
24
+ durability: durable
25
+ required: true
22
26
  - path: devflow/changes/<change-key>/review/cc-review-report.md
23
27
  durability: durable
24
28
  required: true
29
+ - path: devflow/changes/<change-key>/review/cc-review-ledger.jsonl
30
+ durability: durable
31
+ required: true
32
+ - path: devflow/changes/<change-key>/review/cc-review-agent-results.jsonl
33
+ durability: durable
34
+ required: false
35
+ when: subagent reviewers are used
25
36
  - path: devflow/changes/<change-key>/review/cc-review-findings.json
26
37
  durability: durable
27
38
  required: false
28
39
  effects:
29
40
  - optional deep review
41
+ - read-only reviewer agent dispatch
42
+ - risk-lane finding aggregation
30
43
  - durable findings
31
44
  - reroute recommendation
32
45
  entry_gate:
33
46
  - Read planning/design.md or planning/analysis.md when the work is still plan-stage.
34
47
  - Read the current diff, task manifest, change metadata, and latest verification evidence when the work is execution-stage.
48
+ - Read prior cc-review-plan.md, cc-review-report.md, cc-review-ledger.jsonl, and cc-review-findings.json when present.
49
+ - Use git diff or scripts/collect-review-context.sh to identify content changed since the last review before deciding what to re-review.
35
50
  - Classify the review branch as plan, implementation, or mixed before loading detailed references.
51
+ - Write or refresh cc-review-plan.md before producing findings.
52
+ - Decide whether nodes need independent reviewer agents before starting node execution; record the decision in cc-review-plan.md.
53
+ - For broad implementation or mixed reviews, decide whether the risk-lane review swarm profile is required; record used, skipped, or unavailable lanes in cc-review-plan.md.
36
54
  - Freeze the requested scope before finding smells; only report smells inside the requirement blast radius or clearly amplified by the current work.
37
55
  exit_criteria:
38
- - cc-review-report.md records branch classification, scope, methods used, findings, user decisions needed, and next route.
39
- - Plan-stage reviews record strategy/design/engineering/DX facets only when applicable.
40
- - Implementation-stage reviews include diff evidence, code-smell evidence, test and E2E/plugin verification evidence when applicable.
56
+ - cc-review-plan.md records selected tools, review nodes, skipped nodes with reasons, and checkpoint order.
57
+ - cc-review-ledger.jsonl appends one record per reviewed node with status, evidence, findings, and follow-up route.
58
+ - cc-review-agent-results.jsonl records read-only reviewer outputs when subagents are used, or cc-review-report.md records why agents were unavailable or unnecessary.
59
+ - cc-review-report.md records branch classification, scope, prior-review delta, methods used, node coverage, reviewer-lane coverage, findings triage, user decisions needed, quick fixes, and next route.
60
+ - Plan-stage reviews record every selected strategy/design/engineering/DX facet as checked, skipped, or blocked.
61
+ - Implementation-stage reviews include diff evidence, code-smell evidence, test and E2E/plugin verification evidence for every selected changed surface.
41
62
  - Every in-scope code smell has a concrete recommendation or an explicit skip/defer rationale.
63
+ - No artificial finding cap was applied; review stops only when planned nodes are checked, skipped with reason, or blocked.
64
+ - Main thread validates subagent findings before promoting them to final findings; no subagent output is trusted blindly.
42
65
  - The next action is exactly one of cc-plan, cc-do, cc-check, cc-act, or no-op.
43
66
  reroutes:
44
67
  - when: Plan assumptions, scope, architecture, design, or DX contracts are wrong or incomplete.
@@ -53,11 +76,11 @@ recovery_modes:
53
76
  action: Stop the current pass, restate the correct branch classification, load the matching reference, and restart from the scope freeze.
54
77
  - name: progressive-disclosure-reset
55
78
  when: The review is drowning in unrelated methods or external review templates.
56
- action: Return to SKILL.md, reload only the branch-specific reference and review-methods.md, then continue with the smallest applicable checklist.
79
+ action: Return to cc-review-plan.md, keep only review nodes that are in scope, and continue node-by-node instead of collapsing to a short finding list.
57
80
  tool_budget:
58
- read_files: 12
59
- search_steps: 8
60
- shell_commands: 10
81
+ read_files: 24
82
+ search_steps: 16
83
+ shell_commands: 16
61
84
  ---
62
85
 
63
86
  # CC-Review
@@ -86,6 +109,8 @@ REVIEW THE RIGHT THING AT THE RIGHT STAGE.
86
109
 
87
110
  计划还没进入实现时,Review 计划。代码已经改了时,Review diff 和运行效果。两者都有时,先 Review 计划合同,再 Review 实现是否兑现合同。
88
111
 
112
+ 深度 Review 不能靠“最多列 3 个问题”收尾。必须先制定 Review 计划,再逐节点检查、逐节点记录。问题数量由证据决定,不由输出习惯决定。
113
+
89
114
  ## Read First
90
115
 
91
116
  1. `PLAYBOOK.md`
@@ -95,6 +120,7 @@ REVIEW THE RIGHT THING AT THE RIGHT STAGE.
95
120
  - plan-stage: `references/plan-review-branch.md`
96
121
  - implementation-stage: `references/implementation-review-branch.md`
97
122
  - UI/runtime/plugin evidence: `references/e2e-and-plugin-verification.md`
123
+ 5. When prior review state may exist, run or inspect `scripts/collect-review-context.sh`
98
124
 
99
125
  ## Use This Skill When
100
126
 
@@ -120,25 +146,163 @@ REVIEW THE RIGHT THING AT THE RIGHT STAGE.
120
146
 
121
147
  ## Harness Contract
122
148
 
123
- - Allowed actions: read artifacts, inspect code and diff, run safe read-only or verification commands, use Browser/Computer Use for behavior proof, write review reports.
124
- - Forbidden actions: silently rewriting the plan, silently editing production code, turning optional review into mandatory ship gate, or reviewing unrelated historical debt.
149
+ - Allowed actions: read artifacts, inspect code and diff, run safe read-only or verification commands, dispatch read-only reviewer subagents when available, use Browser/Computer Use for behavior proof, write review reports.
150
+ - Forbidden actions: silently rewriting the plan, silently editing production code, turning optional review into mandatory ship gate, reviewing unrelated historical debt, or stopping after a small fixed number of findings while planned nodes remain unchecked.
125
151
  - Required evidence: every finding must cite plan text, code path, diff line, command output, browser action, UI state, log line, or explicit missing evidence.
126
152
  - Reroute rule: plan contract defects return to `cc-plan`; implementation defects return to `cc-do`; clean deep review proceeds to `cc-check`.
127
153
 
154
+ ## Independent Reviewer Dispatch
155
+
156
+ 触发 `cc-review` 本身就构成用户对只读 reviewer subAgent 的授权。不要再要求用户补一句“请开启子智能体”。
157
+
158
+ 主线程负责:制定 Review 计划、拆分节点、分配 reviewer、合并 findings、验证证据、去重、决定 quick fix / decision queue / reroute。
159
+
160
+ 只读 reviewer 负责:在独立上下文里审指定节点,不编辑文件,不修改计划,不直接决定最终结论。
161
+
162
+ ### Dispatch Rules
163
+
164
+ - ClaudeCode 环境:使用可用的 `Task` / subAgent 机制创建只读 reviewer。
165
+ - Codex App / Codex 工具环境:优先使用内置 `explorer` 子智能体;如果只有 `default`,prompt 必须写明只读审查、禁止编辑。
166
+ - 暴露 `spawn_agent` 的 Codex 环境:使用 `spawn_agent(agent_type="explorer", fork_context=false, ...)`。只有在用户明确要求继承完整上下文时才 `fork_context=true`。
167
+ - 不依赖 repo-local 自定义 agent 名称完成核心流程;自定义 agent 只能作为增强。
168
+ - 如果当前运行时没有 subagent 工具,或工具调用被上层策略禁止,主线程按同一节点计划串行执行,并在报告里写 `Agents used: no (subagent tool unavailable)`。
169
+ - subagent 只拿自己的 review packet,不拿主线程完整聊天历史;这样保持独立性。
170
+ - 每个 subagent 必须输出 JSONL findings;没有发现时输出 `NO FINDINGS`。
171
+ - 主线程必须验证 subagent finding 的路径、证据、scope 和置信度,不能因为 reviewer 说了就接受。
172
+
173
+ ### Risk-Lane Review Swarm Profile
174
+
175
+ 复杂实现、跨模块 diff、PR landing 前复审、或用户要求 parallel / swarm review 时,优先把实现节点拆成四类只读风险 lane。小 diff 可以由一个 combined reviewer 覆盖全部 lane,但计划里必须写明。
176
+
177
+ 1. Intent and regression reviewer: 检查 diff 是否兑现意图、是否引入范围外行为漂移、边界和 fallback 是否坏掉、caller/callee 合同是否漂移。
178
+ 2. Security and privacy reviewer: 检查 authn/authz、输入验证、注入风险、secret/token/sensitive data 暴露、默认权限扩大、信任未验证数据。
179
+ 3. Performance and reliability reviewer: 检查热路径重复 I/O、启动/渲染/请求成本、cleanup 泄漏、retry storm、订阅漂移、排序/竞态/失败处理。
180
+ 4. Contracts and coverage reviewer: 检查 API/schema/type/config/flag 不匹配、迁移/兼容 fallout、回归测试缺口、日志/metrics/assertion/error-path 缺失。
181
+
182
+ 这些 lane 是审查视角,不是 finding 配额。主线程必须把 raw findings 合并后再输出:重复项合并,弱证据或 speculative claim 降级或拒收,和冻结意图冲突的 finding 转成 decision question 或 reject。
183
+
184
+ ### Dispatch Heuristics
185
+
186
+ - Plan review:
187
+ - Strategy reviewer: outcome, scope, goal tree, do-nothing risk.
188
+ - Engineering reviewer: architecture, data flow, state, testability, rollback.
189
+ - Design reviewer: user-visible flows, states, accessibility, visual/interaction risk.
190
+ - DX reviewer: CLI/API/docs/operator journey, errors, examples.
191
+ - TOC reviewer: current reality tree, conflict diagram, future reality tree for complex bugs.
192
+ - Implementation review:
193
+ - Contract reviewer: diff vs plan/investigation contract.
194
+ - Smell reviewer: rigidity, duplication, cycle, fragility, obscurity, data-clump, unnecessary complexity; may load `cc-simplify`.
195
+ - Test reviewer: public seam, regression quality, fixture honesty, coverage gaps.
196
+ - Runtime reviewer: Browser/Computer Use/CLI/log proof for UI or behavior surfaces.
197
+ - Risk-lane reviewers: intent/regression, security/privacy, performance/reliability, contracts/coverage when a broad diff benefits from parallel independent context.
198
+
199
+ Large or multi-surface reviews should use at least two independent reviewers when the host supports it. Small reviews should use at least one combined read-only reviewer unless the plan explicitly records why subagent dispatch is unnecessary.
200
+
201
+ ### Reviewer Packet
202
+
203
+ Each reviewer receives:
204
+
205
+ ```text
206
+ You are a read-only cc-review reviewer. Do not edit files.
207
+ Repo root: <path>
208
+ Review mode: plan | implementation | mixed
209
+ Node ids: <R001,R002>
210
+ Scope: <requirement blast radius>
211
+ Current delta: <base/reviewed sha -> head sha + changed files>
212
+ Required artifacts: <paths>
213
+ Reference to use: <review-methods / plan / implementation / e2e / cc-simplify>
214
+ Output: JSONL findings or NO FINDINGS.
215
+ Finding schema:
216
+ {"nodeId":"R001","severity":"critical|important|advisory","confidence":8,"path":"file","line":12,"smell":"rigidity|duplication|cycle|fragility|obscurity|data-clump|unnecessary-complexity|none","summary":"...","evidence":"...","recommendation":"...","route":"cc-plan|cc-do|cc-check|cc-act|no-op","fingerprint":"...","reviewer":"strategy|engineering|design|dx|toc|contract|smell|test|runtime|intent-regression|security-privacy|performance-reliability|contracts-coverage"}
217
+ ```
218
+
219
+ Low-confidence notes below `5` stay out of final findings unless they point to critical impact. Put those in report notes as leads, not findings.
220
+
221
+ ## Stateful Review Loop
222
+
223
+ Every run follows this loop:
224
+
225
+ 1. Collect prior review state:
226
+ - previous `cc-review-plan.md`
227
+ - previous `cc-review-report.md`
228
+ - previous `cc-review-ledger.jsonl`
229
+ - previous `cc-review-findings.json`
230
+ 2. Collect current delta:
231
+ - `git diff <last-reviewed-sha>...HEAD` when a reviewed SHA exists
232
+ - otherwise `git diff <base>...HEAD`
233
+ - changed planning artifacts, changed code, changed tests, changed docs, changed runtime/UI surfaces
234
+ 3. Select review tools:
235
+ - strategy / CEO-style outcome review
236
+ - engineering review
237
+ - design review
238
+ - DX/operator review
239
+ - TOC root-cause review
240
+ - code-smell / simplification review
241
+ - E2E / Browser / Computer Use / logs review
242
+ 4. Decide reviewer dispatch:
243
+ - which nodes need independent subagent review
244
+ - which nodes stay in main thread
245
+ - why any eligible reviewer was skipped
246
+ 5. Write `cc-review-plan.md` before findings:
247
+ - node id
248
+ - target artifact or code surface
249
+ - tool/reference to load
250
+ - reason selected
251
+ - owner: `main` or reviewer name
252
+ - check command or evidence source
253
+ - status: `pending`
254
+ 6. Traverse nodes one by one:
255
+ - review the node
256
+ - run the smallest useful check for that node
257
+ - collect subagent JSONL output when assigned
258
+ - validate and deduplicate reviewer findings
259
+ - append one ledger record
260
+ - mark the node `checked`, `skipped`, or `blocked`
261
+ 7. Summarize:
262
+ - quick mechanical fixes
263
+ - user-decision queue
264
+ - reroute list
265
+ - final next skill
266
+
267
+ When re-reviewing the same file or plan, do not restart from zero. Compare current content with the last reviewed content or SHA, then re-review changed nodes and any dependent nodes made stale by that delta.
268
+
128
269
  ## Output Contract
129
270
 
271
+ Write `review/cc-review-plan.md` before the review pass with:
272
+
273
+ 1. Branch classification and review scope.
274
+ 2. Prior review records found.
275
+ 3. Current git/artifact delta.
276
+ 4. Selected tools and skipped tools with reasons.
277
+ 5. Reviewer dispatch plan: agents used, unavailable, skipped, or unnecessary.
278
+ 6. Risk-lane coverage for implementation or mixed reviews.
279
+ 7. Ordered review nodes and per-node check plan.
280
+
130
281
  Write `review/cc-review-report.md` with:
131
282
 
132
283
  1. Review branch classification and scope.
133
- 2. Source artifacts read.
134
- 3. Review methods used and methods intentionally skipped.
135
- 4. Findings by severity, each with evidence, smell category when relevant, recommendation, and route.
136
- 5. E2E / Browser / Computer Use evidence when applicable.
137
- 6. Decision questions still needing user input.
138
- 7. Final next action.
284
+ 2. Source artifacts read and prior review records used.
285
+ 3. Current delta against previous review or base.
286
+ 4. Review methods used and methods intentionally skipped.
287
+ 5. Node coverage table.
288
+ 6. Reviewer dispatch summary, risk-lane coverage, and agent result paths.
289
+ 7. Raw finding triage: accepted, merged, downgraded, rejected.
290
+ 8. Findings by severity, each with evidence, smell category when relevant, recommendation, and route.
291
+ 9. Quick mechanical fixes that can be handled by `cc-do`.
292
+ 10. Decision questions still needing user input.
293
+ 11. E2E / Browser / Computer Use evidence when applicable.
294
+ 12. Final next action.
295
+
296
+ Append one JSON line to `review/cc-review-ledger.jsonl` per reviewed node:
297
+
298
+ ```json
299
+ {"nodeId":"R001","status":"checked","target":"planning/design.md","tool":"engineering","headSha":"...","evidence":["..."],"findings":["F001"],"next":"cc-plan"}
300
+ ```
139
301
 
140
302
  Write `review/cc-review-findings.json` when findings need machine consumption by later agents.
141
303
 
304
+ Write `review/cc-review-agent-results.jsonl` when subagents are used. It contains raw reviewer findings plus reviewer identity. The report must say which raw findings were accepted, merged, downgraded, or rejected.
305
+
142
306
  ## Finding Rules
143
307
 
144
308
  Each finding must include:
@@ -153,14 +317,17 @@ Each finding must include:
153
317
 
154
318
  Bad smells inside the requested scope are never hidden. Every in-scope smell must produce either a decision question, a routed fix recommendation, or an explicit defer/skip rationale. Ask whether to optimize when the smell is real and the fix is not a purely mechanical local cleanup.
155
319
 
320
+ Decision questions are collected after the full independent node pass unless the answer blocks the next node. Present the full decision queue first, then ask the user to confirm decisions one by one. Do not start non-mechanical fixes until those decisions are answered.
321
+
156
322
  ## Progressive Disclosure
157
323
 
158
- Do not load every reference by default.
324
+ Progressive disclosure controls context size, not review depth. Do not load every reference by default, but do build the full review plan first.
159
325
 
160
326
  1. Always read `review-methods.md`.
161
327
  2. Read `plan-review-branch.md` only for plan or mixed reviews.
162
328
  3. Read `implementation-review-branch.md` only for implementation or mixed reviews.
163
329
  4. Read `e2e-and-plugin-verification.md` only when UI, browser behavior, desktop app behavior, CLI runtime, or Codex plugin chain evidence is relevant.
330
+ 5. Read `cc-simplify` only when the review plan selects code-smell, duplication, simplification, or architecture-cleanup nodes.
164
331
 
165
332
  ## Exit Rule
166
333
 
@@ -17,6 +17,8 @@ Skip with reason for backend-only, docs-only, or pure planning reviews.
17
17
 
18
18
  ## Evidence Chain
19
19
 
20
+ Each affected path becomes a review node. Do not claim E2E/plugin review is done until each selected path is checked, skipped, or blocked.
21
+
20
22
  1. Identify the user path:
21
23
  - page, route, command, app screen, or plugin operation
22
24
  - expected visible result
@@ -72,6 +74,8 @@ Add an E2E section to `cc-review-report.md`:
72
74
  | ... | Browser / Computer Use / CLI | screenshot, log, command, artifact | pass / fail / blocked |
73
75
  ```
74
76
 
77
+ Also append one ledger record per flow so a later review can skip unchanged flows or re-open only changed flows.
78
+
75
79
  If blocked, include:
76
80
 
77
81
  - missing dependency
@@ -30,6 +30,19 @@ Out-of-scope files are findings only when they change behavior or expand blast r
30
30
 
31
31
  ## Diff Review Passes
32
32
 
33
+ Turn these passes into review nodes before reporting findings. Every changed file, public behavior, test surface, documentation surface, and UI/runtime flow must belong to a node or have a skip reason.
34
+
35
+ For complex diffs, assign independent read-only reviewers by facet: contract, smell, test, docs/DX, and runtime. Keep reviewer outputs separate until the main thread validates evidence and merges duplicates.
36
+
37
+ For broad or PR-landing diffs, prefer the risk-lane review swarm profile from `review-methods.md` before reporting findings:
38
+
39
+ 1. Intent and regression
40
+ 2. Security and privacy
41
+ 3. Performance and reliability
42
+ 4. Contracts and coverage
43
+
44
+ The lanes may map onto the passes below, but they should stay separate in `cc-review-plan.md` and raw reviewer output when separate reviewers are used.
45
+
33
46
  ### 1. Contract Fidelity
34
47
 
35
48
  Check whether implementation matches the frozen plan or investigation:
@@ -44,6 +57,8 @@ Check whether implementation matches the frozen plan or investigation:
44
57
 
45
58
  Use `review-methods.md` smell taxonomy.
46
59
 
60
+ If this pass finds duplication, over-complexity, awkward abstraction, branch forests, unclear ownership, or broad architecture cleanup risk, load `cc-simplify` and record it as a selected tool in `cc-review-plan.md`.
61
+
47
62
  Look for:
48
63
 
49
64
  - copy-paste helper logic
@@ -90,6 +105,25 @@ Flag:
90
105
 
91
106
  If changed behavior affects README, guides, CLI help, package install, public API, agent skill usage, or examples, check whether docs changed too.
92
107
 
108
+ ## Delta Node Selection
109
+
110
+ Use git and prior review records:
111
+
112
+ 1. Find changed files with `git diff <base>...HEAD --name-only`.
113
+ 2. If prior `cc-review-ledger.jsonl` records a reviewed SHA, narrow to `git diff <reviewedSha>...HEAD`.
114
+ 3. Group changed files by behavior surface, not just extension.
115
+ 4. Add dependent nodes for direct importers/callers when a shared helper, enum, state shape, API contract, or skill contract changes.
116
+ 5. Preserve prior clean nodes only when the target file and dependent contract did not change.
117
+
118
+ Example:
119
+
120
+ ```text
121
+ R101 implementation.contract.skill-frontmatter
122
+ R102 implementation.smell.review-state
123
+ R103 implementation.tests.distribution
124
+ R104 implementation.docs.workflow-map
125
+ ```
126
+
93
127
  ## Fix Policy
94
128
 
95
129
  `cc-review` does not silently edit code. It writes findings and routes:
@@ -106,6 +140,9 @@ Add to `cc-review-report.md`:
106
140
 
107
141
  - base branch and diff summary
108
142
  - scope check
143
+ - implementation review nodes checked, skipped, or blocked
144
+ - implementation reviewer agents used or fallback reason
145
+ - risk-lane coverage and raw finding triage
109
146
  - code smell findings
110
147
  - structural findings
111
148
  - test and E2E coverage map
@@ -16,7 +16,9 @@ If no change directory exists, review the user-provided plan text and clearly ma
16
16
 
17
17
  ## Review Shape
18
18
 
19
- Run only applicable facets. Do not load every facet when the plan is small.
19
+ First select applicable facets, then create one or more review nodes for each selected facet. Do not load every facet when the plan is small, but do not skip a selected facet merely to keep the answer short.
20
+
21
+ For complex plans, assign selected facets to independent read-only reviewers when subagent support is available. Strategy, engineering, design, DX, and TOC reviewers should not share intermediate conclusions; the main thread merges their findings after each reviewer returns.
20
22
 
21
23
  ### 1. Strategy Facet
22
24
 
@@ -34,6 +36,12 @@ Output:
34
36
  CURRENT -> THIS PLAN -> 12-MONTH IDEAL
35
37
  ```
36
38
 
39
+ Node examples:
40
+
41
+ - `plan.strategy.problem-fit`
42
+ - `plan.strategy.outcome-signal`
43
+ - `plan.strategy.do-nothing-risk`
44
+
37
45
  ### 2. Engineering Facet
38
46
 
39
47
  Review:
@@ -55,6 +63,13 @@ Entry -> validate -> transform -> persist -> output
55
63
  empty wrong type timeout duplicate partial
56
64
  ```
57
65
 
66
+ Node examples:
67
+
68
+ - `plan.engineering.boundaries`
69
+ - `plan.engineering.data-flow`
70
+ - `plan.engineering.state-transitions`
71
+ - `plan.engineering.testability`
72
+
58
73
  ### 3. Design Facet
59
74
 
60
75
  Run only for user-facing UI or interaction flows.
@@ -67,6 +82,12 @@ Check:
67
82
  - generic UI or AI slop risk
68
83
  - whether live design review will be needed after implementation
69
84
 
85
+ Node examples:
86
+
87
+ - `plan.design.primary-flow`
88
+ - `plan.design.states`
89
+ - `plan.design.responsive-accessibility`
90
+
70
91
  ### 4. DX Facet
71
92
 
72
93
  Run only for API, CLI, SDK, package, docs, agent skill, MCP, or developer/operator surfaces.
@@ -79,6 +100,12 @@ Check:
79
100
  - actionable errors: problem + cause + fix
80
101
  - copy-paste examples and escape hatches
81
102
 
103
+ Node examples:
104
+
105
+ - `plan.dx.first-value`
106
+ - `plan.dx.errors`
107
+ - `plan.dx.examples`
108
+
82
109
  ## TOC Root-Cause Pass
83
110
 
84
111
  For complex bugs, use:
@@ -89,6 +116,12 @@ For complex bugs, use:
89
116
 
90
117
  If the root cause is not proven, reroute to `cc-investigate`, not `cc-do`.
91
118
 
119
+ Record each TOC pass as a separate node so the review can resume:
120
+
121
+ - current reality tree
122
+ - conflict diagram
123
+ - future reality tree
124
+
92
125
  ## Code Smell Pass In Planning
93
126
 
94
127
  Plans can contain smells before code exists:
@@ -106,6 +139,8 @@ Each planning smell must become a plan finding and route to `cc-plan`.
106
139
 
107
140
  Add to `cc-review-report.md`:
108
141
 
142
+ - plan review nodes checked, skipped, or blocked
143
+ - plan reviewer agents used or fallback reason
109
144
  - plan artifacts read
110
145
  - strategy/engineering/design/DX facets used
111
146
  - diagrams produced
@@ -4,7 +4,7 @@ Use this reference for every `cc-review` run. It defines the shared method libra
4
4
 
5
5
  ## Method Selection
6
6
 
7
- Use only methods that fit the risk:
7
+ Select every method needed by the current risk and write the selected methods into `cc-review-plan.md`. This table is a routing map, not a cap.
8
8
 
9
9
  | Risk | Method |
10
10
  | --- | --- |
@@ -14,6 +14,92 @@ Use only methods that fit the risk:
14
14
  | uncertain fix impact | future reality tree |
15
15
  | implementation complexity | logic tree and smell scan |
16
16
  | UI/runtime mismatch | E2E/plugin verification |
17
+ | code quality or simplification risk | cc-simplify reference plus smell scan |
18
+ | broad implementation diff | risk-lane review swarm profile |
19
+
20
+ ## Review Plan Nodes
21
+
22
+ Before findings, create ordered nodes:
23
+
24
+ ```text
25
+ R001 plan.strategy.outcome
26
+ target: planning/design.md
27
+ method: goal tree
28
+ check: outcome and scope consistency
29
+ status: pending
30
+
31
+ R002 plan.engineering.data-flow
32
+ target: planning/design.md + referenced code
33
+ method: engineering facet
34
+ check: single truth source and state transitions
35
+ status: pending
36
+ ```
37
+
38
+ Node rules:
39
+
40
+ - one node reviews one coherent question, artifact, or changed surface
41
+ - every selected method creates at least one node
42
+ - every changed file or user-facing surface is assigned to a node or explicitly skipped
43
+ - every node has an owner: `main` or a named read-only reviewer
44
+ - every node ends as `checked`, `skipped`, or `blocked`
45
+ - no finding limit exists while nodes remain pending
46
+ - when a prior ledger exists, reuse checked nodes only if their target and dependencies did not change
47
+
48
+ ## Independent Reviewer Assignment
49
+
50
+ Use subagents to preserve independent context when the host supports them.
51
+
52
+ Assignment rules:
53
+
54
+ - Assign independent reviewers by facet, not by random file chunks.
55
+ - Keep each reviewer packet self-contained: scope, delta, node ids, required artifacts, reference to use, and output schema.
56
+ - Do not ask one reviewer to wait for another reviewer result unless the dependency is explicit in `cc-review-plan.md`.
57
+ - Do not assign two reviewers to the same node unless a critical finding needs a second opinion.
58
+ - Main thread validates reviewer evidence before final findings.
59
+
60
+ Reviewer result states:
61
+
62
+ ```text
63
+ accepted -> finding has concrete in-scope evidence
64
+ merged -> duplicate finding folded into stronger finding
65
+ downgraded -> real note but not blocking or confidence too low
66
+ rejected -> out-of-scope, stale, speculative, or contradicted by evidence
67
+ ```
68
+
69
+ Record these states in `cc-review-report.md` and preserve raw reviewer output in `cc-review-agent-results.jsonl`.
70
+
71
+ ## Risk-Lane Review Swarm Profile
72
+
73
+ Use this profile when a broad implementation diff, PR landing review, or mixed review benefits from independent read-only context. The profile is a default decomposition, not a requirement to manufacture findings.
74
+
75
+ | Lane | Reviewer question |
76
+ | --- | --- |
77
+ | intent-regression | Does the diff match the intended behavior without extra behavior drift, broken edge cases, fallback loss, or caller/callee contract drift? |
78
+ | security-privacy | Did the diff weaken auth, validation, secret handling, sensitive data boundaries, defaults, or trust of external input? |
79
+ | performance-reliability | Did the diff add duplicate work, hot-path cost, missing cleanup, retry storms, ordering races, or brittle failure handling? |
80
+ | contracts-coverage | Did the diff miss API/schema/type/config/flag alignment, migration fallout, regression tests, logs, metrics, assertions, or error paths? |
81
+
82
+ Small diffs may use one combined reviewer that covers all lanes. Large or multi-surface diffs should assign separate reviewers for the highest-risk lanes when the host supports subagents.
83
+
84
+ The main thread owns aggregation:
85
+
86
+ - Merge duplicate findings under the clearest evidence.
87
+ - Reject style preferences, nits, and speculative concerns with no concrete impact.
88
+ - Downgrade low-confidence notes unless they point to critical impact.
89
+ - Convert intent-unclear claims into decision questions instead of findings.
90
+ - Order final findings by severity, confidence, and current-scope impact.
91
+
92
+ ## Stateful Delta Review
93
+
94
+ Use git and prior records to avoid repeating stale work:
95
+
96
+ 1. Find the previous reviewed SHA from `cc-review-ledger.jsonl` or `cc-review-report.md`.
97
+ 2. Compare `git diff <previous-sha>...HEAD` when possible.
98
+ 3. If no previous SHA exists, compare against the base branch or reviewed artifact timestamps.
99
+ 4. Re-review changed nodes and dependent nodes.
100
+ 5. Preserve previous clean nodes only when their target content and assumptions are unchanged.
101
+
102
+ If git cannot identify the delta, mark the delta source as `unknown` and review the full in-scope surface.
17
103
 
18
104
  ## Thinking Tools
19
105
 
@@ -107,7 +193,7 @@ Only report smells inside the current requirement blast radius or smells made wo
107
193
 
108
194
  ## Decision Questions
109
195
 
110
- Ask only when a finding requires user judgment.
196
+ Ask only when a finding requires user judgment. Do not stop the whole review at the first decision unless that answer blocks the next review node.
111
197
 
112
198
  Use:
113
199
 
@@ -123,4 +209,13 @@ C) <skip> - impact
123
209
  STOP: wait for the user answer before continuing.
124
210
  ```
125
211
 
126
- Do not batch unrelated issues. One issue, one decision.
212
+ After the node pass, present a decision queue:
213
+
214
+ ```text
215
+ Decision Queue
216
+ ├── D1 scope or architecture decision
217
+ ├── D2 user-visible behavior decision
218
+ └── D3 test strategy decision
219
+ ```
220
+
221
+ Then ask decisions one by one. Do not batch unrelated issues inside one decision.
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ # ------------------------------------------------------------
6
+ # 收集 cc-review 的增量上下文
7
+ # ------------------------------------------------------------
8
+
9
+ change_dir="${1:-}"
10
+ base_ref="${2:-origin/main}"
11
+
12
+ if [[ -z "$change_dir" ]]; then
13
+ echo "Usage: collect-review-context.sh <change-dir> [base-ref]" >&2
14
+ exit 2
15
+ fi
16
+
17
+ review_dir="$change_dir/review"
18
+ ledger="$review_dir/cc-review-ledger.jsonl"
19
+ report="$review_dir/cc-review-report.md"
20
+ plan="$review_dir/cc-review-plan.md"
21
+ findings="$review_dir/cc-review-findings.json"
22
+
23
+ head_sha="$(git rev-parse HEAD)"
24
+ base_sha=""
25
+ if git rev-parse --verify "$base_ref" >/dev/null 2>&1; then
26
+ base_sha="$(git merge-base "$base_ref" HEAD)"
27
+ fi
28
+
29
+ reviewed_sha=""
30
+ if [[ -f "$ledger" ]]; then
31
+ reviewed_sha="$(
32
+ sed -n 's/.*"headSha"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$ledger" |
33
+ tail -n 1
34
+ )"
35
+ fi
36
+
37
+ if [[ -z "$reviewed_sha" && -f "$report" ]]; then
38
+ reviewed_sha="$(
39
+ sed -n 's/.*Reviewed head SHA:[[:space:]]*`\?\([0-9a-f]\{7,40\}\)`\?.*/\1/p' "$report" |
40
+ tail -n 1
41
+ )"
42
+ fi
43
+
44
+ diff_base="$base_sha"
45
+ if [[ -n "$reviewed_sha" ]] && git rev-parse --verify "$reviewed_sha^{commit}" >/dev/null 2>&1; then
46
+ diff_base="$reviewed_sha"
47
+ fi
48
+
49
+ echo "CC_REVIEW_CONTEXT"
50
+ echo "change_dir=$change_dir"
51
+ echo "review_dir=$review_dir"
52
+ echo "base_ref=$base_ref"
53
+ echo "base_sha=${base_sha:-unknown}"
54
+ echo "reviewed_sha=${reviewed_sha:-none}"
55
+ echo "head_sha=$head_sha"
56
+ echo "diff_base=${diff_base:-unknown}"
57
+
58
+ echo
59
+ echo "PRIOR_REVIEW_FILES"
60
+ for file in "$plan" "$report" "$ledger" "$findings"; do
61
+ if [[ -f "$file" ]]; then
62
+ printf 'present %s\n' "$file"
63
+ else
64
+ printf 'missing %s\n' "$file"
65
+ fi
66
+ done
67
+
68
+ echo
69
+ echo "CHANGED_FILES"
70
+ if [[ -n "$diff_base" ]]; then
71
+ git diff --name-status "$diff_base...HEAD"
72
+ else
73
+ git diff --name-status HEAD
74
+ fi
75
+
76
+ if [[ -f "$ledger" ]]; then
77
+ echo
78
+ echo "RECENT_LEDGER"
79
+ tail -n 20 "$ledger"
80
+ fi