cc-devflow 4.5.5 → 4.5.7

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 (73) hide show
  1. package/.claude/skills/cc-act/PLAYBOOK.md +2 -2
  2. package/.claude/skills/cc-act/SKILL.md +2 -2
  3. package/.claude/skills/cc-act/scripts/{archive-requirement.sh → archive-change.sh} +7 -7
  4. package/.claude/skills/cc-investigate/CHANGELOG.md +5 -0
  5. package/.claude/skills/cc-investigate/SKILL.md +2 -2
  6. package/.claude/skills/cc-plan/CHANGELOG.md +34 -0
  7. package/.claude/skills/cc-plan/PLAYBOOK.md +22 -17
  8. package/.claude/skills/cc-plan/SKILL.md +135 -12
  9. package/.claude/skills/cc-plan/assets/DESIGN_TEMPLATE.md +51 -0
  10. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +2 -0
  11. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +66 -3
  12. package/.claude/skills/cc-plan/assets/TINY_DESIGN_TEMPLATE.md +37 -0
  13. package/.claude/skills/cc-plan/references/planning-contract.md +33 -10
  14. package/.claude/skills/cc-plan/scripts/next-change-key.sh +78 -0
  15. package/.claude/skills/cc-review/CHANGELOG.md +7 -0
  16. package/.claude/skills/cc-review/PLAYBOOK.md +54 -0
  17. package/.claude/skills/cc-review/SKILL.md +173 -0
  18. package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +81 -0
  19. package/.claude/skills/cc-review/references/implementation-review-branch.md +115 -0
  20. package/.claude/skills/cc-review/references/plan-review-branch.md +116 -0
  21. package/.claude/skills/cc-review/references/review-methods.md +126 -0
  22. package/.claude/skills/cc-roadmap/CHANGELOG.md +6 -0
  23. package/.claude/skills/cc-roadmap/SKILL.md +102 -8
  24. package/.claude/skills/cc-roadmap/assets/BACKLOG_TEMPLATE.md +3 -0
  25. package/.claude/skills/cc-roadmap/assets/ROADMAP_TEMPLATE.md +23 -0
  26. package/.claude/skills/cc-roadmap/assets/TRACKING_TEMPLATE.json +20 -1
  27. package/.claude/skills/cc-roadmap/references/roadmap-dialogue.md +28 -13
  28. package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/markdown.js +18 -0
  29. package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/schema.js +8 -0
  30. package/CHANGELOG.md +21 -0
  31. package/README.md +10 -5
  32. package/README.zh-CN.md +10 -5
  33. package/bin/cc-devflow-cli.js +135 -2
  34. package/config/distributable-skills.json +2 -0
  35. package/docs/CLAUDE.md +1 -1
  36. package/docs/examples/example-bindings.json +5 -4
  37. package/docs/examples/full-design-blocked/BACKLOG.md +1 -1
  38. package/docs/examples/full-design-blocked/README.md +1 -1
  39. package/docs/examples/full-design-blocked/ROADMAP.md +16 -1
  40. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +42 -1
  41. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +345 -65
  42. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/tasks.md +2 -1
  43. package/docs/examples/full-design-blocked/roadmap.json +18 -2
  44. package/docs/examples/local-handoff/BACKLOG.md +1 -1
  45. package/docs/examples/local-handoff/README.md +1 -1
  46. package/docs/examples/local-handoff/ROADMAP.md +16 -1
  47. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +34 -1
  48. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +197 -39
  49. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/tasks.md +2 -1
  50. package/docs/examples/local-handoff/roadmap.json +16 -2
  51. package/docs/examples/pdca-loop/BACKLOG.md +1 -1
  52. package/docs/examples/pdca-loop/README.md +1 -1
  53. package/docs/examples/pdca-loop/ROADMAP.md +16 -1
  54. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +34 -1
  55. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +89 -8
  56. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/tasks.md +2 -1
  57. package/docs/examples/pdca-loop/roadmap.json +16 -2
  58. package/docs/examples/scripts/check-example-bindings.sh +2 -0
  59. package/docs/guides/getting-started.md +13 -10
  60. package/docs/guides/getting-started.zh-CN.md +13 -10
  61. package/lib/skill-runtime/__tests__/archive-change.test.js +124 -0
  62. package/lib/skill-runtime/__tests__/autopilot.test.js +13 -10
  63. package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +1 -0
  64. package/lib/skill-runtime/__tests__/paths.test.js +106 -1
  65. package/lib/skill-runtime/__tests__/query.test.js +49 -0
  66. package/lib/skill-runtime/archive-change.js +64 -0
  67. package/lib/skill-runtime/artifacts.js +2 -2
  68. package/lib/skill-runtime/intent.js +14 -14
  69. package/lib/skill-runtime/operations/autopilot-shared.js +4 -4
  70. package/lib/skill-runtime/paths.js +60 -7
  71. package/lib/skill-runtime/query-registry.js +3 -3
  72. package/lib/skill-runtime/query.js +30 -30
  73. package/package.json +2 -1
@@ -3,19 +3,20 @@
3
3
  ## Order
4
4
 
5
5
  0. 先做 `Context Snapshot`:现有 roadmap / backlog、capability specs、历史 design/analysis、最近提交、forcing functions、项目语言 / durable decisions
6
- 1. 用户是谁
7
- 2. 今天靠什么笨办法活着
8
- 3. 最强需求证据是什么
9
- 4. 为什么现在必须解决
10
- 5. deadline / capacity / dependency / distribution 约束是什么
11
- 6. 当前最大的 adoption / trust / delivery 卡点是什么
12
- 7. 核心术语是否已有 canonical definition,是否和现有 capability spec / roadmap decision 冲突
13
- 8. 最窄突破口是什么
14
- 9. 6-12 个月后会长成什么
15
- 10. 给出 2-3 条路线图形状并明确推荐
16
- 11. 冻结 1-3 个阶段,写 exit signal / kill signal / non-goals
17
- 12. 画出 `RM dependency graph`,标出串行主链和 parallel-ready wave
18
- 13. 标出哪些事项真的 ready for `cc-plan`
6
+ 1. 先判断 project direction mode:founder-business / internal-company / hackathon-demo / open-source-research / learning / side-project / infrastructure / recovery
7
+ 2. 用户是谁
8
+ 3. 今天靠什么笨办法活着
9
+ 4. 最强需求证据是什么
10
+ 5. 为什么现在必须解决
11
+ 6. deadline / capacity / dependency / distribution 约束是什么
12
+ 7. 当前最大的 adoption / trust / delivery 卡点是什么
13
+ 8. 核心术语是否已有 canonical definition,是否和现有 capability spec / roadmap decision 冲突
14
+ 9. 最窄突破口是什么
15
+ 10. 6-12 个月后会长成什么
16
+ 11. 给出 2-3 条路线图形状并明确推荐
17
+ 12. 冻结 1-3 个阶段,写 exit signal / kill signal / non-goals
18
+ 13. 画出 `RM dependency graph`,标出串行主链和 parallel-ready wave
19
+ 14. 标出哪些事项真的 ready for `cc-plan`
19
20
 
20
21
  ## Question Rules
21
22
 
@@ -25,11 +26,25 @@
25
26
  - 没证据时明确写 assumption
26
27
  - 用户没批准前,不把事项偷下放成 requirement
27
28
 
29
+ ## Project Direction Modes
30
+
31
+ - `founder-business`: 问 demand reality、status quo、specific human、narrowest paid wedge、observed behavior、future fit。允许给创业行动建议,但必须 source-neutral:找具体用户、看真实使用、验证付费或强行为、缩小本周 wedge。禁止品牌广告、申请建议、推广链接和外部权威背书。
32
+ - `internal-company`: 问 sponsor、最小可批准 demo、组织依赖、维护 owner、reorg 风险。不要写对外市场叙事。
33
+ - `hackathon-demo`: 问 wow moment、demo path、fallback、时间盒。不要先设计长期平台。
34
+ - `open-source-research`: 问替代品、可复现 benchmark、贡献者 first success、维护边界。不要套商业销售漏斗。
35
+ - `learning`: 问要学会什么、最小练习闭环、反馈方式。不要让生产级架构遮住学习目标。
36
+ - `side-project`: 问自己会不会反复用、最酷可分享版本、最快可用路径。不要强行商业化。
37
+ - `infrastructure`: 问调用方、workaround、失败成本、迁移/回滚、复用边界。不要虚构用户访谈。
38
+ - `recovery`: 问事故证据、最小可信修复、防回归、kill signal、信任恢复。不要扩张新功能。
39
+
40
+ 如果 direction mode 变了,回到 route selection 重新算,不要沿用前一组问题。
41
+
28
42
  ## Route Shapes
29
43
 
30
44
  - `wedge-first`: 先用一个窄切口打穿真实需求
31
45
  - `platform-first`: 先做后面几阶段都会反复复用的底座
32
46
  - `rescue-first`: 先解决 adoption、trust、delivery 里最大的卡点
47
+ - `decompose-first`: 先拆多个可独立交付系统,再决定每个系统的路线
33
48
 
34
49
  ## Output Rules
35
50
 
@@ -621,6 +621,20 @@ function renderParked(tracking) {
621
621
  .join('\n\n');
622
622
  }
623
623
 
624
+ function renderProjectDirectionHandoff(tracking) {
625
+ const context = tracking.context || {};
626
+
627
+ return [
628
+ `- Project direction mode: ${formatBacklogValue(context.projectDirectionMode)}`,
629
+ `- Direction mode rationale: ${formatBacklogValue(context.projectDirectionRationale)}`,
630
+ `- Direction-specific questions selected: ${formatList(context.directionQuestionsSelected || [])}`,
631
+ `- Direction-specific questions skipped: ${formatList(context.directionQuestionsSkipped || [])}`,
632
+ `- Direction guardrails applied: ${formatList(context.directionGuardrailsApplied || [])}`,
633
+ `- Planning posture: ${formatBacklogValue(context.planningPosture)}`,
634
+ `- Evidence maturity: ${formatBacklogValue(context.evidenceMaturity)}`
635
+ ].join('\n');
636
+ }
637
+
624
638
  function renderBacklogDocument({ backlogFile, trackingFile, tracking }) {
625
639
  const relativePath = path.relative(path.dirname(backlogFile), trackingFile).replace(/\\/g, '/');
626
640
  const displayPath = relativePath || path.basename(trackingFile);
@@ -651,6 +665,10 @@ function renderBacklogDocument({ backlogFile, trackingFile, tracking }) {
651
665
  `- Parallel-ready next wave: ${formatBacklogValue(tracking.dependencyHandoff.parallelReadyNextWave)}`,
652
666
  `- Notes on blockers: ${formatBacklogValue(tracking.dependencyHandoff.notesOnBlockers)}`,
653
667
  '',
668
+ '## Project Direction Handoff',
669
+ '',
670
+ renderProjectDirectionHandoff(tracking),
671
+ '',
654
672
  '## Ready For Req-Plan',
655
673
  '',
656
674
  renderReadyForReqPlan(tracking),
@@ -78,6 +78,11 @@ const DEFAULT_ROADMAP_STATE = {
78
78
  currentFocusStage: ''
79
79
  },
80
80
  context: {
81
+ projectDirectionMode: '',
82
+ projectDirectionRationale: '',
83
+ directionQuestionsSelected: [],
84
+ directionQuestionsSkipped: [],
85
+ directionGuardrailsApplied: [],
81
86
  planningPosture: '',
82
87
  evidenceMaturity: '',
83
88
  canonicalTerms: [],
@@ -282,6 +287,9 @@ function normalizeRoadmapState(raw = {}) {
282
287
  context: {
283
288
  ...DEFAULT_ROADMAP_STATE.context,
284
289
  ...context,
290
+ directionQuestionsSelected: normalizeStringList(context.directionQuestionsSelected),
291
+ directionQuestionsSkipped: normalizeStringList(context.directionQuestionsSkipped),
292
+ directionGuardrailsApplied: normalizeStringList(context.directionGuardrailsApplied),
285
293
  canonicalTerms: normalizeStringList(context.canonicalTerms),
286
294
  durableDecisionSources: normalizeStringList(context.durableDecisionSources)
287
295
  },
package/CHANGELOG.md CHANGED
@@ -9,6 +9,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [4.5.7] - 2026-05-10
13
+
14
+ ### Changed
15
+
16
+ - Added public `cc-review` as an optional deep review skill that branches between plan-stage and implementation-stage review, keeps heavyweight methods in progressive references, checks in-scope code smells, and records Browser/Computer Use plus log evidence when UI or runtime behavior is involved.
17
+ - Updated `cc-roadmap` and `cc-plan` with AI Leverage Route/Decision Lens gates that require real user/operator, status quo workaround, human-vs-agent effort, complete-lake boundary, ocean boundary, and boil-lake/sharp-wedge/needs-evidence/pivot verdicts before work becomes implementation-ready.
18
+ - Updated `cc-plan` with an opt-in External Best-Practice Validation gate that records generalized search approval, source trust, repo-fit verdicts, and skip reasons in durable planning artifacts.
19
+ - Updated `cc-plan` Decision Question options to require `A/B/C` lettered choices while keeping `D1` / `D2` as question IDs.
20
+
21
+ ## [4.5.6] - 2026-05-08
22
+
23
+ ### Changed
24
+
25
+ - Updated `cc-plan` with a fixed Decision Question Protocol so approval gates use numbered questions, recommendations, option tradeoffs, impact, and STOP instead of ad hoc prose.
26
+ - Updated `cc-plan` to treat the full `REQ/FIX-<number>-<description>` change key as identity, so repeated numbers from parallel worktrees stay distinct.
27
+
28
+ ### Fixed
29
+
30
+ - Fixed typed runtime queries and `cc-devflow query` so duplicate local change numbers can be resolved with an explicit `--change-key`.
31
+ - Fixed ambiguous query path resolution so duplicate change ids return a structured JSON failure instead of escaping the query registry.
32
+
12
33
  ## [4.5.5] - 2026-05-06
13
34
 
14
35
  ### Changed
package/README.md CHANGED
@@ -14,13 +14,13 @@ CC-DevFlow is a small, explicit workflow system for agent coding. It gives an AI
14
14
  ```text
15
15
  cc-roadmap
16
16
 
17
- PDCA: cc-plan -> cc-do -> cc-check -> cc-act
18
- IDCA: cc-investigate -> cc-do -> cc-check -> cc-act
17
+ PDCA: cc-plan -> [cc-review] -> cc-do -> [cc-review] -> cc-check -> cc-act
18
+ IDCA: cc-investigate -> [cc-review] -> cc-do -> [cc-review] -> cc-check -> cc-act
19
19
  ```
20
20
 
21
21
  ## Why cc-devflow
22
22
 
23
- - **Small public surface**: six visible workflow skills plus a CLI for installation and platform adaptation.
23
+ - **Small public surface**: six core workflow skills, one optional deep review skill, plus a CLI for installation and platform adaptation.
24
24
  - **Evidence before done**: implementation must pass through verification proof before shipping or handoff.
25
25
  - **Skill-first distribution**: the public contract lives in `.claude/skills/<skill>/SKILL.md` and `PLAYBOOK.md`, not in hidden runtime behavior.
26
26
  - **Multi-platform output**: install once, then adapt for Codex, Cursor, Qwen, Antigravity, and related agent environments.
@@ -56,7 +56,7 @@ Refresh every supported platform output:
56
56
  npx cc-devflow@latest adapt --cwd /path/to/your/project --all
57
57
  ```
58
58
 
59
- After installation, ask your agent to use the workflow skills directly. Start with `cc-roadmap` for product direction, use `cc-plan` for new work, use `cc-investigate` for bugs, then continue through `cc-do`, `cc-check`, and `cc-act`.
59
+ After installation, ask your agent to use the workflow skills directly. Start with `cc-roadmap` for product direction, use `cc-plan` for new work, use `cc-investigate` for bugs, optionally run `cc-review` on complex frozen plans or investigations, then continue through `cc-do`, optional implementation `cc-review`, `cc-check`, and `cc-act`.
60
60
 
61
61
  ## Workflow Skills
62
62
 
@@ -66,6 +66,7 @@ After installation, ask your agent to use the workflow skills directly. Start wi
66
66
  | `cc-plan` | A feature or change needs scope, design, and task freezing | `planning/design.md`, `planning/tasks.md`, `task-manifest.json` |
67
67
  | `cc-investigate` | A bug needs symptom, reproduction, root cause, and repair boundary | `planning/analysis.md`, `planning/tasks.md`, `task-manifest.json` |
68
68
  | `cc-do` | Planned or investigated work needs implementation | code, tests, checkpoints, scratch runtime |
69
+ | `cc-review` | Complex plans, investigations, or diffs need optional deep multi-round review before implementation or verification | `cc-review-report.md`, optional `cc-review-findings.json` |
69
70
  | `cc-check` | Work needs fresh verification evidence | `report-card.json` |
70
71
  | `cc-act` | Verified work needs a PR, local handoff, release note, or closeout | one final handoff file |
71
72
 
@@ -82,6 +83,8 @@ Canonical language and durable decisions stay inside cc-devflow-native sources:
82
83
 
83
84
  `cc-plan` freezes more implementation decisions before `cc-do` starts. Non-trivial plans compare minimal viable and ideal architecture options, full designs include decision horizon plus error/rescue mapping, and test-first plans record test framework evidence, public test seams, spec-style test names, public verification paths, behavior assertions, mock boundaries, coverage quality, mandatory regression tests, interface depth, Green minimality guards, refactor candidates, and vertical tracer-bullet slices when existing behavior changes. Before handoff, `cc-plan` and `cc-investigate` also reconcile the source roadmap item so RM status, REQ/FIX binding, progress, and spec diagnosis do not drift from the frozen change artifacts.
84
85
 
86
+ `cc-review` is optional and deeper than `cc-check`. It can run immediately after `cc-plan` / `cc-investigate` to review the frozen plan or root-cause contract, or after `cc-do` to review the implementation. It classifies the input as plan-stage or implementation-stage, then runs the matching review branch: plan reviews borrow strategy/design/engineering/DX methods through progressive references, while implementation reviews inspect diff scope, code smells, tests, UI/runtime behavior, Browser/Computer Use evidence, and logs when applicable. Findings route back to `cc-plan` or `cc-do`; clean implementation reviews continue to `cc-check`.
87
+
85
88
  ## Verification And Ship Gates
86
89
 
87
90
  `cc-check` now treats QA as a feedback-loop problem, not only a green-test problem. Bugfix and behavior work records the loop used to prove reality, expected versus actual behavior, reproduction steps, test boundary quality, and architecture follow-ups when no clean public test seam exists.
@@ -120,6 +123,7 @@ npx skills add https://github.com/Dimon94/cc-devflow --skill cc-roadmap
120
123
  npx skills add https://github.com/Dimon94/cc-devflow --skill cc-plan
121
124
  npx skills add https://github.com/Dimon94/cc-devflow --skill cc-investigate
122
125
  npx skills add https://github.com/Dimon94/cc-devflow --skill cc-do
126
+ npx skills add https://github.com/Dimon94/cc-devflow --skill cc-review
123
127
  npx skills add https://github.com/Dimon94/cc-devflow --skill cc-check
124
128
  npx skills add https://github.com/Dimon94/cc-devflow --skill cc-act
125
129
  ```
@@ -185,6 +189,7 @@ The currently distributed skill folders are:
185
189
  - `.claude/skills/cc-plan/`
186
190
  - `.claude/skills/cc-investigate/`
187
191
  - `.claude/skills/cc-do/`
192
+ - `.claude/skills/cc-review/`
188
193
  - `.claude/skills/cc-check/`
189
194
  - `.claude/skills/cc-act/`
190
195
  - `.claude/skills/cc-spec-init/`
@@ -193,7 +198,7 @@ The currently distributed skill folders are:
193
198
  ## Durable vs Ephemeral
194
199
 
195
200
  - `devflow/specs/` stores durable capability truth: `INDEX.md` plus `capabilities/*.md`.
196
- - New change directories use `REQ-<number>-<description>` for requirements or `FIX-<number>-<description>` for bug fixes. `REQ` and `FIX` numbers advance independently, so the same number may exist in both prefixes.
201
+ - New change directories use `REQ-<number>-<description>` for requirements or `FIX-<number>-<description>` for bug fixes. `REQ` and `FIX` numbers advance independently, so the same number may exist in both prefixes. Parallel worktrees may also create repeated numbers; the full change key must use a specific description to distinguish the work.
197
202
  - `devflow/changes/<change>/` stores durable change truth: `change-state.json`, `change-meta.json`, planning docs, `task-manifest.json`, `team-state.json`, task `checkpoint.json`, `report-card.json`, and one final handoff file.
198
203
  - `devflow/workspaces/<change>/` stores ephemeral runtime scratch such as worker assignment, journals, prompts, and session logs.
199
204
  - Regenerable files should not be persisted under `devflow/changes/`.
package/README.zh-CN.md CHANGED
@@ -14,13 +14,13 @@ CC-DevFlow 是一个给 Agent 编程时代准备的小而明确的工作流系
14
14
  ```text
15
15
  cc-roadmap
16
16
 
17
- PDCA: cc-plan -> cc-do -> cc-check -> cc-act
18
- IDCA: cc-investigate -> cc-do -> cc-check -> cc-act
17
+ PDCA: cc-plan -> [cc-review] -> cc-do -> [cc-review] -> cc-check -> cc-act
18
+ IDCA: cc-investigate -> [cc-review] -> cc-do -> [cc-review] -> cc-check -> cc-act
19
19
  ```
20
20
 
21
21
  ## 为什么用 cc-devflow
22
22
 
23
- - **公开入口很小**:6 个可见 workflow skill,加一个负责安装和平台适配的 CLI。
23
+ - **公开入口很小**:6 个核心 workflow skill、1 个可选深度 review skill,加一个负责安装和平台适配的 CLI。
24
24
  - **先证据后完成**:实现之后必须经过验证证据,才能进入 ship 或 handoff。
25
25
  - **Skill-first 分发**:公开契约写在 `.claude/skills/<skill>/SKILL.md` 和 `PLAYBOOK.md`,不依赖隐藏运行时语义。
26
26
  - **多平台产物**:一次安装,再生成 Codex、Cursor、Qwen、Antigravity 等 Agent 环境需要的输出。
@@ -56,7 +56,7 @@ npx cc-devflow@latest adapt --cwd /path/to/your/project --platform antigravity
56
56
  npx cc-devflow@latest adapt --cwd /path/to/your/project --all
57
57
  ```
58
58
 
59
- 安装完成后,直接让 Agent 使用这些 workflow skill。产品方向先走 `cc-roadmap`,新需求走 `cc-plan`,Bug 和 regression 走 `cc-investigate`,然后继续进入 `cc-do`、`cc-check`、`cc-act`。
59
+ 安装完成后,直接让 Agent 使用这些 workflow skill。产品方向先走 `cc-roadmap`,新需求走 `cc-plan`,Bug 和 regression 走 `cc-investigate`;复杂计划或根因合同冻结后可以先接 `cc-review`,再进入 `cc-do`;实现复杂时还可以再接一次实现 `cc-review`,最后进入 `cc-check` 和 `cc-act`。
60
60
 
61
61
  ## Workflow Skill
62
62
 
@@ -66,6 +66,7 @@ npx cc-devflow@latest adapt --cwd /path/to/your/project --all
66
66
  | `cc-plan` | 新功能或变更需要澄清范围、设计方案、冻结任务 | `planning/design.md`、`planning/tasks.md`、`task-manifest.json` |
67
67
  | `cc-investigate` | Bug 需要症状、复现、根因和修复边界 | `planning/analysis.md`、`planning/tasks.md`、`task-manifest.json` |
68
68
  | `cc-do` | 已计划或已调查的任务需要实现 | 代码、测试、checkpoint、scratch runtime |
69
+ | `cc-review` | 复杂方案、调查根因或 diff 需要在实现前或验证前做可选深度多轮 Review | `cc-review-report.md`,可选 `cc-review-findings.json` |
69
70
  | `cc-check` | 工作需要新鲜验证证据 | `report-card.json` |
70
71
  | `cc-act` | 已验证工作需要 PR、本地 handoff、release note 或 closeout | 唯一最终 handoff 文件 |
71
72
 
@@ -82,6 +83,8 @@ Canonical language 和 durable decisions 只收敛到 cc-devflow 原生真相源
82
83
 
83
84
  `cc-plan` 会在 `cc-do` 开始前冻结更多实现决策。非 trivial 计划需要比较 minimal viable 和 ideal architecture,full-design 需要包含 implementation decision horizon 和 error/rescue map;测试计划要记录测试框架证据、public test seam、spec-style test name、public verification path、behavior assertion、mock boundary、覆盖质量、强制 regression test、interface depth、Green minimality guard、refactor candidates 和 vertical tracer-bullet slices。交接前,`cc-plan` 和 `cc-investigate` 还会校准 source roadmap item,让 RM 状态、REQ/FIX 绑定、progress 和 spec diagnosis 不再漂移。
84
85
 
86
+ `cc-review` 是可选的深度 Review,不替代 `cc-check`。它可以接在 `cc-plan` / `cc-investigate` 后审冻结的计划或根因合同,也可以接在 `cc-do` 后审实现。它先判断输入属于计划阶段还是实现阶段,再走对应分支:计划 Review 通过渐进式 references 借鉴 strategy / design / engineering / DX 方法;实现 Review 检查 diff 范围、代码坏味道、测试、UI/runtime 行为、Browser/Computer Use 证据和日志。Finding 回到 `cc-plan` 或 `cc-do`;实现 Review 干净后再进入 `cc-check`。
87
+
85
88
  ## 验证与交付门禁
86
89
 
87
90
  `cc-check` 现在把 QA 当成反馈环问题,而不是只看测试是否绿。Bugfix 和行为变更需要记录证明现实的 loop、expected / actual、复现步骤、测试边界质量;如果没有干净的 public test seam,要留下架构 follow-up。
@@ -120,6 +123,7 @@ npx skills add https://github.com/Dimon94/cc-devflow --skill cc-roadmap
120
123
  npx skills add https://github.com/Dimon94/cc-devflow --skill cc-plan
121
124
  npx skills add https://github.com/Dimon94/cc-devflow --skill cc-investigate
122
125
  npx skills add https://github.com/Dimon94/cc-devflow --skill cc-do
126
+ npx skills add https://github.com/Dimon94/cc-devflow --skill cc-review
123
127
  npx skills add https://github.com/Dimon94/cc-devflow --skill cc-check
124
128
  npx skills add https://github.com/Dimon94/cc-devflow --skill cc-act
125
129
  ```
@@ -185,6 +189,7 @@ npx cc-devflow config doctor --cwd /path/to/your/project
185
189
  - `.claude/skills/cc-plan/`
186
190
  - `.claude/skills/cc-investigate/`
187
191
  - `.claude/skills/cc-do/`
192
+ - `.claude/skills/cc-review/`
188
193
  - `.claude/skills/cc-check/`
189
194
  - `.claude/skills/cc-act/`
190
195
  - `.claude/skills/cc-spec-init/`
@@ -193,7 +198,7 @@ npx cc-devflow config doctor --cwd /path/to/your/project
193
198
  ## Durable 与 Ephemeral
194
199
 
195
200
  - `devflow/specs/` 保存 durable capability truth:`INDEX.md` 和 `capabilities/*.md`。
196
- - 新 change 目录使用 `REQ-<number>-<description>` 表示需求,使用 `FIX-<number>-<description>` 表示 Bug 修复。`REQ` 和 `FIX` 各自递增自己的编号,跨前缀同号允许共存。
201
+ - 新 change 目录使用 `REQ-<number>-<description>` 表示需求,使用 `FIX-<number>-<description>` 表示 Bug 修复。`REQ` 和 `FIX` 各自递增自己的编号,跨前缀同号允许共存。并行工作树也可能产生重复编号,必须用完整 change key 的描述区分业务内容。
197
202
  - `devflow/changes/<change>/` 保存 durable change truth:`change-state.json`、`change-meta.json`、planning 文档、`task-manifest.json`、`team-state.json`、任务级 `checkpoint.json`、`report-card.json` 和唯一最终 handoff 文件。
198
203
  - `devflow/workspaces/<change>/` 保存 ephemeral runtime scratch,例如 worker assignment、journal、prompt 和 session log。
199
204
  - 能从 durable truth 再生成的文件,不应该持久化到 `devflow/changes/`。
@@ -60,6 +60,10 @@ Commands:
60
60
  config doctor Validate config and local ignore safety
61
61
  query list List typed runtime query ids
62
62
  query <id> Run a typed runtime query as JSON
63
+ next-change-key Compute the next REQ/FIX change key
64
+ archive-change Archive a completed change to devflow/changes/archive/YYYY-MM/
65
+ restore-change Restore an archived change back to devflow/changes/
66
+ list-archived List all archived changes
63
67
 
64
68
  Init options:
65
69
  --dir <path> Target project path (default: cwd)
@@ -89,6 +93,12 @@ Query options:
89
93
  --cwd <path> Project path used for devflow artifact lookup
90
94
  --change <id> Change id, for example REQ-123
91
95
  --change-id <id> Alias for --change
96
+ --change-key <key> Full change key, for example REQ-123-my-feature
97
+
98
+ Next-change-key options:
99
+ --prefix <REQ|FIX> Change type prefix (required)
100
+ --description <text> Short description, will be slugified (required)
101
+ --cwd <path> Project path (default: cwd)
92
102
 
93
103
  Examples:
94
104
  cc-devflow init
@@ -101,6 +111,7 @@ Examples:
101
111
  cc-devflow config resolve --cwd /path/to/project --format policy
102
112
  cc-devflow query list
103
113
  cc-devflow query ship-readiness --cwd /path/to/project --change REQ-123
114
+ cc-devflow query progress --change REQ-123 --change-key REQ-123-my-feature
104
115
  `);
105
116
  }
106
117
 
@@ -449,6 +460,7 @@ function parseQueryArgs(args) {
449
460
  const parsed = {
450
461
  cwd: null,
451
462
  changeId: null,
463
+ changeKey: null,
452
464
  rest: []
453
465
  };
454
466
 
@@ -480,6 +492,16 @@ function parseQueryArgs(args) {
480
492
  continue;
481
493
  }
482
494
 
495
+ if (arg === '--change-key') {
496
+ parsed.changeKey = args[++i];
497
+ continue;
498
+ }
499
+
500
+ if (arg.startsWith('--change-key=')) {
501
+ parsed.changeKey = arg.slice('--change-key='.length);
502
+ continue;
503
+ }
504
+
483
505
  parsed.rest.push(arg);
484
506
  }
485
507
 
@@ -490,7 +512,7 @@ async function runQueryCommand(args) {
490
512
  const [subcommand, ...rest] = args;
491
513
 
492
514
  if (!subcommand || subcommand === '--help' || subcommand === '-h') {
493
- console.error('Use: cc-devflow query list OR cc-devflow query <id> --change <changeId> [--cwd <path>]');
515
+ console.error('Use: cc-devflow query list OR cc-devflow query <id> --change <changeId> [--change-key <key>] [--cwd <path>]');
494
516
  return 3;
495
517
  }
496
518
 
@@ -507,13 +529,39 @@ async function runQueryCommand(args) {
507
529
 
508
530
  const result = await runQuery(subcommand, {
509
531
  repoRoot: path.resolve(options.cwd || process.cwd()),
510
- changeId: options.changeId
532
+ changeId: options.changeId,
533
+ changeKey: options.changeKey
511
534
  });
512
535
 
513
536
  process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
514
537
  return result.ok ? 0 : 2;
515
538
  }
516
539
 
540
+ function runNextChangeKey(args) {
541
+ const parsed = { prefix: null, description: null, cwd: null };
542
+
543
+ for (let i = 0; i < args.length; i++) {
544
+ const arg = args[i];
545
+ if (arg === '--prefix') { parsed.prefix = args[++i]; continue; }
546
+ if (arg.startsWith('--prefix=')) { parsed.prefix = arg.slice('--prefix='.length); continue; }
547
+ if (arg === '--description') { parsed.description = args[++i]; continue; }
548
+ if (arg.startsWith('--description=')) { parsed.description = arg.slice('--description='.length); continue; }
549
+ if (arg === '--cwd') { parsed.cwd = args[++i]; continue; }
550
+ if (arg.startsWith('--cwd=')) { parsed.cwd = arg.slice('--cwd='.length); continue; }
551
+ }
552
+
553
+ if (!parsed.prefix || !parsed.description) {
554
+ console.error('Use: cc-devflow next-change-key --prefix REQ|FIX --description "short description"');
555
+ return 1;
556
+ }
557
+
558
+ const { nextChangeKey } = require(path.join(PACKAGE_ROOT, 'lib/skill-runtime/paths.js'));
559
+ const repoRoot = path.resolve(parsed.cwd || process.cwd());
560
+ const result = nextChangeKey(repoRoot, parsed.prefix, parsed.description);
561
+ process.stdout.write(`${result.changeId}\n${result.changeKey}\n`);
562
+ return 0;
563
+ }
564
+
517
565
  function runAdapt(args) {
518
566
  const { options, rest } = parseCliArgs(args);
519
567
 
@@ -557,6 +605,75 @@ function runAdapter(command, args) {
557
605
  return typeof result.status === 'number' ? result.status : 1;
558
606
  }
559
607
 
608
+ function runArchiveChange(args) {
609
+ const parsed = { changeKey: null, cwd: null };
610
+
611
+ for (let i = 0; i < args.length; i++) {
612
+ const arg = args[i];
613
+ if (arg === '--cwd') { parsed.cwd = args[++i]; continue; }
614
+ if (arg.startsWith('--cwd=')) { parsed.cwd = arg.slice('--cwd='.length); continue; }
615
+ if (!arg.startsWith('-') && !parsed.changeKey) { parsed.changeKey = arg; continue; }
616
+ }
617
+
618
+ if (!parsed.changeKey) {
619
+ console.error('Use: cc-devflow archive-change <change-key> [--cwd path]');
620
+ return 1;
621
+ }
622
+
623
+ const { archiveChange } = require(path.join(PACKAGE_ROOT, 'lib/skill-runtime/archive-change.js'));
624
+ const repoRoot = path.resolve(parsed.cwd || process.cwd());
625
+ const result = archiveChange(repoRoot, parsed.changeKey);
626
+ process.stdout.write(`Archived to ${result.archived}\n`);
627
+ return 0;
628
+ }
629
+
630
+ function runRestoreChange(args) {
631
+ const parsed = { archivedPath: null, cwd: null };
632
+
633
+ for (let i = 0; i < args.length; i++) {
634
+ const arg = args[i];
635
+ if (arg === '--cwd') { parsed.cwd = args[++i]; continue; }
636
+ if (arg.startsWith('--cwd=')) { parsed.cwd = arg.slice('--cwd='.length); continue; }
637
+ if (!arg.startsWith('-') && !parsed.archivedPath) { parsed.archivedPath = arg; continue; }
638
+ }
639
+
640
+ if (!parsed.archivedPath) {
641
+ console.error('Use: cc-devflow restore-change <archived-path> [--cwd path]');
642
+ return 1;
643
+ }
644
+
645
+ const { restoreChange } = require(path.join(PACKAGE_ROOT, 'lib/skill-runtime/archive-change.js'));
646
+ const repoRoot = path.resolve(parsed.cwd || process.cwd());
647
+ const archivePath = path.resolve(parsed.archivedPath);
648
+ const result = restoreChange(repoRoot, archivePath);
649
+ process.stdout.write(`Restored to ${result.restored}\n`);
650
+ return 0;
651
+ }
652
+
653
+ function runListArchived(args) {
654
+ const parsed = { cwd: null };
655
+
656
+ for (let i = 0; i < args.length; i++) {
657
+ const arg = args[i];
658
+ if (arg === '--cwd') { parsed.cwd = args[++i]; continue; }
659
+ if (arg.startsWith('--cwd=')) { parsed.cwd = arg.slice('--cwd='.length); continue; }
660
+ }
661
+
662
+ const { listArchived } = require(path.join(PACKAGE_ROOT, 'lib/skill-runtime/archive-change.js'));
663
+ const repoRoot = path.resolve(parsed.cwd || process.cwd());
664
+ const items = listArchived(repoRoot);
665
+
666
+ if (items.length === 0) {
667
+ process.stdout.write('No archived changes.\n');
668
+ return 0;
669
+ }
670
+
671
+ for (const item of items) {
672
+ process.stdout.write(`${item.month} ${item.changeKey}\n`);
673
+ }
674
+ return 0;
675
+ }
676
+
560
677
  async function main() {
561
678
  const argv = process.argv.slice(2);
562
679
  const [command, ...rest] = argv;
@@ -582,6 +699,22 @@ async function main() {
582
699
  return runQueryCommand(rest);
583
700
  }
584
701
 
702
+ if (command === 'next-change-key') {
703
+ return runNextChangeKey(rest);
704
+ }
705
+
706
+ if (command === 'archive-change') {
707
+ return runArchiveChange(rest);
708
+ }
709
+
710
+ if (command === 'restore-change') {
711
+ return runRestoreChange(rest);
712
+ }
713
+
714
+ if (command === 'list-archived') {
715
+ return runListArchived(rest);
716
+ }
717
+
585
718
  return runAdapter(command, rest);
586
719
  }
587
720
 
@@ -4,6 +4,7 @@
4
4
  "cc-plan",
5
5
  "cc-investigate",
6
6
  "cc-do",
7
+ "cc-review",
7
8
  "cc-check",
8
9
  "cc-act"
9
10
  ],
@@ -12,6 +13,7 @@
12
13
  "cc-plan",
13
14
  "cc-investigate",
14
15
  "cc-do",
16
+ "cc-review",
15
17
  "cc-check",
16
18
  "cc-act",
17
19
  "cc-spec-init",
package/docs/CLAUDE.md CHANGED
@@ -27,4 +27,4 @@ docs/
27
27
  - 面向使用者:优先写“怎么用/怎么做”,其次再写“为什么”。
28
28
  - 可检索:标题清晰、关键词统一(`/flow-*`、`/core-*`、`/speckit.*`)。
29
29
  - 可落地:结论必须能映射到具体命令、脚本或模板文件路径。
30
- - change 目录命名必须保留大写逻辑 ID 前缀:`REQ-123-...` 表示需求变更,`FIX-123-...` 表示缺陷修复;`REQ` 和 `FIX` 是独立编号空间;描述部分使用 kebab-case。
30
+ - change 目录命名必须保留大写逻辑 ID 前缀:`REQ-123-...` 表示需求变更,`FIX-123-...` 表示缺陷修复;`REQ` 和 `FIX` 各自递增自己的编号,跨前缀同号不是冲突;并行工作树造成重复编号时,完整 change key 依靠描述区分业务内容;描述部分使用 kebab-case。
@@ -1,10 +1,11 @@
1
1
  {
2
- "updatedAt": "2026-05-06",
2
+ "updatedAt": "2026-05-09",
3
3
  "skills": {
4
- "cc-roadmap": "5.0.0",
5
- "cc-plan": "3.7.5",
6
- "cc-investigate": "1.2.2",
4
+ "cc-roadmap": "5.2.0",
5
+ "cc-plan": "3.8.1",
6
+ "cc-investigate": "1.3.0",
7
7
  "cc-do": "1.6.2",
8
+ "cc-review": "1.0.0",
8
9
  "cc-check": "1.10.1",
9
10
  "cc-act": "1.8.2",
10
11
  "cc-spec-init": "1.1.0"
@@ -5,7 +5,7 @@
5
5
  ## Backlog Meta
6
6
 
7
7
  - Roadmap version: `roadmap.v2`
8
- - Skill version: `5.0.0`
8
+ - Skill version: `5.2.0`
9
9
  - Last synced: `2026-04-19`
10
10
  - Current focus stage: `Stage 2`
11
11
  - Roadmap state source: `roadmap.json`
@@ -4,7 +4,7 @@
4
4
 
5
5
  - Example version: `1.0.0`
6
6
  - Last reviewed: `2026-04-17`
7
- - Bound skills: `cc-roadmap@5.0.0`, `cc-plan@3.7.5`, `cc-do@1.6.2`, `cc-check@1.10.1`
7
+ - Bound skills: `cc-roadmap@5.2.0`, `cc-plan@3.8.1`, `cc-do@1.6.2`, `cc-check@1.10.1`
8
8
 
9
9
  This example shows a requirement that **looked executable**, but `cc-check` correctly stopped it and sent it back to `cc-plan`.
10
10
 
@@ -3,7 +3,7 @@
3
3
  ## Roadmap Meta
4
4
 
5
5
  - Roadmap version: `roadmap.v2`
6
- - Skill version: `5.0.0`
6
+ - Skill version: `5.2.0`
7
7
  - Status: `active`
8
8
  - Last updated: `2026-04-16`
9
9
  - Owner / decider: `product-owner`
@@ -27,6 +27,21 @@
27
27
  - Adoption / trust bottleneck: admins will not trust bulk invite if seat usage and audit logs drift
28
28
  - Known unknowns: how duplicate users, seat limits, and partial imports should behave
29
29
 
30
+ ## AI Leverage Route Lens
31
+
32
+ - Real user / operator: workspace admin onboarding 20-200 collaborators
33
+ - Status quo workaround: paste individual invite emails or coordinate in external spreadsheets
34
+ - Human-team effort for full scope: multiple weeks across product, engineering, billing, and support review
35
+ - CC / agent effort for full scope: several hours once row semantics are approved, but unbounded before that
36
+ - AI compression ratio: high after semantics freeze, low while the product contract is ambiguous
37
+ - Complete-lake boundary: row classification, admin upload flow, billing-seat checks, and audit mapping after rule approval
38
+ - Ocean boundary: SCIM, background retries, rollback wizard, and unspecified billing semantics
39
+ - Scope recommendation: `sharp-wedge`
40
+ - First success signal: admins can predict duplicate, invalid, and over-limit outcomes
41
+ - Kill signal: duplicate and seat-limit semantics remain unresolved
42
+ - Verdict: `sharp-wedge`
43
+ - Missing evidence before ready-for-cc-plan: none recorded at route handoff; cc-check later reopened duplicate, invalid-row, partial-success, and seat-limit semantics
44
+
30
45
  ## Route Options
31
46
 
32
47
  | Shape | Why this could work | Why this may fail | Decision |
@@ -4,7 +4,7 @@
4
4
 
5
5
  - Requirement version: `REQ-002.v2`
6
6
  - Design version: `design.v2`
7
- - CC-Plan skill version: `3.7.5`
7
+ - CC-Plan skill version: `3.8.1`
8
8
  - Requirement ID: `REQ-002`
9
9
  - Design mode: `full-design`
10
10
  - Why not `tiny-design`: the feature crosses import parsing, invite rules, billing limits, duplicate handling, and audit logging
@@ -120,6 +120,44 @@
120
120
  - Deferred questions:
121
121
  - whether partial success needs an explicit rollback option
122
122
 
123
+ ## AI Leverage Decision Lens
124
+
125
+ - Real user / operator: workspace admin onboarding larger teams
126
+ - Status quo workaround: paste invite emails one by one or track them in spreadsheets
127
+ - Human-team effort for full scope: multiple weeks across product, engineering, billing, and support review
128
+ - CC / agent effort for full scope: several hours once row semantics are approved, but unbounded before that
129
+ - AI compression ratio: high after semantics freeze, low while the product contract is ambiguous
130
+ - Complete-lake boundary: row classification, admin upload flow, billing-seat checks, and audit mapping after rule approval
131
+ - Ocean boundary: SCIM, background retries, rollback wizard, and unspecified billing semantics
132
+ - Scope recommendation: `sharp-wedge`
133
+ - Cost model: medium agent time after rule approval, high human review time until semantics are approved, high failure cost if billing or audit outcomes drift
134
+ - Verdict: `sharp-wedge`
135
+ - Missing evidence or pivot reason: none at plan approval; cc-check later reopened duplicate, invalid-row, partial-success, and seat-limit semantics before retry or cc-act
136
+
137
+ ## External Best-Practice Validation
138
+
139
+ - Needed: Yes
140
+ - Decision status: declined
141
+ - Decision question: `D2`
142
+ - Privacy guard: generalized terms only; no project names, private requirements, customer names, secrets, logs, or proprietary concepts
143
+ - Generalized search terms:
144
+ - `bulk invite CSV import validation best practices`
145
+ - Sources checked:
146
+ - Conventional wisdom:
147
+ - Current discourse:
148
+ - Repo-fit verdict: skipped
149
+ - Changes to options / tasks:
150
+ - keep the design blocked until row-outcome semantics are approved from internal evidence
151
+ - Skipped reason: user kept the example repo-local for the blocked design
152
+
153
+ ## Decision Questions
154
+
155
+ | ID | Gate | Known evidence | Recommendation | User choice | Impact on `cc-do` | Status |
156
+ |----|------|----------------|----------------|-------------|-------------------|--------|
157
+ | D1 | approach-approval | Best-effort upload would let duplicate, invalid, and seat-limit semantics drift during execution | Choose Option B and freeze a rule matrix first | Option B | Keep execution blocked until row outcomes are modeled | answered |
158
+ | D2 | external-best-practice | Bulk CSV import semantics could benefit from generalized external practice, but this example stays repo-local | Stay repo-local for this blocked example | Stay repo-local | `cc-do` still must not start implementation until row outcomes are answered from internal evidence | answered |
159
+ | D3 | review-blocker | Duplicate and seat-limit outcomes are still not explicit enough for final requirement proof | Answer the row-outcome matrix before retry or cc-act | pending | `cc-do` retry and `cc-act` must stay blocked until this is answered | asked |
160
+
123
161
  ## Design
124
162
 
125
163
  - Modules touched:
@@ -169,6 +207,9 @@
169
207
  - Feasibility scan: pass
170
208
  - Source alignment: pass; roadmap still prioritizes trust over speed
171
209
  - PRD brief scan: pass for actors and stories; blocked on duplicate and seat-limit semantics
210
+ - AI Leverage Decision Lens scan: pass at plan approval as a sharp wedge; cc-check later blocked final proof because product semantics were still unbounded evidence risk
211
+ - External best-practice scan: pass; declined and recorded before task generation
212
+ - Decision question scan: blocked; `D3` is still unanswered
172
213
  - UI / interaction review summary: result states are acceptable if semantics are frozen first
173
214
  - DX review summary: execution still needs a single row-outcome matrix
174
215
  - Auto-decided items: