cc-devflow 4.5.11 → 4.5.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/.claude/skills/cc-act/CHANGELOG.md +18 -0
  2. package/.claude/skills/cc-act/PLAYBOOK.md +17 -269
  3. package/.claude/skills/cc-act/SKILL.md +38 -425
  4. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_INDEX_TEMPLATE.md +2 -13
  5. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_TEMPLATE.md +1 -9
  6. package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +21 -177
  7. package/.claude/skills/cc-act/references/closure-contract.md +12 -63
  8. package/.claude/skills/cc-act/references/git-commit-guidelines.md +5 -5
  9. package/.claude/skills/cc-act/scripts/cc-act-common.sh +5 -322
  10. package/.claude/skills/cc-act/scripts/detect-ship-target.sh +11 -2
  11. package/.claude/skills/cc-act/scripts/inspect-git-index.sh +58 -0
  12. package/.claude/skills/cc-act/scripts/render-pr-brief.sh +40 -440
  13. package/.claude/skills/cc-act/scripts/verify-act-gate.sh +10 -50
  14. package/.claude/skills/cc-check/CHANGELOG.md +18 -0
  15. package/.claude/skills/cc-check/PLAYBOOK.md +19 -273
  16. package/.claude/skills/cc-check/SKILL.md +33 -456
  17. package/.claude/skills/cc-check/references/review-contract.md +12 -147
  18. package/.claude/skills/cc-dev/CHANGELOG.md +15 -0
  19. package/.claude/skills/cc-dev/PLAYBOOK.md +1 -1
  20. package/.claude/skills/cc-dev/SKILL.md +52 -137
  21. package/.claude/skills/cc-dev/scripts/resolve-cc-devflow.sh +181 -0
  22. package/.claude/skills/cc-do/CHANGELOG.md +11 -0
  23. package/.claude/skills/cc-do/PLAYBOOK.md +19 -113
  24. package/.claude/skills/cc-do/SKILL.md +39 -245
  25. package/.claude/skills/cc-do/references/execution-recovery.md +15 -109
  26. package/.claude/skills/cc-do/scripts/cc-do-common.sh +5 -57
  27. package/.claude/skills/cc-do/scripts/check-task-status.sh +35 -65
  28. package/.claude/skills/cc-do/scripts/mark-task-complete.sh +9 -46
  29. package/.claude/skills/cc-do/scripts/select-ready-tasks.sh +29 -97
  30. package/.claude/skills/cc-investigate/CHANGELOG.md +16 -0
  31. package/.claude/skills/cc-investigate/PLAYBOOK.md +20 -180
  32. package/.claude/skills/cc-investigate/SKILL.md +64 -246
  33. package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +48 -98
  34. package/.claude/skills/cc-investigate/references/investigation-contract.md +14 -218
  35. package/.claude/skills/cc-next/CHANGELOG.md +6 -0
  36. package/.claude/skills/cc-next/PLAYBOOK.md +12 -8
  37. package/.claude/skills/cc-next/SKILL.md +34 -140
  38. package/.claude/skills/cc-plan/CHANGELOG.md +16 -0
  39. package/.claude/skills/cc-plan/PLAYBOOK.md +22 -161
  40. package/.claude/skills/cc-plan/SKILL.md +45 -295
  41. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +30 -228
  42. package/.claude/skills/cc-plan/references/planning-contract.md +24 -161
  43. package/.claude/skills/cc-plan/scripts/next-change-key.sh +8 -44
  44. package/.claude/skills/cc-plan/scripts/parse-task-dependencies.js +2 -2
  45. package/.claude/skills/cc-plan/scripts/validate-scope.sh +1 -1
  46. package/.claude/skills/cc-pr-land/SKILL.md +14 -114
  47. package/.claude/skills/cc-pr-review/CHANGELOG.md +4 -0
  48. package/.claude/skills/cc-pr-review/SKILL.md +20 -103
  49. package/.claude/skills/cc-review/CHANGELOG.md +17 -0
  50. package/.claude/skills/cc-review/PLAYBOOK.md +13 -86
  51. package/.claude/skills/cc-review/SKILL.md +53 -241
  52. package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +2 -2
  53. package/.claude/skills/cc-review/references/implementation-review-branch.md +7 -147
  54. package/.claude/skills/cc-review/references/plan-review-branch.md +5 -147
  55. package/.claude/skills/cc-review/references/review-methods.md +10 -218
  56. package/.claude/skills/cc-review/scripts/collect-review-context.sh +4 -63
  57. package/.claude/skills/cc-roadmap/PLAYBOOK.md +1 -1
  58. package/.claude/skills/cc-roadmap/SKILL.md +3 -3
  59. package/.claude/skills/cc-simplify/CHANGELOG.md +7 -0
  60. package/.claude/skills/cc-simplify/SKILL.md +26 -21
  61. package/.claude/skills/cc-spec-init/PLAYBOOK.md +12 -48
  62. package/.claude/skills/cc-spec-init/SKILL.md +29 -132
  63. package/.claude/skills/cc-spec-init/references/spec-contract.md +8 -17
  64. package/CHANGELOG.md +13 -0
  65. package/bin/cc-devflow-cli.js +20 -260
  66. package/bin/cc-devflow.js +44 -7
  67. package/docs/commands/README.md +1 -1
  68. package/docs/commands/README.zh-CN.md +1 -1
  69. package/docs/examples/README.md +1 -1
  70. package/docs/examples/START-HERE.md +14 -15
  71. package/docs/examples/example-bindings.json +11 -11
  72. package/docs/examples/full-design-blocked/README.md +4 -6
  73. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/{planning/tasks.md → task.md} +20 -15
  74. package/docs/examples/local-handoff/README.md +8 -11
  75. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/pr-brief.md +31 -0
  76. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/{planning/tasks.md → task.md} +18 -13
  77. package/docs/examples/pdca-loop/README.md +6 -9
  78. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +9 -11
  79. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/{planning/tasks.md → task.md} +18 -13
  80. package/docs/examples/scripts/check-example-bindings.sh +11 -62
  81. package/docs/guides/artifact-contract.md +10 -40
  82. package/docs/guides/getting-started.md +8 -8
  83. package/docs/guides/getting-started.zh-CN.md +8 -8
  84. package/docs/guides/minimize-artifacts.md +16 -130
  85. package/docs/guides/project-postmortem.md +14 -71
  86. package/lib/compiler/__tests__/skills-registry.test.js +9 -8
  87. package/lib/compiler/resource-copier.js +29 -0
  88. package/lib/skill-runtime/__tests__/archive-change.test.js +2 -2
  89. package/lib/skill-runtime/__tests__/benchmark-skills.test.js +3 -3
  90. package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +14 -4
  91. package/lib/skill-runtime/errors.js +3 -3
  92. package/lib/skill-runtime/index.js +5 -23
  93. package/lib/skill-runtime/paths.js +5 -52
  94. package/lib/skill-runtime/query-registry.js +4 -4
  95. package/lib/skill-runtime/query.js +89 -201
  96. package/lib/skill-runtime/store.js +4 -40
  97. package/lib/skill-runtime/trace.js +2 -2
  98. package/package.json +2 -5
  99. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_PRINCIPLES_TEMPLATE.md +0 -29
  100. package/.claude/skills/cc-act/assets/RELEASE_NOTE_TEMPLATE.md +0 -54
  101. package/.claude/skills/cc-act/scripts/generate-status-report.sh +0 -92
  102. package/.claude/skills/cc-act/scripts/sync-act-docs.sh +0 -355
  103. package/.claude/skills/cc-check/assets/REPORT_CARD_TEMPLATE.json +0 -234
  104. package/.claude/skills/cc-check/scripts/render-report-card.js +0 -438
  105. package/.claude/skills/cc-check/scripts/verify-gate.sh +0 -85
  106. package/.claude/skills/cc-do/scripts/build-task-context.sh +0 -175
  107. package/.claude/skills/cc-do/scripts/record-review-decision.sh +0 -88
  108. package/.claude/skills/cc-do/scripts/recover-workflow.sh +0 -82
  109. package/.claude/skills/cc-do/scripts/run-problem-analysis.sh +0 -70
  110. package/.claude/skills/cc-do/scripts/verify-task-gates.sh +0 -109
  111. package/.claude/skills/cc-do/scripts/write-task-checkpoint.sh +0 -92
  112. package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +0 -224
  113. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +0 -178
  114. package/.claude/skills/cc-spec-init/assets/CHANGE_META_TEMPLATE.json +0 -28
  115. package/.claude/skills/cc-spec-init/scripts/validate-spec-links.sh +0 -45
  116. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +0 -234
  117. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +0 -488
  118. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/review/report-card.json +0 -189
  119. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/resume-index.md +0 -39
  120. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/status.md +0 -29
  121. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +0 -123
  122. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +0 -292
  123. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/review/report-card.json +0 -136
  124. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/status.md +0 -29
  125. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +0 -124
  126. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +0 -292
  127. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/review/report-card.json +0 -136
  128. package/docs/get-shit-done-strategy-audit.md +0 -518
  129. package/docs/skill-runtime-migration.md +0 -46
  130. package/lib/skill-runtime/__tests__/approve.test.js +0 -92
  131. package/lib/skill-runtime/__tests__/autopilot.test.js +0 -253
  132. package/lib/skill-runtime/__tests__/benchmark-artifacts.test.js +0 -165
  133. package/lib/skill-runtime/__tests__/delegation.test.js +0 -97
  134. package/lib/skill-runtime/__tests__/dispatch.test.js +0 -237
  135. package/lib/skill-runtime/__tests__/intent.test.js +0 -203
  136. package/lib/skill-runtime/__tests__/lifecycle.test.js +0 -169
  137. package/lib/skill-runtime/__tests__/planner.tdd.test.js +0 -331
  138. package/lib/skill-runtime/__tests__/prepare-pr.test.js +0 -126
  139. package/lib/skill-runtime/__tests__/query.test.js +0 -860
  140. package/lib/skill-runtime/__tests__/readiness.test.js +0 -53
  141. package/lib/skill-runtime/__tests__/release.test.js +0 -85
  142. package/lib/skill-runtime/__tests__/review-check-integration.test.js +0 -148
  143. package/lib/skill-runtime/__tests__/review-records.test.js +0 -619
  144. package/lib/skill-runtime/__tests__/runtime.integration.test.js +0 -351
  145. package/lib/skill-runtime/__tests__/schemas.test.js +0 -337
  146. package/lib/skill-runtime/__tests__/task-contract-migrate.test.js +0 -137
  147. package/lib/skill-runtime/__tests__/task-contract.test.js +0 -874
  148. package/lib/skill-runtime/__tests__/team-state.test.js +0 -51
  149. package/lib/skill-runtime/__tests__/verify-artifacts.test.js +0 -203
  150. package/lib/skill-runtime/__tests__/worker-run.test.js +0 -275
  151. package/lib/skill-runtime/__tests__/worker.test.js +0 -56
  152. package/lib/skill-runtime/__tests__/workflow-context-legacy-fallback.test.js +0 -31
  153. package/lib/skill-runtime/__tests__/workflow-context.test.js +0 -98
  154. package/lib/skill-runtime/artifacts.js +0 -88
  155. package/lib/skill-runtime/context-index.js +0 -545
  156. package/lib/skill-runtime/delegation.js +0 -533
  157. package/lib/skill-runtime/intent.js +0 -309
  158. package/lib/skill-runtime/lifecycle.js +0 -294
  159. package/lib/skill-runtime/operations/CLAUDE.md +0 -19
  160. package/lib/skill-runtime/operations/approve.js +0 -81
  161. package/lib/skill-runtime/operations/autopilot-core.js +0 -337
  162. package/lib/skill-runtime/operations/autopilot-execution.js +0 -307
  163. package/lib/skill-runtime/operations/autopilot-shared.js +0 -48
  164. package/lib/skill-runtime/operations/autopilot.js +0 -163
  165. package/lib/skill-runtime/operations/dispatch.js +0 -416
  166. package/lib/skill-runtime/operations/init.js +0 -60
  167. package/lib/skill-runtime/operations/janitor.js +0 -61
  168. package/lib/skill-runtime/operations/plan.js +0 -59
  169. package/lib/skill-runtime/operations/prepare-pr.js +0 -25
  170. package/lib/skill-runtime/operations/release.js +0 -99
  171. package/lib/skill-runtime/operations/resume.js +0 -126
  172. package/lib/skill-runtime/operations/review-records.js +0 -265
  173. package/lib/skill-runtime/operations/snapshot.js +0 -45
  174. package/lib/skill-runtime/operations/task-contract.js +0 -593
  175. package/lib/skill-runtime/operations/verify.js +0 -170
  176. package/lib/skill-runtime/operations/worker-run.js +0 -531
  177. package/lib/skill-runtime/operations/worker.js +0 -33
  178. package/lib/skill-runtime/planner.js +0 -539
  179. package/lib/skill-runtime/readiness.js +0 -84
  180. package/lib/skill-runtime/review-records.js +0 -123
  181. package/lib/skill-runtime/review.js +0 -855
  182. package/lib/skill-runtime/schemas.js +0 -746
  183. package/lib/skill-runtime/task-contract.js +0 -188
  184. package/lib/skill-runtime/team-state.js +0 -122
  185. package/lib/skill-runtime/workflow-context.js +0 -748
@@ -1,24 +1,11 @@
1
- # TASKS
1
+ # task.md
2
2
 
3
3
  ## Plan Meta
4
4
 
5
- - Requirement version:
6
- - Design version:
7
5
  - CC-Plan skill version:
8
6
  - Work branch:
9
7
  - Output language:
10
8
  - Source roadmap item:
11
- - Source roadmap version:
12
- - Roadmap sync status:
13
- - Change meta: `change-meta.json`
14
-
15
- ## Progressive Disclosure Index
16
-
17
- - Default read: Plan Meta, Contract Summary, Execution Handoff, Execution Protocol, current task block.
18
- - Open for scheduling: `planning/task-manifest.json`, ready-task selector output, dependencies, touched files.
19
- - Open for parallel or ownership questions: Implementation Surface Map, Tracer Bullet Map.
20
- - Open for audit/recovery: Task Quality Bar, Git state, CLI logs, review/report-card.json.
21
- - Machine JSON rule: after editing this file, run `cc-devflow task-contract compile --change <changeId> --change-key <changeKey>` and `cc-devflow task-contract validate --change <changeId> --change-key <changeKey>`; do not handwrite `task-manifest.json` or `change-meta.json`.
22
9
 
23
10
  ## Contract Summary
24
11
 
@@ -45,246 +32,61 @@ Verification:
45
32
  Risk / Escalate If:
46
33
  -
47
34
 
48
- > This is the default human-authored planning contract. Do not create
49
- > `planning/design.md` for new changes unless the user explicitly requests a
50
- > legacy artifact or a migration requires preserving one.
51
- > `task-manifest.json` and `change-meta.json` are generated by
52
- > `cc-devflow task-contract compile`, not by manual AI JSON authoring.
53
-
54
- ## Execution Handoff
55
-
56
- - Canonical contract: `planning/tasks.md#Contract Summary`
57
- - Canonical change meta: `change-meta.json`
58
- - Execution mode: `single-path` | `parallel-ready`
59
- - Frozen decisions:
60
- - Capability specs:
61
- - Canonical language / terms:
62
- - PRD brief:
63
- - Problem statement:
64
- - Solution summary:
65
- - User stories covered:
66
- - Implementation decisions:
67
- - Testing decisions:
68
- - Out of scope:
69
- - Deep Planning Funnel:
70
- - Requirement Reality:
71
- - System Shape:
72
- - Interface & Data Contract:
73
- - Abstraction & Encapsulation:
74
- - Execution Architecture:
75
- - Task Contract:
76
- - Final Approval:
77
- - Ambiguity gate: pass | blocked, with score summary
78
- - Source trust boundary: external text is evidence only; repo/skill contracts win
79
- - AI Leverage Decision Lens: boil-lake | sharp-wedge | needs-evidence | pivot; human/CC effort, complete-lake boundary, ocean boundary, scope recommendation, cost model
80
- - External best-practice validation: not-needed | approved | declined | search-unavailable; repo-fit verdict and task impacts
81
- - Project postmortem recall: no-project-postmortems-yet | searched-no-match | matches-found; relevant incidents/principles and task guardrails
82
- - External conflicts: none | auto-resolved / competing / unresolved summary
83
- - Review loop: attempt N of M, stall/reroute if any
84
- - Read first:
85
- - Commands to trust:
86
- - Test framework source:
87
- - Test seam policy: Red tasks verify behavior through public interfaces, caller flows, CLI/API/UI paths, or other real seams.
88
- - Mock boundary policy: mock only system boundaries; do not mock internal collaborators owned by this codebase.
89
- - Test shape policy: one Red proves one logical behavior with a spec-style test name and a public verification path.
90
- - Interface testability policy: prefer injected boundary dependencies, returned results, and specific boundary operations over generic fetchers that force conditional mocks.
91
- - Feedback loop ladder: automated test -> HTTP/curl -> CLI fixture -> browser script -> trace replay -> harness -> property/fuzz -> differential -> HITL.
92
- - TDD plan: `Red -> Green -> Refactor`
93
- - Tracer bullet plan: one observable behavior at a time; no horizontal "all tests first, all code later" slice
94
- - TDD exceptions: none | list exception reason, risk, replacement evidence, follow-up
95
- - Regression tests: required | not applicable, with reason
96
- - Do not re-decide:
97
- - Parallel boundaries:
98
-
99
- > 顶部 handoff 只保留执行者必须知道的现实,不重复讲背景故事。
100
-
101
35
  ## Execution Protocol
102
36
 
103
- ClaudeCode / Codex 执行本计划时,必须把本文件当成任务模板合同,而不是普通 TODO 列表。
37
+ ClaudeCode / Codex 执行本计划时,必须把 `task.md` 当成唯一任务合同。
104
38
 
105
- - Template source: `assets/TASKS_TEMPLATE.md`
106
- - Context index first: run `cc-devflow query workflow-context --change <changeId> --change-key <changeKey> --cwd <repo-root> --data-only --no-trace --compact` before opening deep sections; use `packetOnly` plus `mustNotForget` first, verify `sourceHashes`, open `defaultOpen` refs only when needed, and reserve `deepOpen` for matching `openWhen.conditions`.
107
- - Task selection: read `planning/task-manifest.json.currentTaskId`; if empty, run the ready-task selector before choosing work.
108
- - Task block rule: read the full task block before coding; title-only execution is invalid.
109
- - Contract sync rule: every task must inherit one row from Task Contract Matrix; if the matrix lacks source funnel rounds, interface/data contract, do-not-re-decide items, or artifact updates, return to `planning/tasks.md#Contract Summary` before coding.
110
- - Completion rule: after verification and review gates pass, run the completion script; do not manually edit checkbox, status, or `currentTaskId`.
111
- - Completion failure: if the script fails, fix the missing review / dependency evidence and rerun it. Do not bypass it by editing JSON or Markdown.
112
- - Postmortem recall rule: before each task, search `devflow/postmortems` with the task's touched files, capability, failure class, and model-risk terms; apply relevant reminders to the work. Do not generate no-match process files.
113
- - Runtime file ban: do not generate `execution/tasks/<task-id>/context.md`, `checkpoint.json`, review markdown, or any AI-written process file. Recovery reads code, Git, `planning/tasks.md`, `planning/task-manifest.json`, and CLI logs only.
39
+ - CLI resolver: all workflow commands must run through `.claude/skills/cc-dev/scripts/resolve-cc-devflow.sh` or `.codex/skills/cc-dev/scripts/resolve-cc-devflow.sh`; if it cannot prove `query workflow-context` and `next-change-key`, stop blocked.
40
+ - Task selection: use `scripts/select-ready-tasks.sh --tasks devflow/changes/<change-key>/task.md`.
41
+ - Completion: after Red/Green/Refactor evidence and review pass, run `scripts/mark-task-complete.sh --tasks devflow/changes/<change-key>/task.md --task <task-id>`.
42
+ - Stage commit rule: when PDCA or IDCA finishes in the current environment, commit the completed stage to Git.
43
+ - Runtime file ban: do not generate process files beyond this `task.md`.
114
44
 
115
45
  ```bash
116
- cc-devflow query workflow-context --change <changeId> --change-key <changeKey> --cwd <repo-root> --data-only --no-trace --compact
46
+ DEVFLOW=".claude/skills/cc-dev/scripts/resolve-cc-devflow.sh"
47
+ if [[ ! -f "$DEVFLOW" && -f ".codex/skills/cc-dev/scripts/resolve-cc-devflow.sh" ]]; then
48
+ DEVFLOW=".codex/skills/cc-dev/scripts/resolve-cc-devflow.sh"
49
+ fi
50
+ bash "$DEVFLOW" require query workflow-context next-change-key
51
+ bash "$DEVFLOW" query workflow-context --change <changeId> --change-key <changeKey> --cwd <repo-root> --data-only --no-trace --compact
117
52
  SCRIPT_ROOT=".claude/skills/cc-do/scripts"
118
53
  if [[ ! -d "$SCRIPT_ROOT" && -d ".codex/skills/cc-do/scripts" ]]; then
119
54
  SCRIPT_ROOT=".codex/skills/cc-do/scripts"
120
55
  fi
121
- bash "$SCRIPT_ROOT/select-ready-tasks.sh" --manifest devflow/changes/<change-key>/planning/task-manifest.json
122
- bash "$SCRIPT_ROOT/mark-task-complete.sh" --manifest devflow/changes/<change-key>/planning/task-manifest.json --tasks devflow/changes/<change-key>/planning/tasks.md --task <task-id>
56
+ bash "$SCRIPT_ROOT/select-ready-tasks.sh" --tasks devflow/changes/<change-key>/task.md
57
+ bash "$SCRIPT_ROOT/mark-task-complete.sh" --tasks devflow/changes/<change-key>/task.md --task <task-id>
123
58
  ```
124
59
 
125
- ## Implementation Surface Map
126
-
127
- | Surface | Responsibility | Tasks | Coupling risk |
128
- |---------|----------------|-------|---------------|
129
- | | | | |
130
-
131
- > 这张表是执行边界,不是装饰。任务拆分必须沿着这些职责走,不能让 `cc-do` 临场重切文件归属。
132
-
133
- ## Tracer Bullet Map
134
-
135
- | Slice | Observable behavior | Spec-style test name | Public test seam | Public verification path | Feedback loop | Red task | Green task | Refactor / evidence | Why vertical |
136
- |-------|---------------------|----------------------|------------------|--------------------------|---------------|----------|------------|---------------------|--------------|
137
- | Slice 1 | | | | | automated test | T001 | T002 | T005 | |
138
-
139
- > 每个 slice 必须能独立证明一个端到端行为,不要按“只改数据层 / 只改 UI 层”横切。
140
-
141
60
  ## Task Contract Matrix
142
61
 
143
- | Task | Source funnel rounds | User / edge story | Interface / method | Key fields | File owner / responsibility | Do not re-decide | Artifact updates | Verification evidence |
144
- |------|----------------------|-------------------|--------------------|------------|-----------------------------|------------------|------------------|-----------------------|
145
- | T001 | Requirement Reality; Interface & Data Contract; Task Contract | US-001 / US-EDGE-001 | | | | | test file only | failing output |
146
-
147
- > 这张表是 task block 的来源映射。每个 task 必须能追溯到已经确认的 funnel round,且明确哪些设计点不允许 `cc-do` 重新发明。
62
+ | Task | User / edge story | Interface / method | File owner / responsibility | Do not re-decide | Verification evidence |
63
+ |------|-------------------|--------------------|-----------------------------|------------------|-----------------------|
64
+ | T001 | US-001 / US-EDGE-001 | | tests own behavior proof | public seam | failing output |
148
65
 
149
66
  ## Phase 1: Foundation
150
67
 
151
68
  - [ ] T001 [TEST] Write the first failing test (dependsOn:none) `path/to/test`
152
69
  Goal: 证明当前行为还没实现,必须先看到失败。
153
- Source funnel rounds: Requirement Reality; Interface & Data Contract; Task Contract.
154
- Contract: user story `US-001`; edge story `US-EDGE-001`; file responsibility `tests own behavior proof`; method/interface `<public seam>`; key fields `<field list>`; input/output `<contract>`; failure path `<expected missing behavior>`; AFK/HITL `AFK`.
155
- Do not re-decide: target behavior, public seam, key fields, allowed mock boundary.
156
- Artifact updates: `path/to/test`; no production files in Red.
70
+ Contract: user story `US-001`; method/interface `<public seam>`; input/output `<contract>`.
71
+ Do not re-decide: target behavior, public seam, allowed mock boundary.
157
72
  TDD phase: red
158
73
  Files: `path/to/test`
159
- Read first: `design.md`, `tasks.md`
160
- Project postmortem search: `rg -n "<test seam|capability|module|model-risk>" devflow/postmortems` or record `no-project-postmortems-yet`
74
+ Read first: `task.md`
161
75
  Verification: `npm test -- path/to/test`
162
76
  Evidence: failing output
163
- Completion: after failing evidence and required review records exist, run `bash "$SCRIPT_ROOT/mark-task-complete.sh" --manifest devflow/changes/<change-key>/planning/task-manifest.json --tasks devflow/changes/<change-key>/planning/tasks.md --task T001`; do not hand-edit status.
164
- Coverage: unit / integration / e2e / eval; regression: yes / no
165
- Spec-style test name: 测试名像规格说明,描述可观察行为
166
- One logical behavior: yes / no
167
- Test seam: public interface / caller flow / CLI / API / UI / trace replay / harness
168
- Public verification path: 从同一公共入口或用户可见路径读回结果;除非 DB / filesystem 本身是被测边界,不绕过接口侧查
169
- Behavior asserted: 描述用户或调用方可观察行为,不描述内部实现步骤
170
- Allowed mocks: none / external API / time / randomness / filesystem / database boundary
171
- Test quality guard: no private methods, no internal call-count assertions, no internal collaborator mocks, no broad bulk Red
172
- Vertical slice: Slice 1
173
- Ready when: 没有上游依赖,且测试路径已经确定
77
+ Completion: after failing evidence exists, run `bash "$SCRIPT_ROOT/mark-task-complete.sh" --tasks devflow/changes/<change-key>/task.md --task T001`.
78
+ Public verification path: 从公共入口或用户可见路径读回结果。
79
+ Ready when: 没有上游依赖,且测试路径已经确定。
174
80
 
175
81
  - [ ] T002 [IMPL] Make the first test pass (dependsOn:T001) `path/to/file`
176
82
  Goal: 用最小实现让 T001 转绿。
177
- Source funnel rounds: System Shape; Abstraction & Encapsulation; Execution Architecture; Task Contract.
178
- Contract: user story `US-001`; file responsibility `<module responsibility>`; method/interface `<method or operation>`; key fields `<field list>`; input/output `<contract>`; failure path `<rescue or error behavior>`; AFK/HITL `AFK`.
179
- Do not re-decide: file ownership, method shape, key fields, error shape, Green minimality boundary.
180
- Artifact updates: `path/to/file`; update tests only if the approved public seam changes.
83
+ Contract: user story `US-001`; method/interface `<method or operation>`; input/output `<contract>`.
84
+ Do not re-decide: file ownership, method shape, error shape, Green minimality boundary.
181
85
  TDD phase: green
182
86
  Files: `path/to/file`
183
- Read first: `design.md`, `path/to/test`
184
- Project postmortem search: `rg -n "<implementation surface|module|failure-class|model-risk>" devflow/postmortems` or record `no-project-postmortems-yet`
87
+ Read first: `task.md`, `path/to/test`
185
88
  Verification: `npm test -- path/to/test`
186
89
  Evidence: passing output + Git diff
187
- Completion: after green evidence and required review records exist, run `bash "$SCRIPT_ROOT/mark-task-complete.sh" --manifest devflow/changes/<change-key>/planning/task-manifest.json --tasks devflow/changes/<change-key>/planning/tasks.md --task T002`; do not hand-edit status.
188
- Green minimality guard: 只写当前红灯要求的最小实现,不预铺未来行为、分支或 API
189
- Vertical slice: Slice 1
190
- Ready when: T001 已经见红,且当前 touched files 不和其他并行任务冲突
191
-
192
- ## Phase 2: Build
193
-
194
- - [ ] T003 [P] [TEST] Add another independent failing test (dependsOn:T002) `path/to/other.test`
195
- Goal: 为独立行为补红灯。
196
- Source funnel rounds: Requirement Reality; Interface & Data Contract; Task Contract.
197
- Contract: user story `US-002`; edge story `US-EDGE-002`; file responsibility `tests own behavior proof`; method/interface `<public seam>`; key fields `<field list>`; input/output `<contract>`; failure path `<expected missing behavior>`; AFK/HITL `AFK`.
198
- Do not re-decide: behavior boundary, public seam, key fields, allowed mock boundary.
199
- Artifact updates: `path/to/other.test`; no production files in Red.
200
- TDD phase: red
201
- Files: `path/to/other.test`
202
- Read first: `design.md`, `tasks.md`
203
- Project postmortem search: `rg -n "<test seam|capability|module|model-risk>" devflow/postmortems` or record `no-project-postmortems-yet`
204
- Verification: `npm test -- path/to/other.test`
205
- Evidence: failing output
206
- Completion: after failing evidence and required review records exist, run `bash "$SCRIPT_ROOT/mark-task-complete.sh" --manifest devflow/changes/<change-key>/planning/task-manifest.json --tasks devflow/changes/<change-key>/planning/tasks.md --task T003`; do not hand-edit status.
207
- Coverage: unit / integration / e2e / eval; regression: yes / no
208
- Spec-style test name: 测试名像规格说明,描述可观察行为
209
- One logical behavior: yes / no
210
- Test seam: public interface / caller flow / CLI / API / UI / trace replay / harness
211
- Public verification path: 从同一公共入口或用户可见路径读回结果;除非 DB / filesystem 本身是被测边界,不绕过接口侧查
212
- Behavior asserted: 描述用户或调用方可观察行为,不描述内部实现步骤
213
- Allowed mocks: none / external API / time / randomness / filesystem / database boundary
214
- Test quality guard: no private methods, no internal call-count assertions, no internal collaborator mocks, no broad bulk Red
215
- Vertical slice: Slice 2
216
- Ready when: T002 完成,且该测试覆盖的是独立行为
217
-
218
- - [ ] T004 [P] [IMPL] Make the independent test pass (dependsOn:T003) `path/to/other-file`
219
- Goal: 用最小实现让 T003 转绿,并保留重构空间。
220
- Source funnel rounds: System Shape; Abstraction & Encapsulation; Execution Architecture; Task Contract.
221
- Contract: user story `US-002`; file responsibility `<module responsibility>`; method/interface `<method or operation>`; key fields `<field list>`; input/output `<contract>`; failure path `<rescue or error behavior>`; AFK/HITL `AFK`.
222
- Do not re-decide: module ownership, method shape, key fields, Green minimality boundary.
223
- Artifact updates: `path/to/other-file`; preserve public seam from T003.
224
- TDD phase: green
225
- Files: `path/to/other-file`
226
- Read first: `design.md`, `path/to/other.test`
227
- Project postmortem search: `rg -n "<implementation surface|module|failure-class|model-risk>" devflow/postmortems` or record `no-project-postmortems-yet`
228
- Verification: `npm test -- path/to/other.test`
229
- Evidence: passing output + review notes
230
- Completion: after green evidence and required review records exist, run `bash "$SCRIPT_ROOT/mark-task-complete.sh" --manifest devflow/changes/<change-key>/planning/task-manifest.json --tasks devflow/changes/<change-key>/planning/tasks.md --task T004`; do not hand-edit status.
231
- Green minimality guard: 只写当前红灯要求的最小实现,不预铺未来行为、分支或 API
232
- Vertical slice: Slice 2
233
- Ready when: T003 已经见红,且文件触点与其他 `[P]` 任务不冲突
234
-
235
- ## Phase 3: Verify
236
-
237
- - [ ] T005 [REFACTOR] Simplify after green evidence (dependsOn:T002,T004) `path/to/file`
238
- Goal: 在所有相关测试已绿后清理重复、命名、结构和坏味道。
239
- Source funnel rounds: Abstraction & Encapsulation; Execution Architecture; Task Contract.
240
- Contract: user story `US-001/US-002`; file responsibility `<module responsibility>`; method/interface `<public surface stays unchanged>`; key fields `<no contract drift>`; input/output `<unchanged>`; failure path `<green tests must still cover>`; AFK/HITL `AFK`.
241
- Do not re-decide: public interface, key fields, user-visible behavior, scope boundary.
242
- Artifact updates: implementation files only; update tests only to remove implementation coupling.
243
- TDD phase: refactor
244
- Files: `path/to/file`
245
- Read first: `design.md`, green test outputs
246
- Project postmortem search: `rg -n "<refactor candidate|code smell|module|model-risk>" devflow/postmortems` or record `no-project-postmortems-yet`
247
- Verification: `npm test -- path/to/test path/to/other.test`
248
- Evidence: refactor diff + repeated green output
249
- Completion: after refactor evidence and required review records exist, run `bash "$SCRIPT_ROOT/mark-task-complete.sh" --manifest devflow/changes/<change-key>/planning/task-manifest.json --tasks devflow/changes/<change-key>/planning/tasks.md --task T005`; do not hand-edit status.
250
- Refactor candidates: duplication / long method / shallow module / feature envy / primitive obsession / naming / >3 nesting / newly exposed old code smell
251
- Ready when: 对应 Red/Green 任务都已完成,且清理不会扩大 scope
252
-
253
- - [ ] T006 Run checks and collect evidence (dependsOn:T005) `command or file`
254
- Goal: 为 `cc-check` 准备新鲜证据。
255
- Source funnel rounds: Execution Architecture; Task Contract; Final Approval.
256
- Contract: user story `all planned stories`; file responsibility `verification evidence`; method/interface `all changed public seams`; key fields `all contract fields`; input/output `not applicable`; failure path `gate failure blocks completion`; AFK/HITL `AFK`.
257
- Do not re-decide: scope, test framework, gate set, completion protocol.
258
- Artifact updates: review evidence only; no behavior changes and no execution process files.
259
- TDD phase: evidence
260
- Files: `command or file`
261
- Read first: `tasks.md`, `task-manifest.json`
262
- Project postmortem search: `rg -n "<verification|release|tooling|model-risk>" devflow/postmortems` or record `no-project-postmortems-yet`
263
- Verification: `npm test && npm run lint`
264
- Evidence: gate output
265
- Completion: after gate evidence and required review records exist, run `bash "$SCRIPT_ROOT/mark-task-complete.sh" --manifest devflow/changes/<change-key>/planning/task-manifest.json --tasks devflow/changes/<change-key>/planning/tasks.md --task T006`; do not hand-edit status.
266
- Ready when: 当前 requirement 的实现任务都已收口
267
-
268
- > `[P]` 只表示“依赖满足后有资格并行”,不表示可以无脑同时开发。
269
-
270
- ## Task Quality Bar
271
-
272
- 一个好的 task block 至少让执行者立刻知道:
273
-
274
- - 现在为什么轮到它做
275
- - 做完后现实会发生什么变化
276
- - 用哪条命令证明它完成
277
- - 要留下什么证据给 `cc-check`
278
- - 它处于 Red、Green、Refactor,还是明确的 TDD exception
279
- - 它覆盖哪条 user story 或 edge / recovery story
280
- - 它继承了 Deep Planning Funnel 里确认的哪个接口、方法、字段、分类、输入输出和失败路径
281
- - 它来自哪几轮 funnel,哪些设计点不允许重决策,哪些 artifact 可以改、哪些不能改
282
- - 测试框架依据来自哪里,回归测试是否被明确处理
283
- - Red task 通过哪个公共 seam 证明行为缺失,允许 mock 的边界是什么
284
- - Red task 的测试名是否像规格,一个测试是否只证明一个逻辑行为,结果是否从公共入口读回
285
- - Green task 如何保证只写当前红灯要求的最小代码
286
- - Refactor task 要清理哪些具体坏味道,且只在相关测试已绿后执行
287
- - 测试是否会在内部重构后继续成立,而不是绑定私有函数、调用次数或临时结构
288
- - 它属于哪个 tracer bullet 垂直切片,完成后哪个可观察行为被证明
289
- - 它完成后要运行哪条 `mark-task-complete.sh` 命令,以及为什么不能手工改状态
290
- - 开工前查过哪些项目尸检报告,相关原则如何转成当前 task guardrail
90
+ Completion: after green evidence exists, run `bash "$SCRIPT_ROOT/mark-task-complete.sh" --tasks devflow/changes/<change-key>/task.md --task T002`.
91
+ Public verification path: same as T001.
92
+ Ready when: T001 has failing evidence.
@@ -2,167 +2,30 @@
2
2
 
3
3
  ## Hard Rules
4
4
 
5
- 1. `cc-plan` 默认只产出 3 个文件:`planning/tasks.md`、CLI 生成的 `planning/task-manifest.json`、CLI 生成的 `change-meta.json`。
6
- 2. clarification / brainstorm / review 结论必须并入 `planning/tasks.md#Contract Summary`,不能再默认拆 `planning/design.md` 或独立文档。
7
- 3. 执行 handoff 必须写进 `planning/tasks.md` 顶部,不能依赖单独的 `context-package.md`。
8
- 4. `planning/task-manifest.json` 必须和 `planning/tasks.md` 同步,且能告诉 `cc-do` 当前任务是谁。
9
- 5. `planning/tasks.md`、`planning/task-manifest.json` 必须记录来源版本链。
10
- 6. 机器态 JSON 必须由 `cc-devflow task-contract compile` / 模板 / validator 生成或更新;AI 不手写 `task-manifest.json` 或 `change-meta.json`。
11
- 6. 所有 SKILL 输出必须遵守 `docs/guides/artifact-contract.md`:状态只能有一个 owner,其它文件只能引用、投影或派生。
12
- 7. 计划里出现 placeholder 词,就说明还没想清楚。
13
- 8. 一次只推进一个澄清问题,不允许问题轰炸。
14
- 9. 推荐方案没获批前,不允许继续拆执行任务。
15
- 10. `planning/tasks.md#Contract Summary` 通过 review gate 前,不允许宣称计划完成。
16
- 11. 如果来自 `roadmap`,planning 不得悄悄丢掉 source constraints / non-goals / success signal。
17
- 12. 每个计划必须先找 existing leverage,再决定新增实现;重复已有能力属于 planning 失败。
18
- 13. 同 blast radius 内的完整边界默认纳入,defer 必须写入 `NOT in scope` 和原因。
19
- 14. 如果推荐方案挑战用户原始方向,必须标成 `user challenge`,不能自动改写用户意图。
20
- 15. 行为变更的具体任务默认采用测试先行;没有 Red/Green/Refactor 链、spec-style test name、公共测试 seam、行为断言、mock 边界或 TDD exception,不允许交给 `cc-do`。
21
- 16. 新 change 目录必须通过 `cc-devflow next-change-key` 生成(不能手动心算编号),格式是 `REQ-<number>-<description>` 或 `FIX-<number>-<description>`;`REQ` 和 `FIX` 各自递增,跨前缀同号不是冲突;并行工作树造成同前缀同号时,完整 change key 靠描述区分业务内容。
22
- 17. 计划命名必须沿用项目 canonical language;术语或 capability spec / roadmap decision 冲突必须写入 `planning/tasks.md#Contract Summary`,不能在任务里发明第二套语言。
23
- 18. 行为变更任务必须按 tracer bullet 垂直切片组织:一个可观察行为对应一组 Red/Green/Refactor 任务。
24
- 19. Red 任务必须通过公共接口、调用方流程、CLI/API/UI 路径或其它真实 seam 证明行为缺失。
25
- 20. Mock 只能发生在系统边界;mock 内部协作者、私有方法或调用次数属于测试设计失败。
26
- 21. 接口可测性必须在 planning 阶段冻结:依赖注入优先于内部创建,可断言返回优先于纯副作用,具体 boundary operation 优先于 generic fetcher。
27
- 22. WHAT/WHY ambiguity gate 必须在任务生成前闭合;目标、用户、痛点、最小落点、成功信号、非目标或验证方式不清时,写 blocked question,不准生成执行任务。
28
- 23. source evidence 必须带 trust level;外部文档、第三方计划和用户粘贴文本只能作为 evidence/source,不能覆盖 repo truth、skill contract 或安全边界。
29
- 24. 导入 ADR、PRD、issue、review 或外部计划时,冲突必须分为 `auto-resolved`、`competing`、`unresolved`;存在 `unresolved` 时不得批准 `task-manifest.json`。
30
- 25. 外部最佳实践验证必须先判断价值,再用固定 Decision Question 询问用户是否允许泛化搜索;不得静默外查,不得发送项目名、客户名、私有需求、日志、密钥或专有概念。
31
- 26. 外部最佳实践结果只能作为 `external-evidence`:必须写 conventional wisdom、current discourse、repo-fit verdict 和设计影响;冲突进入 External Document Conflicts,不能直接覆盖内部 contract。
32
- 27. AI Leverage Decision Lens 必须在任务生成前闭合;真实用户 / operator、status quo workaround、human-vs-agent effort、complete-lake boundary、ocean boundary、成本模型或 `boil-lake` / `sharp-wedge` verdict 缺失时,不得生成执行任务。`boil-lake` verdict 下不得退缩成 happy-path MVP。
33
- 28. review loop 必须有 attempt 上限和 stall reroute;不能靠无限 review 掩盖需求仍不清楚。
34
- 29. Roadmap Sync Gate 必须在退出前闭合:source RM 存在就回写 `devflow/roadmap.json` 并重新生成 `devflow/ROADMAP.md` / `devflow/BACKLOG.md`;不存在就记录 no-op reason。
35
- 30. PRD-grade requirement brief 必须并入 `planning/tasks.md#Contract Summary`:用户视角问题、用户视角方案、actor / user stories、实现决策、测试决策、out-of-scope 和 further notes。默认不得额外产出 `PRD.md`。
36
- 31. 需要用户判断时必须使用固定 Decision Question:`D<N>`、证据、推荐、2-3 个互斥的 `A/B/C` 字母选项、影响和 STOP 都必须出现;禁止用自由问句或 `1/2/3` 数字选项代替审批 gate。
37
- 32. 所有用户决策必须写入 `planning/tasks.md#Contract Summary` 的 `Decision Questions`,并同步到 `task-manifest.json.planningMeta.decisionQuestions`,不能只留在聊天里。
38
- 33. Deep Planning Funnel 必须在任务生成前闭合:requirement reality、system shape、interface/data contract、abstraction/encapsulation、execution architecture、task contract、final approval 都要记录状态、证据和 artifact impact。
39
- 34. 每个任务必须继承 funnel 结论形成 task contract:user story / edge story、文件职责、方法或接口、关键字段、输入输出、失败路径、验证方式和 AFK/HITL。没有 task contract 的任务不允许交给 `cc-do`。
40
-
41
- ## Design Modes
42
-
43
- - `tiny-design`:超小需求的冻结设计卡片,不是跳过设计。
44
- - `full-design`:涉及跨模块、复杂数据流、迁移或高风险约束的完整设计。
45
-
46
- 默认优先 `tiny-design`,但一旦需要解释复杂边界,就升级到 `full-design`。
47
-
48
- ## Placeholder Ban
49
-
50
- - TODO later
51
- - implement later
52
- - handle edge cases
53
- - write tests later
54
- - similar to task N
55
- - TBD
56
- - 待定
57
- - 之后再补
58
- - 后面再想
59
-
60
- ## Task Fields
61
-
62
- 每个任务至少写清:
63
-
64
- - 目标
65
- - source funnel rounds
66
- - 对应 user story / edge story
67
- - 文件职责
68
- - 方法或接口
69
- - 关键字段
70
- - 输入输出
71
- - 失败路径
72
- - AFK / HITL
73
- - do-not-re-decide items
74
- - artifact updates
75
- - TDD phase:`red` / `green` / `refactor` / `exception`
76
- - Vertical slice / tracer bullet
77
- - Spec-style test name
78
- - One logical behavior
79
- - Test seam / public interface
80
- - Public verification path
81
- - Behavior asserted
82
- - Mock boundary
83
- - Feedback loop type
84
- - Green minimality guard
85
- - Refactor candidates
86
- - 涉及文件
87
- - 验证方式
88
- - 完成证据
89
- - Completion command:调用 `mark-task-complete.sh`,同步 `planning/task-manifest.json` 与 `planning/tasks.md`
90
- - Forbidden shortcuts:禁止手工改 checkbox、manifest status 或 `currentTaskId`
91
-
92
- 行为变更任务必须先有 `[TEST]` 红灯任务,再有 `[IMPL]` 绿灯任务,最后有 `[REFACTOR]` 或明确 refactor gate。纯文档、纯配置、纯生成文件、throwaway prototype 可以例外,但必须写明原因、风险和替代验证。
93
- 不要把计划拆成水平层:一批测试、一批服务、一批 UI。每个切片完成后都应该能证明一个真实行为。
94
- 也不要把一批 Red 一次性写完再批量实现。每条 tracer bullet 只证明一个可观察行为,Green 只做当前红灯要求的最小实现;下一条 Red 可以吸收上一轮学到的事实,但不能越过冻结边界。
95
-
96
- ## Execution Protocol Fields
97
-
98
- `planning/tasks.md` 必须有 `Execution Protocol` 区块。`planning/task-manifest.json` 不再复制这段协议;它只保留执行图和调度状态,避免把同一条 shell 命令复制进全局 metadata 和每个 task。
99
-
100
- - task 选择来自 `currentTaskId` 或 `select-ready-tasks.sh`
101
- - 每个 task 必须按模板字段完整展开,不能退化成标题清单
102
- - 完成 task 必须调用 `mark-task-complete.sh`
103
- - 脚本失败时修 evidence / review gate / dependency state 后重跑,禁止手工绕过
104
- - 禁止规划或要求生成执行过程文件:`execution/tasks/<task-id>/context.md`、`checkpoint.json`、review markdown 或其它 AI 手写过程文件都不是默认真相源;恢复只看代码、Git、`planning/tasks.md`、`task-manifest.json` 和 CLI 自动日志。
105
- - completion command、required-before-completion 和 forbidden-shortcuts 写在 `planning/tasks.md` 的 task block;不得再写入 `task-manifest.json.executionProtocol` 或 `tasks[].completion`
106
- - `task-manifest.json` 不写顶层 `status`、`activePhase`、`sourceRoadmap` 或 `spec`;整体完成度从 `tasks[].status` 派生,phase 从任务图派生,roadmap/spec 状态从 `change-meta.json` 和 `devflow/roadmap.json` 读取。
107
-
108
- ## Decision Question Fields
109
-
110
- 每个需要用户判断的 gate 至少记录:
111
-
112
- - questionId:`D1` / `D2` / ...
113
- - gate:`planning-mode` / `ambiguity-blocker` / `external-best-practice` / `approach-approval` / `taste-or-user-challenge` / `final-design-approval`
114
- - knownEvidence
115
- - recommendation
116
- - options:只能使用 `A` / `B` / `C` 作为 option id
117
- - userChoice
118
- - impact
119
- - status:`asked` / `answered` / `auto-decided`
120
-
121
- 如果选项不是覆盖度差异,completeness 使用 `different-kind`,并写清不能打分的原因。
5
+ 1. `cc-plan` writes only `task.md`.
6
+ 2. Git commit records Plan completion.
7
+ 3. Clarification, approval, review notes, and execution protocol live inside `task.md`.
8
+ 4. No process file beyond `task.md`.
9
+ 5. New change keys come from `cc-devflow next-change-key`.
10
+ 6. Branch binds to the full change key before durable output.
11
+ 7. User decisions that affect scope, design, or verification are written into `task.md#Contract Summary`.
12
+ 8. Placeholder tasks are invalid.
13
+ 9. Behavior work uses tracer bullets and TDD unless an exception is recorded.
14
+ 10. Roadmap sync, when needed, happens through roadmap files and Git commit, not change metadata.
15
+
16
+ ## Required Task Fields
17
+
18
+ - goal
19
+ - user or edge story
20
+ - files
21
+ - dependencies
22
+ - TDD phase
23
+ - public verification path
24
+ - verification command
25
+ - completion evidence
26
+ - completion command
27
+ - commit point
122
28
 
123
29
  ## Review Gate
124
30
 
125
- `planning/tasks.md#Contract Summary` 至少完成:
126
-
127
- 1. Placeholder scan
128
- 2. Consistency scan
129
- 3. Scope scan
130
- 4. Ambiguity scan
131
- 5. Feasibility scan
132
- 6. Source alignment
133
- 7. Existing leverage map
134
- 8. Scope / complexity challenge
135
- 9. Test diagram and failure modes
136
- 10. Domain language / spec decision conflict scan
137
- 11. Interface depth scan
138
- 12. Interface testability scan
139
- 13. Test seam / mock boundary scan
140
- 14. Public verification path scan
141
- 15. Tracer bullet scan
142
- 16. Green minimality / refactor candidate scan
143
- 17. PRD brief scan
144
- 18. Source trust boundary scan
145
- 19. External best-practice validation scan
146
- 20. AI Leverage Decision Lens scan
147
- 21. External conflict scan
148
- 22. Ambiguity gate
149
- 23. Bounded review loop
150
- 23. NOT in scope
151
- 24. Test-first readiness
152
- 25. Decision questions recorded
153
- 26. Final recommendation
154
-
155
- 如有 UI scope,再补 design review 结论。
156
- 如有 developer-facing scope,再补 DX review 结论。
157
-
158
- ## Decision Log
159
-
160
- 每个非平凡决策至少记录:
161
-
162
- - decision
163
- - classification:`mechanical` / `taste` / `user challenge`
164
- - principle:completeness / pragmatic / DRY / explicit / action
165
- - rationale
166
- - rejected alternative
167
-
168
- 机械选择可以自动落盘。taste decision 和 user challenge 必须在最终 gate 里显式出现。
31
+ Before exit, check scope, existing leverage, non-goals, ambiguity, test seam, mock boundary, and failure modes. If the plan is not executable from `task.md`, it is not done.
@@ -28,51 +28,15 @@ fi
28
28
 
29
29
  REPO_ROOT="${CWD:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
30
30
 
31
- # 优先用本仓库 node CLI(最可靠),再用全局 cc-devflow,最后纯 bash 兜底
31
+ # 通过共享 resolver 找到可证明支持 next-change-key 的真实 CLI。
32
+ # 不再用 PATH 裸命令或 bash 扫目录兜底;缺 CLI 时必须 fail closed。
32
33
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
33
- CLI_JS="$SCRIPT_DIR/../../../../bin/cc-devflow-cli.js"
34
+ RESOLVER="$SCRIPT_DIR/../../cc-dev/scripts/resolve-cc-devflow.sh"
34
35
 
35
- if [[ -f "$CLI_JS" ]] && command -v node >/dev/null 2>&1; then
36
- node "$CLI_JS" next-change-key --prefix "$PREFIX" --description "$DESCRIPTION" --cwd "$REPO_ROOT"
37
- exit $?
38
- fi
39
-
40
- if command -v cc-devflow >/dev/null 2>&1; then
41
- cc-devflow next-change-key --prefix "$PREFIX" --description "$DESCRIPTION" --cwd "$REPO_ROOT"
42
- exit $?
43
- fi
44
-
45
- # 纯 bash 兜底:扫描 devflow/changes/ 取 max+1
46
- CHANGES_DIR="$REPO_ROOT/devflow/changes"
47
- PREFIX_UPPER="$(echo "$PREFIX" | tr '[:lower:]' '[:upper:]')"
48
-
49
- MAX_NUM=0
50
- PAD_WIDTH=3
51
-
52
- if [[ -d "$CHANGES_DIR" ]]; then
53
- for dir in "$CHANGES_DIR/${PREFIX_UPPER}-"*; do
54
- [[ -d "$dir" ]] || continue
55
- basename="$(basename "$dir")"
56
- num_part="$(echo "$basename" | sed -E "s/^${PREFIX_UPPER}-([0-9]+).*/\1/")"
57
- if [[ "$num_part" =~ ^[0-9]+$ ]]; then
58
- num=$((10#$num_part))
59
- if (( num > MAX_NUM )); then
60
- MAX_NUM=$num
61
- fi
62
- if (( ${#num_part} > PAD_WIDTH )); then
63
- PAD_WIDTH=${#num_part}
64
- fi
65
- fi
66
- done
36
+ if [[ ! -f "$RESOLVER" ]]; then
37
+ echo "Missing cc-devflow CLI resolver: $RESOLVER" >&2
38
+ echo "Do not compute change keys manually; install/update cc-devflow skills." >&2
39
+ exit 1
67
40
  fi
68
41
 
69
- NEXT_NUM=$((MAX_NUM + 1))
70
- PADDED_NUM="$(printf "%0${PAD_WIDTH}d" "$NEXT_NUM")"
71
- CHANGE_ID="${PREFIX_UPPER}-${PADDED_NUM}"
72
-
73
- SLUG="$(echo "$DESCRIPTION" | tr '[:upper:]' '[:lower:]' | sed -E 's/[[:space:]_]+/-/g; s/^-+|-+$//g')"
74
- [[ -z "$SLUG" ]] && SLUG="change"
75
-
76
- CHANGE_KEY="${CHANGE_ID}-${SLUG}"
77
- echo "$CHANGE_ID"
78
- echo "$CHANGE_KEY"
42
+ bash "$RESOLVER" next-change-key --prefix "$PREFIX" --description "$DESCRIPTION" --cwd "$REPO_ROOT"
@@ -3,7 +3,7 @@
3
3
  'use strict';
4
4
 
5
5
  // ------------------------------------------------------------
6
- // 解析 tasks.md 里的 phase / [P] / 文件触点
6
+ // 解析 task.md 里的 phase / [P] / 文件触点
7
7
  // ------------------------------------------------------------
8
8
 
9
9
  const fs = require('fs');
@@ -57,7 +57,7 @@ function parse(content) {
57
57
  function main() {
58
58
  const file = process.argv[2];
59
59
  if (!file) {
60
- console.error('Usage: parse-task-dependencies.js tasks.md');
60
+ console.error('Usage: parse-task-dependencies.js task.md');
61
61
  process.exit(1);
62
62
  }
63
63
 
@@ -61,7 +61,7 @@ for file in "${sources[@]}"; do
61
61
  echo "[FAIL] $file contains an empty field bullet"
62
62
  fail=1
63
63
  fi
64
- if [[ "$file" != *"TASK_MANIFEST_TEMPLATE.json" ]]; then
64
+ if [[ "$file" != *"task template" ]]; then
65
65
  for marker in "${required_markers[@]}"; do
66
66
  if ! rg -n --fixed-strings "$marker" "$file" >/dev/null 2>&1; then
67
67
  echo "[FAIL] $file is missing marker: $marker"