cc-devflow 4.5.0 → 4.5.2

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 (75) hide show
  1. package/.claude/skills/cc-act/CHANGELOG.md +14 -0
  2. package/.claude/skills/cc-act/PLAYBOOK.md +26 -1
  3. package/.claude/skills/cc-act/SKILL.md +36 -7
  4. package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +20 -0
  5. package/.claude/skills/cc-act/references/closure-contract.md +8 -0
  6. package/.claude/skills/cc-act/scripts/cc-act-common.sh +6 -1
  7. package/.claude/skills/cc-act/scripts/render-pr-brief.sh +99 -0
  8. package/.claude/skills/cc-act/scripts/verify-act-gate.sh +17 -1
  9. package/.claude/skills/cc-check/CHANGELOG.md +14 -0
  10. package/.claude/skills/cc-check/PLAYBOOK.md +101 -1
  11. package/.claude/skills/cc-check/SKILL.md +128 -7
  12. package/.claude/skills/cc-check/assets/REPORT_CARD_TEMPLATE.json +121 -1
  13. package/.claude/skills/cc-check/references/review-contract.md +88 -0
  14. package/.claude/skills/cc-check/scripts/render-report-card.js +172 -5
  15. package/.claude/skills/cc-check/scripts/verify-gate.sh +21 -0
  16. package/.claude/skills/cc-investigate/CHANGELOG.md +13 -0
  17. package/.claude/skills/cc-investigate/PLAYBOOK.md +105 -4
  18. package/.claude/skills/cc-investigate/SKILL.md +185 -8
  19. package/.claude/skills/cc-investigate/assets/ANALYSIS_TEMPLATE.md +77 -3
  20. package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +10 -3
  21. package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +102 -1
  22. package/.claude/skills/cc-investigate/references/investigation-contract.md +146 -0
  23. package/.claude/skills/cc-plan/CHANGELOG.md +14 -0
  24. package/.claude/skills/cc-plan/PLAYBOOK.md +19 -2
  25. package/.claude/skills/cc-plan/SKILL.md +52 -20
  26. package/.claude/skills/cc-plan/assets/DESIGN_TEMPLATE.md +70 -1
  27. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +13 -0
  28. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +3 -1
  29. package/.claude/skills/cc-plan/assets/TINY_DESIGN_TEMPLATE.md +22 -0
  30. package/.claude/skills/cc-roadmap/CHANGELOG.md +12 -0
  31. package/.claude/skills/cc-roadmap/PLAYBOOK.md +24 -1
  32. package/.claude/skills/cc-roadmap/SKILL.md +50 -15
  33. package/.claude/skills/cc-roadmap/assets/BACKLOG_TEMPLATE.md +15 -0
  34. package/.claude/skills/cc-roadmap/assets/ROADMAP_TEMPLATE.md +37 -0
  35. package/.claude/skills/cc-roadmap/assets/TRACKING_TEMPLATE.json +2 -1
  36. package/.claude/skills/cc-simplify/CHANGELOG.md +15 -0
  37. package/.claude/skills/cc-simplify/SKILL.md +255 -35
  38. package/CHANGELOG.md +36 -0
  39. package/CODE_OF_CONDUCT.md +39 -0
  40. package/CODE_OF_CONDUCT.zh-CN.md +39 -0
  41. package/CONTRIBUTING.md +195 -0
  42. package/CONTRIBUTING.zh-CN.md +195 -0
  43. package/README.md +141 -150
  44. package/README.zh-CN.md +144 -148
  45. package/SECURITY.md +56 -0
  46. package/SECURITY.zh-CN.md +56 -0
  47. package/docs/examples/example-bindings.json +6 -6
  48. package/docs/examples/full-design-blocked/BACKLOG.md +1 -1
  49. package/docs/examples/full-design-blocked/README.md +1 -1
  50. package/docs/examples/full-design-blocked/ROADMAP.md +1 -1
  51. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +1 -1
  52. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/tasks.md +1 -1
  53. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/review/report-card.json +140 -3
  54. package/docs/examples/full-design-blocked/roadmap-tracking.json +1 -1
  55. package/docs/examples/local-handoff/BACKLOG.md +1 -1
  56. package/docs/examples/local-handoff/README.md +1 -1
  57. package/docs/examples/local-handoff/ROADMAP.md +1 -1
  58. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +1 -1
  59. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/tasks.md +1 -1
  60. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/review/report-card.json +92 -0
  61. package/docs/examples/local-handoff/roadmap-tracking.json +1 -1
  62. package/docs/examples/pdca-loop/BACKLOG.md +1 -1
  63. package/docs/examples/pdca-loop/README.md +1 -1
  64. package/docs/examples/pdca-loop/ROADMAP.md +1 -1
  65. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +20 -0
  66. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +1 -1
  67. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +2 -2
  68. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/tasks.md +1 -1
  69. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/review/report-card.json +92 -0
  70. package/docs/examples/pdca-loop/roadmap-tracking.json +1 -1
  71. package/docs/guides/getting-started.md +5 -0
  72. package/docs/guides/getting-started.zh-CN.md +5 -0
  73. package/lib/skill-runtime/review.js +64 -1
  74. package/lib/skill-runtime/schemas.js +150 -3
  75. package/package.json +7 -1
@@ -16,8 +16,10 @@
16
16
 
17
17
  - What the user saw:
18
18
  - Reproduction command / path:
19
+ - Repro stability: `stable` | `intermittent` | `not-yet-reproduced` | `narrowed-only`
19
20
  - Expected:
20
21
  - Actual:
22
+ - Impact / blast radius:
21
23
 
22
24
  ## Evidence Chain
23
25
 
@@ -25,25 +27,97 @@
25
27
  - Code path:
26
28
  - Recent changes:
27
29
  - Existing tests:
30
+ - Prior investigations:
31
+ - TODO / backlog / report-card signals:
28
32
 
29
- ## Hypothesis Table
33
+ ## Boundary Probe Matrix
34
+
35
+ | Component boundary | Input observed | Output observed | Config / env observed | State observed | Verdict |
36
+ | --- | --- | --- | --- | --- | --- |
37
+ | | | | | | unknown |
38
+
39
+ ## Backward Trace Chain
40
+
41
+ - Immediate failure site:
42
+ - Direct caller:
43
+ - Caller chain:
44
+ - Bad value origin:
45
+ - Original trigger:
46
+ - Why symptom-site fix is rejected:
47
+
48
+ ## Reference Comparison
49
+
50
+ - Similar working example:
51
+ - Broken path:
52
+ - Differences found:
53
+ - Differences accepted as hypothesis:
54
+ - Differences ruled out:
55
+
56
+ ## Diagnostic Instrumentation Plan
57
+
58
+ | Probe location | Question answered | Command to run | Expected signal | Actual signal | Cleanup requirement |
59
+ | --- | --- | --- | --- | --- | --- |
60
+ | | | | | | |
30
61
 
31
- | Hypothesis | Evidence for | Evidence against | Status |
62
+ ## Pattern Analysis
63
+
64
+ | Pattern | Evidence checked | Status | Notes |
32
65
  | --- | --- | --- | --- |
33
- | | | | pending |
66
+ | race condition | | ruled-out | |
67
+ | null propagation | | ruled-out | |
68
+ | state corruption | | ruled-out | |
69
+ | integration failure | | ruled-out | |
70
+ | configuration drift | | ruled-out | |
71
+ | stale cache | | ruled-out | |
72
+ | resource leak | | ruled-out | |
73
+ | trust boundary drift | | ruled-out | |
74
+ | timing guess / flaky wait | | ruled-out | |
75
+
76
+ ## Research Evidence
77
+
78
+ - External research used: `yes` | `no`
79
+ - Sanitized query:
80
+ - Source / result:
81
+ - Applicability:
82
+ - Accepted into hypothesis: `yes` | `no`
83
+ - If skipped, reason:
84
+
85
+ ## Hypothesis Table
86
+
87
+ | Hypothesis | Evidence for | Evidence against | Falsification method | Expected observation | Actual observation | Status |
88
+ | --- | --- | --- | --- | --- | --- | --- |
89
+ | | | | | | | pending |
90
+
91
+ ## Escalation Decision
92
+
93
+ - Failed hypothesis count:
94
+ - Attempted evidence:
95
+ - Why current entry is suspect:
96
+ - Next option: `continue-with-new-hypothesis` | `instrument-and-wait` | `human-review` | `reroute-cc-plan`
97
+ - Recommendation:
34
98
 
35
99
  ## Root Cause
36
100
 
37
101
  - Confirmed root cause:
102
+ - Root cause class: `code` | `config` | `environment` | `external` | `timing`
38
103
  - Broken contract:
39
104
  - Spec diagnosis: `implementation drift` | `missing spec truth` | `roadmap mismatch`
40
105
  - Why it escaped:
106
+ - Why not code root cause:
107
+ - Monitoring or future evidence needed:
108
+ - Operator handling after fix:
109
+ - Prior history relationship: `new` | `recurring` | `same-root-cause` | `architectural-smell-candidate`
41
110
 
42
111
  ## Repair Boundary
43
112
 
44
113
  - Fix strategy:
114
+ - Affected module:
115
+ - Allowed files:
45
116
  - Files likely touched:
46
117
  - Do not change:
118
+ - Blast radius file count:
119
+ - Blast radius risk: `low` | `medium` | `high`
120
+ - Split / reroute decision if >5 files:
47
121
  - Expected spec delta:
48
122
  - Verification after fix:
49
123
  - Why this can enter `cc-do`:
@@ -15,14 +15,21 @@
15
15
  - Canonical change meta: `change-meta.json`
16
16
  - Execution mode: `single-path` | `parallel-ready`
17
17
  - Confirmed root cause:
18
+ - Root-cause hypothesis:
18
19
  - Frozen repair boundary:
20
+ - Boundary probes:
21
+ - Backward trace:
22
+ - Reference comparison:
23
+ - Allowed files:
24
+ - Forbidden files:
25
+ - Blast radius:
19
26
  - Capability specs:
20
27
  - Read first:
21
28
  - Commands to trust:
22
29
  - Do not re-decide:
23
30
  - Parallel boundaries:
24
31
 
25
- ## Phase 1: Reproduce Guard
32
+ ## Phase 1: Reproduce And Probe Guard
26
33
 
27
34
  - [ ] T001 [TEST] Capture the failing behavior as a stable reproduction (dependsOn:none) `path/to/test`
28
35
  Goal: 让 bug 先变成一个可复跑的失败事实。
@@ -30,7 +37,7 @@
30
37
  Read first: `analysis.md`, `tasks.md`
31
38
  Verification: `npm test -- path/to/test`
32
39
  Evidence: failing output or reproducible log
33
- Ready when: reproduction path 已稳定
40
+ Ready when: reproduction path 已稳定,analysis 已记录必要的 boundary / trace / comparison evidence
34
41
 
35
42
  ## Phase 2: Repair
36
43
 
@@ -40,7 +47,7 @@
40
47
  Read first: `analysis.md`, `path/to/test`
41
48
  Verification: `npm test -- path/to/test`
42
49
  Evidence: passing output + checkpoint
43
- Ready when: T001 已证明问题存在
50
+ Ready when: T001 已证明问题存在,analysis 已证明根因源头
44
51
 
45
52
  ## Phase 3: Verify
46
53
 
@@ -20,12 +20,112 @@
20
20
  ]
21
21
  },
22
22
  "planningMeta": {
23
- "ccInvestigateSkillVersion": "1.0.0",
23
+ "ccInvestigateSkillVersion": "1.1.4",
24
24
  "analysisVersion": "analysis.v1",
25
25
  "approvedAt": "2026-04-17T12:00:00.000Z",
26
26
  "approvedBy": "user",
27
27
  "basedOnRootCause": "Root cause sentence"
28
28
  },
29
+ "investigationMeta": {
30
+ "symptomStatus": "stable",
31
+ "reproductionPath": "npm test -- src/feature/feature.test.ts",
32
+ "patternAnalysis": {
33
+ "selectedPattern": "implementation drift",
34
+ "ruledOutPatterns": [
35
+ "race condition",
36
+ "configuration drift",
37
+ "timing guess / flaky wait"
38
+ ],
39
+ "notes": "Pattern evidence belongs in planning/analysis.md"
40
+ },
41
+ "boundaryProbes": [
42
+ {
43
+ "componentBoundary": "api -> service",
44
+ "inputObserved": "Request payload matches the reproduced failure",
45
+ "outputObserved": "Service receives invalid state",
46
+ "configEnvObserved": "Relevant env/config values recorded in analysis.md",
47
+ "stateObserved": "State snapshot or log pointer",
48
+ "verdict": "fail"
49
+ }
50
+ ],
51
+ "backwardTrace": {
52
+ "immediateFailureSite": "file:line or operation where the symptom appears",
53
+ "directCaller": "caller that passed the bad value or state",
54
+ "callerChain": [
55
+ "entrypoint",
56
+ "intermediate caller",
57
+ "failure site"
58
+ ],
59
+ "badValueOrigin": "where the invalid data/state first appears",
60
+ "originalTrigger": "user action, command, event, config, or dependency response that starts the chain",
61
+ "symptomSiteFixRejectedBecause": "Guarding only the failure site would leave the bad upstream contract intact"
62
+ },
63
+ "referenceComparison": {
64
+ "similarWorkingExample": "path/to/working/example",
65
+ "brokenPath": "path/to/broken/path",
66
+ "differencesFound": [
67
+ "Working path validates input before persistence"
68
+ ],
69
+ "differencesAcceptedAsHypothesis": [
70
+ "Missing validation before persistence"
71
+ ],
72
+ "differencesRuledOut": []
73
+ },
74
+ "diagnosticInstrumentation": [
75
+ {
76
+ "probeLocation": "file:line or component boundary",
77
+ "questionAnswered": "Which boundary first emits the invalid value?",
78
+ "commandToRun": "npm test -- src/feature/feature.test.ts",
79
+ "expectedSignal": "Probe records invalid value before the failure site",
80
+ "actualSignal": "Observed evidence from the current repo",
81
+ "cleanupRequirement": "Remove temporary probe or convert it into a durable assertion/log"
82
+ }
83
+ ],
84
+ "priorInvestigations": [],
85
+ "researchEvidence": [],
86
+ "rootCauseHypothesis": {
87
+ "statement": "Specific, testable root-cause claim",
88
+ "falsificationMethod": "Command, log probe, assertion, or code-path check",
89
+ "expectedObservation": "What should be observed if the hypothesis is true",
90
+ "actualObservation": "Observed evidence from the current repo",
91
+ "status": "confirmed"
92
+ },
93
+ "rootCauseClass": "code",
94
+ "noCodeRootCause": {
95
+ "whyNotCodeRootCause": "",
96
+ "monitoringOrFutureEvidenceNeeded": "",
97
+ "operatorHandlingAfterFix": ""
98
+ },
99
+ "hypothesisAttempts": [
100
+ {
101
+ "statement": "Specific, testable root-cause claim",
102
+ "status": "confirmed",
103
+ "evidenceFor": [
104
+ "Reproduction output points to the affected code path"
105
+ ],
106
+ "evidenceAgainst": [],
107
+ "falsificationMethod": "Run the reproduction command"
108
+ }
109
+ ],
110
+ "escalationDecision": {
111
+ "failedHypothesisCount": 0,
112
+ "nextOption": "cc-do",
113
+ "recommendation": "Repair the confirmed root cause"
114
+ },
115
+ "repairBoundary": {
116
+ "affectedModule": "src/feature",
117
+ "allowedFiles": [
118
+ "src/feature/feature.ts",
119
+ "src/feature/feature.test.ts"
120
+ ],
121
+ "forbiddenFiles": [
122
+ "unrelated modules"
123
+ ],
124
+ "blastRadiusFileCount": 2,
125
+ "blastRadiusRisk": "low",
126
+ "splitOrRerouteDecision": "single focused repair"
127
+ }
128
+ },
29
129
  "status": "planned",
30
130
  "designMode": "cc-investigate",
31
131
  "approvedOption": "confirmed-root-cause",
@@ -52,6 +152,7 @@
52
152
  "activePhase": 1,
53
153
  "frozenDecisions": [
54
154
  "Fix only the confirmed root cause",
155
+ "Use planning/analysis.md as the canonical root-cause contract",
55
156
  "Do not widen scope without rerouting to cc-plan"
56
157
  ],
57
158
  "tasks": [
@@ -3,6 +3,7 @@
3
3
  ## Iron Law
4
4
 
5
5
  - 没有根因,不准修 bug。
6
+ - 没有 frozen root-cause contract,不准生成 repair task。
6
7
 
7
8
  ## Minimum Evidence
8
9
 
@@ -13,7 +14,18 @@
13
14
  - expected vs actual
14
15
  - code path
15
16
  - recent change signal
17
+ - prior investigation signal
18
+ - boundary probe matrix, when the failure crosses components
19
+ - backward trace chain, when the error appears below the original trigger
20
+ - reference comparison, when a similar working path exists
21
+ - diagnostic instrumentation plan, when probes are needed
22
+ - pattern analysis
23
+ - root-cause hypothesis
24
+ - falsification method
16
25
  - confirmed root cause
26
+ - root cause class
27
+ - repair boundary
28
+ - blast radius
17
29
 
18
30
  ## Output Shape
19
31
 
@@ -21,6 +33,140 @@
21
33
  - `planning/tasks.md` 是修复 handoff
22
34
  - `planning/task-manifest.json` 是执行真相源
23
35
 
36
+ ## Root-Cause Hypothesis
37
+
38
+ 每条假设都必须可证伪:
39
+
40
+ - `hypothesis`:具体说明什么坏了,为什么会导致症状
41
+ - `evidenceFor`
42
+ - `evidenceAgainst`
43
+ - `falsificationMethod`
44
+ - `expectedObservation`
45
+ - `actualObservation`
46
+ - `status`:`pending` / `confirmed` / `rejected` / `needs-more-evidence`
47
+
48
+ 只有 `confirmed` 假设可以进入 Root Cause。
49
+
50
+ ## Pattern Analysis
51
+
52
+ 调查必须显式选择或排除常见模式:
53
+
54
+ - race condition
55
+ - null propagation
56
+ - state corruption
57
+ - integration failure
58
+ - configuration drift
59
+ - stale cache
60
+ - resource leak
61
+ - trust boundary drift
62
+ - timing guess / flaky wait
63
+
64
+ 模式分析只是检索索引,不是 root cause。
65
+
66
+ ## Boundary Probe Matrix
67
+
68
+ 多组件链路必须记录每个边界的事实:
69
+
70
+ - `componentBoundary`
71
+ - `inputObserved`
72
+ - `outputObserved`
73
+ - `configEnvObserved`
74
+ - `stateObserved`
75
+ - `verdict`: `pass` / `fail` / `unknown`
76
+
77
+ 第一个失败边界决定下一轮调查收缩点;多个边界同时失败时,优先追共同上游。
78
+
79
+ ## Backward Trace Chain
80
+
81
+ 深层堆栈或坏值来源不明时,必须追到源头:
82
+
83
+ - immediate failure site
84
+ - direct caller
85
+ - caller chain
86
+ - bad value origin
87
+ - original trigger
88
+ - why symptom-site fix is rejected
89
+
90
+ 找不到 original trigger 时,不能冻结根因。
91
+
92
+ ## Reference Comparison
93
+
94
+ 有相似可用实现时,必须记录:
95
+
96
+ - similar working example
97
+ - broken path
98
+ - differences found
99
+ - differences accepted as hypothesis
100
+ - differences ruled out
101
+
102
+ 不能用“差不多”跳过差异。
103
+
104
+ ## Diagnostic Instrumentation
105
+
106
+ 临时探针必须回答一个明确问题:
107
+
108
+ - probe location
109
+ - question answered
110
+ - command to run
111
+ - expected signal
112
+ - actual signal
113
+ - cleanup requirement
114
+
115
+ 探针不是修复。handoff 必须说明删除、保留为正式日志,或转成测试断言。
116
+
117
+ ## Prior History
118
+
119
+ 调查必须记录是否检查了:
120
+
121
+ - `git log --oneline -20 -- <affected-files>`
122
+ - historical `planning/analysis.md`
123
+ - `TODOS.md` / backlog / roadmap
124
+ - previous `report-card.json` findings
125
+
126
+ 如果同一区域重复出现 bug,必须标记为 architectural smell candidate。
127
+
128
+ ## External Research
129
+
130
+ 外部调研必须脱敏:
131
+
132
+ - 不搜索 host、IP、token、customer id、内部路径、SQL、私有 repo 名
133
+ - 只搜索通用错误类别、框架 / 库名、版本、组件名
134
+ - research finding 只能作为候选假设,必须回到本仓库验证
135
+
136
+ ## No Code Root Cause
137
+
138
+ 如果结论不是代码根因,必须写清:
139
+
140
+ - `rootCauseClass`: `code` / `config` / `environment` / `external` / `timing`
141
+ - why not code root cause
142
+ - monitoring or future evidence needed
143
+ - operator handling after fix
144
+
145
+ 环境、外部服务、时序窗口仍然需要证据;不能把调查不足写成外因。
146
+
147
+ ## Repair Boundary
148
+
149
+ 修复边界至少记录:
150
+
151
+ - affected module
152
+ - allowed files
153
+ - forbidden files
154
+ - expected spec delta
155
+ - verification after fix
156
+ - blast radius file count
157
+ - blast radius risk
158
+
159
+ 预计触碰超过 5 个文件时,必须 split / justify / reroute。
160
+
161
+ ## Escalation
162
+
163
+ 三次假设失败后,不再继续猜。必须记录:
164
+
165
+ - failed hypothesis count
166
+ - attempted evidence
167
+ - why current entry is suspect
168
+ - recommended next option:continue / instrument-and-wait / human-review / reroute-cc-plan
169
+
24
170
  ## Reroute
25
171
 
26
172
  - 根因明确,修复边界清楚 -> `cc-do`
@@ -1,5 +1,19 @@
1
1
  # CC-Plan Skill Changelog
2
2
 
3
+ ## v3.5.6 - 2026-04-28
4
+
5
+ - require non-trivial plans to compare named option roles, including minimal viable and ideal architecture, before freezing a recommendation
6
+ - add implementation decision horizon and error/rescue mapping so full designs resolve implementation-time ambiguity before `cc-do`
7
+ - strengthen test-first planning with test framework evidence, coverage quality mapping, and mandatory regression tests for changed existing behavior
8
+ - add conditional UI and DX/operator gates for design completeness, interaction states, target persona, time to first value, and magic moment
9
+
10
+ ## v3.5.5 - 2026-04-28
11
+
12
+ - require over-broad asks to split back into roadmap stages or separate REQ/FIX candidates before detailed planning
13
+ - clarify that `tiny-design` is a short approved design, not permission to skip the design gate
14
+ - add implementation surface mapping so file responsibilities are locked before task decomposition
15
+ - add review calibration so only build-blocking scope, ambiguity, verification, or execution issues fail the planning gate
16
+
3
17
  ## v3.5.4 - 2026-04-27
4
18
 
5
19
  - require planning outputs to resolve the runtime output policy before writing `planning/design.md`, `planning/tasks.md`, or `change-meta.json`
@@ -20,6 +20,12 @@
20
20
  7. 同 blast radius 内的完整边界优先做完,跨系统或无证据扩张才 defer。
21
21
  8. 具体执行计划默认测试先行;没有 Red/Green/Refactor 链或 TDD exception,不准交给 `cc-do`。
22
22
  9. 新 change 目录必须使用 `REQ-<number>-<description>` 或 `FIX-<number>-<description>`;旧小写目录只读兼容,不再作为新输出。
23
+ 10. 原始需求跨多个独立子系统时,先拆回 roadmap / 多个 REQ/FIX;不要把一个大杂烩压成单个计划。
24
+ 11. `tiny-design` 仍然必须被批准,它只是短设计,不是跳过设计。
25
+ 12. 非 trivial 方案必须至少比较 `minimal viable` 和 `ideal architecture` 两种角色,小方案没有天然优先权。
26
+ 13. `full-design` 必须冻结 implementation decision horizon 和 error/rescue map,避免 `cc-do` 临场补设计。
27
+ 14. 测试框架来源、覆盖质量和回归测试必须在计划阶段写清,不准靠执行阶段猜。
28
+ 15. UI 和 developer/operator-facing 范围只在适用时触发对应 gate,不把每个计划都塞成大审查清单。
23
29
 
24
30
  ## Required Outputs
25
31
 
@@ -53,8 +59,14 @@
53
59
  8. `planning/tasks.md` 顶部必须写清 frozen decisions、commands to trust、do-not-re-decide。
54
60
  9. `planning/task-manifest.json` 必须是 `cc-do` 的真相源,而不是装饰文件。
55
61
  10. `planning/design.md` 必须包含 `Existing Leverage`、`NOT in scope`、`Failure Modes`、`Test Diagram`,除非明确说明为什么不适用。
56
- 11. artifact、CLI、包、容器、文档入口必须在计划阶段写清分发和 discoverability,不准到 `cc-act` 才发现没人能用。
57
- 12. 行为变更任务必须拆成 `[TEST] -> [IMPL] -> [REFACTOR]` 或写明 TDD exception;不能用“实现并测试”混成一个任务。
62
+ 11. `planning/design.md` `planning/tasks.md` 必须包含 implementation surface map:文件、职责、归属理由、耦合风险。
63
+ 12. `full-design` 必须包含 implementation decision horizon error/rescue map;不适用时写清 N/A 理由。
64
+ 13. 新 artifact、CLI、包、容器、文档入口必须在计划阶段写清分发和 discoverability,不准到 `cc-act` 才发现没人能用。
65
+ 14. 行为变更任务必须拆成 `[TEST] -> [IMPL] -> [REFACTOR]` 或写明 TDD exception;不能用“实现并测试”混成一个任务。
66
+ 15. 回归测试不能 defer。修改既有行为且缺少覆盖时,必须先计划 regression test。
67
+ 16. UI scope 要写 design completeness score 和 loading / empty / error / success / partial 状态。
68
+ 17. developer/operator-facing scope 要写 target persona、time to first value、magic moment 和 install / run / debug / upgrade 风险。
69
+ 18. Review gate 只拦会导致实现错误、执行卡住、范围越界、验证缺失的问题;文字偏好和 nice-to-have 只能作为 advisory。
58
70
 
59
71
  ## Approval Flow
60
72
 
@@ -71,7 +83,12 @@
71
83
  - 现有代码已经解决了哪些子问题?
72
84
  - 最小完整方案触达哪些文件,为什么没有更小边界?
73
85
  - 数据流、状态流或执行流怎么走?
86
+ - 每个会触达的文件职责是什么,为什么属于这个文件,而不是另一个平行位置?
87
+ - 为什么推荐方案胜过 `minimal viable` / `ideal architecture` 的另一端?
88
+ - foundation / core / integration / polish 阶段哪些决策已经冻结,哪些仍是 blocked question?
89
+ - 每条 failure path 的 rescue action、用户可见结果和测试证据是什么?
74
90
  - 每条新增 code path / user flow / error path 的第一条失败测试是什么?
91
+ - 测试框架来源是什么,现有覆盖是 strong、happy-path-only、smoke-only 还是 missing?
75
92
  - 哪些生产失败模式已经处理,哪些 defer 到 backlog?
76
93
 
77
94
  ## Design Mode Switch
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cc-plan
3
- version: 3.5.4
3
+ version: 3.5.6
4
4
  description: Use when a requirement, roadmap item, or bug needs scope clarification, design decisions, and executable task breakdown before coding starts.
5
5
  triggers:
6
6
  - 帮我规划这个需求
@@ -34,6 +34,8 @@ writes:
34
34
  entry_gate:
35
35
  - Read roadmap handoff, current requirement files, code, docs, and tests before drafting design.
36
36
  - Freeze problem, constraints, non-goals, and success criteria before proposing implementation tasks.
37
+ - If the raw ask spans multiple independent subsystems, split it back into roadmap stages or separate REQ/FIX candidates before asking implementation details.
38
+ - "For non-trivial designs, compare named option roles: minimal viable, ideal architecture, and optional hybrid. Do not default to smallest unless it best serves the goal."
37
39
  - Plan executable work as Red/Green/Refactor by default; identify the first failing test before any production implementation task, or write an explicit TDD exception with replacement evidence.
38
40
  - Assign a canonical change key before writing artifacts; feature work must use `REQ-<number>-<description>`, and bug-fix work must use `FIX-<number>-<description>`.
39
41
  - Do not generate planning/tasks.md, planning/task-manifest.json, or change-meta.json until the recommended design is approved.
@@ -106,9 +108,11 @@ tool_budget:
106
108
 
107
109
  先给出默认 planning 形态,再解释为什么不是另外两种。`cc-plan` 的第一件事不是产出文档,而是压平 planning 密度。
108
110
 
111
+ `tiny-design` 只是短设计,不是免设计。再小的变更也必须在 `planning/design.md` 里写清边界、验证和用户批准状态,不能用“太简单”跳过设计 gate。
112
+
109
113
  ## Harness Contract
110
114
 
111
- - Allowed actions: clarify scope, compare designs, freeze decisions, and write only `planning/design.md`, `planning/tasks.md`, `planning/task-manifest.json`, and `change-meta.json`.
115
+ - Allowed actions: clarify scope, compare designs, split over-broad asks into separate planning candidates, freeze decisions, and write only `planning/design.md`, `planning/tasks.md`, `planning/task-manifest.json`, and `change-meta.json`.
112
116
  - Forbidden actions: writing production code, splitting planning into new side documents, or emitting tasks before approval.
113
117
  - Required evidence: design choices, task boundaries, and verification commands must point back to repo facts or explicit user approval.
114
118
  - Reroute rule: if the problem expands to project strategy go back to `roadmap`; if the plan is already frozen move straight to `cc-do`.
@@ -166,9 +170,10 @@ tool_budget:
166
170
 
167
171
  1. 先确认当前对象是一个 requirement,而不是整个项目路线图。
168
172
  2. 如果来源于 `roadmap`,必须先定位对应的 `RM-ID`,读清 `devflow/ROADMAP.md` / `devflow/BACKLOG.md` 的版本、证据、约束、success signal、next decision、primary capability、expected spec delta。
169
- 3. 先读当前 change 目录现状。旧目录里如果还有 `BRAINSTORM.md` / `PLAN_REVIEW.md` / `context-package.md`,把有效信息吸收进新的 `planning/design.md`,不要继续增殖。
170
- 4. 先看代码、文档、测试和最近提交,再谈拆任务。
171
- 5. 先写不做什么,再写做什么。
173
+ 3. 如果原始需求包含多个可独立交付的子系统,先拆成独立 `RM` `REQ/FIX` 候选;不要在一个 `cc-plan` 里继续追问实现细节。
174
+ 4. 先读当前 change 目录现状。旧目录里如果还有 `BRAINSTORM.md` / `PLAN_REVIEW.md` / `context-package.md`,把有效信息吸收进新的 `planning/design.md`,不要继续增殖。
175
+ 5. 先看代码、文档、测试和最近提交,再谈拆任务。
176
+ 6. 先写不做什么,再写做什么。
172
177
 
173
178
  ## Context Sweep
174
179
 
@@ -180,6 +185,9 @@ tool_budget:
180
185
  4. 当前 change 目录已有的 `planning/design.md`、`planning/tasks.md`、`planning/task-manifest.json`、`change-meta.json` 与历史 planning 文档
181
186
  5. `CLAUDE.md`、README、相关 docs / specs / ADR / 最近提交
182
187
  6. 当前代码、测试、发布、迁移、依赖的现实边界
188
+ 7. 测试框架真相源:优先读 `CLAUDE.md` / project docs 的测试约定,再用配置文件和目录结构补证。
189
+ 8. 如果有 UI scope,读取现有设计系统、组件、页面状态和交互模式。
190
+ 9. 如果是 API / CLI / SDK / developer-facing / operator-facing scope,读取 README、docs、package metadata、安装/运行/调试入口和当前 first-success path。
183
191
 
184
192
  先把这些材料压成 `Source Handoff`,再决定 discovery 还是 planning。
185
193
 
@@ -202,6 +210,9 @@ tool_budget:
202
210
  2. 澄清时一次只问一个关键问题,不做问题轰炸。
203
211
  3. 先写问题、目标、约束、非目标、成功标准,再写方案。
204
212
  4. 如果方向仍不稳,给 2-3 个方案,带 trade-off 和推荐,但这些内容都写进 `planning/design.md`。
213
+ - `full-design` 的方案必须至少包含 `minimal viable` 和 `ideal architecture` 两个角色。
214
+ - 两个角色权重相等;小方案不是默认答案,理想架构也不是默认过度设计。
215
+ - 只有一个方案成立时,必须写清其它方案为何被排除。
205
216
  5. 推荐方案没有得到用户明确批准前,不允许生成 `planning/tasks.md`。
206
217
  6. 批准后先判断这次用 `tiny-design` 还是 `full-design`。
207
218
  7. 把批准后的唯一方案冻结进 `planning/design.md`。
@@ -215,11 +226,19 @@ tool_budget:
215
226
 
216
227
  1. Existing leverage map:每个子问题先映射到现有代码、脚本、spec、模板或测试,避免重复造轮子。
217
228
  2. Scope challenge:超过 8 个文件、2 个新 service/class、或跨模块连锁时,必须解释为什么不是过度设计。
218
- 3. Architecture diagram:跨模块或状态流变更要写 ASCII 数据流 / 依赖图。
219
- 4. Code quality scan:指出 DRY、命名、错误处理、三层以上分支、隐藏耦合风险。
220
- 5. Test diagram:列出新增 code pathuser flow、错误路径、边界状态,并标注 first failing testunit / e2e / eval。
221
- 6. Performance and distribution:涉及批量、I/O、发布物、CLI、包、容器时,必须写清性能和分发边界。
222
- 7. NOT in scope:所有被考虑但 defer 的内容要写理由,不能消失在聊天里。
229
+ 3. Implementation surface map:先锁定每个会新增或修改的文件、职责、归属理由、耦合风险,再拆任务。
230
+ 4. Option role check:非 trivial 方案必须比较 `minimal viable`、`ideal architecture`,必要时加 `hybrid`,并写清为什么推荐方案服务当前目标。
231
+ 5. Implementation decision horizon:提前写出 foundationcore logicintegration、polish/tests 阶段实现者会撞到的决策,能现在冻结就不要留给 `cc-do` 临场猜。
232
+ 6. Architecture diagram:跨模块或状态流变更要写 ASCII 数据流 / 依赖图。
233
+ 7. Error & Rescue map:`full-design` 必须按 codepath 写清 failure、rescue、user sees、test evidence;不适用时写 N/A 理由。
234
+ 8. Code quality scan:指出 DRY、命名、错误处理、三层以上分支、隐藏耦合风险。
235
+ 9. Test diagram:列出新增 code path、user flow、错误路径、边界状态,并标注 first failing test、unit / e2e / eval。
236
+ 10. Test framework source:先记录测试框架来自 `CLAUDE.md` / docs / config / directory 的哪条证据;不能靠猜。
237
+ 11. UI state coverage:有 UI / interaction scope 时,写 loading / empty / error / success / partial 状态表和 design completeness score。
238
+ 12. DX / operator coverage:developer-facing / operator-facing scope 必须写 target persona、time to first value、magic moment、install / run / debug / upgrade 风险。
239
+ 13. Performance and distribution:涉及批量、I/O、发布物、CLI、包、容器时,必须写清性能和分发边界。
240
+ 14. NOT in scope:所有被考虑但 defer 的内容要写理由,不能消失在聊天里。
241
+ 15. Review calibration:只有会导致 `cc-do` 建错、卡住、越界、漏测的问题才是 blocking;措辞偏好和非阻塞建议不能伪装成 gate failure。
223
242
 
224
243
  如果任一项无法从当前证据完成,写 `assumption` 或 `blocked question`,不要伪装成已经审过。
225
244
 
@@ -227,15 +246,21 @@ tool_budget:
227
246
 
228
247
  `cc-plan` 生成具体计划时默认采用测试先行纪律。不能让计划是“先实现再补测”,然后把 TDD 压力留给 `cc-do` 临场修正。
229
248
 
230
- 1. 每个可观察行为变更默认拆成 `Red -> Green -> Refactor`:
249
+ 1. 先定位测试框架真相源:
250
+ - 优先读取 `CLAUDE.md` / project docs 中的 testing 约定。
251
+ - 如果没有,按配置文件和目录结构识别:`vitest` / `jest` / `pytest` / `go test` / `cargo test` / `rspec` / `playwright` / `cypress` 等。
252
+ - 如果仍然没有框架,写成 `test framework unknown`,并把验证计划降级为 exploratory spike 或 manual evidence,不准假装已有自动测试路径。
253
+ 2. 每个可观察行为变更默认拆成 `Red -> Green -> Refactor`:
231
254
  - Red:先写 `[TEST]` 任务,目标是用最小失败测试证明目标行为缺失。
232
255
  - Green:再写 `[IMPL]` 任务,只做让对应红灯转绿的最小生产实现。
233
256
  - Refactor:最后写 `[REFACTOR]` 或在实现任务中明确 refactor checkpoint,说明何时清理重复、命名、结构和坏味道。
234
- 2. `planning/tasks.md` 不能把测试和实现塞进同一个 task。一个 task 同时写“实现并测试”就是计划失败。
235
- 3. `planning/task-manifest.json` 必须让 `cc-do` 看出每个任务的 `tddPhase`、依赖和证据:`red` 任务产出 failing output,`green` 任务产出 passing output,`refactor` 任务产出重跑后的 green evidence。
236
- 4. 只有纯文档、纯配置、纯生成文件、throwaway prototype 可以例外。例外必须写进 `planning/design.md` `planning/tasks.md` `TDD exceptions`,包含原因、风险、替代验证命令和后续补证入口。
237
- 5. 并行只允许发生在已经满足上游 Red/Green 依赖之后。两个 `[P]` 任务如果共享同一个红灯或同一组 touched files,就不能并行。
238
- 6. 如果当前需求找不到第一条失败测试,先把它写成 blocked question exploratory spike,不准伪装成可执行实现任务。
257
+ 3. `planning/tasks.md` 不能把测试和实现塞进同一个 task。一个 task 同时写“实现并测试”就是计划失败。
258
+ 4. `planning/task-manifest.json` 必须让 `cc-do` 看出每个任务的 `tddPhase`、依赖和证据:`red` 任务产出 failing output,`green` 任务产出 passing output,`refactor` 任务产出重跑后的 green evidence。
259
+ 5. Test diagram 要同时覆盖 code paths 和 user flows。每条路径标注 `unit` / `integration` / `e2e` / `eval`,并给现有测试质量分级:`strong`、`happy-path-only`、`smoke-only`、`missing`。
260
+ 6. 回归测试是硬门槛。只要计划修改既有行为且现有测试没有覆盖,就必须把 regression test 写进 `planning/tasks.md`,不能 defer,不能问用户要不要跳过。
261
+ 7. 只有纯文档、纯配置、纯生成文件、throwaway prototype 可以例外。例外必须写进 `planning/design.md` `planning/tasks.md` 的 `TDD exceptions`,包含原因、风险、替代验证命令和后续补证入口。
262
+ 8. 并行只允许发生在已经满足上游 Red/Green 依赖之后。两个 `[P]` 任务如果共享同一个红灯或同一组 touched files,就不能并行。
263
+ 9. 如果当前需求找不到第一条失败测试,先把它写成 blocked question 或 exploratory spike,不准伪装成可执行实现任务。
239
264
 
240
265
  ## Design Modes
241
266
 
@@ -251,6 +276,8 @@ tool_budget:
251
276
  3. 不涉及 migration、复杂状态流、权限、安全、回滚编排
252
277
  4. 执行者看完一张冻结卡片就能准确落地
253
278
 
279
+ `tiny-design` 仍然必须有用户批准、implementation surface、第一条验证证据和升级到 `full-design` 的触发条件。它消除的是冗长文档,不是消除设计。
280
+
254
281
  出现以下任一情况,直接升级到 `full-design`:
255
282
 
256
283
  1. 需要跨模块协调或多阶段落地
@@ -268,11 +295,15 @@ tool_budget:
268
295
  4. Ambiguity scan:实现者看完不能还靠猜
269
296
  5. Feasibility scan:方案要接得上现有代码、依赖和时间边界
270
297
  6. Source alignment:仍然对齐上游 roadmap 的 success signal、constraints、non-goals
271
- 7. Engineering scan:完成 existing leverage、scope challenge、test diagram、failure modes、NOT in scope
272
- 8. Final gate:明确 auto-decided items、taste decisions、user challenges 和最终 recommendation
298
+ 7. Engineering scan:完成 existing leverage、scope challenge、implementation surface、test diagram、failure modes、NOT in scope
299
+ 8. Decision horizon scan:foundation / core / integration / polish/tests 的实现决策是否已经冻结或明确 blocked。
300
+ 9. Error & rescue scan:`full-design` 是否写清 failure -> rescue -> user sees -> test evidence。
301
+ 10. Test framework / regression scan:测试框架来源、覆盖质量、回归测试是否明确。
302
+ 11. Review calibration:只把会导致实现错误、执行卡住、范围越界、验证缺失的问题标成 blocking;非阻塞建议必须降级为 advisory
303
+ 12. Final gate:明确 auto-decided items、taste decisions、user challenges 和最终 recommendation
273
304
 
274
- 如果有 UI / interaction 明显范围,在 `planning/design.md` 里补一段 design review 结论。
275
- 如果有 API / CLI / developer-facing scope,在 `planning/design.md` 里补一段 DX review 结论。
305
+ 如果有 UI / interaction 明显范围,在 `planning/design.md` 里补 design completeness score 和状态覆盖表。
306
+ 如果有 API / CLI / developer-facing / operator-facing scope,在 `planning/design.md` 里补 target persona、time to first value、magic moment 和 DX / operator review 结论。
276
307
 
277
308
  ## Good Output
278
309
 
@@ -305,6 +336,7 @@ tool_budget:
305
336
  7. 具体计划默认测试先行;没有 Red/Green/Refactor 或 TDD exception,就不能进入 `cc-do`。
306
337
  8. 任务一旦超过 2-5 分钟粒度就继续拆,直到可以稳定交给执行者。
307
338
  9. 三层以上判断说明设计还没压平,应回到 `planning/design.md` 继续简化。
339
+ 10. `tiny-design` 不得被当成“免审批”;只要要写任务,就必须先有已批准的设计卡片。
308
340
 
309
341
  ## Exit Criteria
310
342