cc-devflow 4.5.13 → 4.5.14
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.
- package/.claude/skills/cc-act/SKILL.md +1 -1
- package/.claude/skills/cc-check/CHANGELOG.md +6 -0
- package/.claude/skills/cc-check/PLAYBOOK.md +18 -1
- package/.claude/skills/cc-check/SKILL.md +59 -2
- package/.claude/skills/cc-check/references/gate-contract.md +34 -0
- package/.claude/skills/cc-check/references/review-contract.md +11 -0
- package/.claude/skills/cc-do/CHANGELOG.md +6 -0
- package/.claude/skills/cc-do/PLAYBOOK.md +23 -6
- package/.claude/skills/cc-do/SKILL.md +19 -2
- package/.claude/skills/cc-do/references/execution-recovery.md +15 -3
- package/.claude/skills/cc-investigate/CHANGELOG.md +6 -0
- package/.claude/skills/cc-investigate/PLAYBOOK.md +24 -0
- package/.claude/skills/cc-investigate/SKILL.md +38 -2
- package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +67 -0
- package/.claude/skills/cc-investigate/references/investigation-contract.md +32 -0
- package/.claude/skills/cc-plan/CHANGELOG.md +6 -0
- package/.claude/skills/cc-plan/PLAYBOOK.md +18 -1
- package/.claude/skills/cc-plan/SKILL.md +67 -7
- package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +48 -0
- package/.claude/skills/cc-plan/references/planning-contract.md +23 -4
- package/.claude/skills/cc-review/CHANGELOG.md +6 -0
- package/.claude/skills/cc-review/PLAYBOOK.md +9 -3
- package/.claude/skills/cc-review/SKILL.md +52 -1
- package/.claude/skills/cc-review/references/implementation-review-branch.md +106 -6
- package/.claude/skills/cc-review/references/plan-review-branch.md +109 -4
- package/.claude/skills/cc-review/references/review-methods.md +162 -9
- package/.claude/skills/cc-spec-init/PLAYBOOK.md +1 -1
- package/.claude/skills/cc-spec-init/SKILL.md +1 -1
- package/CHANGELOG.md +10 -0
- package/README.md +17 -18
- package/README.zh-CN.md +16 -17
- package/docs/examples/example-bindings.json +5 -5
- package/docs/examples/full-design-blocked/README.md +1 -1
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/task.md +1 -1
- package/docs/examples/local-handoff/README.md +1 -1
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/task.md +1 -1
- package/docs/examples/pdca-loop/README.md +1 -1
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/task.md +1 -1
- package/docs/guides/artifact-contract.md +1 -1
- package/docs/guides/getting-started.md +3 -3
- package/docs/guides/getting-started.zh-CN.md +3 -3
- package/docs/guides/minimize-artifacts.md +1 -7
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cc-plan
|
|
3
|
-
version: 3.10.
|
|
3
|
+
version: 3.10.2
|
|
4
4
|
description: Use when a requirement, roadmap item, or bug needs scope clarification, design decisions, and executable task breakdown before coding starts.
|
|
5
5
|
triggers:
|
|
6
6
|
- 帮我规划这个需求
|
|
@@ -28,11 +28,14 @@ entry_gate:
|
|
|
28
28
|
- Resolve the CLI with `../cc-dev/scripts/resolve-cc-devflow.sh require query workflow-context next-change-key config` before workflow commands.
|
|
29
29
|
- Assign a canonical REQ/FIX change key through `next-change-key` before writing `task.md`.
|
|
30
30
|
- Enforce the Worktree Branch Contract immediately after the change key exists.
|
|
31
|
-
- Read
|
|
32
|
-
-
|
|
31
|
+
- Read repo evidence before asking the user: roadmap handoff, specs, relevant code/tests/docs, recent commits, and existing task truth when present.
|
|
32
|
+
- Run the planning flow before task generation: requirement reality, system shape, interface/data contract, abstraction boundary, execution architecture, task contract, and final approval.
|
|
33
|
+
- Ask with the Decision Question Protocol when the answer changes scope, design, implementation boundary, or verification.
|
|
33
34
|
exit_criteria:
|
|
34
|
-
- "`task.md#Contract Summary` states the approved solution, non-goals, frozen decisions, work branch, verification expectations, and open assumptions."
|
|
35
|
+
- "`task.md#Contract Summary` states the approved solution, non-goals, frozen decisions, work branch, user stories, decision questions, planning-flow results, review gate, verification expectations, and open assumptions."
|
|
35
36
|
- "`task.md` contains executable task blocks generated from `assets/TASKS_TEMPLATE.md`."
|
|
37
|
+
- "Non-trivial plans compare `minimal viable` and `ideal architecture` before approval."
|
|
38
|
+
- "User decisions that changed the plan were asked as D<N> questions and recorded in `task.md`."
|
|
36
39
|
- "No process file is created beyond `task.md`."
|
|
37
40
|
- "Source roadmap progress is synced or explicitly skipped in the final response."
|
|
38
41
|
- "Plan-stage changes are committed to Git before handing off to `cc-do`."
|
|
@@ -53,15 +56,15 @@ tool_budget:
|
|
|
53
56
|
|
|
54
57
|
- `devflow/changes/<change-key>/task.md`
|
|
55
58
|
|
|
56
|
-
|
|
59
|
+
不要生成额外过程文件。Git commit 是阶段历史,`task.md` 是任务真相。
|
|
57
60
|
|
|
58
61
|
## Operating Contract
|
|
59
62
|
|
|
60
63
|
1. 先用 resolver 找到当前仓库的 `cc-devflow`,并确认支持 `query workflow-context`、`next-change-key`、`config`。
|
|
61
64
|
2. 用 `next-change-key --prefix REQ|FIX --description "..."` 生成 `changeId` 和完整 `changeKey`,不要手动扫描编号。
|
|
62
65
|
3. 分配 change key 后立刻锚定分支:`REQ-003-copy-link` 对应 `REQ/003-copy-link`,`FIX-014-auth-race` 对应 `FIX/014-auth-race`。当前在 default branch 时停止并报告 setup blocker。
|
|
63
|
-
4. 写
|
|
64
|
-
5. `task.md` 必须包含 `Contract Summary
|
|
66
|
+
4. 写 task blocks 前先确认方案。tiny 计划仍要过 planning flow,只是更短。
|
|
67
|
+
5. `task.md` 必须包含 `Contract Summary`、决策问题、planning flow、review gate、任务列表、验证命令、完成证据、禁止重决策事项和阶段 commit 要求。
|
|
65
68
|
6. 完成 Plan 后提交 Git commit。下一阶段从 Git history 和 `task.md` 恢复,不靠过程文件。
|
|
66
69
|
|
|
67
70
|
```bash
|
|
@@ -74,10 +77,67 @@ bash "$DEVFLOW" config resolve --format policy
|
|
|
74
77
|
- 用最小可逆方案解决真实需求,不扩张到假想未来。
|
|
75
78
|
- 缺证据就写 assumption,不伪装成事实。
|
|
76
79
|
- 非 trivial 方案比较 `minimal viable` 和 `ideal architecture`,但推荐必须落到当前仓库可执行边界。
|
|
80
|
+
- 计划先做上下文和设计判断,再拆 task;不能把架构、接口、字段、测试缝隙留给 `cc-do` 猜。
|
|
81
|
+
- 用户视角必须清楚:真实用户 / operator、status quo、最痛失败场景、最小成功信号和非目标。
|
|
77
82
|
- 行为变更任务按 tracer bullet 写:`[TEST] -> [IMPL] -> [REFACTOR]`,不要水平切层。
|
|
78
83
|
- 每个任务写清目标、文件、依赖、TDD phase、读什么、怎么验证、完成证据。
|
|
79
84
|
- 回归测试不能 defer;缺 seam 时先计划 spike 或设计修正。
|
|
80
85
|
|
|
86
|
+
## Planning Flow
|
|
87
|
+
|
|
88
|
+
先把调查和引导结果写进 `task.md#Contract Summary`,再生成任务。不要把这些内容拆成其它过程文件。
|
|
89
|
+
|
|
90
|
+
1. Requirement Reality:确认真实用户 / operator、当前 workaround、最痛失败场景、最小成功信号、非目标。
|
|
91
|
+
2. System Shape:确认现有代码链路、模块归属、状态 / 数据流、复用点、边界外系统和必须保留的不变量。
|
|
92
|
+
3. Interface / Data Contract:确认 public interface、调用方、输入输出、关键字段、错误形态、权限 / 边界和命名来源。
|
|
93
|
+
4. Abstraction Boundary:确认复杂度藏在哪个模块,哪些抽象被拒绝,哪些公共方法必须保持小而深。
|
|
94
|
+
5. Execution Architecture:确认 foundation、core logic、integration、polish/tests 阶段的冻结决策、文件职责、耦合风险和失败恢复。
|
|
95
|
+
6. Task Contract:确认每条 tracer bullet 的 user / edge story、Red test name、public seam、Green minimality guard、refactor candidates 和 2-5 分钟任务粒度。
|
|
96
|
+
7. Final Approval:展示冻结方案和任务合同摘要;用户批准前不生成执行 task blocks。
|
|
97
|
+
|
|
98
|
+
`tiny-design` 可以把每轮压成一句话;`full-design` 必须保留足够证据让执行者不二次设计。任一轮 `blocked` 时,只能问一个 blocking question、拆回 roadmap / 多个 REQ/FIX,或记录用户明确接受的人工边界。
|
|
99
|
+
|
|
100
|
+
## Decision Question Protocol
|
|
101
|
+
|
|
102
|
+
只在答案会改变范围、方案、接口、任务切分或验证口径时提问。能从 repo evidence、roadmap、spec、测试或 git history 确认的,不问用户。
|
|
103
|
+
|
|
104
|
+
固定格式:
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
D<N> - <decision title>
|
|
108
|
+
Planning object: <REQ/FIX/RM/change key>
|
|
109
|
+
Known evidence: <repo / roadmap / code / test facts>
|
|
110
|
+
Decision needed: <what changes downstream>
|
|
111
|
+
Recommendation: <A/B/C> because <reason>
|
|
112
|
+
Options:
|
|
113
|
+
A) <label> (recommended)
|
|
114
|
+
Good: <upside>
|
|
115
|
+
Cost/Risk: <cost or risk>
|
|
116
|
+
B) <label>
|
|
117
|
+
Good: <upside>
|
|
118
|
+
Cost/Risk: <cost or risk>
|
|
119
|
+
C) <label, optional>
|
|
120
|
+
Good: <upside>
|
|
121
|
+
Cost/Risk: <cost or risk>
|
|
122
|
+
Impact: <what cc-do will do differently>
|
|
123
|
+
STOP: wait for the user answer before continuing.
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
用户回答后,把决定写入 `task.md#Contract Summary` 的 `Decision Questions`。聊天不是长期真相源。
|
|
127
|
+
|
|
128
|
+
## Engineering Review Gate
|
|
129
|
+
|
|
130
|
+
冻结 task blocks 前,在 `task.md#Contract Summary` 里完成轻量 review:
|
|
131
|
+
|
|
132
|
+
1. Existing leverage map:每个子问题先映射到现有代码、脚本、spec、模板或测试。
|
|
133
|
+
2. Scope challenge:超过 8 个文件、2 个新 service/class、或跨模块连锁时,说明为什么不是过度设计。
|
|
134
|
+
3. Option role check:非 trivial 方案比较 `minimal viable`、`ideal architecture`,必要时加 `hybrid`。
|
|
135
|
+
4. Domain language check:核心名词、文件名、测试名、任务标题对齐项目真相;没有来源就写 assumption。
|
|
136
|
+
5. Interface depth check:公共面小而深,复杂度藏进模块内部,边界 adapter 是具体操作而不是 generic catch-all。
|
|
137
|
+
6. Test seam check:Red 任务从公共接口、调用方流程或用户可见路径证明行为;不要测私有实现细节。
|
|
138
|
+
7. Mock boundary check:只 mock 外部 API、时间、随机性、文件系统或必要数据库边界。
|
|
139
|
+
8. Feedback loop check:为每个行为选定最短可信反馈循环。
|
|
140
|
+
|
|
81
141
|
## Required Output
|
|
82
142
|
|
|
83
143
|
`task.md` 的结构由 `assets/TASKS_TEMPLATE.md` 提供。模板外只允许补充对当前需求必要的事实,不允许新建额外过程文件。
|
|
@@ -20,9 +20,57 @@ Goal:
|
|
|
20
20
|
Do Not Do:
|
|
21
21
|
-
|
|
22
22
|
|
|
23
|
+
Source Handoff:
|
|
24
|
+
- Roadmap / issue / user source:
|
|
25
|
+
- Repo evidence read:
|
|
26
|
+
- Existing leverage:
|
|
27
|
+
- Canonical language:
|
|
28
|
+
|
|
29
|
+
Requirement Reality:
|
|
30
|
+
- User / operator:
|
|
31
|
+
- Status quo workaround:
|
|
32
|
+
- Most painful failure:
|
|
33
|
+
- Smallest success signal:
|
|
34
|
+
- Non-goals:
|
|
35
|
+
|
|
36
|
+
Decision Questions:
|
|
37
|
+
| ID | Decision | Evidence | Choice | Impact |
|
|
38
|
+
|----|----------|----------|--------|--------|
|
|
39
|
+
| D1 | | | | |
|
|
40
|
+
|
|
41
|
+
Planning Flow:
|
|
42
|
+
| Round | Status | Evidence / decision | Opens task? |
|
|
43
|
+
|-------|--------|---------------------|-------------|
|
|
44
|
+
| Requirement Reality | confirmed | | |
|
|
45
|
+
| System Shape | confirmed | | |
|
|
46
|
+
| Interface / Data Contract | confirmed | | |
|
|
47
|
+
| Abstraction Boundary | confirmed | | |
|
|
48
|
+
| Execution Architecture | confirmed | | |
|
|
49
|
+
| Task Contract | confirmed | | |
|
|
50
|
+
| Final Approval | confirmed | | yes |
|
|
51
|
+
|
|
52
|
+
Options:
|
|
53
|
+
- Minimal viable:
|
|
54
|
+
- Ideal architecture:
|
|
55
|
+
- Recommended:
|
|
56
|
+
- Why not the other option:
|
|
57
|
+
|
|
23
58
|
Approved Direction:
|
|
24
59
|
-
|
|
25
60
|
|
|
61
|
+
User Stories:
|
|
62
|
+
| ID | Actor | Story | Acceptance | Edge / recovery |
|
|
63
|
+
|----|-------|-------|------------|-----------------|
|
|
64
|
+
| US-001 | | | | |
|
|
65
|
+
|
|
66
|
+
Engineering Review Gate:
|
|
67
|
+
- Existing leverage map:
|
|
68
|
+
- Scope challenge:
|
|
69
|
+
- Interface depth:
|
|
70
|
+
- Test seam:
|
|
71
|
+
- Mock boundary:
|
|
72
|
+
- Feedback loop:
|
|
73
|
+
|
|
26
74
|
Acceptance:
|
|
27
75
|
-
|
|
28
76
|
|
|
@@ -9,9 +9,28 @@
|
|
|
9
9
|
5. New change keys come from `cc-devflow next-change-key`.
|
|
10
10
|
6. Branch binds to the full change key before durable output.
|
|
11
11
|
7. User decisions that affect scope, design, or verification are written into `task.md#Contract Summary`.
|
|
12
|
-
8.
|
|
13
|
-
9.
|
|
14
|
-
10.
|
|
12
|
+
8. Planning flow results are written into `task.md#Contract Summary`; removing old process files must not remove planning thought.
|
|
13
|
+
9. Placeholder tasks are invalid.
|
|
14
|
+
10. Behavior work uses tracer bullets and TDD unless an exception is recorded.
|
|
15
|
+
11. Roadmap sync, when needed, happens through roadmap files and Git commit, not change metadata.
|
|
16
|
+
|
|
17
|
+
## Planning Flow
|
|
18
|
+
|
|
19
|
+
Every non-trivial plan confirms these rounds before task generation:
|
|
20
|
+
|
|
21
|
+
1. Requirement Reality: real user/operator, workaround, painful failure, smallest success signal, non-goals.
|
|
22
|
+
2. System Shape: existing code path, module owner, state/data flow, reuse point, boundary systems.
|
|
23
|
+
3. Interface/Data Contract: public seam, caller, input/output, fields, error shape, permission/boundary.
|
|
24
|
+
4. Abstraction Boundary: where complexity lives, rejected abstractions, public/private method split.
|
|
25
|
+
5. Execution Architecture: foundation/core/integration/polish decisions, file responsibility, failure recovery.
|
|
26
|
+
6. Task Contract: tracer bullets, Red test names, public seams, Green minimality, refactor candidates.
|
|
27
|
+
7. Final Approval: approved option and task contract summary.
|
|
28
|
+
|
|
29
|
+
Tiny plans may compress a round to one evidence-backed line. Full designs must preserve enough detail that `cc-do` does not invent architecture, fields, interfaces, or tests.
|
|
30
|
+
|
|
31
|
+
## Decision Questions
|
|
32
|
+
|
|
33
|
+
Ask only when the answer changes scope, design, task split, interface, or verification. Use `D<N>` with known evidence, recommendation, 2-3 mutually exclusive options, impact, and a stop point. Record the answer in `task.md#Contract Summary`.
|
|
15
34
|
|
|
16
35
|
## Required Task Fields
|
|
17
36
|
|
|
@@ -28,4 +47,4 @@
|
|
|
28
47
|
|
|
29
48
|
## Review Gate
|
|
30
49
|
|
|
31
|
-
Before exit, check scope, existing leverage,
|
|
50
|
+
Before exit, check scope, existing leverage, option role, domain language, interface depth, test seam, mock boundary, feedback loop, and failure modes. If the plan is not executable from `task.md`, it is not done.
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# CC-Review Changelog
|
|
2
2
|
|
|
3
|
+
## 2.2.1 - 2026-05-14
|
|
4
|
+
|
|
5
|
+
- restore deep review method flow without restoring review process files
|
|
6
|
+
- add node-by-node review, risk-lane coverage, finding aggregation, decision question, plan facet, implementation diff, and test-quality guidance
|
|
7
|
+
- keep plan review output in `task.md` and implementation review output in the response/user-choice loop
|
|
8
|
+
|
|
3
9
|
## 2.2.0 - 2026-05-13
|
|
4
10
|
|
|
5
11
|
- split review exits by branch: plan and investigation reviews write findings directly into `task.md`
|
|
@@ -11,9 +11,12 @@
|
|
|
11
11
|
3. 不读取、不生成、不维护过程文件。
|
|
12
12
|
4. Git history 是唯一持久 review 记忆;重复 review 时用 `git diff <old>...HEAD` 缩小范围。
|
|
13
13
|
5. 可用 subagent 时可以派发只读 reviewer;raw output 留在会话里,主线程验证后再进入最终 findings。
|
|
14
|
-
6.
|
|
15
|
-
7.
|
|
16
|
-
8.
|
|
14
|
+
6. 复杂实现或 mixed review 考虑 intent/regression、security/privacy、performance/reliability、contracts/coverage 四类风险 lane。
|
|
15
|
+
7. 按 selected facet 或 changed surface 逐节点检查;每个节点 checked、skipped 或 blocked。
|
|
16
|
+
8. 不固定 finding 数量。证据决定输出。
|
|
17
|
+
9. 每条 finding 必须有 evidence、impact、recommendation 和 route。
|
|
18
|
+
10. 输出前聚合 raw findings:合并重复,降级弱证据,拒收 speculative / out-of-scope / stale findings。
|
|
19
|
+
11. 计划 review 的结果直接写回 `task.md`;执行 review 的结果先询问用户选择修复方案;只差验收,进 `cc-check`。
|
|
17
20
|
|
|
18
21
|
## Review Standard
|
|
19
22
|
|
|
@@ -26,6 +29,9 @@
|
|
|
26
29
|
- 哪些代码坏味道在当前 blast radius 内?
|
|
27
30
|
- 哪些测试、日志、UI 操作或端到端证据缺失?
|
|
28
31
|
- 哪些 finding 必须修,哪些可以 defer,哪些只是 advisory?
|
|
32
|
+
- 哪些节点已经审过,哪些 skipped / blocked,原因是什么?
|
|
33
|
+
- 四类风险 lane 哪些覆盖了,哪些因为 scope 小或工具不可用跳过?
|
|
34
|
+
- subagent findings 哪些被接受、合并、降级或拒收?
|
|
29
35
|
- 下一步为什么是 `cc-plan` / `cc-do` / `cc-check` / `cc-act` / `stop`?
|
|
30
36
|
|
|
31
37
|
## Decision Rule
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cc-review
|
|
3
|
-
version: 2.2.
|
|
3
|
+
version: 2.2.1
|
|
4
4
|
description: Use when a plan, bug fix, PR, or implementation diff needs review findings. Plan reviews write findings into task.md; implementation reviews ask the user to choose a repair option before fixing.
|
|
5
5
|
triggers:
|
|
6
6
|
- 深度 review 这个方案
|
|
@@ -17,6 +17,7 @@ reads:
|
|
|
17
17
|
- references/plan-review-branch.md
|
|
18
18
|
- references/implementation-review-branch.md
|
|
19
19
|
- references/e2e-and-plugin-verification.md
|
|
20
|
+
- scripts/collect-review-context.sh
|
|
20
21
|
writes:
|
|
21
22
|
- path: current response
|
|
22
23
|
durability: ephemeral
|
|
@@ -34,6 +35,7 @@ entry_gate:
|
|
|
34
35
|
- Classify the review target as plan, implementation, PR, or mixed.
|
|
35
36
|
- Read only the task, PR, diff, code, tests, logs, screenshots, and docs needed to review the requested scope.
|
|
36
37
|
- Use Git history and current diff as the only durable review memory; do not load or create process files.
|
|
38
|
+
- For repeat reviews, use `git diff <old>...HEAD` or `scripts/collect-review-context.sh` to narrow the delta before re-reviewing.
|
|
37
39
|
- Freeze the requested scope before finding smells; report only issues inside the change blast radius or clearly amplified by it.
|
|
38
40
|
- Subagents are optional read-only reviewers; their raw output stays in the conversation and is not saved to files.
|
|
39
41
|
exit_criteria:
|
|
@@ -42,6 +44,8 @@ exit_criteria:
|
|
|
42
44
|
- Plan or investigation review findings are written into the relevant `task.md` section before exit.
|
|
43
45
|
- Implementation review findings are returned with concrete repair options and a blocking user choice; no repair happens until the user selects an option.
|
|
44
46
|
- In-scope code smells are either findings, explicit defers, or clean with reason.
|
|
47
|
+
- Selected review facets or changed surfaces are checked, skipped with reason, or blocked; no artificial finding cap was applied.
|
|
48
|
+
- Subagent findings, when used, are accepted, merged, downgraded, or rejected by the main thread before final output.
|
|
45
49
|
- If no issues are found, the answer says so and names residual test or evidence risk.
|
|
46
50
|
- No process file was created.
|
|
47
51
|
reroutes:
|
|
@@ -97,6 +101,21 @@ Review 的价值在于问题质量,不在于过程记录数量。没有证据
|
|
|
97
101
|
| `PR` | 用户要求 review PR | PR diff, body accuracy, CI/test proof, merge risk |
|
|
98
102
|
| `mixed` | 方案和实现都变了 | plan contract first, then implementation conformance |
|
|
99
103
|
|
|
104
|
+
## Review Loop
|
|
105
|
+
|
|
106
|
+
每次 review 都保留深度流程,但不保留过程文件:
|
|
107
|
+
|
|
108
|
+
1. Classify:判断 plan / implementation / PR / mixed。
|
|
109
|
+
2. Scope Freeze:写清本次 review 的意图、blast radius、明确不审的历史债。
|
|
110
|
+
3. Delta:用 Git、PR diff、`task.md` 和当前命令输出确定相对上次或 base 的真实变化。
|
|
111
|
+
4. Facets:按风险选择 strategy / engineering / design / DX / TOC / contract / smell / test / runtime / docs。
|
|
112
|
+
5. Nodes:把每个 selected facet 或 changed surface 当成一个 review node,在 scratch reasoning 中逐个检查;每个 node 只能 checked、skipped、blocked。
|
|
113
|
+
6. Findings:每个 finding 必须有 evidence、impact、recommendation、route;没有证据的怀疑只能是 residual risk 或 blocked evidence。
|
|
114
|
+
7. Aggregate:合并重复 finding,降级弱证据,拒收 out-of-scope、stale、speculative finding。
|
|
115
|
+
8. Exit:计划问题写 `task.md`;实现问题回对话给修复选项;只差验证进 `cc-check`。
|
|
116
|
+
|
|
117
|
+
渐进加载只控制读多少上下文,不允许把该审的节点省掉。
|
|
118
|
+
|
|
100
119
|
## Exit Contract
|
|
101
120
|
|
|
102
121
|
- Plan / investigation review: directly update `devflow/changes/<change-key>/task.md` with the review findings, decision options, blocked assumptions, and required task changes. Final response only summarizes what was written and the next route.
|
|
@@ -104,6 +123,17 @@ Review 的价值在于问题质量,不在于过程记录数量。没有证据
|
|
|
104
123
|
- PR review: return findings in the response or GitHub review only; do not write local files.
|
|
105
124
|
- Clean review: say `No findings`, name residual verification risk, and route to `cc-check` or `stop`.
|
|
106
125
|
|
|
126
|
+
## Risk Lanes
|
|
127
|
+
|
|
128
|
+
复杂实现、跨模块 diff、PR landing 前复审、或 mixed review 默认考虑四条风险 lane。小 diff 可以由一个 combined pass 覆盖,但必须说明 skip reason。
|
|
129
|
+
|
|
130
|
+
1. Intent / regression: diff 是否兑现意图,是否引入范围外行为、fallback 退化、caller/callee contract 漂移。
|
|
131
|
+
2. Security / privacy: auth、输入验证、注入、secret、敏感数据、默认权限、外部输入信任边界。
|
|
132
|
+
3. Performance / reliability: 热路径重复 I/O、启动/渲染/请求成本、cleanup 泄漏、retry storm、排序/竞态、失败处理。
|
|
133
|
+
4. Contracts / coverage: API/schema/type/config/flag、迁移 fallout、回归测试、日志、metrics、assertion、error path。
|
|
134
|
+
|
|
135
|
+
这些是审查视角,不是 finding 配额。
|
|
136
|
+
|
|
107
137
|
## Finding Rules
|
|
108
138
|
|
|
109
139
|
每条 finding 必须包含:
|
|
@@ -121,6 +151,27 @@ Review 的价值在于问题质量,不在于过程记录数量。没有证据
|
|
|
121
151
|
|
|
122
152
|
可以使用只读 reviewer subagent,但输出只在主线程汇总,不写文件。主线程必须验证、去重、降级或拒收 subagent finding。
|
|
123
153
|
|
|
154
|
+
Subagent 只拿自己的 review packet:scope、delta、node/facet、需要读取的文件、输出格式。不要把完整聊天历史当作 reviewer 上下文。没有 subagent 工具时,主线程按同样 node/facet 串行检查,并在输出中说明 fallback。
|
|
155
|
+
|
|
156
|
+
## Decision Questions
|
|
157
|
+
|
|
158
|
+
只有 finding 需要用户判断时才提问。不要在第一个问题处打断整个 review,除非答案会阻塞下一个 node。
|
|
159
|
+
|
|
160
|
+
格式:
|
|
161
|
+
|
|
162
|
+
```text
|
|
163
|
+
D<N> - <decision title>
|
|
164
|
+
Evidence: <file/line/diff/log/UI action>
|
|
165
|
+
Risk: <what breaks if ignored>
|
|
166
|
+
Recommendation: <recommended option and why>
|
|
167
|
+
Options:
|
|
168
|
+
A) <smallest safe fix> - impact
|
|
169
|
+
B) <broader cleanup> - impact
|
|
170
|
+
C) <defer> - risk
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Plan / investigation review 的 decision question 写进 `task.md`。Implementation review 的 repair options 留在当前回复,等待用户选择。
|
|
174
|
+
|
|
124
175
|
## Output
|
|
125
176
|
|
|
126
177
|
按 review 类型输出:
|
|
@@ -1,12 +1,112 @@
|
|
|
1
1
|
# Implementation Review Branch
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use this reference when the review target is code, tests, docs, UI behavior, or a current branch diff.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
2. `task.md`
|
|
7
|
-
3. changed code and tests
|
|
8
|
-
4. fresh command output when available
|
|
5
|
+
## Intake
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
Read, in order:
|
|
8
|
+
|
|
9
|
+
1. current branch and base branch
|
|
10
|
+
2. `git diff <base>...HEAD --stat`
|
|
11
|
+
3. full diff for changed files
|
|
12
|
+
4. `task.md`
|
|
13
|
+
5. changed code plus direct importers/callers for enum, state, API, and behavior changes
|
|
14
|
+
6. fresh command output when available
|
|
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 this in scratch reasoning before findings:
|
|
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 belongs to a node or has a skip reason.
|
|
34
|
+
|
|
35
|
+
For broad or PR-landing diffs, use the risk-lane profile from `review-methods.md` before final findings:
|
|
36
|
+
|
|
37
|
+
1. Intent and regression
|
|
38
|
+
2. Security and privacy
|
|
39
|
+
3. Performance and reliability
|
|
40
|
+
4. Contracts and coverage
|
|
41
|
+
|
|
42
|
+
### Contract Fidelity
|
|
43
|
+
|
|
44
|
+
Check whether implementation matches `task.md` or investigation:
|
|
45
|
+
|
|
46
|
+
- required tasks done
|
|
47
|
+
- rejected scope not implemented
|
|
48
|
+
- root cause still true
|
|
49
|
+
- expected spec delta honored
|
|
50
|
+
- behavior visible at public seam
|
|
51
|
+
|
|
52
|
+
### Code Smell Scan
|
|
53
|
+
|
|
54
|
+
Use `review-methods.md` smell taxonomy.
|
|
55
|
+
|
|
56
|
+
Look for:
|
|
57
|
+
|
|
58
|
+
- copy-paste helper logic
|
|
59
|
+
- broad catch-all errors
|
|
60
|
+
- parameter clumps
|
|
61
|
+
- shallow pass-through modules
|
|
62
|
+
- internal mocks driving production design
|
|
63
|
+
- new branch forests where a data shape would collapse cases
|
|
64
|
+
- hidden state or multiple truth sources
|
|
65
|
+
- cycles between modules
|
|
66
|
+
|
|
67
|
+
### Structural Risk
|
|
68
|
+
|
|
69
|
+
Check:
|
|
70
|
+
|
|
71
|
+
- security and trust boundaries
|
|
72
|
+
- enum/value completeness outside the diff
|
|
73
|
+
- migrations and rollback
|
|
74
|
+
- concurrency and double-submit
|
|
75
|
+
- external service failures
|
|
76
|
+
- logs/metrics for new paths
|
|
77
|
+
|
|
78
|
+
### Test Quality
|
|
79
|
+
|
|
80
|
+
Build a coverage map:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
CODE PATHS USER/RUNTIME FLOWS
|
|
84
|
+
file.ts feature flow
|
|
85
|
+
├── [tested] happy ├── [tested] main path
|
|
86
|
+
├── [gap] empty ├── [gap] double action
|
|
87
|
+
└── [gap] upstream error └── [gap] navigate away / timeout
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Flag:
|
|
91
|
+
|
|
92
|
+
- no regression test for changed behavior
|
|
93
|
+
- tests only assert implementation shape
|
|
94
|
+
- tests mock internal modules instead of public seam
|
|
95
|
+
- fixture lies with missing fields or type casts
|
|
96
|
+
- no UI/E2E proof for user-visible change
|
|
97
|
+
|
|
98
|
+
### Documentation and DX
|
|
99
|
+
|
|
100
|
+
If changed behavior affects README, guides, CLI help, package install, public API, agent skill usage, or examples, check whether docs changed too.
|
|
101
|
+
|
|
102
|
+
## Fix Policy
|
|
11
103
|
|
|
12
104
|
Findings stay in the response. Ask which repair option to apply before editing code. Do not write process files.
|
|
105
|
+
|
|
106
|
+
Return:
|
|
107
|
+
|
|
108
|
+
- findings ordered by severity
|
|
109
|
+
- smallest safe repair option
|
|
110
|
+
- broader cleanup option when the smell is real
|
|
111
|
+
- defer option with explicit risk
|
|
112
|
+
- recommendation and route
|
|
@@ -1,9 +1,114 @@
|
|
|
1
1
|
# Plan Review Branch
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use this reference when the review target is a plan, investigation handoff, or mixed branch whose plan contract may be wrong.
|
|
4
|
+
|
|
5
|
+
## Intake
|
|
6
|
+
|
|
7
|
+
Read, in order:
|
|
4
8
|
|
|
5
9
|
1. `task.md`
|
|
6
|
-
2. relevant roadmap or
|
|
7
|
-
3. affected code/tests/docs
|
|
10
|
+
2. relevant roadmap, issue, PR text, or user request
|
|
11
|
+
3. affected code/tests/docs referenced by the plan
|
|
12
|
+
4. existing command output only when it proves or disproves a planning assumption
|
|
13
|
+
|
|
14
|
+
If no `task.md` exists, review the user-provided plan text and make missing durable task contract a finding.
|
|
15
|
+
|
|
16
|
+
## Review Facets
|
|
17
|
+
|
|
18
|
+
Select only applicable facets, but do not skip a selected facet to keep the answer short.
|
|
19
|
+
|
|
20
|
+
### Strategy
|
|
21
|
+
|
|
22
|
+
Check:
|
|
23
|
+
|
|
24
|
+
- Is this the right problem?
|
|
25
|
+
- Is the stated user/business outcome direct or only a proxy?
|
|
26
|
+
- What happens if we do nothing?
|
|
27
|
+
- What does the 12-month ideal look like?
|
|
28
|
+
- What existing code or workflow already solves part of this?
|
|
29
|
+
|
|
30
|
+
Useful shape:
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
CURRENT -> THIS PLAN -> 12-MONTH IDEAL
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Engineering
|
|
37
|
+
|
|
38
|
+
Check:
|
|
39
|
+
|
|
40
|
+
- component boundaries
|
|
41
|
+
- data flow and shadow paths
|
|
42
|
+
- state transitions
|
|
43
|
+
- security boundaries
|
|
44
|
+
- rollback shape
|
|
45
|
+
- testability seam
|
|
46
|
+
- parallelization risk
|
|
47
|
+
|
|
48
|
+
For non-trivial plans, reason through:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
Entry -> validate -> transform -> persist -> output
|
|
52
|
+
| | | | |
|
|
53
|
+
nil invalid exception conflict stale
|
|
54
|
+
empty wrong type timeout duplicate partial
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Design
|
|
58
|
+
|
|
59
|
+
Run only for user-facing UI or interaction flows.
|
|
60
|
+
|
|
61
|
+
Check:
|
|
62
|
+
|
|
63
|
+
- first, second, third thing the user sees
|
|
64
|
+
- loading / empty / error / success / partial states
|
|
65
|
+
- responsive and accessibility intent
|
|
66
|
+
- generic UI or AI slop risk
|
|
67
|
+
- whether live design review will be needed after implementation
|
|
68
|
+
|
|
69
|
+
### DX / Operator
|
|
70
|
+
|
|
71
|
+
Run only for API, CLI, SDK, package, docs, agent skill, MCP, or developer/operator surfaces.
|
|
72
|
+
|
|
73
|
+
Check:
|
|
74
|
+
|
|
75
|
+
- target developer/operator persona
|
|
76
|
+
- time to first value
|
|
77
|
+
- install/run/debug/upgrade path
|
|
78
|
+
- actionable errors: problem + cause + fix
|
|
79
|
+
- copy-paste examples and escape hatches
|
|
80
|
+
|
|
81
|
+
### TOC Root Cause
|
|
82
|
+
|
|
83
|
+
For complex bugs:
|
|
84
|
+
|
|
85
|
+
1. Current reality tree: symptoms, causes, enabling conditions.
|
|
86
|
+
2. Conflict diagram: why the obvious fix conflicts with a real need.
|
|
87
|
+
3. Future reality tree: what the proposed fix changes and what it may break.
|
|
88
|
+
|
|
89
|
+
If the root cause is not proven, reroute to `cc-investigate`, not `cc-do`.
|
|
90
|
+
|
|
91
|
+
## Planning Smells
|
|
92
|
+
|
|
93
|
+
Plans can contain smells before code exists:
|
|
94
|
+
|
|
95
|
+
- repeated implementation steps with slight variations
|
|
96
|
+
- parallel data sources
|
|
97
|
+
- task split by technical layer instead of behavior
|
|
98
|
+
- fake abstraction or one-adapter seam
|
|
99
|
+
- missing owner for shared state
|
|
100
|
+
- hand-wavy "handle edge cases" or "add validation"
|
|
101
|
+
|
|
102
|
+
Each planning smell becomes a finding in `task.md` and routes to `cc-plan`.
|
|
103
|
+
|
|
104
|
+
## Output
|
|
105
|
+
|
|
106
|
+
Write plan review findings directly into `task.md`:
|
|
107
|
+
|
|
108
|
+
- scope or architecture finding
|
|
109
|
+
- evidence and impact
|
|
110
|
+
- required task or contract change
|
|
111
|
+
- decision options when user judgment is needed
|
|
112
|
+
- reroute recommendation
|
|
8
113
|
|
|
9
|
-
|
|
114
|
+
Final response only summarizes changed `task.md` sections and next route. Do not write separate files.
|