cc-devflow 4.5.10 → 4.5.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/.claude/skills/cc-act/CHANGELOG.md +23 -0
  2. package/.claude/skills/cc-act/PLAYBOOK.md +17 -269
  3. package/.claude/skills/cc-act/SKILL.md +38 -418
  4. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_INDEX_TEMPLATE.md +2 -13
  5. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_TEMPLATE.md +1 -9
  6. package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +21 -177
  7. package/.claude/skills/cc-act/references/closure-contract.md +12 -63
  8. package/.claude/skills/cc-act/references/git-commit-guidelines.md +5 -5
  9. package/.claude/skills/cc-act/scripts/cc-act-common.sh +5 -322
  10. package/.claude/skills/cc-act/scripts/detect-ship-target.sh +11 -2
  11. package/.claude/skills/cc-act/scripts/inspect-git-index.sh +58 -0
  12. package/.claude/skills/cc-act/scripts/render-pr-brief.sh +40 -440
  13. package/.claude/skills/cc-act/scripts/verify-act-gate.sh +10 -50
  14. package/.claude/skills/cc-check/CHANGELOG.md +24 -0
  15. package/.claude/skills/cc-check/PLAYBOOK.md +19 -273
  16. package/.claude/skills/cc-check/SKILL.md +33 -454
  17. package/.claude/skills/cc-check/references/review-contract.md +12 -147
  18. package/.claude/skills/cc-dev/CHANGELOG.md +20 -0
  19. package/.claude/skills/cc-dev/PLAYBOOK.md +1 -1
  20. package/.claude/skills/cc-dev/SKILL.md +52 -130
  21. package/.claude/skills/cc-dev/scripts/resolve-cc-devflow.sh +181 -0
  22. package/.claude/skills/cc-do/CHANGELOG.md +17 -0
  23. package/.claude/skills/cc-do/PLAYBOOK.md +19 -113
  24. package/.claude/skills/cc-do/SKILL.md +39 -236
  25. package/.claude/skills/cc-do/references/execution-recovery.md +15 -109
  26. package/.claude/skills/cc-do/scripts/cc-do-common.sh +5 -57
  27. package/.claude/skills/cc-do/scripts/check-task-status.sh +35 -65
  28. package/.claude/skills/cc-do/scripts/mark-task-complete.sh +9 -46
  29. package/.claude/skills/cc-do/scripts/select-ready-tasks.sh +29 -97
  30. package/.claude/skills/cc-investigate/CHANGELOG.md +23 -0
  31. package/.claude/skills/cc-investigate/PLAYBOOK.md +20 -180
  32. package/.claude/skills/cc-investigate/SKILL.md +65 -513
  33. package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +48 -95
  34. package/.claude/skills/cc-investigate/references/investigation-contract.md +14 -217
  35. package/.claude/skills/cc-next/CHANGELOG.md +6 -0
  36. package/.claude/skills/cc-next/PLAYBOOK.md +12 -8
  37. package/.claude/skills/cc-next/SKILL.md +34 -140
  38. package/.claude/skills/cc-plan/CHANGELOG.md +29 -0
  39. package/.claude/skills/cc-plan/PLAYBOOK.md +22 -161
  40. package/.claude/skills/cc-plan/SKILL.md +47 -640
  41. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +30 -225
  42. package/.claude/skills/cc-plan/references/planning-contract.md +24 -160
  43. package/.claude/skills/cc-plan/scripts/next-change-key.sh +8 -44
  44. package/.claude/skills/cc-plan/scripts/parse-task-dependencies.js +2 -2
  45. package/.claude/skills/cc-plan/scripts/validate-scope.sh +1 -1
  46. package/.claude/skills/cc-pr-land/SKILL.md +14 -114
  47. package/.claude/skills/cc-pr-review/CHANGELOG.md +4 -0
  48. package/.claude/skills/cc-pr-review/SKILL.md +20 -103
  49. package/.claude/skills/cc-review/CHANGELOG.md +17 -0
  50. package/.claude/skills/cc-review/PLAYBOOK.md +13 -86
  51. package/.claude/skills/cc-review/SKILL.md +53 -241
  52. package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +2 -2
  53. package/.claude/skills/cc-review/references/implementation-review-branch.md +7 -147
  54. package/.claude/skills/cc-review/references/plan-review-branch.md +5 -147
  55. package/.claude/skills/cc-review/references/review-methods.md +10 -218
  56. package/.claude/skills/cc-review/scripts/collect-review-context.sh +4 -63
  57. package/.claude/skills/cc-roadmap/PLAYBOOK.md +1 -1
  58. package/.claude/skills/cc-roadmap/SKILL.md +3 -3
  59. package/.claude/skills/cc-simplify/CHANGELOG.md +7 -0
  60. package/.claude/skills/cc-simplify/SKILL.md +26 -21
  61. package/.claude/skills/cc-spec-init/PLAYBOOK.md +12 -48
  62. package/.claude/skills/cc-spec-init/SKILL.md +29 -132
  63. package/.claude/skills/cc-spec-init/references/spec-contract.md +8 -17
  64. package/CHANGELOG.md +27 -0
  65. package/README.md +5 -3
  66. package/README.zh-CN.md +5 -3
  67. package/bin/cc-devflow-cli.js +20 -260
  68. package/bin/cc-devflow.js +44 -7
  69. package/docs/commands/README.md +1 -1
  70. package/docs/commands/README.zh-CN.md +1 -1
  71. package/docs/examples/README.md +1 -1
  72. package/docs/examples/START-HERE.md +14 -14
  73. package/docs/examples/example-bindings.json +11 -11
  74. package/docs/examples/full-design-blocked/README.md +4 -6
  75. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/{planning/tasks.md → task.md} +20 -15
  76. package/docs/examples/local-handoff/README.md +8 -11
  77. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/pr-brief.md +31 -0
  78. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/{planning/tasks.md → task.md} +18 -13
  79. package/docs/examples/pdca-loop/README.md +6 -9
  80. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +9 -11
  81. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/{planning/tasks.md → task.md} +18 -13
  82. package/docs/examples/scripts/check-example-bindings.sh +11 -62
  83. package/docs/guides/artifact-contract.md +10 -36
  84. package/docs/guides/getting-started.md +8 -7
  85. package/docs/guides/getting-started.zh-CN.md +8 -7
  86. package/docs/guides/minimize-artifacts.md +16 -116
  87. package/docs/guides/project-postmortem.md +14 -71
  88. package/lib/compiler/__tests__/skills-registry.test.js +9 -8
  89. package/lib/compiler/resource-copier.js +29 -0
  90. package/lib/skill-runtime/__tests__/archive-change.test.js +2 -2
  91. package/lib/skill-runtime/__tests__/benchmark-skills.test.js +109 -0
  92. package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +14 -4
  93. package/lib/skill-runtime/errors.js +3 -3
  94. package/lib/skill-runtime/index.js +5 -23
  95. package/lib/skill-runtime/paths.js +5 -52
  96. package/lib/skill-runtime/query-registry.js +4 -4
  97. package/lib/skill-runtime/query.js +89 -201
  98. package/lib/skill-runtime/store.js +4 -40
  99. package/lib/skill-runtime/trace.js +2 -2
  100. package/package.json +5 -7
  101. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_PRINCIPLES_TEMPLATE.md +0 -29
  102. package/.claude/skills/cc-act/assets/RELEASE_NOTE_TEMPLATE.md +0 -54
  103. package/.claude/skills/cc-act/scripts/generate-status-report.sh +0 -92
  104. package/.claude/skills/cc-act/scripts/sync-act-docs.sh +0 -355
  105. package/.claude/skills/cc-check/assets/REPORT_CARD_TEMPLATE.json +0 -234
  106. package/.claude/skills/cc-check/scripts/render-report-card.js +0 -438
  107. package/.claude/skills/cc-check/scripts/verify-gate.sh +0 -85
  108. package/.claude/skills/cc-do/scripts/build-task-context.sh +0 -175
  109. package/.claude/skills/cc-do/scripts/record-review-decision.sh +0 -88
  110. package/.claude/skills/cc-do/scripts/recover-workflow.sh +0 -82
  111. package/.claude/skills/cc-do/scripts/run-problem-analysis.sh +0 -70
  112. package/.claude/skills/cc-do/scripts/verify-task-gates.sh +0 -109
  113. package/.claude/skills/cc-do/scripts/write-task-checkpoint.sh +0 -92
  114. package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +0 -225
  115. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +0 -179
  116. package/.claude/skills/cc-spec-init/assets/CHANGE_META_TEMPLATE.json +0 -28
  117. package/.claude/skills/cc-spec-init/scripts/validate-spec-links.sh +0 -45
  118. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +0 -234
  119. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +0 -488
  120. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/review/report-card.json +0 -189
  121. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/resume-index.md +0 -39
  122. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/status.md +0 -29
  123. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +0 -123
  124. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +0 -292
  125. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/review/report-card.json +0 -136
  126. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/status.md +0 -29
  127. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +0 -124
  128. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +0 -292
  129. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/review/report-card.json +0 -136
  130. package/docs/get-shit-done-strategy-audit.md +0 -518
  131. package/docs/skill-runtime-migration.md +0 -46
  132. package/lib/skill-runtime/__tests__/approve.test.js +0 -92
  133. package/lib/skill-runtime/__tests__/autopilot.test.js +0 -253
  134. package/lib/skill-runtime/__tests__/benchmark-artifacts.test.js +0 -165
  135. package/lib/skill-runtime/__tests__/delegation.test.js +0 -97
  136. package/lib/skill-runtime/__tests__/dispatch.test.js +0 -237
  137. package/lib/skill-runtime/__tests__/intent.test.js +0 -203
  138. package/lib/skill-runtime/__tests__/lifecycle.test.js +0 -169
  139. package/lib/skill-runtime/__tests__/planner.tdd.test.js +0 -331
  140. package/lib/skill-runtime/__tests__/prepare-pr.test.js +0 -126
  141. package/lib/skill-runtime/__tests__/query.test.js +0 -860
  142. package/lib/skill-runtime/__tests__/readiness.test.js +0 -53
  143. package/lib/skill-runtime/__tests__/release.test.js +0 -85
  144. package/lib/skill-runtime/__tests__/review-check-integration.test.js +0 -148
  145. package/lib/skill-runtime/__tests__/review-records.test.js +0 -619
  146. package/lib/skill-runtime/__tests__/runtime.integration.test.js +0 -351
  147. package/lib/skill-runtime/__tests__/schemas.test.js +0 -337
  148. package/lib/skill-runtime/__tests__/task-contract-migrate.test.js +0 -137
  149. package/lib/skill-runtime/__tests__/task-contract.test.js +0 -783
  150. package/lib/skill-runtime/__tests__/team-state.test.js +0 -51
  151. package/lib/skill-runtime/__tests__/verify-artifacts.test.js +0 -203
  152. package/lib/skill-runtime/__tests__/worker-run.test.js +0 -275
  153. package/lib/skill-runtime/__tests__/worker.test.js +0 -56
  154. package/lib/skill-runtime/__tests__/workflow-context-legacy-fallback.test.js +0 -31
  155. package/lib/skill-runtime/__tests__/workflow-context.test.js +0 -98
  156. package/lib/skill-runtime/artifacts.js +0 -88
  157. package/lib/skill-runtime/context-index.js +0 -545
  158. package/lib/skill-runtime/delegation.js +0 -533
  159. package/lib/skill-runtime/intent.js +0 -309
  160. package/lib/skill-runtime/lifecycle.js +0 -294
  161. package/lib/skill-runtime/operations/CLAUDE.md +0 -19
  162. package/lib/skill-runtime/operations/approve.js +0 -81
  163. package/lib/skill-runtime/operations/autopilot-core.js +0 -337
  164. package/lib/skill-runtime/operations/autopilot-execution.js +0 -307
  165. package/lib/skill-runtime/operations/autopilot-shared.js +0 -48
  166. package/lib/skill-runtime/operations/autopilot.js +0 -163
  167. package/lib/skill-runtime/operations/dispatch.js +0 -416
  168. package/lib/skill-runtime/operations/init.js +0 -60
  169. package/lib/skill-runtime/operations/janitor.js +0 -61
  170. package/lib/skill-runtime/operations/plan.js +0 -59
  171. package/lib/skill-runtime/operations/prepare-pr.js +0 -25
  172. package/lib/skill-runtime/operations/release.js +0 -99
  173. package/lib/skill-runtime/operations/resume.js +0 -126
  174. package/lib/skill-runtime/operations/review-records.js +0 -265
  175. package/lib/skill-runtime/operations/snapshot.js +0 -45
  176. package/lib/skill-runtime/operations/task-contract.js +0 -524
  177. package/lib/skill-runtime/operations/verify.js +0 -170
  178. package/lib/skill-runtime/operations/worker-run.js +0 -531
  179. package/lib/skill-runtime/operations/worker.js +0 -33
  180. package/lib/skill-runtime/planner.js +0 -539
  181. package/lib/skill-runtime/readiness.js +0 -84
  182. package/lib/skill-runtime/review-records.js +0 -123
  183. package/lib/skill-runtime/review.js +0 -855
  184. package/lib/skill-runtime/schemas.js +0 -746
  185. package/lib/skill-runtime/task-contract.js +0 -187
  186. package/lib/skill-runtime/team-state.js +0 -122
  187. package/lib/skill-runtime/workflow-context.js +0 -748
@@ -1,55 +1,19 @@
1
1
  # CC-Spec-Init Playbook
2
2
 
3
- ## Core Rules
3
+ ## Role
4
4
 
5
- 1. 先定 capability 边界,再写 spec 文本。
6
- 2. `spec` 记录现状,`roadmap` 记录未来,`change-meta` 记录桥接。
7
- 3. 同一个 change 可以多挂 capability,但只能有一个 primary capability。
8
- 4. 正常演化优先 `deprecated` / `merged` / `split`,不要直接物理删除。
9
- 5. 每次变更结束都跑链接校验,别把断链留到下轮执行。
5
+ Specs record current capability truth. Roadmap records future work. Git records process history.
10
6
 
11
- ## Standard Modes
7
+ ## Flow
12
8
 
13
- ### Bootstrap
9
+ 1. Read existing `devflow/specs/INDEX.md`.
10
+ 2. Read related capability specs.
11
+ 3. Decide whether the work is bootstrap, create, split, merge, deprecate, or language cleanup.
12
+ 4. Update spec Markdown only.
13
+ 5. Commit the spec change.
14
14
 
15
- - `devflow/specs/INDEX.md`
16
- - 建 `devflow/specs/capabilities/`
17
- - 为当前最重要的 capability 建最小 truth source
15
+ ## Do Not
18
16
 
19
- ### Create
20
-
21
- - capability spec
22
- - 回写 `INDEX.md`
23
- - 为当前 change 生成 `change-meta.json`
24
-
25
- ### Update Links
26
-
27
- - 修 roadmap / backlog / change / spec 的 capability 引用
28
- - 重建 `INDEX.md`
29
-
30
- ### Split / Merge / Deprecate
31
-
32
- - 在原 capability spec 标明状态变化
33
- - 补 `splitInto` / `mergedInto` / `supersededBy`
34
- - 确认历史 change 仍然可追踪
35
-
36
- ## Command Kit
37
-
38
- ```bash
39
- # 初始化 specs 目录
40
- bash .claude/skills/cc-spec-init/scripts/bootstrap-specs.sh
41
-
42
- # 校验 spec 链路
43
- bash .claude/skills/cc-spec-init/scripts/validate-spec-links.sh
44
-
45
- # 看哪些 change 已缺 change-meta
46
- find devflow/changes -maxdepth 2 -name change-meta.json | sort
47
- ```
48
-
49
- ## Review Questions
50
-
51
- 1. capability 的边界是否清楚到 AI 不会把别的系统能力写进来?
52
- 2. `Current Truth` 是否只写当前成立的承诺?
53
- 3. `Missing` 和 `Intentional Gaps` 是否被保留下来?
54
- 4. roadmap item 和 change 是否都能指向 capability?
55
- 5. 这次是该 `update`,还是其实应该 `split` / `merge`?
17
+ - Do not create change-scoped JSON.
18
+ - Do not store workflow state in specs.
19
+ - Do not turn one requirement's implementation detail into capability truth.
@@ -1,148 +1,45 @@
1
1
  ---
2
2
  name: cc-spec-init
3
- version: 1.1.0
4
- description: Use when you need to initialize capability specs under `devflow/specs/`, create or evolve capability truth sources, generate `change-meta.json`, or validate roadmap/change/spec links before roadmap, planning, or closeout work continues.
3
+ version: 1.2.0
4
+ description: Use when you need to initialize or evolve capability specs under `devflow/specs/`.
5
+ reads:
6
+ - PLAYBOOK.md
7
+ - references/spec-contract.md
8
+ - assets/INDEX_TEMPLATE.md
9
+ - assets/CAPABILITY_TEMPLATE.md
10
+ writes:
11
+ - path: devflow/specs/INDEX.md
12
+ durability: durable
13
+ required: false
14
+ - path: devflow/specs/capabilities/<capability>.md
15
+ durability: durable
16
+ required: false
17
+ effects:
18
+ - capability truth source initialization or update
19
+ - Git commit after spec work completes
5
20
  ---
6
21
 
7
22
  # CC-Spec-Init
8
23
 
9
- > [PROTOCOL]: 变更时同步更新 `version`、`CHANGELOG.md`、相关模板/脚本引用,然后检查 `CLAUDE.md`
24
+ `cc-spec-init` maintains long-lived capability specs. It is not a process-state generator.
10
25
 
11
- ## Role
12
-
13
- `cc-spec-init` 是 capability-centered spec 的收口器。
14
-
15
- 它只做一件事:把系统“当前承诺什么”收成稳定 truth source,并把 `roadmap -> change -> spec` 的链接补齐。
16
-
17
- 它不是主 workflow 的一环。
18
-
19
- 主 workflow 仍然是:
20
-
21
- - `cc-roadmap`
22
- - `cc-plan` 或 `cc-investigate`
23
- - `cc-do`
24
- - `cc-check`
25
- - `cc-act`
26
-
27
- `cc-spec-init` 负责这些动作:
28
-
29
- - 初始化 `devflow/specs/`
30
- - 新建 capability spec
31
- - 对 capability 做 `split` / `merge` / `deprecate`
32
- - 生成或修复 `devflow/changes/<change-key>/change-meta.json`
33
- - 重建 `devflow/specs/INDEX.md`
34
- - 校验 capability、roadmap item、change 之间的链接完整性
35
-
36
- ## Runtime Output Policy
37
-
38
- 写入任何 durable Markdown 或 JSON metadata 前,先运行 `cc-devflow config resolve --format policy`。
39
-
40
- - `Output language` 是机器约束,capability spec、`devflow/specs/INDEX.md` 和 `change-meta.json` 必须记录并遵守它。
41
- - `agent_preferences` 是用户偏好建议,只影响表达方式和结构选择,不覆盖本 Skill 的工作流边界。
42
- - 如果配置解析失败,先修配置或向用户说明阻塞,不要用默认语言继续生成正式文档。
43
-
44
- ## Read First
45
-
46
- 1. `PLAYBOOK.md`
47
- 2. `CHANGELOG.md`
48
- 3. `references/spec-contract.md`
49
- 4. `assets/INDEX_TEMPLATE.md`
50
- 5. `assets/CAPABILITY_TEMPLATE.md`
51
- 6. `assets/CHANGE_META_TEMPLATE.json`
52
-
53
- ## Use This Skill When
54
-
55
- - 你第一次把仓库升级到 capability-centered spec 模型
56
- - 需要创建新 capability spec
57
- - 需要把 change 绑定到 primary / secondary capability
58
- - 需要做 capability 的 `split` / `merge` / `deprecate`
59
- - `cc-roadmap`、`cc-plan`、`cc-act` 发现 spec 链路断了
60
- - 需要在 closeout 前确认 spec/roadmap/change 仍然同构
61
-
62
- 如果当前工作只是执行一个已冻结任务,不要停在这里,回主 workflow。
63
-
64
- ## Entry Gate
65
-
66
- 1. 先读现有 `devflow/specs/INDEX.md`、相关 capability spec、相关 `devflow/ROADMAP.md` / `devflow/BACKLOG.md`、相关 `change-meta.json`。
67
- 2. 先判断你是在做 `bootstrap`、`create`、`update-links`、`split`、`merge` 还是 `deprecate`。
68
- 3. 先锁定 capability 边界,再写模板;不要先写 prose 再猜结构。
69
- 4. 先明确 primary capability,再允许 secondary capabilities 存在。
70
- 5. 先检查命名是否已经有 canonical term;同义词、歧义词和关系约束没收口前,不要新建第二套 capability 名称。
71
-
72
- ## Session Protocol
73
-
74
- 1. 先判断现状:
75
- - `devflow/specs/` 是否已存在
76
- - capability 是否已存在
77
- - 相关 change 是否已有 `change-meta.json`
78
- 2. 如果是首次初始化:
79
- - 创建 `devflow/specs/INDEX.md`
80
- - 创建 `devflow/specs/capabilities/`
81
- - 为当前已知 capability 写最小 spec
82
- 3. 如果是新 capability:
83
- - 先写 capability 边界、约束、当前 truth、gaps
84
- - 再写最小 language block:canonical term、definition、aliases to avoid、relationships、flagged ambiguities
85
- - 再登记到 `INDEX.md`
86
- 4. 如果是 change 绑定:
87
- - 生成或更新 `change-meta.json`
88
- - 填入 `primaryCapability`、`secondaryCapabilities`、`expectedDelta`、`affectedInvariants`、`gapsClosed`、`newGaps`
89
- 5. 如果是 capability 结构调整:
90
- - 优先 `deprecated` / `mergedInto` / `splitInto`
91
- - 不要直接物理删除,除非确认没有 roadmap/change 仍在引用
92
- 6. 结束前运行链接校验,确认:
93
- - `INDEX.md` 引到的 capability 文件都存在
94
- - `change-meta.json` 里的 capability 都能落到 spec
95
- - roadmap / backlog 里的 capability 引用仍可追踪
96
- - 新 capability 的名称、aliases、relationships 没有和已有 spec 冲突
97
-
98
- ## Language Boundary Gate
99
-
100
- capability spec 是长期 truth source,命名必须比一次需求更稳定:
101
-
102
- - canonical term:只选一个主名,优先沿用 roadmap、历史 design/analysis、代码公共接口和用户领域语言里已经稳定的词。
103
- - aliases to avoid:记录容易混用的别名,说明为什么不能继续用。
104
- - flagged ambiguity:同一个词指向两个概念时,必须写清拆分边界,必要时拆 capability。
105
- - relationships:用一句话写清 capability 之间的拥有、依赖、生命周期、输入输出或互斥关系。
106
- - implementation names:类名、文件名、函数名只有在它们已经是公共领域语言时才进入 spec;否则留在 change 设计里。
107
-
108
- ## Output
26
+ Allowed outputs:
109
27
 
110
28
  - `devflow/specs/INDEX.md`
111
29
  - `devflow/specs/capabilities/<capability>.md`
112
- - `devflow/changes/<change-key>/change-meta.json`
113
- - 链接校验结果
114
-
115
- ## Working Rules
116
30
 
117
- 1. `spec` 写现状,不写一次性推导过程。
118
- 2. `roadmap` 写未来推进,不写当前 truth。
119
- 3. `change-meta.json` 是机器真相源;capability markdown 是人机共读的长期约束源。
120
- 4. 一个 change 可以挂多个 capability,但必须有一个 `primaryCapability`。
121
- 5. capability 不直接硬删除;优先用状态表达历史连续性。
122
- 6. `INDEX.md` 只做目录和状态总览,不复制各 spec 正文。
31
+ Do not create change-scoped JSON. Changes link to specs through `task.md`, roadmap text, PR text, and Git commits.
123
32
 
124
- ## Bundled Resources
33
+ ## Use This Skill When
125
34
 
126
- - 变更记录:`CHANGELOG.md`
127
- - 使用剧本:`PLAYBOOK.md`
128
- - 契约:`references/spec-contract.md`
129
- - 模板:`assets/INDEX_TEMPLATE.md`
130
- - 模板:`assets/CAPABILITY_TEMPLATE.md`
131
- - 模板:`assets/CHANGE_META_TEMPLATE.json`
132
- - 初始化:`scripts/bootstrap-specs.sh`
133
- - 校验:`scripts/validate-spec-links.sh`
35
+ - initializing `devflow/specs/`
36
+ - creating a capability spec
37
+ - splitting, merging, or deprecating a capability
38
+ - clarifying canonical project language
134
39
 
135
40
  ## Exit Criteria
136
41
 
137
- - `devflow/specs/` 已建立或已修复
138
- - 相关 capability spec 有明确边界、约束、truth、gaps
139
- - 相关 change 已有 `change-meta.json`
140
- - `INDEX.md`、roadmap、change、spec 之间的链接可追踪
141
- - 下一步可以安心回到 `cc-roadmap`、`cc-plan` 或 `cc-act`
142
-
143
- ## Do Not
144
-
145
- - 不把 roadmap 写回 spec
146
- - 不把执行细节写成 capability truth
147
- - 不允许没有 primary capability 的多 capability change
148
- - 不直接删 capability 文件导致链路断裂
42
+ - capability boundary is clear
43
+ - current truth and gaps are written
44
+ - `INDEX.md` links to existing capability files
45
+ - spec changes are committed to Git
@@ -1,22 +1,13 @@
1
1
  # Spec Contract
2
2
 
3
- ## Truth Layers
3
+ ## Files
4
4
 
5
- - `devflow/ROADMAP.md` / `devflow/BACKLOG.md`: 未来推进什么 capability
6
- - `devflow/specs/INDEX.md`: capability 总目录与当前状态快照
7
- - `devflow/specs/capabilities/*.md`: 某个 capability 当前承诺什么
8
- - `devflow/changes/<change>/change-meta.json`: 某次 change 如何影响 capability
5
+ - `devflow/specs/INDEX.md`
6
+ - `devflow/specs/capabilities/<capability>.md`
9
7
 
10
- ## Capability Rules
8
+ ## Rules
11
9
 
12
- 1. 以用户可感知能力为主,内部系统能力为辅。
13
- 2. `Boundary`、`Invariants`、`Current Truth` 是核心,不要被 narrative 淹没。
14
- 3. `Missing` `Intentional Gaps` 必须长期保留。
15
- 4. capability 名称要稳定、可重用,不要按一次需求命名。
16
-
17
- ## Change Meta Rules
18
-
19
- 1. `primaryCapability` 必填。
20
- 2. `secondaryCapabilities` 可空,但必须有明确原因。
21
- 3. `changeType` 只使用:`create`、`update`、`split`、`merge`、`deprecate`。
22
- 4. `syncStatus` 生命周期:`planned -> verified -> synced`。
10
+ - Specs describe stable capability truth.
11
+ - Specs do not track per-change state.
12
+ - Per-change decisions live in `task.md`, PR text, commits, or postmortems.
13
+ - Capability names must follow project language and avoid duplicate terms.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [4.5.12] - 2026-05-13
13
+
14
+ ### Changed
15
+
16
+ - Changed `cc-devflow task-contract` so task document budgets are advisory warnings instead of blocking validation failures.
17
+ - Changed `npm run benchmark:skills` so skill entrypoint budgets report advisory failures without failing `npm run verify`.
18
+ - Updated `cc-plan` and `cc-investigate` to preserve required task-template fields instead of trimming contract truth to fit token estimates.
19
+
20
+ ### Fixed
21
+
22
+ - Fixed `task-contract compile` so shorthand task checklists fail before `task-manifest.json` or `change-meta.json` can be generated.
23
+ - Added task-template validation to reject incomplete task blocks with `C11` instead of letting default manifest enrichment hide missing contract fields.
24
+
25
+ ## [4.5.11] - 2026-05-13
26
+
27
+ ### Added
28
+
29
+ - Added `npm run benchmark:skills` to keep public skill entrypoints under explicit context budgets.
30
+
31
+ ### Changed
32
+
33
+ - Slimmed the `cc-plan` public entrypoint into a thin harness contract and moved low-frequency planning/review rules behind conditional references.
34
+ - Slimmed the `cc-investigate` public entrypoint into a thin root-cause contract and moved low-frequency debug rules behind conditional references.
35
+ - Updated `cc-plan` and `cc-investigate` to require CLI-owned machine artifacts: agents write `planning/tasks.md`, then run `cc-devflow task-contract compile` / `validate` for `task-manifest.json` and `change-meta.json`.
36
+ - Internalized the new PDCA/IDCA operating principles into the stage skills themselves: assumptions and simplicity in plan/investigate, surgical read-before-write execution in do, fresh intent-focused proof in check, and explicit checkpoint/ship blockers in dev/act.
37
+ - Updated `npm run verify` to include `benchmark:skills` after tests, example binding checks, and artifact verification.
38
+
12
39
  ## [4.5.10] - 2026-05-13
13
40
 
14
41
  ### Added
package/README.md CHANGED
@@ -118,7 +118,7 @@ Canonical language and durable decisions stay inside cc-devflow-native sources:
118
118
 
119
119
  `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.
120
120
 
121
- Every post-planning stage can start from `cc-devflow query workflow-context --change <id> --change-key <key> --data-only --no-trace --compact`. Treat the result as a context index, not semantic compression: it routes the next stage, names the current task, carries source hashes, `mustNotForget` constraints, default section/JSON refs, trusted commands, fail-closed rules, and machine-readable deep-open conditions. Source artifacts still decide disputed facts. This primarily reduces stage-routing and context-reset reads; end-to-end PDCA/IDCA savings depend on how often agents open `defaultOpen` and `deepOpen` refs. Use `npm run benchmark:workflow-context` to inspect token estimates plus routing correctness over the checked-in and synthetic examples.
121
+ Every post-planning stage can start from `cc-devflow query workflow-context --change <id> --change-key <key> --data-only --no-trace --compact`. Treat the result as a context index, not semantic compression: it routes the next stage, names the current task, carries source hashes, `mustNotForget` constraints, default section/JSON refs, trusted commands, fail-closed rules, and machine-readable deep-open conditions. Source artifacts still decide disputed facts. This primarily reduces stage-routing and context-reset reads; end-to-end PDCA/IDCA savings depend on how often agents open `defaultOpen` and `deepOpen` refs. Use `npm run benchmark:workflow-context` to inspect token estimates plus routing correctness over the checked-in and synthetic examples. Use `npm run benchmark:skills` to keep public skill entrypoints thin; deeper planning rules should live behind conditional references instead of default context.
122
122
 
123
123
  `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 reads prior review records and current git/artifact delta, then records review lifecycle events through `cc-devflow review start`, `record-node`, `add-finding`, and `close` into `review-ledger.jsonl`. Human Markdown reports are rendered on demand with `cc-devflow review render`. When the host supports subagents, selected nodes can be dispatched to independent read-only reviewers so strategy, engineering, design, DX, smell, test, and runtime checks do not share one contaminated context. Broad implementation reviews can use separate risk lanes for intent/regression, security/privacy, performance/reliability, and contracts/coverage before the main thread triages raw findings. 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`.
124
124
 
@@ -244,9 +244,10 @@ The currently distributed skill folders are:
244
244
 
245
245
  - `devflow/specs/` stores durable capability truth: `INDEX.md` plus `capabilities/*.md`.
246
246
  - 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.
247
- - `devflow/changes/<change>/` stores durable change truth: `change-meta.json`, `planning/tasks.md`, CLI-generated `task-manifest.json`, review ledger/findings records, optional CLI logs for debug/failure, `report-card.json`, and one final handoff file. Task `context.md`, `checkpoint.json`, review markdown, and AI-written process files are not default durable truth.
247
+ - `devflow/changes/<change>/` stores durable change truth: CLI-generated `change-meta.json`, `planning/tasks.md`, CLI-generated `task-manifest.json`, review ledger/findings records, optional CLI logs for debug/failure, `report-card.json`, and one final handoff file. Task `context.md`, `checkpoint.json`, review markdown, and AI-written process files are not default durable truth.
248
248
  - New changes default to one human-authored Markdown artifact: `planning/tasks.md`. Feature plans put the frozen design in `## Contract Summary`; bug investigations put root-cause truth in `## Root Cause Contract`. Legacy `planning/design.md`, `planning/analysis.md`, and `cc-review-*.md` remain fallback inputs, not new default writes.
249
- - Use `cc-devflow task-contract validate`, `npm run verify:artifacts`, and `npm run benchmark:artifacts` to keep workflow artifacts small and measurable.
249
+ - Machine JSON is CLI-owned: write the human contract in `planning/tasks.md`, then run `cc-devflow task-contract compile` / `validate`; do not handwrite `task-manifest.json` or `change-meta.json`.
250
+ - Use `cc-devflow task-contract validate`, `npm run verify:artifacts`, `npm run benchmark:artifacts`, and `npm run benchmark:skills` to keep workflow artifacts and skill entrypoints small and measurable.
250
251
  - `devflow/workspaces/<change>/` stores ephemeral runtime scratch such as worker assignment, journals, prompts, and session logs.
251
252
  - Regenerable files should not be persisted under `devflow/changes/`.
252
253
 
@@ -256,6 +257,7 @@ Artifact contract quick checks:
256
257
  npx cc-devflow task-contract validate --change REQ-001 --change-key REQ-001-copy-invite-link
257
258
  npm run verify:artifacts
258
259
  npm run benchmark:artifacts
260
+ npm run benchmark:skills
259
261
  ```
260
262
 
261
263
  For complete artifact examples, start with [`docs/examples/START-HERE.md`](./docs/examples/START-HERE.md). Example version bindings live in [`docs/examples/example-bindings.json`](./docs/examples/example-bindings.json). Migration and authoring guidance for the minimized artifact contract lives in [`docs/guides/minimize-artifacts.md`](./docs/guides/minimize-artifacts.md).
package/README.zh-CN.md CHANGED
@@ -118,7 +118,7 @@ Canonical language 和 durable decisions 只收敛到 cc-devflow 原生真相源
118
118
 
119
119
  `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 不再漂移。
120
120
 
121
- planning 之后的每个阶段都可以先运行 `cc-devflow query workflow-context --change <id> --change-key <key> --data-only --no-trace --compact`。把结果当成 context index,而不是语义压缩:它负责路由下一阶段、标记当前 task、携带 source hash、`mustNotForget` 约束、默认 section/JSON refs、可信命令、fail-closed 规则和机器可读 deep-open 条件;有争议的事实仍由源 artifact 裁决。它主要降低 stage-routing 和 context-reset 的读取成本;端到端 PDCA/IDCA 节省取决于 agent 实际打开多少 `defaultOpen` 和 `deepOpen` refs。可用 `npm run benchmark:workflow-context` 查看仓库示例和合成用例上的 token 估算与路由正确性。
121
+ planning 之后的每个阶段都可以先运行 `cc-devflow query workflow-context --change <id> --change-key <key> --data-only --no-trace --compact`。把结果当成 context index,而不是语义压缩:它负责路由下一阶段、标记当前 task、携带 source hash、`mustNotForget` 约束、默认 section/JSON refs、可信命令、fail-closed 规则和机器可读 deep-open 条件;有争议的事实仍由源 artifact 裁决。它主要降低 stage-routing 和 context-reset 的读取成本;端到端 PDCA/IDCA 节省取决于 agent 实际打开多少 `defaultOpen` 和 `deepOpen` refs。可用 `npm run benchmark:workflow-context` 查看仓库示例和合成用例上的 token 估算与路由正确性。用 `npm run benchmark:skills` 保持 public skill 入口足够薄;深层规划规则应该放在条件 reference 后面,而不是默认上下文里。
122
122
 
123
123
  `cc-review` 是可选的深度 Review,不替代 `cc-check`。它可以接在 `cc-plan` / `cc-investigate` 后审冻结的计划或根因合同,也可以接在 `cc-do` 后审实现。它先读取上次 Review 记录和当前 git/artifact delta,再通过 `cc-devflow review start`、`record-node`、`add-finding`、`close` 把生命周期事件写进 `review-ledger.jsonl`。需要人类 Markdown 报告时,再用 `cc-devflow review render` 按需渲染。宿主支持 subAgent 时,选中的节点可以派给独立只读 reviewer,让 strategy、engineering、design、DX、坏味道、测试和运行时审查不共享同一个被污染的上下文。复杂实现 Review 可以把 intent/regression、security/privacy、performance/reliability、contracts/coverage 拆成独立风险 lane,再由主线程聚合和筛掉弱 findings。计划 Review 通过渐进式 references 借鉴 strategy / design / engineering / DX 方法;实现 Review 检查 diff 范围、代码坏味道、测试、UI/runtime 行为、Browser/Computer Use 证据和日志。Finding 回到 `cc-plan` 或 `cc-do`;实现 Review 干净后再进入 `cc-check`。
124
124
 
@@ -244,9 +244,10 @@ npx cc-devflow config doctor --cwd /path/to/your/project
244
244
 
245
245
  - `devflow/specs/` 保存 durable capability truth:`INDEX.md` 和 `capabilities/*.md`。
246
246
  - 新 change 目录使用 `REQ-<number>-<description>` 表示需求,使用 `FIX-<number>-<description>` 表示 Bug 修复。`REQ` 和 `FIX` 各自递增自己的编号,跨前缀同号允许共存。并行工作树也可能产生重复编号,必须用完整 change key 的描述区分业务内容。
247
- - `devflow/changes/<change>/` 保存 durable change truth:`change-meta.json`、`planning/tasks.md`、CLI 生成的 `task-manifest.json`、review ledger / findings 记录、debug / failed 的可选 CLI 日志、`report-card.json` 和唯一最终 handoff 文件。任务级 `context.md`、`checkpoint.json`、review markdown 和 AI 手写过程文件不是默认 durable truth。
247
+ - `devflow/changes/<change>/` 保存 durable change truth:CLI 生成的 `change-meta.json`、`planning/tasks.md`、CLI 生成的 `task-manifest.json`、review ledger / findings 记录、debug / failed 的可选 CLI 日志、`report-card.json` 和唯一最终 handoff 文件。任务级 `context.md`、`checkpoint.json`、review markdown 和 AI 手写过程文件不是默认 durable truth。
248
248
  - 新 change 默认只有一个人工编写的 Markdown artifact:`planning/tasks.md`。功能计划把冻结设计写进 `## Contract Summary`;Bug 调查把根因真相写进 `## Root Cause Contract`。历史 `planning/design.md`、`planning/analysis.md` 和 `cc-review-*.md` 只作为旧 change 的 fallback 输入,不再是新默认写入。
249
- - `cc-devflow task-contract validate`、`npm run verify:artifacts` `npm run benchmark:artifacts` 保持 workflow artifact 小而可测。
249
+ - 机器态 JSON 归 CLI 所有:先把人类合同写进 `planning/tasks.md`,再运行 `cc-devflow task-contract compile` / `validate`;不要手写 `task-manifest.json` `change-meta.json`。
250
+ - 用 `cc-devflow task-contract validate`、`npm run verify:artifacts`、`npm run benchmark:artifacts` 和 `npm run benchmark:skills` 保持 workflow artifact 与 skill 入口小而可测。
250
251
  - `devflow/workspaces/<change>/` 保存 ephemeral runtime scratch,例如 worker assignment、journal、prompt 和 session log。
251
252
  - 能从 durable truth 再生成的文件,不应该持久化到 `devflow/changes/`。
252
253
 
@@ -256,6 +257,7 @@ Artifact contract 快速检查:
256
257
  npx cc-devflow task-contract validate --change REQ-001 --change-key REQ-001-copy-invite-link
257
258
  npm run verify:artifacts
258
259
  npm run benchmark:artifacts
260
+ npm run benchmark:skills
259
261
  ```
260
262
 
261
263
  想先看完整产物链,可以从 [`docs/examples/START-HERE.md`](./docs/examples/START-HERE.md) 开始。样例和 Skill 的版本绑定真相源在 [`docs/examples/example-bindings.json`](./docs/examples/example-bindings.json)。最小 artifact 合同的迁移与编写指南在 [`docs/guides/minimize-artifacts.md`](./docs/guides/minimize-artifacts.md)。