cc-devflow 4.5.6 → 4.5.8

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 (92) hide show
  1. package/.claude/skills/cc-act/CHANGELOG.md +6 -0
  2. package/.claude/skills/cc-act/PLAYBOOK.md +11 -2
  3. package/.claude/skills/cc-act/SKILL.md +17 -7
  4. package/.claude/skills/cc-act/references/closure-contract.md +4 -0
  5. package/.claude/skills/cc-act/scripts/{archive-requirement.sh → archive-change.sh} +7 -7
  6. package/.claude/skills/cc-act/scripts/detect-ship-target.sh +27 -0
  7. package/.claude/skills/cc-act/scripts/ensure-ship-branch.sh +93 -0
  8. package/.claude/skills/cc-act/scripts/generate-status-report.sh +6 -0
  9. package/.claude/skills/cc-act/scripts/render-pr-brief.sh +6 -0
  10. package/.claude/skills/cc-act/scripts/sync-act-docs.sh +14 -0
  11. package/.claude/skills/cc-dev/CHANGELOG.md +5 -0
  12. package/.claude/skills/cc-dev/PLAYBOOK.md +63 -0
  13. package/.claude/skills/cc-dev/SKILL.md +168 -0
  14. package/.claude/skills/cc-do/CHANGELOG.md +6 -0
  15. package/.claude/skills/cc-do/SKILL.md +23 -1
  16. package/.claude/skills/cc-investigate/CHANGELOG.md +5 -0
  17. package/.claude/skills/cc-investigate/SKILL.md +2 -2
  18. package/.claude/skills/cc-next/CHANGELOG.md +5 -0
  19. package/.claude/skills/cc-next/PLAYBOOK.md +52 -0
  20. package/.claude/skills/cc-next/SKILL.md +161 -0
  21. package/.claude/skills/cc-plan/CHANGELOG.md +28 -0
  22. package/.claude/skills/cc-plan/PLAYBOOK.md +20 -17
  23. package/.claude/skills/cc-plan/SKILL.md +135 -21
  24. package/.claude/skills/cc-plan/assets/DESIGN_TEMPLATE.md +42 -0
  25. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +28 -0
  26. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +84 -2
  27. package/.claude/skills/cc-plan/assets/TINY_DESIGN_TEMPLATE.md +30 -0
  28. package/.claude/skills/cc-plan/references/planning-contract.md +31 -15
  29. package/.claude/skills/cc-plan/scripts/next-change-key.sh +78 -0
  30. package/.claude/skills/cc-pr-land/CHANGELOG.md +5 -0
  31. package/.claude/skills/cc-pr-land/PLAYBOOK.md +45 -0
  32. package/.claude/skills/cc-pr-land/SKILL.md +157 -0
  33. package/.claude/skills/cc-pr-review/CHANGELOG.md +5 -0
  34. package/.claude/skills/cc-pr-review/PLAYBOOK.md +46 -0
  35. package/.claude/skills/cc-pr-review/SKILL.md +142 -0
  36. package/.claude/skills/cc-review/CHANGELOG.md +28 -0
  37. package/.claude/skills/cc-review/PLAYBOOK.md +108 -0
  38. package/.claude/skills/cc-review/SKILL.md +340 -0
  39. package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +85 -0
  40. package/.claude/skills/cc-review/references/implementation-review-branch.md +152 -0
  41. package/.claude/skills/cc-review/references/plan-review-branch.md +151 -0
  42. package/.claude/skills/cc-review/references/review-methods.md +221 -0
  43. package/.claude/skills/cc-review/scripts/collect-review-context.sh +80 -0
  44. package/.claude/skills/cc-roadmap/CHANGELOG.md +6 -0
  45. package/.claude/skills/cc-roadmap/SKILL.md +102 -8
  46. package/.claude/skills/cc-roadmap/assets/BACKLOG_TEMPLATE.md +3 -0
  47. package/.claude/skills/cc-roadmap/assets/ROADMAP_TEMPLATE.md +23 -0
  48. package/.claude/skills/cc-roadmap/assets/TRACKING_TEMPLATE.json +20 -1
  49. package/.claude/skills/cc-roadmap/references/roadmap-dialogue.md +28 -13
  50. package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/markdown.js +18 -0
  51. package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/schema.js +8 -0
  52. package/.claude/skills/cc-simplify/CHANGELOG.md +6 -0
  53. package/.claude/skills/cc-simplify/SKILL.md +19 -8
  54. package/CHANGELOG.md +16 -0
  55. package/README.md +58 -4
  56. package/README.zh-CN.md +58 -4
  57. package/bin/cc-devflow-cli.js +119 -0
  58. package/config/distributable-skills.json +10 -0
  59. package/docs/assets/cc-devflow-pr-harness-en.svg +153 -0
  60. package/docs/assets/cc-devflow-pr-harness-zh.svg +152 -0
  61. package/docs/assets/wechat-group-qr.jpg +0 -0
  62. package/docs/examples/example-bindings.json +11 -6
  63. package/docs/examples/full-design-blocked/BACKLOG.md +1 -1
  64. package/docs/examples/full-design-blocked/README.md +1 -1
  65. package/docs/examples/full-design-blocked/ROADMAP.md +16 -1
  66. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +36 -3
  67. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +604 -76
  68. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/tasks.md +46 -1
  69. package/docs/examples/full-design-blocked/roadmap.json +18 -2
  70. package/docs/examples/local-handoff/BACKLOG.md +1 -1
  71. package/docs/examples/local-handoff/README.md +1 -1
  72. package/docs/examples/local-handoff/ROADMAP.md +16 -1
  73. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +27 -1
  74. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +366 -44
  75. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/tasks.md +36 -1
  76. package/docs/examples/local-handoff/roadmap.json +16 -2
  77. package/docs/examples/pdca-loop/BACKLOG.md +1 -1
  78. package/docs/examples/pdca-loop/README.md +1 -1
  79. package/docs/examples/pdca-loop/ROADMAP.md +16 -1
  80. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +27 -1
  81. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +259 -14
  82. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/tasks.md +36 -1
  83. package/docs/examples/pdca-loop/roadmap.json +16 -2
  84. package/docs/examples/scripts/check-example-bindings.sh +21 -1
  85. package/docs/guides/getting-started.md +12 -9
  86. package/docs/guides/getting-started.zh-CN.md +12 -9
  87. package/lib/skill-runtime/__tests__/archive-change.test.js +124 -0
  88. package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +1 -0
  89. package/lib/skill-runtime/__tests__/paths.test.js +81 -1
  90. package/lib/skill-runtime/archive-change.js +64 -0
  91. package/lib/skill-runtime/paths.js +32 -0
  92. package/package.json +7 -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
 
@@ -70,20 +73,31 @@
70
73
  - 涉及文件
71
74
  - 验证方式
72
75
  - 完成证据
76
+ - Completion command:调用 `mark-task-complete.sh`,同步 `planning/task-manifest.json` 与 `planning/tasks.md`
77
+ - Forbidden shortcuts:禁止手工改 checkbox、manifest status 或 `currentTaskId`
73
78
 
74
79
  行为变更任务必须先有 `[TEST]` 红灯任务,再有 `[IMPL]` 绿灯任务,最后有 `[REFACTOR]` 或明确 refactor checkpoint。纯文档、纯配置、纯生成文件、throwaway prototype 可以例外,但必须写明原因、风险和替代验证。
75
80
  不要把计划拆成水平层:一批测试、一批服务、一批 UI。每个切片完成后都应该能证明一个真实行为。
76
81
  也不要把一批 Red 一次性写完再批量实现。每条 tracer bullet 只证明一个可观察行为,Green 只做当前红灯要求的最小实现;下一条 Red 可以吸收上一轮学到的事实,但不能越过冻结边界。
77
82
 
83
+ ## Execution Protocol Fields
84
+
85
+ `planning/tasks.md` 必须有 `Execution Protocol` 区块,`planning/task-manifest.json` 必须有 `executionProtocol` 对象。它们共同约束 ClaudeCode / Codex:
86
+
87
+ - task 选择来自 `currentTaskId` 或 `select-ready-tasks.sh`
88
+ - 每个 task 必须按模板字段完整展开,不能退化成标题清单
89
+ - 完成 task 必须调用 `mark-task-complete.sh`
90
+ - 脚本失败时修 evidence / checkpoint / review gate 后重跑,禁止手工绕过
91
+
78
92
  ## Decision Question Fields
79
93
 
80
94
  每个需要用户判断的 gate 至少记录:
81
95
 
82
96
  - questionId:`D1` / `D2` / ...
83
- - gate:`planning-mode` / `ambiguity-blocker` / `approach-approval` / `taste-or-user-challenge` / `final-design-approval`
97
+ - gate:`planning-mode` / `ambiguity-blocker` / `external-best-practice` / `approach-approval` / `taste-or-user-challenge` / `final-design-approval`
84
98
  - knownEvidence
85
99
  - recommendation
86
- - options
100
+ - options:只能使用 `A` / `B` / `C` 作为 option id
87
101
  - userChoice
88
102
  - impact
89
103
  - status:`asked` / `answered` / `auto-decided`
@@ -112,13 +126,15 @@
112
126
  16. Green minimality / refactor candidate scan
113
127
  17. PRD brief scan
114
128
  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
129
+ 19. External best-practice validation scan
130
+ 20. AI Leverage Decision Lens scan
131
+ 21. External conflict scan
132
+ 22. Ambiguity gate
133
+ 23. Bounded review loop
134
+ 23. NOT in scope
135
+ 24. Test-first readiness
136
+ 25. Decision questions recorded
137
+ 26. Final recommendation
122
138
 
123
139
  如有 UI scope,再补 design review 结论。
124
140
  如有 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,5 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0
4
+
5
+ - Added review-first, rebase-first PR landing workflow with main parity proof.
@@ -0,0 +1,45 @@
1
+ # CC-PR-Land Playbook
2
+
3
+ ## Visible State Machine
4
+
5
+ `reviewed remote PRs -> cc-pr-land -> main parity | cc-pr-review | cc-dev | stop`
6
+
7
+ - Enter from: `cc-pr-review` approval, PR URL, PR number, or user request to land reviewed PRs.
8
+ - Stay in: `cc-pr-land` until each PR has review truth, rebase truth, conflict truth, validation truth, and parity truth.
9
+ - Exit to: main parity, `cc-pr-review` for missing review, `cc-dev` for implementation gaps, or stop when GitHub truth is unavailable.
10
+
11
+ ## Core Rules
12
+
13
+ 1. GitHub live PR list is truth.
14
+ 2. 先 review,再 landing。
15
+ 3. rebase 到 evolving mainline,不 rebase 到过期 main。
16
+ 4. 冲突解决后必须 re-review。
17
+ 5. 不允许需求缩水。
18
+ 6. 不确定是不是需求缩水,就停下来问。
19
+ 7. 用 `--force-with-lease` 更新 PR head,不无脑 force。
20
+ 8. main 只允许 ff-only / inspected push,不覆盖未检查远端。
21
+ 9. landing 后必须证明 local main、remote main、active main worktree 一致。
22
+ 10. 临时 branch / worktree 要清理或报告。
23
+
24
+ ## Required Outputs
25
+
26
+ - Live PR truth set
27
+ - Landing order
28
+ - Review evidence
29
+ - Rebase/conflict notes
30
+ - Post-conflict re-review verdict
31
+ - Validation evidence
32
+ - Main parity proof
33
+ - Cleanup result
34
+
35
+ ## Stop Conditions
36
+
37
+ Stop instead of guessing when:
38
+
39
+ - GitHub truth unavailable
40
+ - PR queue changed mid-run
41
+ - review evidence is missing
42
+ - conflict intent is unclear
43
+ - resolved diff drops required behavior
44
+ - validation fails only after integration
45
+ - main parity cannot be proven
@@ -0,0 +1,157 @@
1
+ ---
2
+ name: cc-pr-land
3
+ version: 1.0.0
4
+ description: Use in a separate session to land one or more reviewed GitHub PRs into main with review-first, rebase-first discipline. It refreshes live PR truth, rebases each PR onto the evolving mainline, resolves conflicts without shrinking requirements, re-reviews after conflict resolution, pushes cleaned PR heads when needed, fast-forwards main, verifies local/remote parity, and cleans temporary branches. It must not implement new feature scope.
5
+ triggers:
6
+ - 合并这个 PR
7
+ - 单独会话合并 PR
8
+ - land this PR
9
+ - merge reviewed PRs
10
+ - review and land open PRs
11
+ - rebase PRs onto main
12
+ reads:
13
+ - ../cc-pr-review/SKILL.md
14
+ - ../cc-review/SKILL.md
15
+ - ../cc-check/SKILL.md
16
+ - GitHub pull requests
17
+ - devflow/changes/<change-key>/review/report-card.json
18
+ writes:
19
+ - path: GitHub pull request head branch
20
+ durability: remote
21
+ required: false
22
+ when: the PR branch must be rebased or conflict fixes must be pushed back
23
+ - path: origin/main
24
+ durability: remote
25
+ required: true
26
+ when: landing succeeds
27
+ effects:
28
+ - review-first PR landing
29
+ - rebase-first mainline integration
30
+ - local and remote main parity proof
31
+ entry_gate:
32
+ - Fetch live GitHub PR truth; do not rely on stale local refs or cached queue state.
33
+ - Require prior review truth or perform a review pass before landing.
34
+ - Create only temporary integration/helper branches as needed; do not open new feature worktrees as product work.
35
+ - Rebase onto the evolving integration mainline, not stale origin/main.
36
+ - Stop when conflict resolution would require product intent guessing.
37
+ exit_criteria:
38
+ - Each landed PR was reviewed before landing and re-reviewed after material rebase or conflict resolution.
39
+ - Requirement shrinkage after conflict resolution is explicitly rejected or ruled out.
40
+ - Remote main, local main, and the active main worktree parity are verified.
41
+ - Open PR queue state is refreshed after landing when the task was to clear the queue.
42
+ - Temporary branches or integration worktrees created by cc-pr-land are cleaned up or reported.
43
+ reroutes:
44
+ - when: The PR has unreviewed implementation risk or stale review evidence.
45
+ target: cc-pr-review
46
+ - when: Conflict resolution reveals missing implementation or broken requirements.
47
+ target: cc-dev
48
+ - when: Mainline parity cannot be proven because GitHub, auth, or network truth is unavailable.
49
+ target: stop
50
+ recovery_modes:
51
+ - name: queue-changed
52
+ when: The live open PR set changes during landing.
53
+ action: Stop, refresh the queue, and recalculate the landing order before continuing.
54
+ - name: requirement-shrinkage-risk
55
+ when: A conflict resolution makes the PR smaller or removes user-facing behavior, tests, or docs.
56
+ action: Re-review the resolved diff and stop for user decision if intent is unclear.
57
+ - name: parity-failure
58
+ when: local main, active main worktree, and origin/main do not match after landing.
59
+ action: Diagnose without force reset; preserve local work and repair through fetch/rebase/ff-only sync.
60
+ tool_budget:
61
+ read_files: 12
62
+ search_steps: 8
63
+ shell_commands: 18
64
+ ---
65
+
66
+ # CC-PR-Land
67
+
68
+ > [PROTOCOL]: 变更时同步更新 `version`、`CHANGELOG.md`、公开文档和分发配置,然后检查 `CLAUDE.md`
69
+
70
+ ## Role
71
+
72
+ `cc-pr-land` 是远程 PR 的落主干入口。它回答:
73
+
74
+ ```text
75
+ 这些已经 review 的 PR 是否可以线性落到 main,并证明本地远程一致?
76
+ ```
77
+
78
+ 它不做新需求开发。发现需要新代码,回 `cc-dev`。
79
+
80
+ ## Read First
81
+
82
+ 1. Live GitHub PR truth
83
+ 2. `../cc-pr-review/SKILL.md`
84
+ 3. `../cc-review/SKILL.md`
85
+ 4. `../cc-check/SKILL.md`
86
+ 5. Linked change artifacts when available
87
+
88
+ ## Use This Skill When
89
+
90
+ - 一个或多个 PR 已 review,准备合并。
91
+ - 用户要求 review-first / rebase-first 落主干。
92
+ - 用户要求清空 open PR 队列并证明 main parity。
93
+
94
+ 如果 PR 还没 review,先去 `cc-pr-review`。
95
+
96
+ ## Harness Contract
97
+
98
+ - Allowed actions: refresh PR truth, verify prior review, rebase PR branches, resolve conflicts, re-review resolved diffs, push cleaned PR heads, fast-forward main, verify parity, and clean temporary integration state.
99
+ - Forbidden actions: implement new feature scope, silently drop requirements, force-push main, rely on stale PR refs, or declare parity without remote proof.
100
+ - Required evidence: PR list, review status, commit ranges, conflict resolutions, validation commands, remote main SHA, local main SHA, and active main worktree SHA when available.
101
+ - Reroute rule: unreviewed PRs go to `cc-pr-review`; requirement or implementation gaps go to `cc-dev`; unavailable GitHub truth stops landing.
102
+
103
+ ## Landing Order
104
+
105
+ 1. Fetch live PR truth.
106
+ 2. Record PR number, title, head, base, review state, checks, and linked change.
107
+ 3. For each PR:
108
+ - confirm review exists or run/re-route to `cc-pr-review`
109
+ - separate true PR commits from base drift
110
+ - rebase onto the evolving integration mainline
111
+ - resolve conflicts without shrinking requirements
112
+ - re-review if the rebase or conflict resolution changed behavior
113
+ - push cleaned PR head with `--force-with-lease` when the PR branch changed
114
+ - fast-forward the integration branch
115
+ 4. Validate integrated result.
116
+ 5. Push or fast-forward main.
117
+ 6. Verify parity.
118
+ 7. Clean temporary state.
119
+
120
+ ## Conflict Rule
121
+
122
+ Conflict resolution is not a place to redesign the product.
123
+
124
+ After every conflict:
125
+
126
+ - compare before vs after intent
127
+ - check tests and docs were not silently dropped
128
+ - rerun targeted verification
129
+ - re-review resolved files
130
+
131
+ If you cannot distinguish better upstream implementation from accidental requirement loss, stop and ask.
132
+
133
+ ## Parity Proof
134
+
135
+ Do not declare done until these are true or explicitly blocked:
136
+
137
+ ```text
138
+ origin/main SHA: <sha>
139
+ local main SHA: <sha>
140
+ active main worktree SHA: <sha or not-applicable>
141
+ open PR queue: <empty or remaining list>
142
+ ```
143
+
144
+ Use ff-only sync. Do not force reset user work.
145
+
146
+ ## Output
147
+
148
+ Report:
149
+
150
+ - PRs landed
151
+ - PRs skipped and why
152
+ - review evidence used
153
+ - conflicts and requirement-shrinkage verdict
154
+ - validation commands
155
+ - final remote/local main SHA
156
+ - open PR queue state
157
+ - cleanup actions
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0
4
+
5
+ - Added independent remote PR review workflow that separates review from landing.
@@ -0,0 +1,46 @@
1
+ # CC-PR-Review Playbook
2
+
3
+ ## Visible State Machine
4
+
5
+ `remote PR -> cc-pr-review -> cc-dev | cc-do | cc-pr-land | stop`
6
+
7
+ - Enter from: a remote PR URL, PR number, or `cc-dev` terminal state.
8
+ - Stay in: `cc-pr-review` until PR truth, diff intent, checks, artifacts, findings, and verdict are explicit.
9
+ - Exit to: `cc-pr-land` when approved, `cc-dev` or `cc-do` when fixes are required, or stop when blocked or unclear.
10
+
11
+ ## Core Rules
12
+
13
+ 1. 只 review,不 merge。
14
+ 2. 先冻结 GitHub PR truth。
15
+ 3. 先区分 true PR commits 和 stale base drift。
16
+ 4. 先写 review packet,再写 findings。
17
+ 5. finding 必须有证据。
18
+ 6. 没有证据就写 unknown,不伪装成 bug。
19
+ 7. 宽 diff 使用四类风险 lane。
20
+ 8. subAgent reviewer 只读;主线程负责验证和去重。
21
+ 9. PR head 或 checks 改了,重新 refresh。
22
+ 10. 干净 PR 的下一步是 `cc-pr-land`,不是在本 skill 里顺手合并。
23
+
24
+ ## Required Outputs
25
+
26
+ - PR review packet
27
+ - Covered lanes
28
+ - Findings triage
29
+ - Checks status
30
+ - Verdict
31
+ - Next gate
32
+
33
+ ## Finding Shape
34
+
35
+ Each accepted finding should include:
36
+
37
+ ```text
38
+ - Path or PR surface:
39
+ - Issue:
40
+ - Why it matters:
41
+ - Evidence:
42
+ - Confidence:
43
+ - Fix path:
44
+ ```
45
+
46
+ Speculative or style-only comments do not block landing.
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: cc-pr-review
3
+ version: 1.0.0
4
+ description: Use in a separate session to review one remote GitHub PR before landing. It fetches PR truth, builds a review packet, runs cc-review-style plan or implementation review with optional read-only reviewers, records findings, and updates the PR or reroutes to cc-dev/cc-do for fixes. It must not merge the PR or push main.
5
+ triggers:
6
+ - review 这个 PR
7
+ - 单独会话 review PR
8
+ - 审这个远程 PR
9
+ - review remote PR
10
+ - pre-landing PR review
11
+ - check this PR before merge
12
+ reads:
13
+ - ../cc-review/SKILL.md
14
+ - ../cc-check/SKILL.md
15
+ - GitHub pull request
16
+ - devflow/changes/<change-key>/review/report-card.json
17
+ writes:
18
+ - path: devflow/changes/<change-key>/review/cc-pr-review.md
19
+ durability: durable
20
+ required: false
21
+ when: the PR maps to a local cc-devflow change
22
+ - path: GitHub pull request comments or review
23
+ durability: remote
24
+ required: false
25
+ when: remote review feedback is posted
26
+ effects:
27
+ - remote PR review packet
28
+ - finding triage
29
+ - fix or landing recommendation
30
+ entry_gate:
31
+ - Freeze PR title, body, commits, head branch, base branch, checks, linked issues, and current diff from GitHub.
32
+ - Separate true PR commits from stale base drift before judging the diff.
33
+ - Read local cc-devflow artifacts when the PR links to a change key.
34
+ - Build a review packet before producing findings.
35
+ - Do not merge, push main, or mark the PR landed.
36
+ exit_criteria:
37
+ - Review result is exactly one of approved-for-landing, changes-requested, needs-clarification, or blocked.
38
+ - Findings cite concrete PR diff, artifacts, command output, checks, or missing evidence.
39
+ - Any required fixes route back to cc-dev or cc-do; clean PRs route to cc-pr-land.
40
+ - No merge or mainline integration happened inside cc-pr-review.
41
+ reroutes:
42
+ - when: Required fixes are inside the PR implementation scope.
43
+ target: cc-dev
44
+ - when: The PR is clean and ready to land.
45
+ target: cc-pr-land
46
+ - when: The review needs deeper local artifact or diff review.
47
+ target: cc-review
48
+ recovery_modes:
49
+ - name: stale-pr-refresh
50
+ when: PR head, checks, comments, or base branch changed during review.
51
+ action: Refresh GitHub PR truth and rebuild the review packet before continuing.
52
+ - name: base-drift-confusion
53
+ when: The raw PR diff appears to delete or rewrite unrelated base work.
54
+ action: Use commit and cherry inspection to separate true PR changes from stale-base perspective.
55
+ tool_budget:
56
+ read_files: 10
57
+ search_steps: 6
58
+ shell_commands: 12
59
+ ---
60
+
61
+ # CC-PR-Review
62
+
63
+ > [PROTOCOL]: 变更时同步更新 `version`、`CHANGELOG.md`、公开文档和分发配置,然后检查 `CLAUDE.md`
64
+
65
+ ## Role
66
+
67
+ `cc-pr-review` 是远程 PR 的独立审查入口。它回答:
68
+
69
+ ```text
70
+ 这个 PR 是否可以交给 cc-pr-land 合并?
71
+ ```
72
+
73
+ 它只 review,不合并。
74
+
75
+ ## Read First
76
+
77
+ 1. GitHub PR snapshot
78
+ 2. `../cc-review/SKILL.md`
79
+ 3. `../cc-check/SKILL.md`
80
+ 4. Linked `devflow/changes/<change-key>/` artifacts when available
81
+
82
+ ## Use This Skill When
83
+
84
+ - PR 已经由 `cc-dev` 创建或更新。
85
+ - 用户想在独立会话 review PR。
86
+ - 合并前需要证明 diff、测试、门禁和需求没有漂移。
87
+
88
+ 如果用户要求合并,进入 `cc-pr-land`,不要把 review 和 landing 混成一个动作。
89
+
90
+ ## Harness Contract
91
+
92
+ - Allowed actions: fetch PR truth, build review packet, inspect diffs/artifacts/checks, run safe verification, dispatch read-only reviewers when available, record review findings, and recommend fix or landing.
93
+ - Forbidden actions: merge PRs, push main, rewrite unrelated PR scope, or accept findings without evidence.
94
+ - Required evidence: every accepted finding must cite PR diff, local artifact, command output, check result, issue/PR text, or explicit missing evidence.
95
+ - Reroute rule: required implementation fixes go back to `cc-dev` or `cc-do`; clean PRs go to `cc-pr-land`.
96
+
97
+ ## Review Packet
98
+
99
+ Build this before findings:
100
+
101
+ ```text
102
+ PR Review Packet
103
+ - PR: #<number> <title>
104
+ - Base/head: <base> <- <head>
105
+ - Intended behavior: <from PR body, issue, commits, artifacts>
106
+ - Must remain unchanged: <known invariants>
107
+ - True PR commits: <commit range>
108
+ - Drift ruled out: <yes/no and evidence>
109
+ - Checks: <latest status>
110
+ - Local artifacts: <change key and report-card if found>
111
+ ```
112
+
113
+ ## Review Lanes
114
+
115
+ Use `cc-review` methods. For broad diffs, cover:
116
+
117
+ - intent and regression
118
+ - security and privacy
119
+ - performance and reliability
120
+ - contracts and coverage
121
+
122
+ Small diffs may combine lanes, but the report must state what was covered or skipped.
123
+
124
+ ## Verdicts
125
+
126
+ - `approved-for-landing`: no blocking findings; route to `cc-pr-land`.
127
+ - `changes-requested`: PR needs fixes; route to `cc-dev` or `cc-do`.
128
+ - `needs-clarification`: product intent or requirement shrinkage is unclear.
129
+ - `blocked`: GitHub, auth, checks, dependencies, or local artifacts are unavailable.
130
+
131
+ ## Output
132
+
133
+ Report:
134
+
135
+ - PR number and URL
136
+ - review packet summary
137
+ - lanes covered or skipped
138
+ - accepted findings
139
+ - rejected or downgraded raw findings when reviewers were used
140
+ - latest checks
141
+ - verdict
142
+ - next gate
@@ -0,0 +1,28 @@
1
+ # CC-Review Changelog
2
+
3
+ ## 1.3.0
4
+
5
+ - Added a risk-lane review swarm profile for broad implementation and PR-landing reviews.
6
+ - Required `cc-review-plan.md` and `cc-review-report.md` to record intent/regression, security/privacy, performance/reliability, and contracts/coverage lane coverage when applicable.
7
+ - Hardened main-thread aggregation so raw reviewer findings are accepted, merged, downgraded, or rejected before becoming final findings.
8
+
9
+ ## 1.2.0
10
+
11
+ - Added automatic read-only reviewer subAgent dispatch for selected plan and implementation review nodes.
12
+ - Required reviewer packets to be self-contained so each subAgent works from independent context instead of inherited chat assumptions.
13
+ - Added `cc-review-agent-results.jsonl` for raw reviewer outputs and report-level accepted/merged/downgraded/rejected triage.
14
+ - Required truthful main-thread fallback when the host does not expose subAgent tools.
15
+
16
+ ## 1.1.0
17
+
18
+ - Added stateful review planning with `cc-review-plan.md` and per-node `cc-review-ledger.jsonl`.
19
+ - Required prior review records and git/artifact deltas before re-reviewing the same plan or implementation.
20
+ - Replaced short finding-list behavior with node-by-node review, per-node checks, and no artificial finding cap.
21
+ - Added decision queues so user-judgment findings are collected after traversal and confirmed one by one before non-mechanical fixes.
22
+ - Added `cc-simplify` selection guidance for code-smell and simplification review nodes.
23
+
24
+ ## 1.0.0
25
+
26
+ - Added `cc-review` as an optional deep review workflow that branches between plan-stage and implementation-stage review.
27
+ - Added progressive references for TOC/root-cause methods, plan review, implementation review, and Codex plugin E2E verification.
28
+ - Added durable review report and structured findings output contracts.