cc-devflow 4.5.11 → 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 (185) hide show
  1. package/.claude/skills/cc-act/CHANGELOG.md +18 -0
  2. package/.claude/skills/cc-act/PLAYBOOK.md +17 -269
  3. package/.claude/skills/cc-act/SKILL.md +38 -425
  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 +18 -0
  15. package/.claude/skills/cc-check/PLAYBOOK.md +19 -273
  16. package/.claude/skills/cc-check/SKILL.md +33 -456
  17. package/.claude/skills/cc-check/references/review-contract.md +12 -147
  18. package/.claude/skills/cc-dev/CHANGELOG.md +15 -0
  19. package/.claude/skills/cc-dev/PLAYBOOK.md +1 -1
  20. package/.claude/skills/cc-dev/SKILL.md +52 -137
  21. package/.claude/skills/cc-dev/scripts/resolve-cc-devflow.sh +181 -0
  22. package/.claude/skills/cc-do/CHANGELOG.md +11 -0
  23. package/.claude/skills/cc-do/PLAYBOOK.md +19 -113
  24. package/.claude/skills/cc-do/SKILL.md +39 -245
  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 +16 -0
  31. package/.claude/skills/cc-investigate/PLAYBOOK.md +20 -180
  32. package/.claude/skills/cc-investigate/SKILL.md +64 -246
  33. package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +48 -98
  34. package/.claude/skills/cc-investigate/references/investigation-contract.md +14 -218
  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 +16 -0
  39. package/.claude/skills/cc-plan/PLAYBOOK.md +22 -161
  40. package/.claude/skills/cc-plan/SKILL.md +45 -295
  41. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +30 -228
  42. package/.claude/skills/cc-plan/references/planning-contract.md +24 -161
  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 +13 -0
  65. package/bin/cc-devflow-cli.js +20 -260
  66. package/bin/cc-devflow.js +44 -7
  67. package/docs/commands/README.md +1 -1
  68. package/docs/commands/README.zh-CN.md +1 -1
  69. package/docs/examples/README.md +1 -1
  70. package/docs/examples/START-HERE.md +14 -15
  71. package/docs/examples/example-bindings.json +11 -11
  72. package/docs/examples/full-design-blocked/README.md +4 -6
  73. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/{planning/tasks.md → task.md} +20 -15
  74. package/docs/examples/local-handoff/README.md +8 -11
  75. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/pr-brief.md +31 -0
  76. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/{planning/tasks.md → task.md} +18 -13
  77. package/docs/examples/pdca-loop/README.md +6 -9
  78. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +9 -11
  79. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/{planning/tasks.md → task.md} +18 -13
  80. package/docs/examples/scripts/check-example-bindings.sh +11 -62
  81. package/docs/guides/artifact-contract.md +10 -40
  82. package/docs/guides/getting-started.md +8 -8
  83. package/docs/guides/getting-started.zh-CN.md +8 -8
  84. package/docs/guides/minimize-artifacts.md +16 -130
  85. package/docs/guides/project-postmortem.md +14 -71
  86. package/lib/compiler/__tests__/skills-registry.test.js +9 -8
  87. package/lib/compiler/resource-copier.js +29 -0
  88. package/lib/skill-runtime/__tests__/archive-change.test.js +2 -2
  89. package/lib/skill-runtime/__tests__/benchmark-skills.test.js +3 -3
  90. package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +14 -4
  91. package/lib/skill-runtime/errors.js +3 -3
  92. package/lib/skill-runtime/index.js +5 -23
  93. package/lib/skill-runtime/paths.js +5 -52
  94. package/lib/skill-runtime/query-registry.js +4 -4
  95. package/lib/skill-runtime/query.js +89 -201
  96. package/lib/skill-runtime/store.js +4 -40
  97. package/lib/skill-runtime/trace.js +2 -2
  98. package/package.json +2 -5
  99. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_PRINCIPLES_TEMPLATE.md +0 -29
  100. package/.claude/skills/cc-act/assets/RELEASE_NOTE_TEMPLATE.md +0 -54
  101. package/.claude/skills/cc-act/scripts/generate-status-report.sh +0 -92
  102. package/.claude/skills/cc-act/scripts/sync-act-docs.sh +0 -355
  103. package/.claude/skills/cc-check/assets/REPORT_CARD_TEMPLATE.json +0 -234
  104. package/.claude/skills/cc-check/scripts/render-report-card.js +0 -438
  105. package/.claude/skills/cc-check/scripts/verify-gate.sh +0 -85
  106. package/.claude/skills/cc-do/scripts/build-task-context.sh +0 -175
  107. package/.claude/skills/cc-do/scripts/record-review-decision.sh +0 -88
  108. package/.claude/skills/cc-do/scripts/recover-workflow.sh +0 -82
  109. package/.claude/skills/cc-do/scripts/run-problem-analysis.sh +0 -70
  110. package/.claude/skills/cc-do/scripts/verify-task-gates.sh +0 -109
  111. package/.claude/skills/cc-do/scripts/write-task-checkpoint.sh +0 -92
  112. package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +0 -224
  113. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +0 -178
  114. package/.claude/skills/cc-spec-init/assets/CHANGE_META_TEMPLATE.json +0 -28
  115. package/.claude/skills/cc-spec-init/scripts/validate-spec-links.sh +0 -45
  116. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +0 -234
  117. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +0 -488
  118. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/review/report-card.json +0 -189
  119. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/resume-index.md +0 -39
  120. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/status.md +0 -29
  121. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +0 -123
  122. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +0 -292
  123. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/review/report-card.json +0 -136
  124. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/status.md +0 -29
  125. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +0 -124
  126. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +0 -292
  127. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/review/report-card.json +0 -136
  128. package/docs/get-shit-done-strategy-audit.md +0 -518
  129. package/docs/skill-runtime-migration.md +0 -46
  130. package/lib/skill-runtime/__tests__/approve.test.js +0 -92
  131. package/lib/skill-runtime/__tests__/autopilot.test.js +0 -253
  132. package/lib/skill-runtime/__tests__/benchmark-artifacts.test.js +0 -165
  133. package/lib/skill-runtime/__tests__/delegation.test.js +0 -97
  134. package/lib/skill-runtime/__tests__/dispatch.test.js +0 -237
  135. package/lib/skill-runtime/__tests__/intent.test.js +0 -203
  136. package/lib/skill-runtime/__tests__/lifecycle.test.js +0 -169
  137. package/lib/skill-runtime/__tests__/planner.tdd.test.js +0 -331
  138. package/lib/skill-runtime/__tests__/prepare-pr.test.js +0 -126
  139. package/lib/skill-runtime/__tests__/query.test.js +0 -860
  140. package/lib/skill-runtime/__tests__/readiness.test.js +0 -53
  141. package/lib/skill-runtime/__tests__/release.test.js +0 -85
  142. package/lib/skill-runtime/__tests__/review-check-integration.test.js +0 -148
  143. package/lib/skill-runtime/__tests__/review-records.test.js +0 -619
  144. package/lib/skill-runtime/__tests__/runtime.integration.test.js +0 -351
  145. package/lib/skill-runtime/__tests__/schemas.test.js +0 -337
  146. package/lib/skill-runtime/__tests__/task-contract-migrate.test.js +0 -137
  147. package/lib/skill-runtime/__tests__/task-contract.test.js +0 -874
  148. package/lib/skill-runtime/__tests__/team-state.test.js +0 -51
  149. package/lib/skill-runtime/__tests__/verify-artifacts.test.js +0 -203
  150. package/lib/skill-runtime/__tests__/worker-run.test.js +0 -275
  151. package/lib/skill-runtime/__tests__/worker.test.js +0 -56
  152. package/lib/skill-runtime/__tests__/workflow-context-legacy-fallback.test.js +0 -31
  153. package/lib/skill-runtime/__tests__/workflow-context.test.js +0 -98
  154. package/lib/skill-runtime/artifacts.js +0 -88
  155. package/lib/skill-runtime/context-index.js +0 -545
  156. package/lib/skill-runtime/delegation.js +0 -533
  157. package/lib/skill-runtime/intent.js +0 -309
  158. package/lib/skill-runtime/lifecycle.js +0 -294
  159. package/lib/skill-runtime/operations/CLAUDE.md +0 -19
  160. package/lib/skill-runtime/operations/approve.js +0 -81
  161. package/lib/skill-runtime/operations/autopilot-core.js +0 -337
  162. package/lib/skill-runtime/operations/autopilot-execution.js +0 -307
  163. package/lib/skill-runtime/operations/autopilot-shared.js +0 -48
  164. package/lib/skill-runtime/operations/autopilot.js +0 -163
  165. package/lib/skill-runtime/operations/dispatch.js +0 -416
  166. package/lib/skill-runtime/operations/init.js +0 -60
  167. package/lib/skill-runtime/operations/janitor.js +0 -61
  168. package/lib/skill-runtime/operations/plan.js +0 -59
  169. package/lib/skill-runtime/operations/prepare-pr.js +0 -25
  170. package/lib/skill-runtime/operations/release.js +0 -99
  171. package/lib/skill-runtime/operations/resume.js +0 -126
  172. package/lib/skill-runtime/operations/review-records.js +0 -265
  173. package/lib/skill-runtime/operations/snapshot.js +0 -45
  174. package/lib/skill-runtime/operations/task-contract.js +0 -593
  175. package/lib/skill-runtime/operations/verify.js +0 -170
  176. package/lib/skill-runtime/operations/worker-run.js +0 -531
  177. package/lib/skill-runtime/operations/worker.js +0 -33
  178. package/lib/skill-runtime/planner.js +0 -539
  179. package/lib/skill-runtime/readiness.js +0 -84
  180. package/lib/skill-runtime/review-records.js +0 -123
  181. package/lib/skill-runtime/review.js +0 -855
  182. package/lib/skill-runtime/schemas.js +0 -746
  183. package/lib/skill-runtime/task-contract.js +0 -188
  184. package/lib/skill-runtime/team-state.js +0 -122
  185. package/lib/skill-runtime/workflow-context.js +0 -748
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: cc-review
3
- version: 2.0.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.
3
+ version: 2.1.2
4
+ description: Use when a plan, bug fix, PR, or implementation diff needs review findings. It finds concrete problems and routes them without writing process files.
5
5
  triggers:
6
6
  - 深度 review 这个方案
7
7
  - review 这个复杂需求
@@ -13,65 +13,50 @@ triggers:
13
13
  - run cc-review
14
14
  reads:
15
15
  - PLAYBOOK.md
16
- - CHANGELOG.md
17
16
  - references/review-methods.md
18
17
  - references/plan-review-branch.md
19
18
  - references/implementation-review-branch.md
20
19
  - references/e2e-and-plugin-verification.md
21
- - scripts/collect-review-context.sh
22
20
  writes:
23
- - path: devflow/changes/<change-key>/review/review-ledger.jsonl
24
- durability: durable
21
+ - path: current response
22
+ durability: ephemeral
25
23
  required: true
26
- - path: devflow/changes/<change-key>/review/review-findings.json
24
+ - path: devflow/changes/<change-key>/handoff/pr-brief.md
27
25
  durability: durable
28
26
  required: false
29
- when: actionable findings need machine consumption
30
- - path: devflow/changes/<change-key>/review/review-agent-results.jsonl
27
+ when: review findings must be reflected in PR text
28
+ - path: devflow/postmortems/incidents/<date>-<change-key>.md
31
29
  durability: durable
32
30
  required: false
33
- when: subagent reviewers are used
31
+ when: review exposes a recurring failure worth preserving
34
32
  effects:
35
33
  - optional deep review
36
34
  - read-only reviewer agent dispatch
37
- - risk-lane finding aggregation
38
- - durable findings
35
+ - finding aggregation
39
36
  - reroute recommendation
40
37
  entry_gate:
41
- - Read planning/design.md or planning/analysis.md when the work is still plan-stage.
42
- - Read the current diff, task manifest, change metadata, and latest verification evidence when the work is execution-stage.
43
- - Read prior `review-ledger.jsonl`, optional `review-findings.json`, optional `review-agent-results.jsonl`, and legacy `cc-review-*` files when present.
44
- - Use git diff or scripts/collect-review-context.sh to identify content changed since the last review before deciding what to re-review.
45
- - Classify the review branch as plan, implementation, or mixed before loading detailed references.
46
- - Start the durable review with `cc-devflow review start` before producing findings; encode selected nodes, skipped nodes, risk lanes, scope, base SHA, and head SHA in the first ledger event.
47
- - Decide whether nodes need independent reviewer agents before starting node execution; record the decision in the `review-started` event and optional `review-agent-results.jsonl`.
48
- - For broad implementation or mixed reviews, decide whether the risk-lane review swarm profile is required; record used, skipped, or unavailable lanes in `review-ledger.jsonl`.
49
- - Freeze the requested scope before finding smells; only report smells inside the requirement blast radius or clearly amplified by the current work.
38
+ - Classify the review target as plan, implementation, PR, or mixed.
39
+ - Read only the task, PR, diff, code, tests, logs, screenshots, and docs needed to review the requested scope.
40
+ - Use Git history and current diff as the only durable review memory; do not load or create process files.
41
+ - Freeze the requested scope before finding smells; report only issues inside the change blast radius or clearly amplified by it.
42
+ - Subagents are optional read-only reviewers; their raw output stays in the conversation and is not saved to files.
50
43
  exit_criteria:
51
- - review-ledger.jsonl records selected tools, review nodes, skipped nodes with reasons, review order, and final route through CLI events.
52
- - review-ledger.jsonl appends one record per reviewed node with status, evidence refs, findings, and follow-up route.
53
- - review-agent-results.jsonl records read-only reviewer outputs when subagents are used, or the review ledger records why agents were unavailable or unnecessary.
54
- - review-findings.json exists only when later agents need structured findings; human Markdown is rendered on demand with `cc-devflow review render`.
55
- - Plan-stage reviews record every selected strategy/design/engineering/DX facet as checked, skipped, or blocked.
56
- - Implementation-stage reviews include diff evidence, code-smell evidence, test and E2E/plugin verification evidence for every selected changed surface.
57
- - Every in-scope code smell has a concrete recommendation or an explicit skip/defer rationale.
58
- - No artificial finding cap was applied; review stops only when planned nodes are checked, skipped with reason, or blocked.
59
- - Main thread validates subagent findings before promoting them to final findings; no subagent output is trusted blindly.
60
- - The next action is exactly one of cc-plan, cc-do, cc-check, cc-act, or no-op.
44
+ - Findings are listed first, ordered by severity and backed by concrete file/line, command, diff, UI, log, or missing-evidence proof.
45
+ - Every finding has impact, recommendation, and route: cc-plan, cc-do, cc-check, cc-act, or stop.
46
+ - In-scope code smells are either findings, explicit defers, or clean with reason.
47
+ - If no issues are found, the answer says so and names residual test or evidence risk.
48
+ - No process file was created.
61
49
  reroutes:
62
50
  - when: Plan assumptions, scope, architecture, design, or DX contracts are wrong or incomplete.
63
51
  target: cc-plan
64
- - when: Implementation findings require code, test, docs, or UI behavior changes.
52
+ - when: Implementation findings require code, test, docs, UI behavior, logs, or PR text changes.
65
53
  target: cc-do
66
54
  - when: Deep review is clean and only fresh evidence verification remains.
67
55
  target: cc-check
68
56
  recovery_modes:
69
- - name: branch-reclassification
70
- when: The review started on the wrong branch type or new evidence shows both plan and implementation need review.
71
- action: Stop the current pass, restate the correct branch classification, load the matching reference, and restart from the scope freeze.
72
- - name: progressive-disclosure-reset
73
- when: The review is drowning in unrelated methods or external review templates.
74
- action: Return to the latest `review-started` event, keep only review nodes that are in scope, and continue node-by-node instead of collapsing to a short finding list.
57
+ - name: scope-reset
58
+ when: The review starts drifting into unrelated historical debt.
59
+ action: Return to the current diff, task.md, or PR scope and discard out-of-scope notes.
75
60
  tool_budget:
76
61
  read_files: 24
77
62
  search_steps: 16
@@ -84,233 +69,60 @@ tool_budget:
84
69
 
85
70
  ## Role
86
71
 
87
- `cc-review` 是可选的深度 Review 节点。
88
-
89
- 它不替代 `cc-check`。`cc-check` 负责流程式证据验收和 pass/fail/blocked 裁决;`cc-review` 负责在复杂需求、复杂 bug、架构风险、UI/DX 风险、代码坏味道出现时做更深的多轮审查。
90
-
91
- ## Runtime Output Policy
72
+ `cc-review` 是可选的深度审查节点。它只做一件事:找出当前范围内真实存在的问题。
92
73
 
93
- 写入任何 durable Markdown JSON metadata 前,先运行 `cc-devflow config resolve --format policy`。
94
-
95
- - `Output language` 是机器约束,`review/review-ledger.jsonl`、`review/review-findings.json` 和 on-demand rendered Markdown 中新增的人类可读摘要必须记录并遵守它。
96
- - `agent_preferences` 是用户偏好建议,只影响表达方式和结构选择,不覆盖本 Skill 的 Review 边界。
97
- - 如果配置解析失败,先修配置或向用户说明阻塞,不要用默认语言继续生成正式文档。
74
+ 它不写过程文件,不维护 review 状态机。需要保留的事实进入 Git commit、PR 文件,或者在复发/事故场景进入尸检 incident。
98
75
 
99
76
  ## Iron Law
100
77
 
101
78
  ```text
102
- REVIEW THE RIGHT THING AT THE RIGHT STAGE.
79
+ FIND THE REAL PROBLEM. DO NOT CREATE REVIEW ARTIFACTS.
103
80
  ```
104
81
 
105
- 计划还没进入实现时,Review 计划。代码已经改了时,Review diff 和运行效果。两者都有时,先 Review 计划合同,再 Review 实现是否兑现合同。
106
-
107
- 深度 Review 不能靠“最多列 3 个问题”收尾。必须先制定 Review 计划,再逐节点检查、逐节点记录。问题数量由证据决定,不由输出习惯决定。
82
+ Review 的价值在于问题质量,不在于过程记录数量。没有证据就不报;有证据就直接报。
108
83
 
109
84
  ## Read First
110
85
 
111
- 1. `PLAYBOOK.md`
112
- 2. `CHANGELOG.md`
113
- 3. `references/review-methods.md`
114
- 4. Branch-specific reference:
115
- - plan-stage: `references/plan-review-branch.md`
116
- - implementation-stage: `references/implementation-review-branch.md`
117
- - UI/runtime/plugin evidence: `references/e2e-and-plugin-verification.md`
118
- 5. When prior review state may exist, run or inspect `scripts/collect-review-context.sh`
119
-
120
- ## Use This Skill When
86
+ 1. `references/review-methods.md`
87
+ 2. Plan review: `references/plan-review-branch.md`
88
+ 3. Implementation review: `references/implementation-review-branch.md`
89
+ 4. UI/runtime/plugin review: `references/e2e-and-plugin-verification.md`
121
90
 
122
- - 复杂需求或复杂 bug 需要比 `cc-check` 更深的 Review。
123
- - `cc-plan` 已有方案,但你怀疑范围、根因、架构、测试或 DX 没压实。
124
- - `cc-do` 已经实现,但你要在进入 `cc-check` 前找设计坏味道、代码坏味道和端到端落地风险。
125
- - 需要检查僵化、冗余、循环依赖、脆弱性、晦涩性、数据泥团、不必要复杂。
126
- - UI 或 Codex 插件链路需要用浏览器、电脑操作、日志和点击验证证明实际效果。
127
-
128
- 不要把每个小改动都送进 `cc-review`。简单、低风险、证据充分的变更直接走 `cc-check`。
91
+ 只按触发条件读取参考,不默认打开全部文件。
129
92
 
130
93
  ## Branch Classifier
131
94
 
132
- 先分类,再加载详细方法:
133
-
134
- | Branch | Signal | Load |
95
+ | Branch | Signal | Review target |
135
96
  | --- | --- | --- |
136
- | `plan` | 用户说“先别写代码”、只有 `planning/design.md` / `planning/analysis.md`,或没有实现 diff | `plan-review-branch.md` |
137
- | `implementation` | 当前分支已有代码 diff、review comment、UI 改动、测试改动或用户说“Review 代码” | `implementation-review-branch.md` |
138
- | `mixed` | 计划和实现都存在,且实现可能偏离计划 | plan,再 implementation |
139
-
140
- 如果分类不清,先读 change artifacts 和 diff。仍然不清时,用一个 Decision Question 问用户,不要猜。
141
-
142
- ## Harness Contract
143
-
144
- - 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.
145
- - 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.
146
- - Required evidence: every finding must cite plan text, code path, diff line, command output, browser action, UI state, log line, or explicit missing evidence.
147
- - Reroute rule: plan contract defects return to `cc-plan`; implementation defects return to `cc-do`; clean deep review proceeds to `cc-check`.
148
-
149
- ## Independent Reviewer Dispatch
150
-
151
- 触发 `cc-review` 本身就构成用户对只读 reviewer subAgent 的授权。不要再要求用户补一句“请开启子智能体”。
152
-
153
- 主线程负责:制定 Review 计划、拆分节点、分配 reviewer、合并 findings、验证证据、去重、决定 quick fix / decision queue / reroute。
154
-
155
- 只读 reviewer 负责:在独立上下文里审指定节点,不编辑文件,不修改计划,不直接决定最终结论。
156
-
157
- ### Dispatch Rules
158
-
159
- - ClaudeCode 环境:使用可用的 `Task` / subAgent 机制创建只读 reviewer。
160
- - Codex App / Codex 工具环境:优先使用内置 `explorer` 子智能体;如果只有 `default`,prompt 必须写明只读审查、禁止编辑。
161
- - 暴露 `spawn_agent` 的 Codex 环境:使用 `spawn_agent(agent_type="explorer", fork_context=false, ...)`。只有在用户明确要求继承完整上下文时才 `fork_context=true`。
162
- - 不依赖 repo-local 自定义 agent 名称完成核心流程;自定义 agent 只能作为增强。
163
- - 如果当前运行时没有 subagent 工具,或工具调用被上层策略禁止,主线程按同一节点计划串行执行,并在报告里写 `Agents used: no (subagent tool unavailable)`。
164
- - subagent 只拿自己的 review packet,不拿主线程完整聊天历史;这样保持独立性。
165
- - 每个 subagent 必须输出 JSONL findings;没有发现时输出 `NO FINDINGS`。
166
- - 主线程必须验证 subagent finding 的路径、证据、scope 和置信度,不能因为 reviewer 说了就接受。
167
-
168
- ### Risk-Lane Review Swarm Profile
169
-
170
- 复杂实现、跨模块 diff、PR landing 前复审、或用户要求 parallel / swarm review 时,优先把实现节点拆成四类只读风险 lane。小 diff 可以由一个 combined reviewer 覆盖全部 lane,但计划里必须写明。
171
-
172
- 1. Intent and regression reviewer: 检查 diff 是否兑现意图、是否引入范围外行为漂移、边界和 fallback 是否坏掉、caller/callee 合同是否漂移。
173
- 2. Security and privacy reviewer: 检查 authn/authz、输入验证、注入风险、secret/token/sensitive data 暴露、默认权限扩大、信任未验证数据。
174
- 3. Performance and reliability reviewer: 检查热路径重复 I/O、启动/渲染/请求成本、cleanup 泄漏、retry storm、订阅漂移、排序/竞态/失败处理。
175
- 4. Contracts and coverage reviewer: 检查 API/schema/type/config/flag 不匹配、迁移/兼容 fallout、回归测试缺口、日志/metrics/assertion/error-path 缺失。
176
-
177
- 这些 lane 是审查视角,不是 finding 配额。主线程必须把 raw findings 合并后再输出:重复项合并,弱证据或 speculative claim 降级或拒收,和冻结意图冲突的 finding 转成 decision question 或 reject。
178
-
179
- ### Dispatch Heuristics
180
-
181
- - Plan review:
182
- - Strategy reviewer: outcome, scope, goal tree, do-nothing risk.
183
- - Engineering reviewer: architecture, data flow, state, testability, rollback.
184
- - Design reviewer: user-visible flows, states, accessibility, visual/interaction risk.
185
- - DX reviewer: CLI/API/docs/operator journey, errors, examples.
186
- - TOC reviewer: current reality tree, conflict diagram, future reality tree for complex bugs.
187
- - Implementation review:
188
- - Contract reviewer: diff vs plan/investigation contract.
189
- - Smell reviewer: rigidity, duplication, cycle, fragility, obscurity, data-clump, unnecessary complexity; may load `cc-simplify`.
190
- - Test reviewer: public seam, regression quality, fixture honesty, coverage gaps.
191
- - Runtime reviewer: Browser/Computer Use/CLI/log proof for UI or behavior surfaces.
192
- - Risk-lane reviewers: intent/regression, security/privacy, performance/reliability, contracts/coverage when a broad diff benefits from parallel independent context.
193
-
194
- 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.
195
-
196
- ### Reviewer Packet
197
-
198
- Each reviewer receives:
199
-
200
- ```text
201
- You are a read-only cc-review reviewer. Do not edit files.
202
- Repo root: <path>
203
- Review mode: plan | implementation | mixed
204
- Node ids: <R001,R002>
205
- Scope: <requirement blast radius>
206
- Current delta: <base/reviewed sha -> head sha + changed files>
207
- Required artifacts: <paths>
208
- Reference to use: <review-methods / plan / implementation / e2e / cc-simplify>
209
- Output: JSONL findings or NO FINDINGS.
210
- Finding schema:
211
- {"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"}
212
- ```
213
-
214
- 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.
215
-
216
- ## Stateful Review Loop
217
-
218
- Every run follows this loop:
219
-
220
- 1. Collect prior review state:
221
- - previous `review-ledger.jsonl`
222
- - previous `review-findings.json`
223
- - previous `review-agent-results.jsonl`
224
- - legacy `cc-review-plan.md` / `cc-review-report.md` / `cc-review-ledger.jsonl` / `cc-review-findings.json` only as fallback
225
- 2. Collect current delta:
226
- - `git diff <last-reviewed-sha>...HEAD` when a reviewed SHA exists
227
- - otherwise `git diff <base>...HEAD`
228
- - changed planning artifacts, changed code, changed tests, changed docs, changed runtime/UI surfaces
229
- 3. Select review tools:
230
- - strategy / CEO-style outcome review
231
- - engineering review
232
- - design review
233
- - DX/operator review
234
- - TOC root-cause review
235
- - code-smell / simplification review
236
- - E2E / Browser / Computer Use / logs review
237
- 4. Decide reviewer dispatch:
238
- - which nodes need independent subagent review
239
- - which nodes stay in main thread
240
- - why any eligible reviewer was skipped
241
- 5. Run `cc-devflow review start` before findings:
242
- - selected node ids
243
- - skipped nodes and reasons
244
- - review mode and scope
245
- - risk lanes
246
- - base/head SHA
247
- 6. Traverse nodes one by one:
248
- - review the node
249
- - run the smallest useful check for that node
250
- - collect subagent JSONL output when assigned
251
- - validate and deduplicate reviewer findings
252
- - append one ledger record
253
- - mark the node `checked`, `skipped`, or `blocked`
254
- 7. Summarize:
255
- - quick mechanical fixes
256
- - user-decision queue
257
- - reroute list
258
- - final next skill
259
-
260
- 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.
261
-
262
- ## Output Contract
263
-
264
- Use CLI records as the default durable output:
265
-
266
- 1. `cc-devflow review start --change <id> --change-key <key> --mode <plan|implementation|mixed> --scope <scope> --base-sha <sha> --head-sha <sha> --selected-node <node> --skipped-node <node:reason> --risk-lane <lane>`
267
- 2. `cc-devflow review record-node --review-id <id> --node-id <node> --target <artifact> --status checked|skipped|blocked --evidence-ref <ref> --finding <id> --next <skill>`
268
- 3. `cc-devflow review add-finding --review-id <id> --finding-id <id> --severity <level> --confidence <1-10> --display-tier <blocking|warning> --path <path> --evidence <evidence> --recommendation <text> --route <skill>`
269
- 4. `cc-devflow review close --review-id <id> --status clean|findings|blocked --blocking-count <n> --warning-count <n> --next <skill>`
270
- 5. `cc-devflow review render --review-id <id> --output <path>` only when a human Markdown report is explicitly needed.
271
-
272
- Append one JSON line to `review/review-ledger.jsonl` per review event. A reviewed node event looks like:
273
-
274
- ```json
275
- {"nodeId":"R001","status":"checked","target":"planning/design.md","tool":"engineering","headSha":"...","evidence":["..."],"findings":["F001"],"next":"cc-plan"}
276
- ```
277
-
278
- Write `review/review-findings.json` only when findings need machine consumption by later agents.
279
-
280
- Write `review/review-agent-results.jsonl` when subagents are used. It contains raw reviewer findings plus reviewer identity. The ledger or rendered report must say which raw findings were accepted, merged, downgraded, or rejected.
97
+ | `plan` | 用户说先 review 方案、只有 `task.md` / docs / issue | scope, contract, architecture, test strategy |
98
+ | `implementation` | 当前分支已有 code/test/docs diff | diff, behavior, tests, smells, regression risk |
99
+ | `PR` | 用户要求 review PR | PR diff, body accuracy, CI/test proof, merge risk |
100
+ | `mixed` | 方案和实现都变了 | plan contract first, then implementation conformance |
281
101
 
282
102
  ## Finding Rules
283
103
 
284
- Each finding must include:
104
+ 每条 finding 必须包含:
285
105
 
286
106
  - severity: `critical` / `important` / `advisory`
287
- - confidence: 1-10
288
- - scope: why this is inside the current requirement blast radius
289
- - evidence: concrete path, line, artifact, command, browser action, or log
290
- - smell: one of `rigidity`, `duplication`, `cycle`, `fragility`, `obscurity`, `data-clump`, `unnecessary-complexity`, or `none`
291
- - recommendation: exact next move
292
- - route: `cc-plan`, `cc-do`, `cc-check`, `cc-act`, or `no-op`
293
-
294
- 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.
107
+ - scope: 为什么属于当前请求范围
108
+ - evidence: 文件行、diff、命令输出、浏览器动作、日志、截图或明确缺失的证据
109
+ - impact: 它会导致什么错误、回归、维护成本或用户问题
110
+ - recommendation: 最小修复动作
111
+ - route: `cc-plan` / `cc-do` / `cc-check` / `cc-act` / `stop`
295
112
 
296
- 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.
113
+ 代码坏味道包括 rigidity、duplication、cycle、fragility、obscurity、data-clump、unnecessary complexity。范围内发现就报;不在范围内只作为 defer 或不提。
297
114
 
298
- ## Progressive Disclosure
115
+ ## Subagents
299
116
 
300
- Progressive disclosure controls context size, not review depth. Do not load every reference by default, but do build the full review plan first.
117
+ 可以使用只读 reviewer subagent,但输出只在主线程汇总,不写文件。主线程必须验证、去重、降级或拒收 subagent finding。
301
118
 
302
- 1. Always read `review-methods.md`.
303
- 2. Read `plan-review-branch.md` only for plan or mixed reviews.
304
- 3. Read `implementation-review-branch.md` only for implementation or mixed reviews.
305
- 4. Read `e2e-and-plugin-verification.md` only when UI, browser behavior, desktop app behavior, CLI runtime, or Codex plugin chain evidence is relevant.
306
- 5. Read `cc-simplify` only when the review plan selects code-smell, duplication, simplification, or architecture-cleanup nodes.
119
+ ## Output
307
120
 
308
- ## Exit Rule
121
+ 只输出当前回复或 GitHub review,不写过程文件。默认结构:
309
122
 
310
- `cc-review` is complete only when the next route is unambiguous:
123
+ 1. Findings: severity, file/line, evidence, impact, fix.
124
+ 2. Questions: only when they block the next route.
125
+ 3. Risk: residual test or evidence gap.
126
+ 4. Route: `cc-plan` / `cc-do` / `cc-check` / `cc-act` / `stop`.
311
127
 
312
- - `cc-plan`: revise design, scope, root cause, UI/DX contract, or task split.
313
- - `cc-do`: fix implementation, tests, docs, UI behavior, logs, or review findings.
314
- - `cc-check`: deep review is clean enough for evidence verification.
315
- - `cc-act`: only when a fresh `cc-check` pass already exists.
316
- - `no-op`: review found no relevant issue and no downstream action is needed.
128
+ 没有问题时直接说 `No findings`,并说明还没验证的风险。
@@ -64,7 +64,7 @@ When Codex plugins are part of the expected path:
64
64
 
65
65
  ## Report Format
66
66
 
67
- Record E2E evidence in `review-ledger.jsonl` and render it into Markdown on demand:
67
+ Report E2E evidence in the review response:
68
68
 
69
69
  ```markdown
70
70
  ## E2E / Plugin Evidence
@@ -74,7 +74,7 @@ Record E2E evidence in `review-ledger.jsonl` and render it into Markdown on dema
74
74
  | ... | Browser / Computer Use / CLI | screenshot, log, command, artifact | pass / fail / blocked |
75
75
  ```
76
76
 
77
- Also append one ledger record per flow so a later review can skip unchanged flows or re-open only changed flows.
77
+ Keep the evidence in the response or PR brief. Later reviews use Git diff, PR text, and current verification output instead of ledger files.
78
78
 
79
79
  If blocked, include:
80
80
 
@@ -1,152 +1,12 @@
1
1
  # Implementation Review Branch
2
2
 
3
- Use this reference when the review target is code, tests, docs, UI behavior, or a current branch diff.
3
+ Read:
4
4
 
5
- ## Intake
5
+ 1. current Git diff
6
+ 2. `task.md`
7
+ 3. changed code and tests
8
+ 4. fresh command output when available
6
9
 
7
- Read, in order:
10
+ Review behavior, regression risk, security, reliability, test quality, and code smells inside the current blast radius.
8
11
 
9
- 1. current branch and base branch
10
- 2. `git diff <base>...HEAD --stat`
11
- 3. full diff for changed files
12
- 4. `planning/design.md` or `planning/analysis.md`
13
- 5. `planning/tasks.md` and `planning/task-manifest.json`
14
- 6. changed code plus direct importers/callers for enum, state, API, and behavior changes
15
-
16
- If no plan exists, infer intent from user request, commits, TODOs, and PR body if present. Mark intent confidence.
17
-
18
- ## Scope Check
19
-
20
- Produce:
21
-
22
- ```text
23
- Scope Check: CLEAN | DRIFT DETECTED | REQUIREMENTS MISSING
24
- Intent: ...
25
- Delivered: ...
26
- Diff surface: ...
27
- ```
28
-
29
- Out-of-scope files are findings only when they change behavior or expand blast radius.
30
-
31
- ## Diff Review Passes
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 `review-ledger.jsonl` and raw reviewer output when separate reviewers are used.
45
-
46
- ### 1. Contract Fidelity
47
-
48
- Check whether implementation matches the frozen plan or investigation:
49
-
50
- - required tasks done
51
- - rejected scope not implemented
52
- - root cause still true
53
- - expected spec delta honored
54
- - behavior visible at public seam
55
-
56
- ### 2. Code Smell Scan
57
-
58
- Use `review-methods.md` smell taxonomy.
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 `review-ledger.jsonl`.
61
-
62
- Look for:
63
-
64
- - copy-paste helper logic
65
- - broad catch-all errors
66
- - parameter clumps
67
- - shallow pass-through modules
68
- - internal mocks driving production design
69
- - new branch forests where a data shape would collapse cases
70
- - hidden state or multiple truth sources
71
- - cycles between modules
72
-
73
- ### 3. Structural Risk
74
-
75
- Check:
76
-
77
- - security and trust boundaries
78
- - enum/value completeness outside the diff
79
- - migrations and rollback
80
- - concurrency and double-submit
81
- - external service failures
82
- - logs/metrics for new paths
83
-
84
- ### 4. Test Quality
85
-
86
- Build a coverage map:
87
-
88
- ```text
89
- CODE PATHS USER/RUNTIME FLOWS
90
- file.ts feature flow
91
- ├── [tested] happy ├── [tested] main path
92
- ├── [gap] empty ├── [gap] double action
93
- └── [gap] upstream error └── [gap] navigate away / timeout
94
- ```
95
-
96
- Flag:
97
-
98
- - no regression test for changed behavior
99
- - tests only assert implementation shape
100
- - tests mock internal modules instead of public seam
101
- - fixture lies with missing fields or type casts
102
- - no UI/E2E proof for user-visible change
103
-
104
- ### 5. Documentation and DX
105
-
106
- If changed behavior affects README, guides, CLI help, package install, public API, agent skill usage, or examples, check whether docs changed too.
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 `review-ledger.jsonl` records a reviewed SHA, narrow to `git diff <reviewedSha>...HEAD`; fall back to legacy `cc-review-ledger.jsonl` only when needed.
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
-
127
- ## Fix Policy
128
-
129
- `cc-review` does not silently edit code. It writes findings and routes:
130
-
131
- - mechanical local issue -> `cc-do` with direct fix recommendation
132
- - architecture/contract issue -> `cc-plan`
133
- - clean implementation -> `cc-check`
134
-
135
- If the user explicitly asks to fix findings in the same turn, switch to `cc-do` behavior after writing the review report.
136
-
137
- ## Output Requirements
138
-
139
- Record in `review-ledger.jsonl` and render on-demand Markdown when a human report is needed:
140
-
141
- - base branch and diff summary
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
146
- - code smell findings
147
- - structural findings
148
- - test and E2E coverage map
149
- - docs/DX notes
150
- - final route
151
-
152
- Write `review-findings.json` when there are actionable findings that later agents need to consume.
12
+ Findings stay in the response or PR text. Do not write process files.