cc-devflow 4.5.1 → 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 (36) 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-simplify/CHANGELOG.md +15 -0
  24. package/.claude/skills/cc-simplify/SKILL.md +255 -35
  25. package/CHANGELOG.md +16 -0
  26. package/docs/examples/example-bindings.json +3 -3
  27. package/docs/examples/full-design-blocked/README.md +1 -1
  28. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/review/report-card.json +140 -3
  29. package/docs/examples/local-handoff/README.md +1 -1
  30. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/review/report-card.json +92 -0
  31. package/docs/examples/pdca-loop/README.md +1 -1
  32. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +20 -0
  33. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/review/report-card.json +92 -0
  34. package/lib/skill-runtime/review.js +64 -1
  35. package/lib/skill-runtime/schemas.js +150 -3
  36. package/package.json +1 -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,20 @@
1
1
  # CC-Simplify Skill Changelog
2
2
 
3
+ ## v1.3.0 - 2026-04-28
4
+
5
+ - add scope-aware Codex reviewer dispatch with small-diff skip rules and conditional security, API contract, release, frontend performance, and red-team facets
6
+ - require reviewer agents to emit JSONL findings with confidence, evidence, fingerprint, specialist, and optional test stubs
7
+ - add finding deduplication, multi-specialist confidence boost, confidence gates, and a Fix-First auto-fix vs ask/reroute decision table
8
+ - expand testing smell coverage for negative paths, edge cases, isolation, flaky tests, and security enforcement tests
9
+ - add false-positive suppressions and a "new diff smells only" boundary so cleanup does not become historical debt sweeping
10
+
11
+ ## v1.2.0 - 2026-04-28
12
+
13
+ - translate the skill body into Chinese and remove the non-Codex `${AGENT_TOOL_NAME}` placeholder
14
+ - define a Codex-native simplification workflow that can use read-only reviewer agents for spec/scope, reuse/structure, and quality/efficiency/test findings
15
+ - require findings to be verified against code, usage, requirements, and fresh validation evidence before any cleanup edit is made
16
+ - add explicit YAGNI, test-anti-pattern, reroute, and cc-check return rules for cleanup changes
17
+
3
18
  ## v1.1.0 - 2026-04-19
4
19
 
5
20
  - expand `cc-simplify` review scope to catch spec drift alongside reuse, quality, and efficiency issues