cc-devflow 4.5.7 → 4.5.8

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 (62) hide show
  1. package/.claude/skills/cc-act/CHANGELOG.md +6 -0
  2. package/.claude/skills/cc-act/PLAYBOOK.md +9 -0
  3. package/.claude/skills/cc-act/SKILL.md +15 -5
  4. package/.claude/skills/cc-act/references/closure-contract.md +4 -0
  5. package/.claude/skills/cc-act/scripts/detect-ship-target.sh +27 -0
  6. package/.claude/skills/cc-act/scripts/ensure-ship-branch.sh +93 -0
  7. package/.claude/skills/cc-act/scripts/generate-status-report.sh +6 -0
  8. package/.claude/skills/cc-act/scripts/render-pr-brief.sh +6 -0
  9. package/.claude/skills/cc-act/scripts/sync-act-docs.sh +14 -0
  10. package/.claude/skills/cc-dev/CHANGELOG.md +5 -0
  11. package/.claude/skills/cc-dev/PLAYBOOK.md +63 -0
  12. package/.claude/skills/cc-dev/SKILL.md +168 -0
  13. package/.claude/skills/cc-do/CHANGELOG.md +6 -0
  14. package/.claude/skills/cc-do/SKILL.md +23 -1
  15. package/.claude/skills/cc-next/CHANGELOG.md +5 -0
  16. package/.claude/skills/cc-next/PLAYBOOK.md +52 -0
  17. package/.claude/skills/cc-next/SKILL.md +161 -0
  18. package/.claude/skills/cc-plan/CHANGELOG.md +6 -0
  19. package/.claude/skills/cc-plan/SKILL.md +45 -3
  20. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +26 -0
  21. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +49 -1
  22. package/.claude/skills/cc-plan/references/planning-contract.md +11 -0
  23. package/.claude/skills/cc-pr-land/CHANGELOG.md +5 -0
  24. package/.claude/skills/cc-pr-land/PLAYBOOK.md +45 -0
  25. package/.claude/skills/cc-pr-land/SKILL.md +157 -0
  26. package/.claude/skills/cc-pr-review/CHANGELOG.md +5 -0
  27. package/.claude/skills/cc-pr-review/PLAYBOOK.md +46 -0
  28. package/.claude/skills/cc-pr-review/SKILL.md +142 -0
  29. package/.claude/skills/cc-review/CHANGELOG.md +21 -0
  30. package/.claude/skills/cc-review/PLAYBOOK.md +64 -10
  31. package/.claude/skills/cc-review/SKILL.md +185 -18
  32. package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +4 -0
  33. package/.claude/skills/cc-review/references/implementation-review-branch.md +37 -0
  34. package/.claude/skills/cc-review/references/plan-review-branch.md +36 -1
  35. package/.claude/skills/cc-review/references/review-methods.md +98 -3
  36. package/.claude/skills/cc-review/scripts/collect-review-context.sh +80 -0
  37. package/.claude/skills/cc-simplify/CHANGELOG.md +6 -0
  38. package/.claude/skills/cc-simplify/SKILL.md +19 -8
  39. package/CHANGELOG.md +8 -1
  40. package/README.md +52 -3
  41. package/README.zh-CN.md +52 -3
  42. package/config/distributable-skills.json +8 -0
  43. package/docs/assets/cc-devflow-pr-harness-en.svg +153 -0
  44. package/docs/assets/cc-devflow-pr-harness-zh.svg +152 -0
  45. package/docs/assets/wechat-group-qr.jpg +0 -0
  46. package/docs/examples/example-bindings.json +9 -5
  47. package/docs/examples/full-design-blocked/README.md +1 -1
  48. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +1 -1
  49. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +310 -6
  50. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/tasks.md +45 -1
  51. package/docs/examples/local-handoff/README.md +1 -1
  52. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +1 -1
  53. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +197 -4
  54. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/tasks.md +35 -1
  55. package/docs/examples/pdca-loop/README.md +1 -1
  56. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +1 -1
  57. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +198 -5
  58. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/tasks.md +35 -1
  59. package/docs/examples/scripts/check-example-bindings.sh +19 -1
  60. package/docs/guides/getting-started.md +1 -1
  61. package/docs/guides/getting-started.zh-CN.md +1 -1
  62. package/package.json +6 -1
@@ -0,0 +1,157 @@
1
+ ---
2
+ name: cc-pr-land
3
+ version: 1.0.0
4
+ description: Use in a separate session to land one or more reviewed GitHub PRs into main with review-first, rebase-first discipline. It refreshes live PR truth, rebases each PR onto the evolving mainline, resolves conflicts without shrinking requirements, re-reviews after conflict resolution, pushes cleaned PR heads when needed, fast-forwards main, verifies local/remote parity, and cleans temporary branches. It must not implement new feature scope.
5
+ triggers:
6
+ - 合并这个 PR
7
+ - 单独会话合并 PR
8
+ - land this PR
9
+ - merge reviewed PRs
10
+ - review and land open PRs
11
+ - rebase PRs onto main
12
+ reads:
13
+ - ../cc-pr-review/SKILL.md
14
+ - ../cc-review/SKILL.md
15
+ - ../cc-check/SKILL.md
16
+ - GitHub pull requests
17
+ - devflow/changes/<change-key>/review/report-card.json
18
+ writes:
19
+ - path: GitHub pull request head branch
20
+ durability: remote
21
+ required: false
22
+ when: the PR branch must be rebased or conflict fixes must be pushed back
23
+ - path: origin/main
24
+ durability: remote
25
+ required: true
26
+ when: landing succeeds
27
+ effects:
28
+ - review-first PR landing
29
+ - rebase-first mainline integration
30
+ - local and remote main parity proof
31
+ entry_gate:
32
+ - Fetch live GitHub PR truth; do not rely on stale local refs or cached queue state.
33
+ - Require prior review truth or perform a review pass before landing.
34
+ - Create only temporary integration/helper branches as needed; do not open new feature worktrees as product work.
35
+ - Rebase onto the evolving integration mainline, not stale origin/main.
36
+ - Stop when conflict resolution would require product intent guessing.
37
+ exit_criteria:
38
+ - Each landed PR was reviewed before landing and re-reviewed after material rebase or conflict resolution.
39
+ - Requirement shrinkage after conflict resolution is explicitly rejected or ruled out.
40
+ - Remote main, local main, and the active main worktree parity are verified.
41
+ - Open PR queue state is refreshed after landing when the task was to clear the queue.
42
+ - Temporary branches or integration worktrees created by cc-pr-land are cleaned up or reported.
43
+ reroutes:
44
+ - when: The PR has unreviewed implementation risk or stale review evidence.
45
+ target: cc-pr-review
46
+ - when: Conflict resolution reveals missing implementation or broken requirements.
47
+ target: cc-dev
48
+ - when: Mainline parity cannot be proven because GitHub, auth, or network truth is unavailable.
49
+ target: stop
50
+ recovery_modes:
51
+ - name: queue-changed
52
+ when: The live open PR set changes during landing.
53
+ action: Stop, refresh the queue, and recalculate the landing order before continuing.
54
+ - name: requirement-shrinkage-risk
55
+ when: A conflict resolution makes the PR smaller or removes user-facing behavior, tests, or docs.
56
+ action: Re-review the resolved diff and stop for user decision if intent is unclear.
57
+ - name: parity-failure
58
+ when: local main, active main worktree, and origin/main do not match after landing.
59
+ action: Diagnose without force reset; preserve local work and repair through fetch/rebase/ff-only sync.
60
+ tool_budget:
61
+ read_files: 12
62
+ search_steps: 8
63
+ shell_commands: 18
64
+ ---
65
+
66
+ # CC-PR-Land
67
+
68
+ > [PROTOCOL]: 变更时同步更新 `version`、`CHANGELOG.md`、公开文档和分发配置,然后检查 `CLAUDE.md`
69
+
70
+ ## Role
71
+
72
+ `cc-pr-land` 是远程 PR 的落主干入口。它回答:
73
+
74
+ ```text
75
+ 这些已经 review 的 PR 是否可以线性落到 main,并证明本地远程一致?
76
+ ```
77
+
78
+ 它不做新需求开发。发现需要新代码,回 `cc-dev`。
79
+
80
+ ## Read First
81
+
82
+ 1. Live GitHub PR truth
83
+ 2. `../cc-pr-review/SKILL.md`
84
+ 3. `../cc-review/SKILL.md`
85
+ 4. `../cc-check/SKILL.md`
86
+ 5. Linked change artifacts when available
87
+
88
+ ## Use This Skill When
89
+
90
+ - 一个或多个 PR 已 review,准备合并。
91
+ - 用户要求 review-first / rebase-first 落主干。
92
+ - 用户要求清空 open PR 队列并证明 main parity。
93
+
94
+ 如果 PR 还没 review,先去 `cc-pr-review`。
95
+
96
+ ## Harness Contract
97
+
98
+ - Allowed actions: refresh PR truth, verify prior review, rebase PR branches, resolve conflicts, re-review resolved diffs, push cleaned PR heads, fast-forward main, verify parity, and clean temporary integration state.
99
+ - Forbidden actions: implement new feature scope, silently drop requirements, force-push main, rely on stale PR refs, or declare parity without remote proof.
100
+ - Required evidence: PR list, review status, commit ranges, conflict resolutions, validation commands, remote main SHA, local main SHA, and active main worktree SHA when available.
101
+ - Reroute rule: unreviewed PRs go to `cc-pr-review`; requirement or implementation gaps go to `cc-dev`; unavailable GitHub truth stops landing.
102
+
103
+ ## Landing Order
104
+
105
+ 1. Fetch live PR truth.
106
+ 2. Record PR number, title, head, base, review state, checks, and linked change.
107
+ 3. For each PR:
108
+ - confirm review exists or run/re-route to `cc-pr-review`
109
+ - separate true PR commits from base drift
110
+ - rebase onto the evolving integration mainline
111
+ - resolve conflicts without shrinking requirements
112
+ - re-review if the rebase or conflict resolution changed behavior
113
+ - push cleaned PR head with `--force-with-lease` when the PR branch changed
114
+ - fast-forward the integration branch
115
+ 4. Validate integrated result.
116
+ 5. Push or fast-forward main.
117
+ 6. Verify parity.
118
+ 7. Clean temporary state.
119
+
120
+ ## Conflict Rule
121
+
122
+ Conflict resolution is not a place to redesign the product.
123
+
124
+ After every conflict:
125
+
126
+ - compare before vs after intent
127
+ - check tests and docs were not silently dropped
128
+ - rerun targeted verification
129
+ - re-review resolved files
130
+
131
+ If you cannot distinguish better upstream implementation from accidental requirement loss, stop and ask.
132
+
133
+ ## Parity Proof
134
+
135
+ Do not declare done until these are true or explicitly blocked:
136
+
137
+ ```text
138
+ origin/main SHA: <sha>
139
+ local main SHA: <sha>
140
+ active main worktree SHA: <sha or not-applicable>
141
+ open PR queue: <empty or remaining list>
142
+ ```
143
+
144
+ Use ff-only sync. Do not force reset user work.
145
+
146
+ ## Output
147
+
148
+ Report:
149
+
150
+ - PRs landed
151
+ - PRs skipped and why
152
+ - review evidence used
153
+ - conflicts and requirement-shrinkage verdict
154
+ - validation commands
155
+ - final remote/local main SHA
156
+ - open PR queue state
157
+ - cleanup actions
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0
4
+
5
+ - Added independent remote PR review workflow that separates review from landing.
@@ -0,0 +1,46 @@
1
+ # CC-PR-Review Playbook
2
+
3
+ ## Visible State Machine
4
+
5
+ `remote PR -> cc-pr-review -> cc-dev | cc-do | cc-pr-land | stop`
6
+
7
+ - Enter from: a remote PR URL, PR number, or `cc-dev` terminal state.
8
+ - Stay in: `cc-pr-review` until PR truth, diff intent, checks, artifacts, findings, and verdict are explicit.
9
+ - Exit to: `cc-pr-land` when approved, `cc-dev` or `cc-do` when fixes are required, or stop when blocked or unclear.
10
+
11
+ ## Core Rules
12
+
13
+ 1. 只 review,不 merge。
14
+ 2. 先冻结 GitHub PR truth。
15
+ 3. 先区分 true PR commits 和 stale base drift。
16
+ 4. 先写 review packet,再写 findings。
17
+ 5. finding 必须有证据。
18
+ 6. 没有证据就写 unknown,不伪装成 bug。
19
+ 7. 宽 diff 使用四类风险 lane。
20
+ 8. subAgent reviewer 只读;主线程负责验证和去重。
21
+ 9. PR head 或 checks 改了,重新 refresh。
22
+ 10. 干净 PR 的下一步是 `cc-pr-land`,不是在本 skill 里顺手合并。
23
+
24
+ ## Required Outputs
25
+
26
+ - PR review packet
27
+ - Covered lanes
28
+ - Findings triage
29
+ - Checks status
30
+ - Verdict
31
+ - Next gate
32
+
33
+ ## Finding Shape
34
+
35
+ Each accepted finding should include:
36
+
37
+ ```text
38
+ - Path or PR surface:
39
+ - Issue:
40
+ - Why it matters:
41
+ - Evidence:
42
+ - Confidence:
43
+ - Fix path:
44
+ ```
45
+
46
+ Speculative or style-only comments do not block landing.
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: cc-pr-review
3
+ version: 1.0.0
4
+ description: Use in a separate session to review one remote GitHub PR before landing. It fetches PR truth, builds a review packet, runs cc-review-style plan or implementation review with optional read-only reviewers, records findings, and updates the PR or reroutes to cc-dev/cc-do for fixes. It must not merge the PR or push main.
5
+ triggers:
6
+ - review 这个 PR
7
+ - 单独会话 review PR
8
+ - 审这个远程 PR
9
+ - review remote PR
10
+ - pre-landing PR review
11
+ - check this PR before merge
12
+ reads:
13
+ - ../cc-review/SKILL.md
14
+ - ../cc-check/SKILL.md
15
+ - GitHub pull request
16
+ - devflow/changes/<change-key>/review/report-card.json
17
+ writes:
18
+ - path: devflow/changes/<change-key>/review/cc-pr-review.md
19
+ durability: durable
20
+ required: false
21
+ when: the PR maps to a local cc-devflow change
22
+ - path: GitHub pull request comments or review
23
+ durability: remote
24
+ required: false
25
+ when: remote review feedback is posted
26
+ effects:
27
+ - remote PR review packet
28
+ - finding triage
29
+ - fix or landing recommendation
30
+ entry_gate:
31
+ - Freeze PR title, body, commits, head branch, base branch, checks, linked issues, and current diff from GitHub.
32
+ - Separate true PR commits from stale base drift before judging the diff.
33
+ - Read local cc-devflow artifacts when the PR links to a change key.
34
+ - Build a review packet before producing findings.
35
+ - Do not merge, push main, or mark the PR landed.
36
+ exit_criteria:
37
+ - Review result is exactly one of approved-for-landing, changes-requested, needs-clarification, or blocked.
38
+ - Findings cite concrete PR diff, artifacts, command output, checks, or missing evidence.
39
+ - Any required fixes route back to cc-dev or cc-do; clean PRs route to cc-pr-land.
40
+ - No merge or mainline integration happened inside cc-pr-review.
41
+ reroutes:
42
+ - when: Required fixes are inside the PR implementation scope.
43
+ target: cc-dev
44
+ - when: The PR is clean and ready to land.
45
+ target: cc-pr-land
46
+ - when: The review needs deeper local artifact or diff review.
47
+ target: cc-review
48
+ recovery_modes:
49
+ - name: stale-pr-refresh
50
+ when: PR head, checks, comments, or base branch changed during review.
51
+ action: Refresh GitHub PR truth and rebuild the review packet before continuing.
52
+ - name: base-drift-confusion
53
+ when: The raw PR diff appears to delete or rewrite unrelated base work.
54
+ action: Use commit and cherry inspection to separate true PR changes from stale-base perspective.
55
+ tool_budget:
56
+ read_files: 10
57
+ search_steps: 6
58
+ shell_commands: 12
59
+ ---
60
+
61
+ # CC-PR-Review
62
+
63
+ > [PROTOCOL]: 变更时同步更新 `version`、`CHANGELOG.md`、公开文档和分发配置,然后检查 `CLAUDE.md`
64
+
65
+ ## Role
66
+
67
+ `cc-pr-review` 是远程 PR 的独立审查入口。它回答:
68
+
69
+ ```text
70
+ 这个 PR 是否可以交给 cc-pr-land 合并?
71
+ ```
72
+
73
+ 它只 review,不合并。
74
+
75
+ ## Read First
76
+
77
+ 1. GitHub PR snapshot
78
+ 2. `../cc-review/SKILL.md`
79
+ 3. `../cc-check/SKILL.md`
80
+ 4. Linked `devflow/changes/<change-key>/` artifacts when available
81
+
82
+ ## Use This Skill When
83
+
84
+ - PR 已经由 `cc-dev` 创建或更新。
85
+ - 用户想在独立会话 review PR。
86
+ - 合并前需要证明 diff、测试、门禁和需求没有漂移。
87
+
88
+ 如果用户要求合并,进入 `cc-pr-land`,不要把 review 和 landing 混成一个动作。
89
+
90
+ ## Harness Contract
91
+
92
+ - Allowed actions: fetch PR truth, build review packet, inspect diffs/artifacts/checks, run safe verification, dispatch read-only reviewers when available, record review findings, and recommend fix or landing.
93
+ - Forbidden actions: merge PRs, push main, rewrite unrelated PR scope, or accept findings without evidence.
94
+ - Required evidence: every accepted finding must cite PR diff, local artifact, command output, check result, issue/PR text, or explicit missing evidence.
95
+ - Reroute rule: required implementation fixes go back to `cc-dev` or `cc-do`; clean PRs go to `cc-pr-land`.
96
+
97
+ ## Review Packet
98
+
99
+ Build this before findings:
100
+
101
+ ```text
102
+ PR Review Packet
103
+ - PR: #<number> <title>
104
+ - Base/head: <base> <- <head>
105
+ - Intended behavior: <from PR body, issue, commits, artifacts>
106
+ - Must remain unchanged: <known invariants>
107
+ - True PR commits: <commit range>
108
+ - Drift ruled out: <yes/no and evidence>
109
+ - Checks: <latest status>
110
+ - Local artifacts: <change key and report-card if found>
111
+ ```
112
+
113
+ ## Review Lanes
114
+
115
+ Use `cc-review` methods. For broad diffs, cover:
116
+
117
+ - intent and regression
118
+ - security and privacy
119
+ - performance and reliability
120
+ - contracts and coverage
121
+
122
+ Small diffs may combine lanes, but the report must state what was covered or skipped.
123
+
124
+ ## Verdicts
125
+
126
+ - `approved-for-landing`: no blocking findings; route to `cc-pr-land`.
127
+ - `changes-requested`: PR needs fixes; route to `cc-dev` or `cc-do`.
128
+ - `needs-clarification`: product intent or requirement shrinkage is unclear.
129
+ - `blocked`: GitHub, auth, checks, dependencies, or local artifacts are unavailable.
130
+
131
+ ## Output
132
+
133
+ Report:
134
+
135
+ - PR number and URL
136
+ - review packet summary
137
+ - lanes covered or skipped
138
+ - accepted findings
139
+ - rejected or downgraded raw findings when reviewers were used
140
+ - latest checks
141
+ - verdict
142
+ - next gate
@@ -1,5 +1,26 @@
1
1
  # CC-Review Changelog
2
2
 
3
+ ## 1.3.0
4
+
5
+ - Added a risk-lane review swarm profile for broad implementation and PR-landing reviews.
6
+ - Required `cc-review-plan.md` and `cc-review-report.md` to record intent/regression, security/privacy, performance/reliability, and contracts/coverage lane coverage when applicable.
7
+ - Hardened main-thread aggregation so raw reviewer findings are accepted, merged, downgraded, or rejected before becoming final findings.
8
+
9
+ ## 1.2.0
10
+
11
+ - Added automatic read-only reviewer subAgent dispatch for selected plan and implementation review nodes.
12
+ - Required reviewer packets to be self-contained so each subAgent works from independent context instead of inherited chat assumptions.
13
+ - Added `cc-review-agent-results.jsonl` for raw reviewer outputs and report-level accepted/merged/downgraded/rejected triage.
14
+ - Required truthful main-thread fallback when the host does not expose subAgent tools.
15
+
16
+ ## 1.1.0
17
+
18
+ - Added stateful review planning with `cc-review-plan.md` and per-node `cc-review-ledger.jsonl`.
19
+ - Required prior review records and git/artifact deltas before re-reviewing the same plan or implementation.
20
+ - Replaced short finding-list behavior with node-by-node review, per-node checks, and no artificial finding cap.
21
+ - Added decision queues so user-judgment findings are collected after traversal and confirmed one by one before non-mechanical fixes.
22
+ - Added `cc-simplify` selection guidance for code-smell and simplification review nodes.
23
+
3
24
  ## 1.0.0
4
25
 
5
26
  - Added `cc-review` as an optional deep review workflow that branches between plan-stage and implementation-stage review.
@@ -14,19 +14,30 @@
14
14
  ## Core Rules
15
15
 
16
16
  1. 先判断 review 对象是计划、实现,还是混合。
17
- 2. 只读当前需求范围内的坏味道;历史债只在被本次变更放大时进入。
18
- 3. `cc-check` 是证据验收,`cc-review` 是深度诊断,两者不要混成一个门。
19
- 4. 计划分支按 strategy / design / engineering / DX 渐进加载,不把所有方法一次塞进上下文。
20
- 5. 实现分支先读 diff 和意图,再读周边代码,最后才给 finding。
21
- 6. UI 或运行时链路有风险时,必须用 Browser / Computer Use / CLI / logs 做端到端证明或写清阻塞原因。
22
- 7. 每个坏味道必须有 evidence、scope、recommendation route
23
- 8. 没有证据就写 unknown,不准把审美判断伪装成缺陷。
24
- 9. 发现计划合同错误,回 `cc-plan`;发现代码错误,回 `cc-do`;只差验收,进 `cc-check`。
25
- 10. 输出必须落到 `review/cc-review-report.md`,不能只留在聊天里。
17
+ 2. 先读上一次 `cc-review` 的 plan / report / ledger / findings,再看当前 git 或 artifact delta。
18
+ 3. 先写 `cc-review-plan.md`,列出要用哪些 Review 工具和哪些节点需要遍历。
19
+ 4. 对适合独立审查的节点,优先派发只读 reviewer subAgent;没有工具时如实降级。
20
+ 5. 复杂实现 diff 优先使用 intent/regression、security/privacy、performance/reliability、contracts/coverage 四类风险 lane;小 diff 可以合并但必须说明。
21
+ 6. 按节点逐个 Review:review 一个、check 一个、ledger 记录一个。
22
+ 7. 主线程必须验证 subAgent findings,不盲信 reviewer
23
+ 8. 只读当前需求范围内的坏味道;历史债只在被本次变更放大时进入。
24
+ 9. `cc-check` 是证据验收,`cc-review` 是深度诊断,两者不要混成一个门。
25
+ 10. 计划分支按 strategy / design / engineering / DX 选择节点,不把所有方法一次塞进上下文,但不能因为渐进加载而跳过未审节点。
26
+ 11. 实现分支先读 diff 和意图,再读周边代码;每个 changed surface 都要 checked、skipped 或 blocked。
27
+ 12. UI 或运行时链路有风险时,必须用 Browser / Computer Use / CLI / logs 做端到端证明或写清阻塞原因。
28
+ 13. 每个坏味道必须有 evidence、scope、recommendation 和 route。
29
+ 14. 没有证据就写 unknown,不准把审美判断伪装成缺陷。
30
+ 15. 不允许固定只列 3 个问题;finding 数量由节点遍历和证据决定。
31
+ 16. 输出前必须聚合 raw findings:合并重复,降级弱证据,拒收 speculative / out-of-scope / stale findings。
32
+ 17. 发现计划合同错误,回 `cc-plan`;发现代码错误,回 `cc-do`;只差验收,进 `cc-check`。
33
+ 18. 输出必须落到 `review/cc-review-plan.md`、`review/cc-review-ledger.jsonl` 和 `review/cc-review-report.md`,不能只留在聊天里。
26
34
 
27
35
  ## Required Outputs
28
36
 
37
+ - `review/cc-review-plan.md`
38
+ - `review/cc-review-ledger.jsonl`
29
39
  - `review/cc-review-report.md`
40
+ - `review/cc-review-agent-results.jsonl` when subagent reviewers are used
30
41
  - `review/cc-review-findings.json` when later agents need structured findings
31
42
 
32
43
  ## Local Kit
@@ -35,6 +46,45 @@
35
46
  - `references/plan-review-branch.md`: plan-stage deep review
36
47
  - `references/implementation-review-branch.md`: diff and code-stage deep review
37
48
  - `references/e2e-and-plugin-verification.md`: Browser / Computer Use / logs evidence
49
+ - `scripts/collect-review-context.sh`: git delta and prior-review state helper
50
+
51
+ ## Stateful Review Plan
52
+
53
+ `cc-review-plan.md` 必须至少包含:
54
+
55
+ - review mode:plan / implementation / mixed
56
+ - previous review state:上次 report、ledger、findings 是否存在
57
+ - delta:本次相对哪个 SHA、哪些文件、哪些 artifacts 变了
58
+ - selected tools:CEO/strategy、engineering、design、DX、TOC、code smell、cc-simplify、E2E/plugin/logs
59
+ - skipped tools:为什么不需要
60
+ - reviewer dispatch:哪些节点交给 subAgent、哪些主线程执行、为什么
61
+ - risk lanes:implementation / mixed review 是否覆盖 intent-regression、security-privacy、performance-reliability、contracts-coverage
62
+ - node list:`R001`、`R002` ...,每个节点有 target、method、owner、evidence source、status
63
+
64
+ Review 过程中每完成一个节点,就追加一条 ledger;不要等最后一次性补记。
65
+
66
+ ## SubAgent Review
67
+
68
+ 触发 `cc-review` 本身就授权只读 reviewer subAgent。主线程不要为了“再确认是否能用 subAgent”打断用户。
69
+
70
+ 调度规则:
71
+
72
+ - 大范围 / 多文件 / 多 facet review:至少尝试两个独立 reviewer。
73
+ - 小范围 review:至少尝试一个 combined reviewer,除非 `cc-review-plan.md` 写明不需要。
74
+ - Plan 节点可分配 strategy、engineering、design、DX、TOC reviewer。
75
+ - Implementation 节点可分配 contract、smell、test、runtime reviewer。
76
+ - 复杂 implementation 节点优先按四类风险 lane 派发 reviewer:intent/regression、security/privacy、performance/reliability、contracts/coverage。
77
+ - Codex 环境优先用 `explorer`;ClaudeCode 环境用可用的 `Task` / subAgent。
78
+ - reviewer 只读,不编辑文件,不改计划,不直接决定最终 route。
79
+ - reviewer 的上下文应独立,只给 review packet,不给完整聊天历史。
80
+ - 主线程负责合并、验证、去重和降级 false positive。
81
+
82
+ 如果没有 subAgent 工具,报告必须写:
83
+
84
+ ```text
85
+ Agents used: no (subagent tool unavailable)
86
+ Fallback: main-thread node-by-node review
87
+ ```
38
88
 
39
89
  ## Review Standard
40
90
 
@@ -47,8 +97,12 @@
47
97
  - 哪些代码坏味道在当前 blast radius 内?
48
98
  - 哪些测试、日志、UI 操作或端到端证据缺失?
49
99
  - 哪些 finding 必须修,哪些可以 defer,哪些只是 advisory?
100
+ - 哪些节点已经被审过,哪些因为 delta 需要复审?
101
+ - 哪些节点没有审,为什么 skip 或 blocked?
102
+ - 哪些 reviewer 被派发,哪些 findings 被接受、合并、降级或拒绝?
103
+ - 四类风险 lane 哪些覆盖了,哪些因为 scope 小或工具不可用而跳过?
50
104
  - 下一步为什么是 `cc-plan` / `cc-do` / `cc-check`?
51
105
 
52
106
  ## Decision Rule
53
107
 
54
- 一个 finding 如果会改变范围、架构、用户可见行为、公共 API、测试策略或超过机械局部清理,必须交给用户决策或 reroute 到上游 skill。机械且低风险的问题可以作为 `cc-do` 的明确修复项,但 `cc-review` 自身不偷偷改代码。
108
+ 一个 finding 如果会改变范围、架构、用户可见行为、公共 API、测试策略或超过机械局部清理,必须进入用户决策队列或 reroute 到上游 skill。先列完整决策清单,再逐个问题向用户确认;确认前不做非机械修复。机械且低风险的问题可以作为 `cc-do` 的明确修复项,但 `cc-review` 自身不偷偷改代码。