cc-devflow 4.5.15 → 4.5.17

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 (56) hide show
  1. package/.claude/skills/cc-act/CHANGELOG.md +11 -0
  2. package/.claude/skills/cc-act/PLAYBOOK.md +2 -2
  3. package/.claude/skills/cc-act/SKILL.md +12 -2
  4. package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +9 -0
  5. package/.claude/skills/cc-act/references/closure-contract.md +3 -2
  6. package/.claude/skills/cc-act/scripts/evaluate-postmortem-trigger.sh +93 -0
  7. package/.claude/skills/cc-act/scripts/render-pr-brief.sh +138 -32
  8. package/.claude/skills/cc-dev/CHANGELOG.md +5 -0
  9. package/.claude/skills/cc-dev/PLAYBOOK.md +6 -3
  10. package/.claude/skills/cc-dev/SKILL.md +10 -7
  11. package/.claude/skills/cc-dev/scripts/ensure-work-branch.sh +117 -0
  12. package/.claude/skills/cc-dev/scripts/prepare-change-worktree.sh +135 -0
  13. package/.claude/skills/cc-investigate/CHANGELOG.md +15 -0
  14. package/.claude/skills/cc-investigate/SKILL.md +85 -8
  15. package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +56 -0
  16. package/.claude/skills/cc-investigate/references/investigation-contract.md +1 -0
  17. package/.claude/skills/cc-plan/CHANGELOG.md +15 -0
  18. package/.claude/skills/cc-plan/SKILL.md +70 -6
  19. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +41 -0
  20. package/.claude/skills/cc-plan/references/planning-contract.md +1 -0
  21. package/.claude/skills/cc-pr-review/CHANGELOG.md +9 -0
  22. package/.claude/skills/cc-pr-review/PLAYBOOK.md +3 -0
  23. package/.claude/skills/cc-pr-review/SKILL.md +30 -1
  24. package/.claude/skills/cc-review/CHANGELOG.md +10 -0
  25. package/.claude/skills/cc-review/SKILL.md +53 -9
  26. package/.claude/skills/cc-review/references/implementation-review-branch.md +1 -0
  27. package/.claude/skills/cc-review/references/plan-review-branch.md +1 -0
  28. package/.claude/skills/cc-review/references/review-methods.md +30 -0
  29. package/.claude/skills/cc-roadmap/CHANGELOG.md +6 -0
  30. package/.claude/skills/cc-roadmap/SKILL.md +1 -1
  31. package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/markdown.js +274 -69
  32. package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/schema.js +69 -15
  33. package/CHANGELOG.md +21 -3
  34. package/README.md +1 -1
  35. package/README.zh-CN.md +1 -1
  36. package/docs/examples/example-bindings.json +8 -8
  37. package/docs/examples/full-design-blocked/BACKLOG.md +12 -1
  38. package/docs/examples/full-design-blocked/README.md +1 -1
  39. package/docs/examples/full-design-blocked/ROADMAP.md +2 -2
  40. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/task.md +23 -1
  41. package/docs/examples/full-design-blocked/roadmap.json +7 -2
  42. package/docs/examples/local-handoff/BACKLOG.md +12 -1
  43. package/docs/examples/local-handoff/README.md +1 -1
  44. package/docs/examples/local-handoff/ROADMAP.md +2 -2
  45. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/task.md +23 -1
  46. package/docs/examples/local-handoff/roadmap.json +7 -2
  47. package/docs/examples/pdca-loop/BACKLOG.md +12 -1
  48. package/docs/examples/pdca-loop/README.md +1 -1
  49. package/docs/examples/pdca-loop/ROADMAP.md +2 -2
  50. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/task.md +23 -1
  51. package/docs/examples/pdca-loop/roadmap.json +7 -2
  52. package/docs/guides/project-postmortem.md +8 -0
  53. package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +2 -1
  54. package/lib/skill-runtime/__tests__/config.test.js +7 -2
  55. package/lib/skill-runtime/config.js +38 -6
  56. package/package.json +1 -1
@@ -0,0 +1,135 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ # ------------------------------------------------------------
6
+ # cc-dev: 为 REQ/FIX 准备独立工作树,主目录不切分支
7
+ # ------------------------------------------------------------
8
+
9
+ usage() {
10
+ cat <<'EOF'
11
+ Usage: prepare-change-worktree.sh --change-key REQ-123-short-name [--base main] [--worktrees-root path]
12
+ EOF
13
+ }
14
+
15
+ physical_path() {
16
+ local path_value="$1"
17
+
18
+ if [[ -e "$path_value" ]]; then
19
+ (cd "$path_value" && pwd -P)
20
+ else
21
+ printf '%s\n' "$path_value"
22
+ fi
23
+ }
24
+
25
+ CHANGE_KEY=""
26
+ BASE_BRANCH=""
27
+ WORKTREES_ROOT=""
28
+
29
+ while [[ $# -gt 0 ]]; do
30
+ case "$1" in
31
+ --change-key) CHANGE_KEY="$2"; shift 2 ;;
32
+ --base) BASE_BRANCH="$2"; shift 2 ;;
33
+ --worktrees-root) WORKTREES_ROOT="$2"; shift 2 ;;
34
+ -h|--help) usage; exit 0 ;;
35
+ *) echo "Unknown arg: $1" >&2; usage; exit 1 ;;
36
+ esac
37
+ done
38
+
39
+ if [[ -z "$CHANGE_KEY" ]]; then
40
+ usage
41
+ exit 1
42
+ fi
43
+
44
+ inside_work_tree="$(git rev-parse --is-inside-work-tree 2>/dev/null || true)"
45
+ if [[ "$inside_work_tree" != "true" ]]; then
46
+ echo "WorktreePrepareError: not inside a git work tree" >&2
47
+ exit 1
48
+ fi
49
+
50
+ if [[ ! "$CHANGE_KEY" =~ ^(REQ|FIX)-[0-9]+-.+ ]]; then
51
+ echo "WorktreePrepareError: change key must be canonical REQ-... or FIX-...: $CHANGE_KEY" >&2
52
+ exit 1
53
+ fi
54
+
55
+ prefix="${CHANGE_KEY%%-*}"
56
+ suffix="${CHANGE_KEY#*-}"
57
+ target_branch="$prefix/$suffix"
58
+ target_lower="$(printf '%s' "$target_branch" | tr '[:upper:]' '[:lower:]')"
59
+
60
+ repo_root="$(git rev-parse --show-toplevel)"
61
+ repo_name="$(basename "$repo_root")"
62
+
63
+ if [[ -z "$WORKTREES_ROOT" ]]; then
64
+ if [[ -n "${CODEX_HOME:-}" ]]; then
65
+ WORKTREES_ROOT="$CODEX_HOME/worktrees"
66
+ else
67
+ WORKTREES_ROOT="$HOME/.codex/worktrees"
68
+ fi
69
+ fi
70
+
71
+ worktree_path="$WORKTREES_ROOT/$CHANGE_KEY/$repo_name"
72
+ script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
73
+ ensure_script="$script_dir/ensure-work-branch.sh"
74
+
75
+ if [[ ! -x "$ensure_script" ]]; then
76
+ echo "WorktreePrepareError: missing executable anchor script: $ensure_script" >&2
77
+ exit 1
78
+ fi
79
+
80
+ while IFS= read -r ref_name; do
81
+ ref_lower="$(printf '%s' "$ref_name" | tr '[:upper:]' '[:lower:]')"
82
+ if [[ "$ref_name" != "$target_branch" && "$ref_lower" == "$target_lower" ]]; then
83
+ echo "WorktreePrepareError: case-variant branch already exists: $ref_name" >&2
84
+ echo "Expected exact branch: $target_branch" >&2
85
+ exit 1
86
+ fi
87
+ done < <(git for-each-ref --format='%(refname:short)' refs/heads 2>/dev/null || true)
88
+
89
+ branch_worktree_path=""
90
+ current_worktree_path=""
91
+ while IFS= read -r line; do
92
+ case "$line" in
93
+ worktree\ *) current_worktree_path="${line#worktree }" ;;
94
+ branch\ refs/heads/"$target_branch")
95
+ branch_worktree_path="$current_worktree_path"
96
+ break
97
+ ;;
98
+ esac
99
+ done < <(git worktree list --porcelain 2>/dev/null || true)
100
+
101
+ if [[ -n "$branch_worktree_path" ]]; then
102
+ branch_worktree_real="$(physical_path "$branch_worktree_path")"
103
+ expected_worktree_real="$(physical_path "$worktree_path")"
104
+ fi
105
+
106
+ if [[ -n "$branch_worktree_path" && "$branch_worktree_real" != "$expected_worktree_real" ]]; then
107
+ echo "WorktreePrepareError: branch $target_branch is already used by worktree: $branch_worktree_path" >&2
108
+ echo "Expected worktree path: $worktree_path" >&2
109
+ exit 1
110
+ fi
111
+
112
+ if [[ -e "$worktree_path" ]]; then
113
+ if [[ "$(git -C "$worktree_path" rev-parse --is-inside-work-tree 2>/dev/null || true)" != "true" ]]; then
114
+ echo "WorktreePrepareError: target path exists but is not a git worktree: $worktree_path" >&2
115
+ exit 1
116
+ fi
117
+ action="reused"
118
+ else
119
+ mkdir -p "$(dirname "$worktree_path")"
120
+ git worktree add --detach "$worktree_path" HEAD >/dev/null
121
+ action="created"
122
+ fi
123
+
124
+ ensure_args=(--change-key "$CHANGE_KEY")
125
+ if [[ -n "$BASE_BRANCH" ]]; then
126
+ ensure_args+=(--base "$BASE_BRANCH")
127
+ fi
128
+
129
+ anchor_output="$(cd "$worktree_path" && bash "$ensure_script" "${ensure_args[@]}")"
130
+
131
+ cat <<EOF
132
+ WORKTREE_ACTION=$action
133
+ WORKTREE_PATH=$worktree_path
134
+ $anchor_output
135
+ EOF
@@ -1,5 +1,20 @@
1
1
  # CC-Investigate Skill Changelog
2
2
 
3
+ ## v1.6.5 - 2026-05-17
4
+
5
+ - require new FIX investigations to prepare an isolated worktree before writing `task.md`
6
+ - keep the main checkout bound to `main` while investigations continue in the returned `WORKTREE_PATH`
7
+
8
+ ## v1.6.4 - 2026-05-17
9
+
10
+ - require ASCII branch-chain node labels and evidence text to follow `Output language` while keeping tree connector tokens ASCII
11
+ - replace hard-coded English branch-chain examples with an `en` / `zh-CN` label table and semantic slots
12
+
13
+ ## v1.6.3 - 2026-05-17
14
+
15
+ - require ASCII Branch Chain Analysis in `task.md#Root Cause Contract` so investigations trace problem chains upstream to the first proven creator, solution chains through the repaired contract, and impact chains downstream to affected seams
16
+ - add prompt/provider source tracing and evidence-request handling to the investigation task template
17
+
3
18
  ## v1.6.2 - 2026-05-14
4
19
 
5
20
  - restore the investigation flow that was over-pruned during artifact minimization: mode classification, feedback loop contract, evidence chain, hypothesis falsification, boundary/backward/reference evidence, diagnostic instrumentation, and correct test seam
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cc-investigate
3
- version: 1.6.2
3
+ version: 1.6.5
4
4
  description: Use when a bug, regression, broken task, or unexpected behavior needs root-cause investigation before coding resumes.
5
5
  triggers:
6
6
  - 帮我查这个 bug
@@ -15,6 +15,8 @@ reads:
15
15
  - docs/guides/project-postmortem.md
16
16
  - assets/TASKS_TEMPLATE.md
17
17
  - ../cc-dev/scripts/resolve-cc-devflow.sh
18
+ - ../cc-dev/scripts/prepare-change-worktree.sh
19
+ - ../cc-dev/scripts/ensure-work-branch.sh
18
20
  - ../cc-roadmap/scripts/locate-roadmap-item.sh
19
21
  - ../cc-roadmap/scripts/sync-roadmap-progress.sh
20
22
  writes:
@@ -27,7 +29,8 @@ effects:
27
29
  entry_gate:
28
30
  - Resolve the CLI with `../cc-dev/scripts/resolve-cc-devflow.sh require next-change-key config`.
29
31
  - Assign a FIX change key through `next-change-key --prefix FIX --description "<short bug name>"`.
30
- - Enforce the Worktree Branch Contract before writing `task.md`.
32
+ - Prepare an isolated FIX worktree before writing `task.md`; keep the main checkout on `main`.
33
+ - Enforce the Worktree Branch Contract inside the returned FIX worktree.
31
34
  - Reproduce or build the closest honest feedback loop before naming root cause.
32
35
  - Classify the investigation mode before tracing: reproduce-first, diff-trace, boundary-probe, backward-trace, reference-compare, condition-wait, workflow-forensics, performance, or diagnose-only.
33
36
  - Search relevant code, logs, recent history, and project postmortems before declaring the bug novel.
@@ -35,6 +38,7 @@ entry_gate:
35
38
  exit_criteria:
36
39
  - "`task.md#Root Cause Contract` proves symptom site, first bad state, violated contract, original trigger, counterfactual proof, and escape reason."
37
40
  - "`task.md#Root Cause Contract` records investigation mode, feedback loop, evidence chain, tested hypotheses, boundary/backward/reference evidence when applicable, correct test seam, and diagnose-only boundary when applicable."
41
+ - "`task.md#Root Cause Contract` contains ASCII Branch Chain Analysis trees for problem chain, solution chain, and impact chain, tracing upstream root cause and downstream blast radius to the deepest proven prompt/code/provider/data source; tree connector characters stay ASCII while node text follows the configured output language."
38
42
  - "`task.md` contains the repair tasks needed by `cc-do`."
39
43
  - "Evidence gaps produce Evidence Request, diagnose-only, or reroute tasks instead of fake repair tasks."
40
44
  - "No process file is created beyond `task.md`."
@@ -74,12 +78,13 @@ NO REPAIR WITHOUT A FROZEN ROOT-CAUSE CONTRACT
74
78
  ## Investigation Loop
75
79
 
76
80
  1. Classify:复现优先、diff trace、boundary probe、flaky、performance、workflow forensics 或 diagnose-only。
77
- 2. Reproduce:用测试、脚本、日志、浏览器路径或最小 harness 证明同一个症状。
78
- 3. Trace:找到 first bad state,而不是只给 symptom guard。
79
- 4. Hypothesize:列候选,写证伪方法,逐个打掉。
80
- 5. Prove:完成 Root Cause Proof Ladder。
81
- 6. Freeze:把根因、修复边界、测试 seam、allowed/forbidden files 写进 `task.md`。
82
- 7. Commit:提交 Investigate 阶段,再交给 `cc-do`。
81
+ 2. Anchor:分配 FIX change key 后运行 `../cc-dev/scripts/prepare-change-worktree.sh --change-key <FIX-...>`,从主 checkout 创建或复用独立 FIX worktree;进入返回的 `WORKTREE_PATH` 后必须得到 exact-case `FIX/...` 分支。大小写碰撞或目标分支不匹配都是 setup blocker。
82
+ 3. Reproduce:用测试、脚本、日志、浏览器路径或最小 harness 证明同一个症状。
83
+ 4. Trace:找到 first bad state,而不是只给 symptom guard。
84
+ 5. Hypothesize:列候选,写证伪方法,逐个打掉。
85
+ 6. Prove:完成 Root Cause Proof Ladder。
86
+ 7. Freeze:把根因、ASCII Branch Chain Analysis、修复边界、测试 seam、allowed/forbidden files 写进 `task.md`。
87
+ 8. Commit:提交 Investigate 阶段,再交给 `cc-do`。
83
88
 
84
89
  ## Investigation Modes
85
90
 
@@ -111,6 +116,78 @@ NO REPAIR WITHOUT A FROZEN ROOT-CAUSE CONTRACT
111
116
  9. Correct Test Seam:说明 regression test 是否覆盖真实触发链;只能测私有实现时,先记录设计缺口或 reroute。
112
117
  10. Repair Boundary:affected module、allowed files、forbidden files、blast radius、split-or-reroute decision。
113
118
 
119
+ ## ASCII Branch Chain Analysis
120
+
121
+ `task.md#Root Cause Contract` 必须包含 ASCII 分叉树代码块。调查要先向上追坏状态来源,再向下追影响面,最后把修复路径也画出来。
122
+
123
+ Language rule:
124
+
125
+ - Tree structure tokens must stay ASCII: `|--`, `` `-- ``, `|`, spaces, and plain punctuation.
126
+ - Node labels, placeholder text, explanations, and evidence summaries must follow `Output language` in `task.md`.
127
+ - If `Output language` is unset, use the current conversation language and record the assumption.
128
+ - Do not hard-code English labels such as `Problem Chain` when the configured output language is not English.
129
+ - Use the Label table as the shared source for chain titles, node labels, and placeholder text.
130
+
131
+ Label table:
132
+
133
+ | Semantic slot | en | zh-CN |
134
+ | --- | --- | --- |
135
+ | problemChain | Problem Chain | 问题链 |
136
+ | symptomMarker | SYMPTOM | 症状 |
137
+ | failureSite | Failure site | 失败位置 |
138
+ | directCaller | direct caller | 直接调用方 |
139
+ | badValueState | bad value/state | 错误值或状态 |
140
+ | upstreamOrigin | Upstream origin | 上游源头 |
141
+ | codeSource | code source | 代码来源 |
142
+ | promptSource | prompt source | 提示词来源 |
143
+ | trigger | trigger | 触发条件 |
144
+ | rejectedSymptomFix | Rejected symptom fix | 已拒绝的症状修补 |
145
+ | solutionChain | Solution Chain | 解决链 |
146
+ | fixMarker | FIX | 修复 |
147
+ | firstBadStateRepair | First bad state repair | 首个错误状态修复 |
148
+ | contractRestored | Contract restored | 恢复的合同 |
149
+ | regressionSeam | Regression seam | 回归缝隙 |
150
+ | escapePrevention | Escape prevention | 逃逸预防 |
151
+ | impactChain | Impact Chain | 影响链 |
152
+ | blastRadiusMarker | BLAST RADIUS | 影响范围 |
153
+ | upstreamPreserved | Upstream preserved | 保持不变的上游 |
154
+ | downstreamAffected | Downstream affected | 受影响下游 |
155
+ | riskBranch | Risk branch | 风险分支 |
156
+ | verificationBranch | Verification branch | 验证分支 |
157
+
158
+ ```text
159
+ <problemChain>
160
+ <symptomMarker>: <observed failure>
161
+ |-- <failureSite>: <file / command / UI / artifact>
162
+ | |-- <directCaller>: <caller>
163
+ | `-- <badValueState>: <first observed bad state>
164
+ |-- <upstreamOrigin>: <earliest proven creator>
165
+ | |-- <codeSource>: <file / function / config>
166
+ | |-- <promptSource>: <prompt / instruction / provider contract, or N/A>
167
+ | `-- <trigger>: <input / event / race / migration>
168
+ `-- <rejectedSymptomFix>: <why guard-at-failure is insufficient>
169
+
170
+ <solutionChain>
171
+ <fixMarker>: <minimal repair>
172
+ |-- <firstBadStateRepair>: <change>
173
+ |-- <contractRestored>: <invariant>
174
+ |-- <regressionSeam>: <test / harness / replay>
175
+ `-- <escapePrevention>: <guard / assertion / operator check>
176
+
177
+ <impactChain>
178
+ <blastRadiusMarker>: <affected behavior>
179
+ |-- <upstreamPreserved>: <contracts that must stay unchanged>
180
+ |-- <downstreamAffected>: <callers / artifacts / docs / release>
181
+ |-- <riskBranch>: <possible regression>
182
+ `-- <verificationBranch>: <commands / evidence>
183
+ ```
184
+
185
+ 规则:
186
+
187
+ - `Upstream origin` 必须追到最早被证据支持的制造点;如果最早点可能是提示词,必须写出精确 prompt / provider 合同位置。
188
+ - `Impact Chain` 必须覆盖下游调用方、artifact、operator 或用户可见行为;只列修复文件不合格。
189
+ - 缺 L2、L4 或 L5 时,树里写 `unknown -> Evidence Request`,并进入 diagnose-only / reroute。
190
+
114
191
  ## Root Cause Proof Ladder
115
192
 
116
193
  - L1 Symptom Site
@@ -96,6 +96,62 @@ Correct Test Seam:
96
96
  - Mock boundary:
97
97
  - Private implementation assertions avoided:
98
98
 
99
+ ASCII Branch Chain Analysis:
100
+ Language rule: keep connector tokens ASCII; write node labels and evidence text in `Output language`.
101
+
102
+ Label table:
103
+ | Semantic slot | en | zh-CN |
104
+ | --- | --- | --- |
105
+ | problemChain | Problem Chain | 问题链 |
106
+ | symptomMarker | SYMPTOM | 症状 |
107
+ | failureSite | Failure site | 失败位置 |
108
+ | directCaller | direct caller | 直接调用方 |
109
+ | badValueState | bad value/state | 错误值或状态 |
110
+ | upstreamOrigin | Upstream origin | 上游源头 |
111
+ | codeSource | code source | 代码来源 |
112
+ | promptSource | prompt source | 提示词来源 |
113
+ | trigger | trigger | 触发条件 |
114
+ | rejectedSymptomFix | Rejected symptom fix | 已拒绝的症状修补 |
115
+ | solutionChain | Solution Chain | 解决链 |
116
+ | fixMarker | FIX | 修复 |
117
+ | firstBadStateRepair | First bad state repair | 首个错误状态修复 |
118
+ | contractRestored | Contract restored | 恢复的合同 |
119
+ | regressionSeam | Regression seam | 回归缝隙 |
120
+ | escapePrevention | Escape prevention | 逃逸预防 |
121
+ | impactChain | Impact Chain | 影响链 |
122
+ | blastRadiusMarker | BLAST RADIUS | 影响范围 |
123
+ | upstreamPreserved | Upstream preserved | 保持不变的上游 |
124
+ | downstreamAffected | Downstream affected | 受影响下游 |
125
+ | riskBranch | Risk branch | 风险分支 |
126
+ | verificationBranch | Verification branch | 验证分支 |
127
+
128
+ ```text
129
+ <problemChain>
130
+ <symptomMarker>: <observed failure>
131
+ |-- <failureSite>: <file / command / UI / artifact>
132
+ | |-- <directCaller>: <caller>
133
+ | `-- <badValueState>: <first observed bad state>
134
+ |-- <upstreamOrigin>: <earliest proven creator>
135
+ | |-- <codeSource>: <file / function / config>
136
+ | |-- <promptSource>: <prompt / instruction / provider contract, or N/A>
137
+ | `-- <trigger>: <input / event / race / migration>
138
+ `-- <rejectedSymptomFix>: <why guard-at-failure is insufficient>
139
+
140
+ <solutionChain>
141
+ <fixMarker>: <minimal repair>
142
+ |-- <firstBadStateRepair>: <change>
143
+ |-- <contractRestored>: <invariant>
144
+ |-- <regressionSeam>: <test / harness / replay>
145
+ `-- <escapePrevention>: <guard / assertion / operator check>
146
+
147
+ <impactChain>
148
+ <blastRadiusMarker>: <affected behavior>
149
+ |-- <upstreamPreserved>: <contracts that must stay unchanged>
150
+ |-- <downstreamAffected>: <callers / artifacts / docs / release>
151
+ |-- <riskBranch>: <possible regression>
152
+ `-- <verificationBranch>: <commands / evidence>
153
+ ```
154
+
99
155
  Verification:
100
156
  -
101
157
 
@@ -26,6 +26,7 @@
26
26
  - repair boundary
27
27
  - correct test seam
28
28
  - verification command
29
+ - ASCII branch-chain connector tokens stay ASCII, but labels, evidence, and explanatory text follow `Output language`.
29
30
 
30
31
  ## Investigation Modes
31
32
 
@@ -1,5 +1,20 @@
1
1
  # CC-Plan Skill Changelog
2
2
 
3
+ ## v3.10.7 - 2026-05-17
4
+
5
+ - require new plans to prepare an isolated change worktree before writing `task.md`
6
+ - keep the main checkout bound to `main` instead of treating it as a branch-switching work surface
7
+
8
+ ## v3.10.6 - 2026-05-17
9
+
10
+ - require ASCII branch-chain node labels and evidence text to follow `Output language` while keeping tree connector tokens ASCII
11
+ - replace hard-coded English branch-chain examples with an `en` / `zh-CN` label table and semantic slots
12
+
13
+ ## v3.10.5 - 2026-05-17
14
+
15
+ - require ASCII Branch Chain Analysis in `task.md#Contract Summary` so requirement plans trace upstream sources, deepest affected code or prompt/provider layer, downstream business impact, and verification seams
16
+ - add the branch-chain section to the plan task template
17
+
3
18
  ## v3.10.4 - 2026-05-14
4
19
 
5
20
  - require product discovery before engineering planning
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cc-plan
3
- version: 3.10.4
3
+ version: 3.10.7
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
  - 帮我规划这个需求
@@ -15,6 +15,8 @@ reads:
15
15
  - assets/TASKS_TEMPLATE.md
16
16
  - references/planning-contract.md
17
17
  - ../cc-dev/scripts/resolve-cc-devflow.sh
18
+ - ../cc-dev/scripts/prepare-change-worktree.sh
19
+ - ../cc-dev/scripts/ensure-work-branch.sh
18
20
  - ../cc-roadmap/scripts/locate-roadmap-item.sh
19
21
  - ../cc-roadmap/scripts/sync-roadmap-progress.sh
20
22
  writes:
@@ -27,12 +29,14 @@ effects:
27
29
  entry_gate:
28
30
  - Resolve the CLI with `../cc-dev/scripts/resolve-cc-devflow.sh require next-change-key config` before workflow commands.
29
31
  - Assign a canonical REQ/FIX change key through `next-change-key` before writing `task.md`.
30
- - Enforce the Worktree Branch Contract immediately after the change key exists.
32
+ - Prepare an isolated change worktree immediately after the change key exists; keep the main checkout on `main`.
33
+ - Enforce the Worktree Branch Contract inside the returned change worktree before writing `task.md`.
31
34
  - Read repo evidence before asking the user: roadmap handoff, specs, relevant code/tests/docs, recent commits, and existing task truth when present.
32
35
  - Run the planning flow before task generation: product/creative discovery, requirement reality, system shape, interface/data contract, abstraction boundary, execution architecture, task contract, Second-Move Review, and final approval.
33
36
  - Ask with the Decision Question Protocol when the answer changes scope, design, implementation boundary, or verification.
34
37
  exit_criteria:
35
38
  - "`task.md#Contract Summary` states the approved solution, non-goals, frozen decisions, work branch, user stories, decision questions, planning-flow results, review gate, verification expectations, and open assumptions."
39
+ - "`task.md#Contract Summary` contains an ASCII Branch Chain Analysis for requirement impact and business impact, tracing upstream sources, current code path, deepest affected layer, downstream blast radius, and prompt/provider contracts when involved; tree connector characters stay ASCII while node text follows the configured output language."
36
40
  - "`task.md` contains executable task blocks generated from `assets/TASKS_TEMPLATE.md`."
37
41
  - "Non-trivial plans complete product/creative discovery before engineering design: worth doing, desired product shape, narrowest wedge, 10x/better version, and do-nothing consequence."
38
42
  - "Non-trivial plans complete Second-Move Review before approval: first good move, simpler move, better architecture, selected move, and rejected tradeoff."
@@ -63,10 +67,11 @@ tool_budget:
63
67
 
64
68
  1. 先用 resolver 找到当前仓库的 `cc-devflow`,并确认支持 `next-change-key`、`config`。
65
69
  2. 用 `next-change-key --prefix REQ|FIX --description "..."` 生成 `changeId` 和完整 `changeKey`,不要手动扫描编号。
66
- 3. 分配 change key 后立刻锚定分支:`REQ-003-copy-link` 对应 `REQ/003-copy-link`,`FIX-014-auth-race` 对应 `FIX/014-auth-race`。当前在 default branch 时停止并报告 setup blocker。
67
- 4. task blocks 前先确认方案。tiny 计划仍要过 planning flow,只是更短。
68
- 5. `task.md` 必须包含 `Contract Summary`、决策问题、planning flow、review gate、任务列表、验证命令、完成证据、禁止重决策事项和阶段 commit 要求。
69
- 6. 完成 Plan 后提交 Git commit。下一阶段从 Git history `task.md` 恢复,不靠过程文件。
70
+ 3. 分配 change key 后立刻运行 `../cc-dev/scripts/prepare-change-worktree.sh --change-key <REQ/FIX-...>`,从主 checkout 创建或复用独立 change worktree;主目录必须继续绑定 `main`。
71
+ 4. 进入脚本返回的 `WORKTREE_PATH` 后,再由 `../cc-dev/scripts/ensure-work-branch.sh --change-key <REQ/FIX-...>` 锚定 exact-case 分支:`REQ-003-copy-link` 对应 `REQ/003-copy-link`,`FIX-014-auth-race` 对应 `FIX/014-auth-race`。大小写碰撞或目标分支不匹配都是 setup blocker。
72
+ 5. task blocks 前先确认方案。tiny 计划仍要过 planning flow,只是更短。
73
+ 6. `task.md` 必须包含 `Contract Summary`、ASCII Branch Chain Analysis、决策问题、planning flow、review gate、任务列表、验证命令、完成证据、禁止重决策事项和阶段 commit 要求。
74
+ 7. 完成 Plan 后提交 Git commit。下一阶段从 Git history 和 `task.md` 恢复,不靠过程文件。
70
75
 
71
76
  ```bash
72
77
  DEVFLOW=".claude/skills/cc-dev/scripts/resolve-cc-devflow.sh"
@@ -81,6 +86,7 @@ bash "$DEVFLOW" config resolve --format policy
81
86
  - 非 trivial 计划至少经过两轮用户确认:先确认产品价值和形态,再确认工程方案和任务合同;只有 roadmap / spec 已经给出等价证据时才能记录 skip reason。
82
87
  - 第一手好方案不能直接冻结;非 trivial 计划必须过 Second-Move Review:先写 first good move,再找 simpler move 和 better architecture,最后选择一个当前可执行的 move。
83
88
  - 计划先做上下文和设计判断,再拆 task;不能把架构、接口、字段、测试缝隙留给 `cc-do` 猜。
89
+ - 需求链路必须画成 ASCII 分叉树:从用户需求追到现有入口、调用方、状态/数据流、最深底层影响点,再向下游展开业务影响、风险和验证面。
84
90
  - 用户视角必须清楚:真实用户 / operator、status quo、最痛失败场景、最小成功信号和非目标。
85
91
  - 行为变更任务按 tracer bullet 写:`[TEST] -> [IMPL] -> [REFACTOR]`,不要水平切层。
86
92
  - 每个任务写清目标、文件、依赖、TDD phase、读什么、怎么验证、完成证据。
@@ -102,6 +108,64 @@ bash "$DEVFLOW" config resolve --format policy
102
108
 
103
109
  `tiny-design` 可以把每轮压成一句话;`full-design` 必须保留足够证据让执行者不二次设计。任一轮 `blocked` 时,只能问一个 blocking question、拆回 roadmap / 多个 REQ/FIX,或记录用户明确接受的人工边界。非 trivial 计划的产品/创意确认和工程方案确认必须分成至少两次确认,不能一次性把所有问题塞给用户。
104
110
 
111
+ ## ASCII Branch Chain Analysis
112
+
113
+ `task.md#Contract Summary` 必须包含一个 ASCII 分叉树代码块。它不是插图,是执行合同的一部分。
114
+
115
+ Language rule:
116
+
117
+ - Tree structure tokens must stay ASCII: `|--`, `` `-- ``, `|`, spaces, and plain punctuation.
118
+ - Node labels, placeholder text, explanations, and evidence summaries must follow `Output language` in `task.md`.
119
+ - If `Output language` is unset, use the current conversation language and record the assumption.
120
+ - Do not hard-code English labels such as `Requirement Impact Chain` when the configured output language is not English.
121
+ - Use the Label table as the shared source for chain titles, node labels, and placeholder text.
122
+
123
+ Label table:
124
+
125
+ | Semantic slot | en | zh-CN |
126
+ | --- | --- | --- |
127
+ | requirementChain | Requirement Impact Chain | 需求影响链 |
128
+ | requirementMarker | REQ | 需求 |
129
+ | upstreamSource | Upstream source | 上游来源 |
130
+ | currentCodePath | Current code path | 当前代码路径 |
131
+ | caller | caller | 调用方 |
132
+ | dataOrState | data or state | 数据或状态 |
133
+ | deepestAffectedLayer | deepest affected layer | 最深影响层 |
134
+ | requiredChange | Required change | 必要变更 |
135
+ | verificationSeam | Verification seam | 验证缝隙 |
136
+ | businessChain | Business Impact Chain | 业务影响链 |
137
+ | outcomeMarker | OUTCOME | 结果 |
138
+ | directBehaviorImpact | Direct behavior impact | 直接行为影响 |
139
+ | downstreamImpact | Downstream impact | 下游影响 |
140
+ | riskBranch | Risk branch | 风险分支 |
141
+ | nonGoalBranch | Non-goal branch | 非目标分支 |
142
+
143
+ ```text
144
+ <requirementChain>
145
+ <requirementMarker>: <user-visible change>
146
+ |-- <upstreamSource>: <roadmap / issue / user request / existing task>
147
+ |-- <currentCodePath>: <entry>
148
+ | |-- <caller>: <file / command / UI / API>
149
+ | |-- <dataOrState>: <field / config / artifact>
150
+ | `-- <deepestAffectedLayer>: <module / prompt / provider contract / storage>
151
+ |-- <requiredChange>: <smallest behavior delta>
152
+ `-- <verificationSeam>: <public test / command / artifact>
153
+
154
+ <businessChain>
155
+ <outcomeMarker>: <operator / user value>
156
+ |-- <directBehaviorImpact>: <what changes for user>
157
+ |-- <downstreamImpact>: <consumers / docs / examples / release>
158
+ |-- <riskBranch>: <regression / migration / support / cost>
159
+ `-- <nonGoalBranch>: <explicitly not changed>
160
+ ```
161
+
162
+ 规则:
163
+
164
+ - 先向上追来源,再向下追影响面;不要只写目标文件列表。
165
+ - 必须找到“最深底层会影响的链路”:数据模型、状态机、CLI/runtime、prompt、provider contract、存储或外部边界。
166
+ - 若需求影响提示词、agent 指令、provider 参数、生成 artifact,树里必须写出精确 prompt/provider 合同位置。
167
+ - 没有证据的分支写 `unknown -> Evidence Request`,不能伪装成已确认。
168
+
105
169
  ## Decision Question Protocol
106
170
 
107
171
  只在答案会改变范围、方案、接口、任务切分或验证口径时提问。能从 repo evidence、roadmap、spec、测试或 git history 确认的,不问用户。
@@ -82,6 +82,47 @@ Engineering Review Gate:
82
82
  - Mock boundary:
83
83
  - Feedback loop:
84
84
 
85
+ ASCII Branch Chain Analysis:
86
+ Language rule: keep connector tokens ASCII; write node labels and evidence text in `Output language`.
87
+
88
+ Label table:
89
+ | Semantic slot | en | zh-CN |
90
+ | --- | --- | --- |
91
+ | requirementChain | Requirement Impact Chain | 需求影响链 |
92
+ | requirementMarker | REQ | 需求 |
93
+ | upstreamSource | Upstream source | 上游来源 |
94
+ | currentCodePath | Current code path | 当前代码路径 |
95
+ | caller | caller | 调用方 |
96
+ | dataOrState | data or state | 数据或状态 |
97
+ | deepestAffectedLayer | deepest affected layer | 最深影响层 |
98
+ | requiredChange | Required change | 必要变更 |
99
+ | verificationSeam | Verification seam | 验证缝隙 |
100
+ | businessChain | Business Impact Chain | 业务影响链 |
101
+ | outcomeMarker | OUTCOME | 结果 |
102
+ | directBehaviorImpact | Direct behavior impact | 直接行为影响 |
103
+ | downstreamImpact | Downstream impact | 下游影响 |
104
+ | riskBranch | Risk branch | 风险分支 |
105
+ | nonGoalBranch | Non-goal branch | 非目标分支 |
106
+
107
+ ```text
108
+ <requirementChain>
109
+ <requirementMarker>: <user-visible change>
110
+ |-- <upstreamSource>: <roadmap / issue / user request / existing task>
111
+ |-- <currentCodePath>: <entry>
112
+ | |-- <caller>: <file / command / UI / API>
113
+ | |-- <dataOrState>: <field / config / artifact>
114
+ | `-- <deepestAffectedLayer>: <module / prompt / provider contract / storage>
115
+ |-- <requiredChange>: <smallest behavior delta>
116
+ `-- <verificationSeam>: <public test / command / artifact>
117
+
118
+ <businessChain>
119
+ <outcomeMarker>: <operator / user value>
120
+ |-- <directBehaviorImpact>: <what changes for user>
121
+ |-- <downstreamImpact>: <consumers / docs / examples / release>
122
+ |-- <riskBranch>: <regression / migration / support / cost>
123
+ `-- <nonGoalBranch>: <explicitly not changed>
124
+ ```
125
+
85
126
  Acceptance:
86
127
  -
87
128
 
@@ -16,6 +16,7 @@
16
16
  12. Non-trivial plans complete Second-Move Review before approval; the first workable plan is not frozen until a simpler move and a better-architecture move have both been considered.
17
17
  13. Non-trivial plans complete product/creative discovery before engineering design; if worth, shape, wedge, or 10x/better version is unclear, ask product questions before implementation questions.
18
18
  14. Product/creative confirmation and engineering confirmation are separate rounds unless roadmap/spec evidence already answers one of them and `task.md` records the skip reason.
19
+ 15. ASCII branch-chain connector tokens stay ASCII, but labels, evidence, and explanatory text follow `Output language`.
19
20
 
20
21
  ## Planning Flow
21
22
 
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.3
4
+
5
+ - require ASCII PR Review Chain labels, findings, and evidence summaries to follow the PR/task/handoff output language while keeping connectors ASCII
6
+ - replace hard-coded English PR Review Chain examples with an `en` / `zh-CN` label table and semantic slots
7
+
8
+ ## 1.1.2
9
+
10
+ - require ASCII PR Review Chains for non-trivial remote PR findings without creating local process files
11
+
3
12
  ## 1.1.1
4
13
 
5
14
  - simplify PR review output persistence to a no-process-files rule
@@ -24,6 +24,8 @@
24
24
  ## Required Outputs
25
25
 
26
26
  - PR review packet
27
+ - ASCII PR Review Chain for each non-trivial finding
28
+ - Output-language check: ASCII connectors only; labels and finding text follow the PR/task/handoff language
27
29
  - Covered lanes
28
30
  - Findings triage
29
31
  - Checks status
@@ -40,6 +42,7 @@ Each accepted finding should include:
40
42
  - Why it matters:
41
43
  - Evidence:
42
44
  - Confidence:
45
+ - ASCII Branch Chain:
43
46
  - Fix path:
44
47
  ```
45
48
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cc-pr-review
3
- version: 1.1.1
3
+ version: 1.1.3
4
4
  description: Use in a separate session to review one remote GitHub PR before landing. It reports findings from PR truth and current diff without writing process files.
5
5
  triggers:
6
6
  - review 这个 PR
@@ -29,6 +29,7 @@ entry_gate:
29
29
  exit_criteria:
30
30
  - Review result is approved-for-landing, changes-requested, needs-clarification, or blocked.
31
31
  - Findings cite concrete PR diff, command output, checks, local task facts, or missing evidence.
32
+ - Non-trivial findings include an ASCII Branch Chain that traces PR source, changed node, upstream contract, downstream landing risk, and route; tree connector characters stay ASCII while node text follows the configured output language.
32
33
  - Required fixes route back to cc-dev or cc-do; clean PRs route to cc-pr-land.
33
34
  - No local process file is created.
34
35
  reroutes:
@@ -57,3 +58,31 @@ Build the review from:
57
58
  - `task.md` and `handoff/pr-brief.md` when available
58
59
 
59
60
  Output findings in the response or GitHub review only. Do not write local process files.
61
+
62
+ For each non-trivial finding, include:
63
+
64
+ Language rule: keep `|--`, `` `-- ``, `|`, spaces, and punctuation ASCII; write labels, explanations, findings, and evidence summaries in the PR/task/handoff output language, falling back to the current conversation language when unavailable. Use the Label table as the shared source for chain titles, node labels, and placeholder text.
65
+
66
+ Label table:
67
+
68
+ | Semantic slot | en | zh-CN |
69
+ | --- | --- | --- |
70
+ | prReviewChain | PR Review Chain | PR 审查链 |
71
+ | findingMarker | FINDING | 问题 |
72
+ | prSource | PR source | PR 来源 |
73
+ | changedNode | Changed node | 变更节点 |
74
+ | upstreamContract | upstream contract | 上游合同 |
75
+ | firstAffectedSeam | first affected seam | 首个受影响边界 |
76
+ | downstreamLandingRisk | Downstream landing risk | 下游合并风险 |
77
+ | route | Route | 路线 |
78
+
79
+ ```text
80
+ <prReviewChain>
81
+ <findingMarker>: <severity + short name>
82
+ |-- <prSource>: <PR number / commit / diff hunk / check>
83
+ |-- <changedNode>: <file / behavior / artifact>
84
+ | |-- <upstreamContract>: <task / spec / prompt / provider / API>
85
+ | `-- <firstAffectedSeam>: <runtime / user / operator / package>
86
+ |-- <downstreamLandingRisk>: <merge / release / main parity / sibling work>
87
+ `-- <route>: <cc-dev / cc-do / cc-review / cc-pr-land / stop>
88
+ ```
@@ -1,5 +1,15 @@
1
1
  # CC-Review Changelog
2
2
 
3
+ ## 2.2.3 - 2026-05-17
4
+
5
+ - require ASCII Branch Chain labels, findings, and evidence summaries to follow the configured output language while keeping connectors ASCII
6
+ - replace hard-coded English Review Chain examples with an `en` / `zh-CN` label table and semantic slots
7
+
8
+ ## 2.2.2 - 2026-05-17
9
+
10
+ - require ASCII Branch Chains for non-trivial plan, investigation, PR, implementation, and code-smell findings
11
+ - route plan and investigation review chains into `task.md` while keeping implementation and PR chains in the response or GitHub review instead of local process files
12
+
3
13
  ## 2.2.1 - 2026-05-14
4
14
 
5
15
  - restore deep review method flow without restoring review process files