cc-devflow 4.5.6 → 4.5.7

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 (65) hide show
  1. package/.claude/skills/cc-act/PLAYBOOK.md +2 -2
  2. package/.claude/skills/cc-act/SKILL.md +2 -2
  3. package/.claude/skills/cc-act/scripts/{archive-requirement.sh → archive-change.sh} +7 -7
  4. package/.claude/skills/cc-investigate/CHANGELOG.md +5 -0
  5. package/.claude/skills/cc-investigate/SKILL.md +2 -2
  6. package/.claude/skills/cc-plan/CHANGELOG.md +22 -0
  7. package/.claude/skills/cc-plan/PLAYBOOK.md +20 -17
  8. package/.claude/skills/cc-plan/SKILL.md +91 -19
  9. package/.claude/skills/cc-plan/assets/DESIGN_TEMPLATE.md +42 -0
  10. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +2 -0
  11. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +36 -2
  12. package/.claude/skills/cc-plan/assets/TINY_DESIGN_TEMPLATE.md +30 -0
  13. package/.claude/skills/cc-plan/references/planning-contract.md +20 -15
  14. package/.claude/skills/cc-plan/scripts/next-change-key.sh +78 -0
  15. package/.claude/skills/cc-review/CHANGELOG.md +7 -0
  16. package/.claude/skills/cc-review/PLAYBOOK.md +54 -0
  17. package/.claude/skills/cc-review/SKILL.md +173 -0
  18. package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +81 -0
  19. package/.claude/skills/cc-review/references/implementation-review-branch.md +115 -0
  20. package/.claude/skills/cc-review/references/plan-review-branch.md +116 -0
  21. package/.claude/skills/cc-review/references/review-methods.md +126 -0
  22. package/.claude/skills/cc-roadmap/CHANGELOG.md +6 -0
  23. package/.claude/skills/cc-roadmap/SKILL.md +102 -8
  24. package/.claude/skills/cc-roadmap/assets/BACKLOG_TEMPLATE.md +3 -0
  25. package/.claude/skills/cc-roadmap/assets/ROADMAP_TEMPLATE.md +23 -0
  26. package/.claude/skills/cc-roadmap/assets/TRACKING_TEMPLATE.json +20 -1
  27. package/.claude/skills/cc-roadmap/references/roadmap-dialogue.md +28 -13
  28. package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/markdown.js +18 -0
  29. package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/schema.js +8 -0
  30. package/CHANGELOG.md +9 -0
  31. package/README.md +9 -4
  32. package/README.zh-CN.md +9 -4
  33. package/bin/cc-devflow-cli.js +119 -0
  34. package/config/distributable-skills.json +2 -0
  35. package/docs/examples/example-bindings.json +5 -4
  36. package/docs/examples/full-design-blocked/BACKLOG.md +1 -1
  37. package/docs/examples/full-design-blocked/README.md +1 -1
  38. package/docs/examples/full-design-blocked/ROADMAP.md +16 -1
  39. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +36 -3
  40. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +295 -71
  41. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/tasks.md +2 -1
  42. package/docs/examples/full-design-blocked/roadmap.json +18 -2
  43. package/docs/examples/local-handoff/BACKLOG.md +1 -1
  44. package/docs/examples/local-handoff/README.md +1 -1
  45. package/docs/examples/local-handoff/ROADMAP.md +16 -1
  46. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +27 -1
  47. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +170 -41
  48. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/tasks.md +2 -1
  49. package/docs/examples/local-handoff/roadmap.json +16 -2
  50. package/docs/examples/pdca-loop/BACKLOG.md +1 -1
  51. package/docs/examples/pdca-loop/README.md +1 -1
  52. package/docs/examples/pdca-loop/ROADMAP.md +16 -1
  53. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +27 -1
  54. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +62 -10
  55. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/tasks.md +2 -1
  56. package/docs/examples/pdca-loop/roadmap.json +16 -2
  57. package/docs/examples/scripts/check-example-bindings.sh +2 -0
  58. package/docs/guides/getting-started.md +12 -9
  59. package/docs/guides/getting-started.zh-CN.md +12 -9
  60. package/lib/skill-runtime/__tests__/archive-change.test.js +124 -0
  61. package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +1 -0
  62. package/lib/skill-runtime/__tests__/paths.test.js +81 -1
  63. package/lib/skill-runtime/archive-change.js +64 -0
  64. package/lib/skill-runtime/paths.js +32 -0
  65. package/package.json +2 -1
@@ -16,7 +16,7 @@
16
16
  12. 同 blast radius 内的完整边界默认纳入,defer 必须写入 `NOT in scope` 和原因。
17
17
  13. 如果推荐方案挑战用户原始方向,必须标成 `user challenge`,不能自动改写用户意图。
18
18
  14. 行为变更的具体任务默认采用测试先行;没有 Red/Green/Refactor 链、spec-style test name、公共测试 seam、行为断言、mock 边界或 TDD exception,不允许交给 `cc-do`。
19
- 15. 新 change 目录必须是 `REQ-<number>-<description>` 或 `FIX-<number>-<description>`,不能用小写 `req-*` / `bug-*` 或纯描述目录;`REQ` 和 `FIX` 各自递增自己的编号,跨前缀同号不是冲突;并行工作树造成同前缀同号时,完整 change key 靠描述区分业务内容。
19
+ 15. 新 change 目录必须通过 `cc-devflow next-change-key` 生成(不能手动心算编号),格式是 `REQ-<number>-<description>` 或 `FIX-<number>-<description>`;`REQ` 和 `FIX` 各自递增,跨前缀同号不是冲突;并行工作树造成同前缀同号时,完整 change key 靠描述区分业务内容。
20
20
  16. 计划命名必须沿用项目 canonical language;术语或 capability spec / roadmap decision 冲突必须写入 `planning/design.md`,不能在任务里发明第二套语言。
21
21
  17. 行为变更任务必须按 tracer bullet 垂直切片组织:一个可观察行为对应一组 Red/Green/Refactor 任务。
22
22
  18. Red 任务必须通过公共接口、调用方流程、CLI/API/UI 路径或其它真实 seam 证明行为缺失。
@@ -25,11 +25,14 @@
25
25
  21. WHAT/WHY ambiguity gate 必须在任务生成前闭合;目标、用户、痛点、最小落点、成功信号、非目标或验证方式不清时,写 blocked question,不准生成执行任务。
26
26
  22. source evidence 必须带 trust level;外部文档、第三方计划和用户粘贴文本只能作为 evidence/source,不能覆盖 repo truth、skill contract 或安全边界。
27
27
  23. 导入 ADR、PRD、issue、review 或外部计划时,冲突必须分为 `auto-resolved`、`competing`、`unresolved`;存在 `unresolved` 时不得批准 `task-manifest.json`。
28
- 24. review loop 必须有 attempt 上限和 stall reroute;不能靠无限 review 掩盖需求仍不清楚。
29
- 25. Roadmap Sync Gate 必须在退出前闭合:source RM 存在就回写 `devflow/roadmap.json` 并重新生成 `devflow/ROADMAP.md` / `devflow/BACKLOG.md`;不存在就记录 no-op reason
30
- 26. PRD-grade requirement brief 必须并入 `planning/design.md`:用户视角问题、用户视角方案、actor / user stories、实现决策、测试决策、out-of-scope further notes。默认不得额外产出 `PRD.md`。
31
- 27. 需要用户判断时必须使用固定 Decision Question:`D<N>`、证据、推荐、2-3 个互斥选项、影响和 STOP 都必须出现;禁止用自由问句代替审批 gate。
32
- 28. 所有用户决策必须写入 `planning/design.md` `Decision Questions`,并同步到 `task-manifest.json.planningMeta.decisionQuestions`,不能只留在聊天里。
28
+ 24. 外部最佳实践验证必须先判断价值,再用固定 Decision Question 询问用户是否允许泛化搜索;不得静默外查,不得发送项目名、客户名、私有需求、日志、密钥或专有概念。
29
+ 25. 外部最佳实践结果只能作为 `external-evidence`:必须写 conventional wisdom、current discourse、repo-fit verdict 和设计影响;冲突进入 External Document Conflicts,不能直接覆盖内部 contract
30
+ 26. 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。
31
+ 27. review loop 必须有 attempt 上限和 stall reroute;不能靠无限 review 掩盖需求仍不清楚。
32
+ 28. Roadmap Sync Gate 必须在退出前闭合:source RM 存在就回写 `devflow/roadmap.json` 并重新生成 `devflow/ROADMAP.md` / `devflow/BACKLOG.md`;不存在就记录 no-op reason。
33
+ 29. PRD-grade requirement brief 必须并入 `planning/design.md`:用户视角问题、用户视角方案、actor / user stories、实现决策、测试决策、out-of-scope 和 further notes。默认不得额外产出 `PRD.md`。
34
+ 30. 需要用户判断时必须使用固定 Decision Question:`D<N>`、证据、推荐、2-3 个互斥的 `A/B/C` 字母选项、影响和 STOP 都必须出现;禁止用自由问句或 `1/2/3` 数字选项代替审批 gate。
35
+ 31. 所有用户决策必须写入 `planning/design.md` 的 `Decision Questions`,并同步到 `task-manifest.json.planningMeta.decisionQuestions`,不能只留在聊天里。
33
36
 
34
37
  ## Design Modes
35
38
 
@@ -80,10 +83,10 @@
80
83
  每个需要用户判断的 gate 至少记录:
81
84
 
82
85
  - questionId:`D1` / `D2` / ...
83
- - gate:`planning-mode` / `ambiguity-blocker` / `approach-approval` / `taste-or-user-challenge` / `final-design-approval`
86
+ - gate:`planning-mode` / `ambiguity-blocker` / `external-best-practice` / `approach-approval` / `taste-or-user-challenge` / `final-design-approval`
84
87
  - knownEvidence
85
88
  - recommendation
86
- - options
89
+ - options:只能使用 `A` / `B` / `C` 作为 option id
87
90
  - userChoice
88
91
  - impact
89
92
  - status:`asked` / `answered` / `auto-decided`
@@ -112,13 +115,15 @@
112
115
  16. Green minimality / refactor candidate scan
113
116
  17. PRD brief scan
114
117
  18. Source trust boundary scan
115
- 19. External conflict scan
116
- 20. Ambiguity gate
117
- 21. Bounded review loop
118
- 22. NOT in scope
119
- 23. Test-first readiness
120
- 24. Decision questions recorded
121
- 25. Final recommendation
118
+ 19. External best-practice validation scan
119
+ 20. AI Leverage Decision Lens scan
120
+ 21. External conflict scan
121
+ 22. Ambiguity gate
122
+ 23. Bounded review loop
123
+ 23. NOT in scope
124
+ 24. Test-first readiness
125
+ 25. Decision questions recorded
126
+ 26. Final recommendation
122
127
 
123
128
  如有 UI scope,再补 design review 结论。
124
129
  如有 developer-facing scope,再补 DX review 结论。
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # 计算下一个 REQ/FIX change key,输出两行:changeId 和 changeKey
5
+
6
+ usage() {
7
+ echo 'Usage: next-change-key.sh --prefix REQ|FIX --description "short description" [--cwd path]'
8
+ }
9
+
10
+ PREFIX=""
11
+ DESCRIPTION=""
12
+ CWD=""
13
+
14
+ while [[ $# -gt 0 ]]; do
15
+ case "$1" in
16
+ --prefix) PREFIX="$2"; shift 2 ;;
17
+ --description) DESCRIPTION="$2"; shift 2 ;;
18
+ --cwd) CWD="$2"; shift 2 ;;
19
+ -h|--help) usage; exit 0 ;;
20
+ *) echo "Unknown arg: $1" >&2; usage; exit 1 ;;
21
+ esac
22
+ done
23
+
24
+ if [[ -z "$PREFIX" || -z "$DESCRIPTION" ]]; then
25
+ usage
26
+ exit 1
27
+ fi
28
+
29
+ REPO_ROOT="${CWD:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
30
+
31
+ # 优先用本仓库 node CLI(最可靠),再用全局 cc-devflow,最后纯 bash 兜底
32
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
33
+ CLI_JS="$SCRIPT_DIR/../../../../bin/cc-devflow-cli.js"
34
+
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
67
+ fi
68
+
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"
@@ -0,0 +1,7 @@
1
+ # CC-Review Changelog
2
+
3
+ ## 1.0.0
4
+
5
+ - Added `cc-review` as an optional deep review workflow that branches between plan-stage and implementation-stage review.
6
+ - Added progressive references for TOC/root-cause methods, plan review, implementation review, and Codex plugin E2E verification.
7
+ - Added durable review report and structured findings output contracts.
@@ -0,0 +1,54 @@
1
+ # CC-Review Playbook
2
+
3
+ ## Visible State Machine
4
+
5
+ `cc-plan / cc-investigate -> cc-review -> cc-plan | cc-do`
6
+
7
+ `cc-do -> cc-review -> cc-do | cc-check`
8
+
9
+ - Enter from: a complex plan, investigated bug, implementation diff, review comment, or user request for deep review.
10
+ - Stay in: `cc-review` until the branch type, scope, findings, plugin/E2E evidence needs, and next route are explicit.
11
+ - Exit to: `cc-plan` for broken plan contracts, `cc-do` for implementation fixes, or `cc-check` for fresh verification.
12
+ - Reroute to: `cc-act` only if `cc-check` is already fresh and clean.
13
+
14
+ ## Core Rules
15
+
16
+ 1. 先判断 review 对象是计划、实现,还是混合。
17
+ 2. 只读当前需求范围内的坏味道;历史债只在被本次变更放大时进入。
18
+ 3. `cc-check` 是证据验收,`cc-review` 是深度诊断,两者不要混成一个门。
19
+ 4. 计划分支按 strategy / design / engineering / DX 渐进加载,不把所有方法一次塞进上下文。
20
+ 5. 实现分支先读 diff 和意图,再读周边代码,最后才给 finding。
21
+ 6. UI 或运行时链路有风险时,必须用 Browser / Computer Use / CLI / logs 做端到端证明或写清阻塞原因。
22
+ 7. 每个坏味道必须有 evidence、scope、recommendation 和 route。
23
+ 8. 没有证据就写 unknown,不准把审美判断伪装成缺陷。
24
+ 9. 发现计划合同错误,回 `cc-plan`;发现代码错误,回 `cc-do`;只差验收,进 `cc-check`。
25
+ 10. 输出必须落到 `review/cc-review-report.md`,不能只留在聊天里。
26
+
27
+ ## Required Outputs
28
+
29
+ - `review/cc-review-report.md`
30
+ - `review/cc-review-findings.json` when later agents need structured findings
31
+
32
+ ## Local Kit
33
+
34
+ - `references/review-methods.md`: TOC / logic tree / smells / severity rules
35
+ - `references/plan-review-branch.md`: plan-stage deep review
36
+ - `references/implementation-review-branch.md`: diff and code-stage deep review
37
+ - `references/e2e-and-plugin-verification.md`: Browser / Computer Use / logs evidence
38
+
39
+ ## Review Standard
40
+
41
+ `cc-review` 至少回答:
42
+
43
+ - 这次 Review 的对象是什么?
44
+ - 当前 scope 的真实意图是什么?
45
+ - 现有代码或计划已经解决了哪些子问题?
46
+ - 哪些设计约束会让实现变脆?
47
+ - 哪些代码坏味道在当前 blast radius 内?
48
+ - 哪些测试、日志、UI 操作或端到端证据缺失?
49
+ - 哪些 finding 必须修,哪些可以 defer,哪些只是 advisory?
50
+ - 下一步为什么是 `cc-plan` / `cc-do` / `cc-check`?
51
+
52
+ ## Decision Rule
53
+
54
+ 一个 finding 如果会改变范围、架构、用户可见行为、公共 API、测试策略或超过机械局部清理,必须交给用户决策或 reroute 到上游 skill。机械且低风险的问题可以作为 `cc-do` 的明确修复项,但 `cc-review` 自身不偷偷改代码。
@@ -0,0 +1,173 @@
1
+ ---
2
+ name: cc-review
3
+ version: 1.0.0
4
+ description: Use when a complex requirement, bug fix, plan, or implementation diff needs an optional deep multi-round review beyond cc-check. Routes plan-stage material through strategy/design/engineering/DX review methods, routes execution-stage code through diff/code-quality/E2E review, identifies in-scope code smells, and writes durable cc-review findings before rerouting to cc-plan, cc-do, or cc-check.
5
+ triggers:
6
+ - 深度 review 这个方案
7
+ - review 这个复杂需求
8
+ - review 这个 bug 修复
9
+ - 做一次 cc-review
10
+ - deep review this plan
11
+ - review this implementation deeply
12
+ - check code smells
13
+ - run cc-review
14
+ reads:
15
+ - PLAYBOOK.md
16
+ - CHANGELOG.md
17
+ - references/review-methods.md
18
+ - references/plan-review-branch.md
19
+ - references/implementation-review-branch.md
20
+ - references/e2e-and-plugin-verification.md
21
+ writes:
22
+ - path: devflow/changes/<change-key>/review/cc-review-report.md
23
+ durability: durable
24
+ required: true
25
+ - path: devflow/changes/<change-key>/review/cc-review-findings.json
26
+ durability: durable
27
+ required: false
28
+ effects:
29
+ - optional deep review
30
+ - durable findings
31
+ - reroute recommendation
32
+ entry_gate:
33
+ - Read planning/design.md or planning/analysis.md when the work is still plan-stage.
34
+ - Read the current diff, task manifest, change metadata, and latest verification evidence when the work is execution-stage.
35
+ - Classify the review branch as plan, implementation, or mixed before loading detailed references.
36
+ - Freeze the requested scope before finding smells; only report smells inside the requirement blast radius or clearly amplified by the current work.
37
+ exit_criteria:
38
+ - cc-review-report.md records branch classification, scope, methods used, findings, user decisions needed, and next route.
39
+ - Plan-stage reviews record strategy/design/engineering/DX facets only when applicable.
40
+ - Implementation-stage reviews include diff evidence, code-smell evidence, test and E2E/plugin verification evidence when applicable.
41
+ - Every in-scope code smell has a concrete recommendation or an explicit skip/defer rationale.
42
+ - The next action is exactly one of cc-plan, cc-do, cc-check, cc-act, or no-op.
43
+ reroutes:
44
+ - when: Plan assumptions, scope, architecture, design, or DX contracts are wrong or incomplete.
45
+ target: cc-plan
46
+ - when: Implementation findings require code, test, docs, or UI behavior changes.
47
+ target: cc-do
48
+ - when: Deep review is clean and only fresh evidence verification remains.
49
+ target: cc-check
50
+ recovery_modes:
51
+ - name: branch-reclassification
52
+ when: The review started on the wrong branch type or new evidence shows both plan and implementation need review.
53
+ action: Stop the current pass, restate the correct branch classification, load the matching reference, and restart from the scope freeze.
54
+ - name: progressive-disclosure-reset
55
+ when: The review is drowning in unrelated methods or external review templates.
56
+ action: Return to SKILL.md, reload only the branch-specific reference and review-methods.md, then continue with the smallest applicable checklist.
57
+ tool_budget:
58
+ read_files: 12
59
+ search_steps: 8
60
+ shell_commands: 10
61
+ ---
62
+
63
+ # CC-Review
64
+
65
+ > [PROTOCOL]: 变更时同步更新 `version`、`CHANGELOG.md`、公开分发配置和相关文档,然后检查 `CLAUDE.md`
66
+
67
+ ## Role
68
+
69
+ `cc-review` 是可选的深度 Review 节点。
70
+
71
+ 它不替代 `cc-check`。`cc-check` 负责流程式证据验收和 pass/fail/blocked 裁决;`cc-review` 负责在复杂需求、复杂 bug、架构风险、UI/DX 风险、代码坏味道出现时做更深的多轮审查。
72
+
73
+ ## Runtime Output Policy
74
+
75
+ 写入任何 durable Markdown 或 JSON metadata 前,先运行 `cc-devflow config resolve --format policy`。
76
+
77
+ - `Output language` 是机器约束,`review/cc-review-report.md` 和 `review/cc-review-findings.json` 中新增的人类可读摘要必须记录并遵守它。
78
+ - `agent_preferences` 是用户偏好建议,只影响表达方式和结构选择,不覆盖本 Skill 的 Review 边界。
79
+ - 如果配置解析失败,先修配置或向用户说明阻塞,不要用默认语言继续生成正式文档。
80
+
81
+ ## Iron Law
82
+
83
+ ```text
84
+ REVIEW THE RIGHT THING AT THE RIGHT STAGE.
85
+ ```
86
+
87
+ 计划还没进入实现时,Review 计划。代码已经改了时,Review diff 和运行效果。两者都有时,先 Review 计划合同,再 Review 实现是否兑现合同。
88
+
89
+ ## Read First
90
+
91
+ 1. `PLAYBOOK.md`
92
+ 2. `CHANGELOG.md`
93
+ 3. `references/review-methods.md`
94
+ 4. Branch-specific reference:
95
+ - plan-stage: `references/plan-review-branch.md`
96
+ - implementation-stage: `references/implementation-review-branch.md`
97
+ - UI/runtime/plugin evidence: `references/e2e-and-plugin-verification.md`
98
+
99
+ ## Use This Skill When
100
+
101
+ - 复杂需求或复杂 bug 需要比 `cc-check` 更深的 Review。
102
+ - `cc-plan` 已有方案,但你怀疑范围、根因、架构、测试或 DX 没压实。
103
+ - `cc-do` 已经实现,但你要在进入 `cc-check` 前找设计坏味道、代码坏味道和端到端落地风险。
104
+ - 需要检查僵化、冗余、循环依赖、脆弱性、晦涩性、数据泥团、不必要复杂。
105
+ - UI 或 Codex 插件链路需要用浏览器、电脑操作、日志和点击验证证明实际效果。
106
+
107
+ 不要把每个小改动都送进 `cc-review`。简单、低风险、证据充分的变更直接走 `cc-check`。
108
+
109
+ ## Branch Classifier
110
+
111
+ 先分类,再加载详细方法:
112
+
113
+ | Branch | Signal | Load |
114
+ | --- | --- | --- |
115
+ | `plan` | 用户说“先别写代码”、只有 `planning/design.md` / `planning/analysis.md`,或没有实现 diff | `plan-review-branch.md` |
116
+ | `implementation` | 当前分支已有代码 diff、review comment、UI 改动、测试改动或用户说“Review 代码” | `implementation-review-branch.md` |
117
+ | `mixed` | 计划和实现都存在,且实现可能偏离计划 | 先 plan,再 implementation |
118
+
119
+ 如果分类不清,先读 change artifacts 和 diff。仍然不清时,用一个 Decision Question 问用户,不要猜。
120
+
121
+ ## Harness Contract
122
+
123
+ - Allowed actions: read artifacts, inspect code and diff, run safe read-only or verification commands, use Browser/Computer Use for behavior proof, write review reports.
124
+ - Forbidden actions: silently rewriting the plan, silently editing production code, turning optional review into mandatory ship gate, or reviewing unrelated historical debt.
125
+ - Required evidence: every finding must cite plan text, code path, diff line, command output, browser action, UI state, log line, or explicit missing evidence.
126
+ - Reroute rule: plan contract defects return to `cc-plan`; implementation defects return to `cc-do`; clean deep review proceeds to `cc-check`.
127
+
128
+ ## Output Contract
129
+
130
+ Write `review/cc-review-report.md` with:
131
+
132
+ 1. Review branch classification and scope.
133
+ 2. Source artifacts read.
134
+ 3. Review methods used and methods intentionally skipped.
135
+ 4. Findings by severity, each with evidence, smell category when relevant, recommendation, and route.
136
+ 5. E2E / Browser / Computer Use evidence when applicable.
137
+ 6. Decision questions still needing user input.
138
+ 7. Final next action.
139
+
140
+ Write `review/cc-review-findings.json` when findings need machine consumption by later agents.
141
+
142
+ ## Finding Rules
143
+
144
+ Each finding must include:
145
+
146
+ - severity: `critical` / `important` / `advisory`
147
+ - confidence: 1-10
148
+ - scope: why this is inside the current requirement blast radius
149
+ - evidence: concrete path, line, artifact, command, browser action, or log
150
+ - smell: one of `rigidity`, `duplication`, `cycle`, `fragility`, `obscurity`, `data-clump`, `unnecessary-complexity`, or `none`
151
+ - recommendation: exact next move
152
+ - route: `cc-plan`, `cc-do`, `cc-check`, `cc-act`, or `no-op`
153
+
154
+ Bad smells inside the requested scope are never hidden. Every in-scope smell must produce either a decision question, a routed fix recommendation, or an explicit defer/skip rationale. Ask whether to optimize when the smell is real and the fix is not a purely mechanical local cleanup.
155
+
156
+ ## Progressive Disclosure
157
+
158
+ Do not load every reference by default.
159
+
160
+ 1. Always read `review-methods.md`.
161
+ 2. Read `plan-review-branch.md` only for plan or mixed reviews.
162
+ 3. Read `implementation-review-branch.md` only for implementation or mixed reviews.
163
+ 4. Read `e2e-and-plugin-verification.md` only when UI, browser behavior, desktop app behavior, CLI runtime, or Codex plugin chain evidence is relevant.
164
+
165
+ ## Exit Rule
166
+
167
+ `cc-review` is complete only when the next route is unambiguous:
168
+
169
+ - `cc-plan`: revise design, scope, root cause, UI/DX contract, or task split.
170
+ - `cc-do`: fix implementation, tests, docs, UI behavior, logs, or review findings.
171
+ - `cc-check`: deep review is clean enough for evidence verification.
172
+ - `cc-act`: only when a fresh `cc-check` pass already exists.
173
+ - `no-op`: review found no relevant issue and no downstream action is needed.
@@ -0,0 +1,81 @@
1
+ # E2E and Plugin Verification
2
+
3
+ Use this reference when implementation review touches UI, browser behavior, desktop app behavior, local app flows, CLI runtime, logs, or Codex plugin interactions.
4
+
5
+ ## Applicability
6
+
7
+ Run this pass when any of these are true:
8
+
9
+ - frontend/UI files changed
10
+ - user-visible interaction changed
11
+ - route, API, or CLI output changed
12
+ - background job or log-based progress changed
13
+ - user asked to use Browser, Computer Use, or Codex plugins
14
+ - plan claims UI and implementation are consistent
15
+
16
+ Skip with reason for backend-only, docs-only, or pure planning reviews.
17
+
18
+ ## Evidence Chain
19
+
20
+ 1. Identify the user path:
21
+ - page, route, command, app screen, or plugin operation
22
+ - expected visible result
23
+ - logs or artifacts that prove backend behavior
24
+ 2. Start the smallest safe runtime:
25
+ - use repo scripts when available
26
+ - avoid production spend unless explicitly required
27
+ - record blocked env vars or missing services
28
+ 3. Use the right tool:
29
+ - Browser plugin for local web targets and screenshots
30
+ - Computer Use plugin for native desktop apps or real app UI
31
+ - shell/CLI for commands and logs
32
+ 4. Click or run every affected primary action.
33
+ 5. Check:
34
+ - visible result
35
+ - console/errors/logs
36
+ - persisted artifact or backend state
37
+ - empty/error/loading states when applicable
38
+
39
+ ## UI Verification Checklist
40
+
41
+ For each changed flow:
42
+
43
+ ```text
44
+ FLOW
45
+ ├── page opened
46
+ ├── primary action clicked
47
+ ├── expected UI state observed
48
+ ├── error/empty/loading state checked or explicitly skipped
49
+ ├── console/log checked
50
+ └── backend artifact/log checked when relevant
51
+ ```
52
+
53
+ ## Plugin Verification Checklist
54
+
55
+ When Codex plugins are part of the expected path:
56
+
57
+ - confirm the plugin exists in the current environment
58
+ - use Browser for localhost/file targets instead of shell-only inspection
59
+ - use Computer Use for desktop app interactions
60
+ - record if plugin access is unavailable and what verification replaced it
61
+ - never claim end-to-end UI proof from code inspection alone
62
+
63
+ ## Report Format
64
+
65
+ Add an E2E section to `cc-review-report.md`:
66
+
67
+ ```markdown
68
+ ## E2E / Plugin Evidence
69
+
70
+ | Flow | Tool | Evidence | Result |
71
+ | --- | --- | --- | --- |
72
+ | ... | Browser / Computer Use / CLI | screenshot, log, command, artifact | pass / fail / blocked |
73
+ ```
74
+
75
+ If blocked, include:
76
+
77
+ - missing dependency
78
+ - command attempted
79
+ - exact error or missing tool
80
+ - fallback evidence
81
+ - whether this blocks `cc-check`
@@ -0,0 +1,115 @@
1
+ # Implementation Review Branch
2
+
3
+ Use this reference when the review target is code, tests, docs, UI behavior, or a current branch diff.
4
+
5
+ ## Intake
6
+
7
+ Read, in order:
8
+
9
+ 1. current branch and base branch
10
+ 2. `git diff <base>...HEAD --stat`
11
+ 3. full diff for changed files
12
+ 4. `planning/design.md` or `planning/analysis.md`
13
+ 5. `planning/tasks.md` and `planning/task-manifest.json`
14
+ 6. changed code plus direct importers/callers for enum, state, API, and behavior changes
15
+
16
+ If no plan exists, infer intent from user request, commits, TODOs, and PR body if present. Mark intent confidence.
17
+
18
+ ## Scope Check
19
+
20
+ Produce:
21
+
22
+ ```text
23
+ Scope Check: CLEAN | DRIFT DETECTED | REQUIREMENTS MISSING
24
+ Intent: ...
25
+ Delivered: ...
26
+ Diff surface: ...
27
+ ```
28
+
29
+ Out-of-scope files are findings only when they change behavior or expand blast radius.
30
+
31
+ ## Diff Review Passes
32
+
33
+ ### 1. Contract Fidelity
34
+
35
+ Check whether implementation matches the frozen plan or investigation:
36
+
37
+ - required tasks done
38
+ - rejected scope not implemented
39
+ - root cause still true
40
+ - expected spec delta honored
41
+ - behavior visible at public seam
42
+
43
+ ### 2. Code Smell Scan
44
+
45
+ Use `review-methods.md` smell taxonomy.
46
+
47
+ Look for:
48
+
49
+ - copy-paste helper logic
50
+ - broad catch-all errors
51
+ - parameter clumps
52
+ - shallow pass-through modules
53
+ - internal mocks driving production design
54
+ - new branch forests where a data shape would collapse cases
55
+ - hidden state or multiple truth sources
56
+ - cycles between modules
57
+
58
+ ### 3. Structural Risk
59
+
60
+ Check:
61
+
62
+ - security and trust boundaries
63
+ - enum/value completeness outside the diff
64
+ - migrations and rollback
65
+ - concurrency and double-submit
66
+ - external service failures
67
+ - logs/metrics for new paths
68
+
69
+ ### 4. Test Quality
70
+
71
+ Build a coverage map:
72
+
73
+ ```text
74
+ CODE PATHS USER/RUNTIME FLOWS
75
+ file.ts feature flow
76
+ ├── [tested] happy ├── [tested] main path
77
+ ├── [gap] empty ├── [gap] double action
78
+ └── [gap] upstream error └── [gap] navigate away / timeout
79
+ ```
80
+
81
+ Flag:
82
+
83
+ - no regression test for changed behavior
84
+ - tests only assert implementation shape
85
+ - tests mock internal modules instead of public seam
86
+ - fixture lies with missing fields or type casts
87
+ - no UI/E2E proof for user-visible change
88
+
89
+ ### 5. Documentation and DX
90
+
91
+ If changed behavior affects README, guides, CLI help, package install, public API, agent skill usage, or examples, check whether docs changed too.
92
+
93
+ ## Fix Policy
94
+
95
+ `cc-review` does not silently edit code. It writes findings and routes:
96
+
97
+ - mechanical local issue -> `cc-do` with direct fix recommendation
98
+ - architecture/contract issue -> `cc-plan`
99
+ - clean implementation -> `cc-check`
100
+
101
+ If the user explicitly asks to fix findings in the same turn, switch to `cc-do` behavior after writing the review report.
102
+
103
+ ## Output Requirements
104
+
105
+ Add to `cc-review-report.md`:
106
+
107
+ - base branch and diff summary
108
+ - scope check
109
+ - code smell findings
110
+ - structural findings
111
+ - test and E2E coverage map
112
+ - docs/DX notes
113
+ - final route
114
+
115
+ Write `cc-review-findings.json` when there are actionable findings.