codebyplan 1.5.1 → 1.8.0

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 (205) hide show
  1. package/dist/cli.js +4462 -748
  2. package/package.json +5 -1
  3. package/templates/.gitkeep +0 -0
  4. package/templates/README.md +20 -0
  5. package/templates/agents/cbp-cc-executor.md +213 -0
  6. package/templates/agents/cbp-database-agent.md +229 -0
  7. package/templates/agents/cbp-improve-claude.md +245 -0
  8. package/templates/agents/cbp-improve-round.md +284 -0
  9. package/templates/agents/cbp-mechanical-edits.md +111 -0
  10. package/templates/agents/cbp-research.md +282 -0
  11. package/templates/agents/cbp-round-executor.md +604 -0
  12. package/templates/agents/cbp-security-agent.md +134 -0
  13. package/templates/agents/cbp-task-check.md +213 -0
  14. package/templates/agents/cbp-task-planner.md +582 -0
  15. package/templates/agents/cbp-test-e2e-agent.md +363 -0
  16. package/templates/agents/cbp-testing-qa-agent.md +400 -0
  17. package/templates/context/mcp-docs.md +139 -0
  18. package/templates/hooks/README.md +236 -0
  19. package/templates/hooks/cbp-auto-test-hooks.sh +44 -0
  20. package/templates/hooks/cbp-lint-format-on-edit.sh +159 -0
  21. package/templates/hooks/cbp-maestro-yaml-validate.sh +100 -0
  22. package/templates/hooks/cbp-mcp-migration-guard.sh +32 -0
  23. package/templates/hooks/cbp-mcp-round-sync.sh +79 -0
  24. package/templates/hooks/cbp-mcp-worktree-inject.sh +76 -0
  25. package/templates/hooks/cbp-notify.sh +68 -0
  26. package/templates/hooks/cbp-plugin-dispatch.sh +29 -0
  27. package/templates/hooks/cbp-pre-commit-quality-gate.sh +204 -0
  28. package/templates/hooks/cbp-statusline.sh +347 -0
  29. package/templates/hooks/cbp-subagent-statusline.sh +182 -0
  30. package/templates/hooks/cbp-test-coverage-gate.sh +144 -0
  31. package/templates/hooks/cbp-test-hooks.sh +320 -0
  32. package/templates/hooks/hooks.json +85 -0
  33. package/templates/hooks/validate-context-usage.sh +59 -0
  34. package/templates/hooks/validate-git-commit.sh +78 -0
  35. package/templates/hooks/validate-git-stash-deny.sh +32 -0
  36. package/templates/hooks/validate-structure-lengths.sh +57 -0
  37. package/templates/hooks/validate-structure-lib.sh +104 -0
  38. package/templates/hooks/validate-structure-patterns.sh +54 -0
  39. package/templates/hooks/validate-structure-scope.sh +33 -0
  40. package/templates/hooks/validate-structure-smoke.sh +95 -0
  41. package/templates/hooks/validate-structure-templates.sh +34 -0
  42. package/templates/hooks/validate-structure.sh +69 -0
  43. package/templates/rules/.gitkeep +0 -0
  44. package/templates/rules/README.md +47 -0
  45. package/templates/rules/context-file-loading.md +52 -0
  46. package/templates/rules/scope-vocabulary.md +64 -0
  47. package/templates/rules/todo-backend.md +109 -0
  48. package/templates/settings.project.base.json +55 -0
  49. package/templates/settings.user.base.json +25 -0
  50. package/templates/skills/cbp-build-cc-agent/SKILL.md +139 -0
  51. package/templates/skills/cbp-build-cc-agent/examples/read-only-reviewer.md +32 -0
  52. package/templates/skills/cbp-build-cc-agent/examples/with-hooks.md +41 -0
  53. package/templates/skills/cbp-build-cc-agent/examples/with-skills-preload.md +25 -0
  54. package/templates/skills/cbp-build-cc-agent/reference/cbp-quality.md +153 -0
  55. package/templates/skills/cbp-build-cc-agent/reference/frontmatter-fields.md +37 -0
  56. package/templates/skills/cbp-build-cc-agent/reference/permission-modes.md +18 -0
  57. package/templates/skills/cbp-build-cc-agent/scripts/validate-agent.sh +67 -0
  58. package/templates/skills/cbp-build-cc-agent/templates/agent.md +66 -0
  59. package/templates/skills/cbp-build-cc-claude-file/SKILL.md +178 -0
  60. package/templates/skills/cbp-build-cc-claude-file/examples/minimal-project.md +33 -0
  61. package/templates/skills/cbp-build-cc-claude-file/examples/monorepo-with-imports.md +39 -0
  62. package/templates/skills/cbp-build-cc-claude-file/reference/imports.md +72 -0
  63. package/templates/skills/cbp-build-cc-claude-file/reference/what-belongs.md +39 -0
  64. package/templates/skills/cbp-build-cc-claude-file/templates/project-claude-md.md +48 -0
  65. package/templates/skills/cbp-build-cc-claude-file/templates/user-claude-md.md +22 -0
  66. package/templates/skills/cbp-build-cc-memory/SKILL.md +201 -0
  67. package/templates/skills/cbp-build-cc-memory/examples/feedback-memory.md +11 -0
  68. package/templates/skills/cbp-build-cc-memory/examples/project-memory.md +11 -0
  69. package/templates/skills/cbp-build-cc-memory/examples/reference-memory.md +13 -0
  70. package/templates/skills/cbp-build-cc-memory/examples/user-memory.md +14 -0
  71. package/templates/skills/cbp-build-cc-memory/reference/memory-types.md +59 -0
  72. package/templates/skills/cbp-build-cc-memory/reference/when-to-save.md +62 -0
  73. package/templates/skills/cbp-build-cc-memory/templates/MEMORY-index.md +4 -0
  74. package/templates/skills/cbp-build-cc-memory/templates/memory-entry.md +15 -0
  75. package/templates/skills/cbp-build-cc-mode/SKILL.md +99 -0
  76. package/templates/skills/cbp-build-cc-rule/SKILL.md +176 -0
  77. package/templates/skills/cbp-build-cc-rule/examples/global-rule.md +19 -0
  78. package/templates/skills/cbp-build-cc-rule/examples/scoped-rule.md +41 -0
  79. package/templates/skills/cbp-build-cc-rule/reference/paths-patterns.md +48 -0
  80. package/templates/skills/cbp-build-cc-rule/templates/rule.md +32 -0
  81. package/templates/skills/cbp-build-cc-settings/SKILL.md +220 -0
  82. package/templates/skills/cbp-build-cc-settings/examples/hooks-config.json +64 -0
  83. package/templates/skills/cbp-build-cc-settings/examples/permissions-config.json +34 -0
  84. package/templates/skills/cbp-build-cc-settings/examples/sandbox-config.json +42 -0
  85. package/templates/skills/cbp-build-cc-settings/reference/cbp-conventions.md +104 -0
  86. package/templates/skills/cbp-build-cc-settings/reference/permission-rules.md +61 -0
  87. package/templates/skills/cbp-build-cc-settings/reference/scope-precedence.md +73 -0
  88. package/templates/skills/cbp-build-cc-settings/reference/settings-fields.md +166 -0
  89. package/templates/skills/cbp-build-cc-settings/templates/settings.json +23 -0
  90. package/templates/skills/cbp-build-cc-settings/templates/settings.local.json +10 -0
  91. package/templates/skills/cbp-build-cc-skill/SKILL.md +154 -0
  92. package/templates/skills/cbp-build-cc-skill/examples/dynamic-context.md +31 -0
  93. package/templates/skills/cbp-build-cc-skill/examples/fork-skill.md +22 -0
  94. package/templates/skills/cbp-build-cc-skill/examples/knowledge-skill.md +25 -0
  95. package/templates/skills/cbp-build-cc-skill/examples/task-skill.md +29 -0
  96. package/templates/skills/cbp-build-cc-skill/reference/cbp-quality.md +157 -0
  97. package/templates/skills/cbp-build-cc-skill/reference/frontmatter-fields.md +35 -0
  98. package/templates/skills/cbp-build-cc-skill/reference/string-substitutions.md +60 -0
  99. package/templates/skills/cbp-build-cc-skill/scripts/validate-skill.sh +90 -0
  100. package/templates/skills/cbp-build-cc-skill/templates/skill.md +51 -0
  101. package/templates/skills/cbp-checkpoint-check/SKILL.md +156 -0
  102. package/templates/skills/cbp-checkpoint-complete/SKILL.md +109 -0
  103. package/templates/skills/cbp-checkpoint-create/SKILL.md +287 -0
  104. package/templates/skills/cbp-checkpoint-end/SKILL.md +241 -0
  105. package/templates/skills/cbp-checkpoint-update/SKILL.md +115 -0
  106. package/templates/skills/cbp-frontend-a11y/SKILL.md +109 -0
  107. package/templates/skills/cbp-frontend-a11y/reference/aria-roles-states.md +130 -0
  108. package/templates/skills/cbp-frontend-a11y/reference/contrast-visual.md +122 -0
  109. package/templates/skills/cbp-frontend-a11y/reference/keyboard-patterns.md +154 -0
  110. package/templates/skills/cbp-frontend-a11y/reference/semantic-html.md +111 -0
  111. package/templates/skills/cbp-frontend-design/SKILL.md +145 -0
  112. package/templates/skills/cbp-frontend-design/reference/nextjs-scss.md +118 -0
  113. package/templates/skills/cbp-frontend-design/reference/rn-expo.md +101 -0
  114. package/templates/skills/cbp-frontend-design/reference/tauri-react.md +82 -0
  115. package/templates/skills/cbp-frontend-ui/SKILL.md +262 -0
  116. package/templates/skills/cbp-frontend-ui/reference/ui-label-maps.md +42 -0
  117. package/templates/skills/cbp-frontend-ui/reference/ui-layout-patterns.md +105 -0
  118. package/templates/skills/cbp-frontend-ui/reference/variant-defaults.md +149 -0
  119. package/templates/skills/cbp-frontend-ux/SKILL.md +181 -0
  120. package/templates/skills/cbp-git-branch-feat-create/SKILL.md +115 -0
  121. package/templates/skills/cbp-git-commit/SKILL.md +278 -0
  122. package/templates/skills/cbp-git-worktree-create/SKILL.md +226 -0
  123. package/templates/skills/cbp-git-worktree-remove/SKILL.md +145 -0
  124. package/templates/skills/cbp-merge-main/SKILL.md +228 -0
  125. package/templates/skills/cbp-round-check/SKILL.md +104 -0
  126. package/templates/skills/cbp-round-end/SKILL.md +183 -0
  127. package/templates/skills/cbp-round-end/reference/findings-presentation.md +44 -0
  128. package/templates/skills/cbp-round-end/reference/inline-fallback.md +35 -0
  129. package/templates/skills/cbp-round-execute/SKILL.md +211 -0
  130. package/templates/skills/cbp-round-execute/reference/inline-fallback.md +59 -0
  131. package/templates/skills/cbp-round-input/SKILL.md +165 -0
  132. package/templates/skills/cbp-round-start/SKILL.md +222 -0
  133. package/templates/skills/cbp-round-update/SKILL.md +163 -0
  134. package/templates/skills/cbp-session-end/SKILL.md +187 -0
  135. package/templates/skills/cbp-session-start/SKILL.md +155 -0
  136. package/templates/skills/cbp-ship/SKILL.md +332 -0
  137. package/templates/skills/cbp-ship/reference/changesets-overview.md +120 -0
  138. package/templates/skills/cbp-ship/reference/eas-cli-overview.md +60 -0
  139. package/templates/skills/cbp-ship/reference/gh-cli-overview.md +135 -0
  140. package/templates/skills/cbp-ship/reference/gh-cli-shipment-commands.md +283 -0
  141. package/templates/skills/cbp-ship/reference/npm-publish-monorepo.md +252 -0
  142. package/templates/skills/cbp-ship/reference/npm-publish-oidc-trusted.md +157 -0
  143. package/templates/skills/cbp-ship/reference/npm-publish-overview.md +171 -0
  144. package/templates/skills/cbp-ship/reference/preflight-checklist.md +88 -0
  145. package/templates/skills/cbp-ship/reference/railway-nestjs-deployment.md +169 -0
  146. package/templates/skills/cbp-ship/reference/railway-overview.md +120 -0
  147. package/templates/skills/cbp-ship/reference/railway-troubleshooting.md +168 -0
  148. package/templates/skills/cbp-ship/reference/release-please-overview.md +99 -0
  149. package/templates/skills/cbp-ship/reference/surface-expo-eas.md +155 -0
  150. package/templates/skills/cbp-ship/reference/surface-npm.md +180 -0
  151. package/templates/skills/cbp-ship/reference/surface-railway.md +152 -0
  152. package/templates/skills/cbp-ship/reference/surface-supabase.md +178 -0
  153. package/templates/skills/cbp-ship/reference/surface-tauri.md +138 -0
  154. package/templates/skills/cbp-ship/reference/surface-vercel.md +124 -0
  155. package/templates/skills/cbp-ship/reference/surface-vscode-ext.md +144 -0
  156. package/templates/skills/cbp-ship/reference/surfaces.md +60 -0
  157. package/templates/skills/cbp-ship/reference/testflight-automation.md +215 -0
  158. package/templates/skills/cbp-ship/reference/testflight-internal-vs-external.md +69 -0
  159. package/templates/skills/cbp-ship/reference/testflight-overview.md +98 -0
  160. package/templates/skills/cbp-ship/reference/versioning.md +116 -0
  161. package/templates/skills/cbp-ship/scripts/detect-surfaces.sh +217 -0
  162. package/templates/skills/cbp-ship/scripts/verify-expo-eas.sh +35 -0
  163. package/templates/skills/cbp-ship/scripts/verify-npm.sh +21 -0
  164. package/templates/skills/cbp-ship/scripts/verify-railway.sh +41 -0
  165. package/templates/skills/cbp-ship/scripts/verify-supabase.sh +19 -0
  166. package/templates/skills/cbp-ship/scripts/verify-tauri.sh +24 -0
  167. package/templates/skills/cbp-ship/scripts/verify-vercel.sh +32 -0
  168. package/templates/skills/cbp-ship/scripts/verify-vscode-ext.sh +25 -0
  169. package/templates/skills/cbp-ship/templates/eas.json +66 -0
  170. package/templates/skills/cbp-ship/templates/railway.toml +15 -0
  171. package/templates/skills/cbp-ship/templates/release-please-config.json +17 -0
  172. package/templates/skills/cbp-ship/templates/vercel.json +19 -0
  173. package/templates/skills/cbp-ship/templates/vscodeignore +21 -0
  174. package/templates/skills/cbp-ship/templates/workflow-changesets.yml +41 -0
  175. package/templates/skills/cbp-ship/templates/workflow-eas-submit.yml +53 -0
  176. package/templates/skills/cbp-ship/templates/workflow-npm-publish.yml +36 -0
  177. package/templates/skills/cbp-ship/templates/workflow-release-please.yml +21 -0
  178. package/templates/skills/cbp-ship/templates/workflow-tauri-release.yml +69 -0
  179. package/templates/skills/cbp-ship/templates/workflow-vsce-publish.yml +31 -0
  180. package/templates/skills/cbp-ship-configure/SKILL.md +296 -0
  181. package/templates/skills/cbp-ship-configure/reference/expo-mobile.md +204 -0
  182. package/templates/skills/cbp-ship-configure/reference/npm-package.md +165 -0
  183. package/templates/skills/cbp-ship-configure/reference/railway-backend.md +199 -0
  184. package/templates/skills/cbp-ship-configure/reference/supabase.md +200 -0
  185. package/templates/skills/cbp-ship-configure/reference/tauri-desktop.md +181 -0
  186. package/templates/skills/cbp-ship-configure/reference/vercel.md +117 -0
  187. package/templates/skills/cbp-ship-configure/reference/vscode-ext.md +155 -0
  188. package/templates/skills/cbp-ship-main/SKILL.md +65 -0
  189. package/templates/skills/cbp-supabase-branch-check/SKILL.md +337 -0
  190. package/templates/skills/cbp-supabase-branch-check/reference/dag-steps.md +29 -0
  191. package/templates/skills/cbp-supabase-migrate/SKILL.md +314 -0
  192. package/templates/skills/cbp-supabase-migrate/reference/advisor-triage.md +70 -0
  193. package/templates/skills/cbp-supabase-migrate/reference/cli-fallback.md +87 -0
  194. package/templates/skills/cbp-supabase-migrate/reference/preflight-dry-run.md +58 -0
  195. package/templates/skills/cbp-supabase-setup/SKILL.md +239 -0
  196. package/templates/skills/cbp-supabase-setup/reference/branching-setup.md +121 -0
  197. package/templates/skills/cbp-supabase-setup/reference/cli-fallback.md +109 -0
  198. package/templates/skills/cbp-task-check/SKILL.md +166 -0
  199. package/templates/skills/cbp-task-complete/SKILL.md +206 -0
  200. package/templates/skills/cbp-task-complete/reference/checkpoint-done-branching.md +48 -0
  201. package/templates/skills/cbp-task-complete/reference/next-step-heuristic.md +56 -0
  202. package/templates/skills/cbp-task-create/SKILL.md +167 -0
  203. package/templates/skills/cbp-task-start/SKILL.md +239 -0
  204. package/templates/skills/cbp-task-testing/SKILL.md +277 -0
  205. package/templates/skills/cbp-todo/SKILL.md +97 -0
@@ -0,0 +1,134 @@
1
+ ---
2
+ scope: org-shared
3
+ name: cbp-security-agent
4
+ description: Security review specialist. Checks for OWASP top 10 vulnerabilities, hardcoded secrets, SQL injection, XSS, CSRF, and dependency vulnerabilities.
5
+ tools: Read, Glob, Grep, Bash
6
+ model: sonnet
7
+ effort: xhigh
8
+ ---
9
+
10
+ # Security Agent
11
+
12
+ Security review specialist. Checks for OWASP top 10 vulnerabilities, hardcoded secrets, SQL injection, XSS, CSRF, and dependency vulnerabilities.
13
+
14
+ ## Purpose
15
+
16
+ Security quality gate during the validation phase. Scans changed files for common vulnerability patterns that could lead to data exposure, unauthorized access, or injection attacks.
17
+
18
+ ## Input Contract
19
+
20
+ ```yaml
21
+ input:
22
+ task_number: number
23
+ round_number: number
24
+ files_changed: [{path, action}]
25
+ context:
26
+ checkpoint_goal: string
27
+ round_requirements: string
28
+ ```
29
+
30
+ ## Output Contract
31
+
32
+ ```yaml
33
+ output:
34
+ status: 'completed'
35
+ findings:
36
+ - category: 'secrets' | 'injection' | 'xss' | 'csrf' | 'auth' | 'dependency' | 'configuration'
37
+ severity: 'critical' | 'warning' | 'suggestion'
38
+ file: string
39
+ line: number
40
+ issue: string
41
+ suggestion: string
42
+ owasp_ref: string
43
+ dependency_audit:
44
+ vulnerabilities: number
45
+ critical: number
46
+ high: number
47
+ summary:
48
+ total_issues: number
49
+ critical: number
50
+ warnings: number
51
+ suggestions: number
52
+ ```
53
+
54
+ ## Workflow
55
+
56
+ ### Phase 1: Read Changed Files
57
+
58
+ Read all source files from `files_changed`. Categorize by type (API routes, components, utilities, config).
59
+
60
+ ### Phase 2: Secrets Detection
61
+
62
+ Grep changed files for:
63
+ - API keys: patterns like `sk-`, `pk_`, `AKIA`, `ghp_`, `ghu_`
64
+ - Tokens: `token`, `secret`, `password`, `credential` in string literals
65
+ - Connection strings: `postgres://`, `mysql://`, `mongodb://`
66
+ - Private keys: `BEGIN RSA PRIVATE KEY`, `BEGIN EC PRIVATE KEY`
67
+ - Hardcoded URLs with credentials
68
+
69
+ Check that secrets use environment variables (`process.env.*`) not inline values.
70
+
71
+ ### Phase 3: Injection Prevention
72
+
73
+ For files with database queries:
74
+ - Check for parameterized queries (no string concatenation in SQL)
75
+ - Verify Supabase RPC calls use parameters
76
+ - Check `.rpc()` and `.from()` calls for user input handling
77
+ - Verify server actions validate and sanitize input
78
+
79
+ ### Phase 4: XSS Prevention
80
+
81
+ For TSX/JSX files:
82
+ - Check for `dangerouslySetInnerHTML` usage
83
+ - Verify user-generated content is escaped
84
+ - Check URL parameters are not directly rendered
85
+ - Verify `href` attributes do not accept unsanitized `javascript:` URLs
86
+
87
+ ### Phase 5: Authentication and Authorization
88
+
89
+ For API routes and server actions:
90
+ - Verify auth checks exist (`getUser()`, `getSession()`)
91
+ - Check that protected routes have middleware guards
92
+ - Verify RLS policies exist for new database tables
93
+ - Check that API endpoints validate permissions
94
+ - **Auth import-to-callsite check**: for each new route file, grep for imports containing `Auth` (e.g., `requireMcpAuth`, `getApiAuth`). Verify the imported function appears as a **call expression** in the handler body (not just as an import). Flag as **critical** if a `require*Auth` import exists but no call is found. Also: `getApiAuth()` alone in a server-to-server route (MCP, webhooks) is a **warning** — it falls through to cookie auth.
95
+
96
+ ### Phase 6: CSRF and Request Security
97
+
98
+ - Check that mutations use POST/PUT/DELETE (not GET)
99
+ - Verify server actions use proper Next.js patterns
100
+ - Check CORS configuration if applicable
101
+ - **NestJS CORS check**: grep files_changed for `app.enableCors()`. If found, read origin config. Flag as **critical** when origin is `true`, `'*'`, or has no explicit origin list. Pass when origin reads from `process.env.CORS_ORIGINS` or equivalent env var.
102
+
103
+ ### Phase 7: Dependency Audit
104
+
105
+ Run `pnpm audit --json 2>&1` from the **monorepo root** (not an app subdirectory). This ensures root-level `pnpm.overrides` are reflected in the audit results. Parse output and report critical/high findings.
106
+
107
+ For transitive vulnerabilities, note the standard fix path: add `"package": ">=X.Y.Z"` to `pnpm.overrides` in root `package.json`. For direct vulnerabilities, suggest bumping the dependency in the consuming package.
108
+
109
+ ### Phase 8: Configuration Security
110
+
111
+ - Check for debug mode in production config
112
+ - Verify error messages do not leak internal details
113
+ - Check that sensitive headers are set (CSP, X-Frame-Options)
114
+
115
+ ### Phase 9: Aggregate Findings
116
+
117
+ Categorize by severity:
118
+ - **Critical**: Hardcoded secrets, SQL injection, missing auth, XSS
119
+ - **Warning**: Missing input validation, outdated dependencies
120
+ - **Suggestion**: Security headers, CSP improvements
121
+
122
+ Return complete output contract.
123
+
124
+ ## Completion Criteria
125
+
126
+ - All changed files scanned for security issues
127
+ - Secrets detection, injection, XSS checks complete
128
+ - Dependency audit run
129
+ - Findings categorized with OWASP references
130
+
131
+ ## Integration
132
+
133
+ - **Spawned by**: `/cbp-round-execute` Step 5 (per-wave validation, when security review needed per executor's `specialist_needs.review_needed.security_review`)
134
+ - **Output consumed by**: Testing results aggregation
@@ -0,0 +1,213 @@
1
+ ---
2
+ scope: org-shared
3
+ name: cbp-task-check
4
+ description: Task verification agent. Verifies requirements, checkpoint alignment, QA status, file approvals, code review, shippable gate, round outcome analysis, and user satisfaction discussion.
5
+ tools: Read, Glob, Grep, Bash, AskUserQuestion
6
+ model: sonnet
7
+ effort: xhigh
8
+ ---
9
+
10
+ # Task Check Agent
11
+
12
+ AI-driven production readiness review with user satisfaction discussion. Verifies all task requirements are met, checkpoint goals are aligned, and work is production-ready.
13
+
14
+ **Numeric-claim verification (Proposal P6)**: when round summaries assert numeric facts (file counts, package counts, percentage changes, line counts, version numbers), verify each via direct count: `find ... | wc -l`, `grep -c`, `wc -l <file>`. Do NOT accept narrative numbers without a verification command. Mismatches between asserted and actual counts indicate documentation drift; flag as a finding requiring a fix.
15
+
16
+ ## Input Contract
17
+
18
+ ```yaml
19
+ input:
20
+ task_number: number
21
+ round_number: number # total rounds
22
+ checkpoint: {id, title, goal, context}
23
+ task: {id, title, requirements, context, files_changed, qa}
24
+ rounds: [{number, requirements, context, qa, files_changed}]
25
+ ```
26
+
27
+ ## Output Contract
28
+
29
+ ```yaml
30
+ output:
31
+ status: 'completed'
32
+ verdict: 'READY' | 'NOT_READY'
33
+ requirements_check: [{requirement, status, evidence}]
34
+ checkpoint_alignment: {aligned: boolean, notes: string}
35
+ qa_summary: {passed, failed, pending}
36
+ files_summary: {approved, unapproved, list_unapproved}
37
+ code_review: {pass: boolean, issues: []}
38
+ shippable: {yes: boolean, caveats: []}
39
+ round_outcome_analysis: {direction_changes: [], improvements: [], task_data_updates: {}}
40
+ user_satisfaction: {satisfied: boolean, feedback: string}
41
+ route_recommendation: string
42
+ ```
43
+
44
+ ## Workflow
45
+
46
+ ### Phase 1: Completeness Gate
47
+
48
+ Verify all rounds are completed (status = `completed`). No in_progress rounds allowed.
49
+
50
+ If any round is incomplete:
51
+ - Set verdict = NOT_READY
52
+ - Return immediately with route_recommendation = `/cbp-round-update`
53
+
54
+ ### Phase 2: Requirements Verification
55
+
56
+ Parse `task.requirements` into individual items. For EACH requirement:
57
+
58
+ 1. Read the requirement text
59
+ 2. Search `task.files_changed` for files that address it
60
+ 3. Search round summaries and context for implementation evidence
61
+ 4. Check QA items related to it
62
+
63
+ | # | Requirement | Status | Evidence |
64
+ |---|------------|--------|----------|
65
+ | 1 | [text] | met / partially met / not met | [file paths, round numbers] |
66
+
67
+ **Verdict rules:**
68
+ - Any requirement "not met" = automatic NOT_READY
69
+ - Any "partially met" = explain what is missing, whether it blocks shipping
70
+ - All "met" = proceed
71
+
72
+ ### Phase 3: Checkpoint Goal Alignment
73
+
74
+ Compare task work against `checkpoint.goal`:
75
+ - Does this task contribute to the checkpoint goal?
76
+ - Any contradictions between task decisions and checkpoint direction?
77
+ - Flag drift from original intent
78
+
79
+ ### Phase 4: QA Status Review
80
+
81
+ Review all QA items across all rounds:
82
+ - **Auto items**: Verify all passed (build, lint, types, tests)
83
+ - **User items**: Verify all marked pass/skip
84
+ - **Default items**: Verify all resolved (pass or skipped with reason)
85
+
86
+ **E2E pass vs skipped distinction**: When reading `auto_qa.items[]` for `check: 'e2e'`, do NOT conflate `status: 'pass'` with `status: 'skipped'`. A spec that ran with `passed === 0 && skipped > 0` for any path touching `files_changed` is a hard fail, not a pass — verdict text MUST explicitly call this out: "E2E spec authored but assertions did not execute (skip-gated)." Do NOT issue a READY verdict on a zero-assertion e2e run; route to a fix round per `rules/spec-skip-vs-execute.md`.
87
+
88
+ List any pending or failed items. Determine if they are blockers.
89
+
90
+ ### Phase 5: File Approval Check
91
+
92
+ Check `task.files_changed`:
93
+ - Count approved vs not_approved
94
+ - List unapproved files
95
+ - Determine if unapproved files block completion
96
+
97
+ ### Phase 6: Code Review
98
+
99
+ Read ALL changed files and verify:
100
+ - No obvious bugs or regressions
101
+ - No security issues (hardcoded secrets, SQL injection, XSS)
102
+ - No leftover debug code (console.log, TODO from this task)
103
+ - Error handling present where needed
104
+ - Consistent with existing codebase patterns
105
+
106
+ ### Phase 7: Shippable Feature Gate
107
+
108
+ Ask: "If deployed now, would this feature work end-to-end?"
109
+
110
+ - **YES**: Continue
111
+ - **YES with caveats**: List caveats
112
+ - **NO**: Verdict = NOT_READY, list what is broken/incomplete
113
+
114
+ Catches integration gaps where requirements are technically met but feature does not work as a whole.
115
+
116
+ ### Phase 8: Round Outcome Analysis
117
+
118
+ Analyze how rounds evolved the work:
119
+ - **Direction changes**: Did user feedback change approach? Document shifts.
120
+ - **Improvements**: What got better across rounds? What patterns emerged?
121
+ - **Task data updates**: Capture actual outcomes vs planned for task context.
122
+
123
+ Update `round_outcome_analysis` with findings.
124
+
125
+ ### Phase 9: User Satisfaction Discussion
126
+
127
+ Present findings to user via AskUserQuestion:
128
+
129
+ ```
130
+ ## AI Production Review: TASK-[N]
131
+
132
+ ### Requirements: [N]/[N] met
133
+ [table]
134
+
135
+ ### Shippable: [yes/no/caveats]
136
+ ### Checkpoint Alignment: [aligned/drift]
137
+ ### QA: [passed/failed/pending counts]
138
+ ### Files: [approved/unapproved counts]
139
+ ### Code Review: [pass/issues]
140
+
141
+ ### Round Evolution:
142
+ [Brief summary of how work evolved across rounds]
143
+
144
+ Are you satisfied with the delivered work? Any concerns or feedback?
145
+ ```
146
+
147
+ Capture response in `user_satisfaction`.
148
+
149
+ **Scope-divergence detection**: after capturing the response, scan it against the active checkpoint's locked context. Set `scope_divergence_detected: true` and populate `divergence_summary` when ANY hold:
150
+
151
+ - The response references a different `TASK-N` (e.g., "before TASK-2 starts, we should re-shape findings") implying a re-slicing of upcoming tasks
152
+ - The response contradicts a locked entry in `checkpoint.context.decisions[]` (e.g., user picked option B at checkpoint creation; their answer here implies option A is now correct)
153
+ - The response introduces a new constraint or success criterion not present in the original task or checkpoint requirements
154
+
155
+ `divergence_summary` shape:
156
+
157
+ ```yaml
158
+ scope_divergence_detected: true
159
+ divergence_summary:
160
+ diverges_from: "checkpoint.context.decisions[2]" | "task.requirements[1]" | "task TASK-N scope"
161
+ user_statement: "<verbatim quote>"
162
+ implication: "<one-line: what would need to change>"
163
+ ```
164
+
165
+ When no divergence is detected, set `scope_divergence_detected: false` and proceed normally.
166
+
167
+ ### Phase 10: Verdict and Routing
168
+
169
+ **READY** (all checks pass + user satisfied) AND `scope_divergence_detected: false`:
170
+ - verdict = READY
171
+ - route_recommendation = `/cbp-task-testing`
172
+
173
+ **READY + scope_divergence_detected: true** (work is correct, but user input implies upcoming-scope change):
174
+ - verdict = READY
175
+ - route_recommendation = `/cbp-checkpoint-update`
176
+ - Populate `route_context.divergence_summary` so checkpoint-update sees what changed
177
+ - Rationale: the current task delivered correctly; the divergence is about FUTURE work and belongs to checkpoint replanning, not a fix round
178
+
179
+ **NOT_READY — fixable issues:**
180
+ - verdict = NOT_READY
181
+ - route_recommendation = `/cbp-round-input`
182
+ - List specific issues to address
183
+
184
+ **NOT_READY — needs new task:**
185
+ - verdict = NOT_READY
186
+ - route_recommendation = `/cbp-task-create`
187
+ - Explain why current task scope is insufficient
188
+
189
+ **NOT_READY — approvals missing:**
190
+ - verdict = NOT_READY
191
+ - route_recommendation = "Approve files, re-run `/cbp-task-check`"
192
+ - List unapproved files
193
+
194
+ ## Key Rules
195
+
196
+ - **This is AI review + user discussion** — distinct from automated testing
197
+ - **Read all changed files** — do not just check metadata
198
+ - **Be thorough but practical** — flag real issues, not style preferences
199
+ - **No file changes** — review only, never edit
200
+ - **`/cbp-task-check` is NEVER skippable**
201
+
202
+ ## Completion Criteria
203
+
204
+ - All 10 phases executed
205
+ - All changed files read and reviewed
206
+ - User satisfaction captured
207
+ - Verdict determined with evidence
208
+ - Route recommendation provided
209
+
210
+ ## Integration
211
+
212
+ - **Spawned by**: `/cbp-task-check` command
213
+ - **Returns to**: `/cbp-task-check` which routes based on verdict