@zigrivers/scaffold 2.1.2 → 2.38.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 (391) hide show
  1. package/README.md +505 -119
  2. package/dist/cli/commands/build.d.ts.map +1 -1
  3. package/dist/cli/commands/build.js +94 -14
  4. package/dist/cli/commands/build.js.map +1 -1
  5. package/dist/cli/commands/build.test.js +30 -5
  6. package/dist/cli/commands/build.test.js.map +1 -1
  7. package/dist/cli/commands/check.d.ts +12 -0
  8. package/dist/cli/commands/check.d.ts.map +1 -0
  9. package/dist/cli/commands/check.js +311 -0
  10. package/dist/cli/commands/check.js.map +1 -0
  11. package/dist/cli/commands/check.test.d.ts +2 -0
  12. package/dist/cli/commands/check.test.d.ts.map +1 -0
  13. package/dist/cli/commands/check.test.js +412 -0
  14. package/dist/cli/commands/check.test.js.map +1 -0
  15. package/dist/cli/commands/complete.d.ts +12 -0
  16. package/dist/cli/commands/complete.d.ts.map +1 -0
  17. package/dist/cli/commands/complete.js +101 -0
  18. package/dist/cli/commands/complete.js.map +1 -0
  19. package/dist/cli/commands/complete.test.d.ts +2 -0
  20. package/dist/cli/commands/complete.test.d.ts.map +1 -0
  21. package/dist/cli/commands/complete.test.js +133 -0
  22. package/dist/cli/commands/complete.test.js.map +1 -0
  23. package/dist/cli/commands/dashboard.d.ts.map +1 -1
  24. package/dist/cli/commands/dashboard.js +12 -8
  25. package/dist/cli/commands/dashboard.js.map +1 -1
  26. package/dist/cli/commands/info.d.ts.map +1 -1
  27. package/dist/cli/commands/info.js +4 -0
  28. package/dist/cli/commands/info.js.map +1 -1
  29. package/dist/cli/commands/knowledge.d.ts.map +1 -1
  30. package/dist/cli/commands/knowledge.js +6 -2
  31. package/dist/cli/commands/knowledge.js.map +1 -1
  32. package/dist/cli/commands/knowledge.test.js +16 -11
  33. package/dist/cli/commands/knowledge.test.js.map +1 -1
  34. package/dist/cli/commands/next.d.ts.map +1 -1
  35. package/dist/cli/commands/next.js +41 -13
  36. package/dist/cli/commands/next.js.map +1 -1
  37. package/dist/cli/commands/next.test.js +3 -0
  38. package/dist/cli/commands/next.test.js.map +1 -1
  39. package/dist/cli/commands/reset.d.ts +1 -0
  40. package/dist/cli/commands/reset.d.ts.map +1 -1
  41. package/dist/cli/commands/reset.js +179 -67
  42. package/dist/cli/commands/reset.js.map +1 -1
  43. package/dist/cli/commands/reset.test.js +360 -0
  44. package/dist/cli/commands/reset.test.js.map +1 -1
  45. package/dist/cli/commands/rework.d.ts +20 -0
  46. package/dist/cli/commands/rework.d.ts.map +1 -0
  47. package/dist/cli/commands/rework.js +332 -0
  48. package/dist/cli/commands/rework.js.map +1 -0
  49. package/dist/cli/commands/rework.test.d.ts +2 -0
  50. package/dist/cli/commands/rework.test.d.ts.map +1 -0
  51. package/dist/cli/commands/rework.test.js +297 -0
  52. package/dist/cli/commands/rework.test.js.map +1 -0
  53. package/dist/cli/commands/run.d.ts.map +1 -1
  54. package/dist/cli/commands/run.js +59 -31
  55. package/dist/cli/commands/run.js.map +1 -1
  56. package/dist/cli/commands/run.test.js +288 -6
  57. package/dist/cli/commands/run.test.js.map +1 -1
  58. package/dist/cli/commands/skill.d.ts +12 -0
  59. package/dist/cli/commands/skill.d.ts.map +1 -0
  60. package/dist/cli/commands/skill.js +123 -0
  61. package/dist/cli/commands/skill.js.map +1 -0
  62. package/dist/cli/commands/skill.test.d.ts +2 -0
  63. package/dist/cli/commands/skill.test.d.ts.map +1 -0
  64. package/dist/cli/commands/skill.test.js +297 -0
  65. package/dist/cli/commands/skill.test.js.map +1 -0
  66. package/dist/cli/commands/skip.d.ts +1 -1
  67. package/dist/cli/commands/skip.d.ts.map +1 -1
  68. package/dist/cli/commands/skip.js +123 -57
  69. package/dist/cli/commands/skip.js.map +1 -1
  70. package/dist/cli/commands/skip.test.js +91 -0
  71. package/dist/cli/commands/skip.test.js.map +1 -1
  72. package/dist/cli/commands/status.d.ts +1 -0
  73. package/dist/cli/commands/status.d.ts.map +1 -1
  74. package/dist/cli/commands/status.js +57 -10
  75. package/dist/cli/commands/status.js.map +1 -1
  76. package/dist/cli/commands/status.test.js +81 -0
  77. package/dist/cli/commands/status.test.js.map +1 -1
  78. package/dist/cli/commands/update.test.js +252 -0
  79. package/dist/cli/commands/update.test.js.map +1 -1
  80. package/dist/cli/commands/version.test.js +171 -1
  81. package/dist/cli/commands/version.test.js.map +1 -1
  82. package/dist/cli/index.d.ts.map +1 -1
  83. package/dist/cli/index.js +8 -0
  84. package/dist/cli/index.js.map +1 -1
  85. package/dist/core/adapters/adapter.d.ts +14 -0
  86. package/dist/core/adapters/adapter.d.ts.map +1 -1
  87. package/dist/core/adapters/adapter.js.map +1 -1
  88. package/dist/core/adapters/adapter.test.js +10 -0
  89. package/dist/core/adapters/adapter.test.js.map +1 -1
  90. package/dist/core/adapters/claude-code.d.ts.map +1 -1
  91. package/dist/core/adapters/claude-code.js +47 -10
  92. package/dist/core/adapters/claude-code.js.map +1 -1
  93. package/dist/core/adapters/claude-code.test.js +41 -20
  94. package/dist/core/adapters/claude-code.test.js.map +1 -1
  95. package/dist/core/adapters/codex.d.ts.map +1 -1
  96. package/dist/core/adapters/codex.js +5 -1
  97. package/dist/core/adapters/codex.js.map +1 -1
  98. package/dist/core/adapters/codex.test.js +5 -0
  99. package/dist/core/adapters/codex.test.js.map +1 -1
  100. package/dist/core/adapters/universal.d.ts.map +1 -1
  101. package/dist/core/adapters/universal.js +0 -1
  102. package/dist/core/adapters/universal.js.map +1 -1
  103. package/dist/core/adapters/universal.test.js +5 -0
  104. package/dist/core/adapters/universal.test.js.map +1 -1
  105. package/dist/core/assembly/context-gatherer.d.ts.map +1 -1
  106. package/dist/core/assembly/context-gatherer.js +5 -2
  107. package/dist/core/assembly/context-gatherer.js.map +1 -1
  108. package/dist/core/assembly/engine.d.ts.map +1 -1
  109. package/dist/core/assembly/engine.js +10 -2
  110. package/dist/core/assembly/engine.js.map +1 -1
  111. package/dist/core/assembly/engine.test.js +19 -0
  112. package/dist/core/assembly/engine.test.js.map +1 -1
  113. package/dist/core/assembly/knowledge-loader.d.ts +25 -0
  114. package/dist/core/assembly/knowledge-loader.d.ts.map +1 -1
  115. package/dist/core/assembly/knowledge-loader.js +75 -2
  116. package/dist/core/assembly/knowledge-loader.js.map +1 -1
  117. package/dist/core/assembly/knowledge-loader.test.js +388 -1
  118. package/dist/core/assembly/knowledge-loader.test.js.map +1 -1
  119. package/dist/core/assembly/meta-prompt-loader.d.ts +6 -0
  120. package/dist/core/assembly/meta-prompt-loader.d.ts.map +1 -1
  121. package/dist/core/assembly/meta-prompt-loader.js +41 -25
  122. package/dist/core/assembly/meta-prompt-loader.js.map +1 -1
  123. package/dist/core/assembly/preset-loader.d.ts +10 -0
  124. package/dist/core/assembly/preset-loader.d.ts.map +1 -1
  125. package/dist/core/assembly/preset-loader.js +26 -1
  126. package/dist/core/assembly/preset-loader.js.map +1 -1
  127. package/dist/core/assembly/preset-loader.test.js +65 -1
  128. package/dist/core/assembly/preset-loader.test.js.map +1 -1
  129. package/dist/core/assembly/update-mode.d.ts.map +1 -1
  130. package/dist/core/assembly/update-mode.js +10 -4
  131. package/dist/core/assembly/update-mode.js.map +1 -1
  132. package/dist/core/assembly/update-mode.test.js +47 -0
  133. package/dist/core/assembly/update-mode.test.js.map +1 -1
  134. package/dist/core/dependency/dependency.d.ts.map +1 -1
  135. package/dist/core/dependency/dependency.js +3 -2
  136. package/dist/core/dependency/dependency.js.map +1 -1
  137. package/dist/core/dependency/dependency.test.js +2 -0
  138. package/dist/core/dependency/dependency.test.js.map +1 -1
  139. package/dist/core/dependency/eligibility.js +3 -3
  140. package/dist/core/dependency/eligibility.js.map +1 -1
  141. package/dist/core/dependency/eligibility.test.js +2 -0
  142. package/dist/core/dependency/eligibility.test.js.map +1 -1
  143. package/dist/core/dependency/graph.d.ts.map +1 -1
  144. package/dist/core/dependency/graph.js +4 -0
  145. package/dist/core/dependency/graph.js.map +1 -1
  146. package/dist/core/dependency/graph.test.d.ts +2 -0
  147. package/dist/core/dependency/graph.test.d.ts.map +1 -0
  148. package/dist/core/dependency/graph.test.js +262 -0
  149. package/dist/core/dependency/graph.test.js.map +1 -0
  150. package/dist/core/rework/phase-selector.d.ts +24 -0
  151. package/dist/core/rework/phase-selector.d.ts.map +1 -0
  152. package/dist/core/rework/phase-selector.js +98 -0
  153. package/dist/core/rework/phase-selector.js.map +1 -0
  154. package/dist/core/rework/phase-selector.test.d.ts +2 -0
  155. package/dist/core/rework/phase-selector.test.d.ts.map +1 -0
  156. package/dist/core/rework/phase-selector.test.js +138 -0
  157. package/dist/core/rework/phase-selector.test.js.map +1 -0
  158. package/dist/dashboard/generator.d.ts +48 -17
  159. package/dist/dashboard/generator.d.ts.map +1 -1
  160. package/dist/dashboard/generator.js +75 -5
  161. package/dist/dashboard/generator.js.map +1 -1
  162. package/dist/dashboard/generator.test.js +213 -5
  163. package/dist/dashboard/generator.test.js.map +1 -1
  164. package/dist/dashboard/template.d.ts +1 -1
  165. package/dist/dashboard/template.d.ts.map +1 -1
  166. package/dist/dashboard/template.js +755 -114
  167. package/dist/dashboard/template.js.map +1 -1
  168. package/dist/e2e/knowledge.test.js +4 -3
  169. package/dist/e2e/knowledge.test.js.map +1 -1
  170. package/dist/e2e/pipeline.test.js +2 -0
  171. package/dist/e2e/pipeline.test.js.map +1 -1
  172. package/dist/e2e/rework.test.d.ts +6 -0
  173. package/dist/e2e/rework.test.d.ts.map +1 -0
  174. package/dist/e2e/rework.test.js +226 -0
  175. package/dist/e2e/rework.test.js.map +1 -0
  176. package/dist/index.js +0 -0
  177. package/dist/project/adopt.test.js +2 -0
  178. package/dist/project/adopt.test.js.map +1 -1
  179. package/dist/project/claude-md.js +2 -2
  180. package/dist/project/claude-md.js.map +1 -1
  181. package/dist/project/claude-md.test.js +4 -4
  182. package/dist/project/claude-md.test.js.map +1 -1
  183. package/dist/project/detector.d.ts.map +1 -1
  184. package/dist/project/detector.js +4 -1
  185. package/dist/project/detector.js.map +1 -1
  186. package/dist/project/frontmatter.d.ts.map +1 -1
  187. package/dist/project/frontmatter.js +54 -15
  188. package/dist/project/frontmatter.js.map +1 -1
  189. package/dist/project/frontmatter.test.js +2 -2
  190. package/dist/project/frontmatter.test.js.map +1 -1
  191. package/dist/state/rework-manager.d.ts +16 -0
  192. package/dist/state/rework-manager.d.ts.map +1 -0
  193. package/dist/state/rework-manager.js +126 -0
  194. package/dist/state/rework-manager.js.map +1 -0
  195. package/dist/state/rework-manager.test.d.ts +2 -0
  196. package/dist/state/rework-manager.test.d.ts.map +1 -0
  197. package/dist/state/rework-manager.test.js +191 -0
  198. package/dist/state/rework-manager.test.js.map +1 -0
  199. package/dist/state/state-manager.d.ts +13 -0
  200. package/dist/state/state-manager.d.ts.map +1 -1
  201. package/dist/state/state-manager.js +39 -2
  202. package/dist/state/state-manager.js.map +1 -1
  203. package/dist/state/state-manager.test.js +74 -1
  204. package/dist/state/state-manager.test.js.map +1 -1
  205. package/dist/state/state-migration.d.ts +23 -0
  206. package/dist/state/state-migration.d.ts.map +1 -0
  207. package/dist/state/state-migration.js +144 -0
  208. package/dist/state/state-migration.js.map +1 -0
  209. package/dist/state/state-migration.test.d.ts +2 -0
  210. package/dist/state/state-migration.test.d.ts.map +1 -0
  211. package/dist/state/state-migration.test.js +451 -0
  212. package/dist/state/state-migration.test.js.map +1 -0
  213. package/dist/types/assembly.d.ts +2 -0
  214. package/dist/types/assembly.d.ts.map +1 -1
  215. package/dist/types/dependency.d.ts +2 -2
  216. package/dist/types/dependency.d.ts.map +1 -1
  217. package/dist/types/frontmatter.d.ts +100 -7
  218. package/dist/types/frontmatter.d.ts.map +1 -1
  219. package/dist/types/frontmatter.js +89 -1
  220. package/dist/types/frontmatter.js.map +1 -1
  221. package/dist/types/index.d.ts +1 -0
  222. package/dist/types/index.d.ts.map +1 -1
  223. package/dist/types/index.js +1 -0
  224. package/dist/types/index.js.map +1 -1
  225. package/dist/types/lock.d.ts +1 -1
  226. package/dist/types/lock.d.ts.map +1 -1
  227. package/dist/types/rework.d.ts +36 -0
  228. package/dist/types/rework.d.ts.map +1 -0
  229. package/dist/types/rework.js +2 -0
  230. package/dist/types/rework.js.map +1 -0
  231. package/dist/utils/errors.d.ts +1 -0
  232. package/dist/utils/errors.d.ts.map +1 -1
  233. package/dist/utils/errors.js +8 -0
  234. package/dist/utils/errors.js.map +1 -1
  235. package/dist/utils/fs.d.ts +6 -0
  236. package/dist/utils/fs.d.ts.map +1 -1
  237. package/dist/utils/fs.js +13 -0
  238. package/dist/utils/fs.js.map +1 -1
  239. package/dist/validation/config-validator.test.d.ts +2 -0
  240. package/dist/validation/config-validator.test.d.ts.map +1 -0
  241. package/dist/validation/config-validator.test.js +210 -0
  242. package/dist/validation/config-validator.test.js.map +1 -0
  243. package/dist/validation/dependency-validator.test.d.ts +2 -0
  244. package/dist/validation/dependency-validator.test.d.ts.map +1 -0
  245. package/dist/validation/dependency-validator.test.js +215 -0
  246. package/dist/validation/dependency-validator.test.js.map +1 -0
  247. package/dist/validation/frontmatter-validator.test.d.ts +2 -0
  248. package/dist/validation/frontmatter-validator.test.d.ts.map +1 -0
  249. package/dist/validation/frontmatter-validator.test.js +371 -0
  250. package/dist/validation/frontmatter-validator.test.js.map +1 -0
  251. package/dist/validation/state-validator.test.d.ts +2 -0
  252. package/dist/validation/state-validator.test.d.ts.map +1 -0
  253. package/dist/validation/state-validator.test.js +325 -0
  254. package/dist/validation/state-validator.test.js.map +1 -0
  255. package/dist/wizard/suggestion.test.d.ts +2 -0
  256. package/dist/wizard/suggestion.test.d.ts.map +1 -0
  257. package/dist/wizard/suggestion.test.js +115 -0
  258. package/dist/wizard/suggestion.test.js.map +1 -0
  259. package/dist/wizard/wizard.d.ts.map +1 -1
  260. package/dist/wizard/wizard.js +34 -1
  261. package/dist/wizard/wizard.js.map +1 -1
  262. package/knowledge/core/adr-craft.md +57 -0
  263. package/knowledge/core/ai-memory-management.md +246 -0
  264. package/knowledge/core/api-design.md +8 -0
  265. package/knowledge/core/automated-review-tooling.md +203 -0
  266. package/knowledge/core/claude-md-patterns.md +254 -0
  267. package/knowledge/core/coding-conventions.md +246 -0
  268. package/knowledge/core/database-design.md +8 -0
  269. package/knowledge/core/design-system-tokens.md +469 -0
  270. package/knowledge/core/dev-environment.md +223 -0
  271. package/knowledge/core/domain-modeling.md +8 -0
  272. package/knowledge/core/eval-craft.md +1008 -0
  273. package/knowledge/core/git-workflow-patterns.md +200 -0
  274. package/knowledge/core/multi-model-review-dispatch.md +250 -0
  275. package/knowledge/core/operations-runbook.md +40 -225
  276. package/knowledge/core/project-structure-patterns.md +231 -0
  277. package/knowledge/core/review-step-template.md +247 -0
  278. package/knowledge/core/{security-review.md → security-best-practices.md} +9 -1
  279. package/knowledge/core/system-architecture.md +5 -1
  280. package/knowledge/core/task-decomposition.md +174 -36
  281. package/knowledge/core/task-tracking.md +225 -0
  282. package/knowledge/core/tech-stack-selection.md +214 -0
  283. package/knowledge/core/testing-strategy.md +63 -70
  284. package/knowledge/core/user-stories.md +69 -60
  285. package/knowledge/core/user-story-innovation.md +70 -0
  286. package/knowledge/core/ux-specification.md +18 -148
  287. package/knowledge/execution/enhancement-workflow.md +201 -0
  288. package/knowledge/execution/task-claiming-strategy.md +130 -0
  289. package/knowledge/execution/tdd-execution-loop.md +172 -0
  290. package/knowledge/execution/worktree-management.md +205 -0
  291. package/knowledge/finalization/apply-fixes-and-freeze.md +177 -14
  292. package/knowledge/finalization/developer-onboarding.md +4 -0
  293. package/knowledge/finalization/implementation-playbook.md +83 -5
  294. package/knowledge/product/gap-analysis.md +5 -1
  295. package/knowledge/product/prd-craft.md +55 -34
  296. package/knowledge/product/prd-innovation.md +12 -0
  297. package/knowledge/product/vision-craft.md +213 -0
  298. package/knowledge/review/review-adr.md +44 -0
  299. package/knowledge/review/{review-api-contracts.md → review-api-design.md} +47 -1
  300. package/knowledge/review/{review-database-schema.md → review-database-design.md} +40 -1
  301. package/knowledge/review/review-domain-modeling.md +38 -1
  302. package/knowledge/review/review-implementation-tasks.md +108 -1
  303. package/knowledge/review/review-methodology.md +11 -0
  304. package/knowledge/review/review-operations.md +67 -0
  305. package/knowledge/review/review-prd.md +46 -0
  306. package/knowledge/review/review-security.md +65 -0
  307. package/knowledge/review/review-system-architecture.md +32 -2
  308. package/knowledge/review/review-testing-strategy.md +62 -0
  309. package/knowledge/review/review-user-stories.md +65 -0
  310. package/knowledge/review/{review-ux-spec.md → review-ux-specification.md} +50 -2
  311. package/knowledge/review/review-vision.md +255 -0
  312. package/knowledge/tools/release-management.md +222 -0
  313. package/knowledge/tools/session-analysis.md +215 -0
  314. package/knowledge/tools/version-strategy.md +200 -0
  315. package/knowledge/validation/critical-path-analysis.md +1 -1
  316. package/knowledge/validation/cross-phase-consistency.md +12 -0
  317. package/knowledge/validation/decision-completeness.md +13 -1
  318. package/knowledge/validation/dependency-validation.md +12 -0
  319. package/knowledge/validation/scope-management.md +12 -0
  320. package/knowledge/validation/traceability.md +12 -0
  321. package/methodology/README.md +37 -0
  322. package/methodology/custom-defaults.yml +44 -4
  323. package/methodology/deep.yml +43 -3
  324. package/methodology/mvp.yml +43 -3
  325. package/package.json +4 -3
  326. package/pipeline/architecture/review-architecture.md +36 -13
  327. package/pipeline/architecture/system-architecture.md +24 -9
  328. package/pipeline/build/multi-agent-resume.md +245 -0
  329. package/pipeline/build/multi-agent-start.md +236 -0
  330. package/pipeline/build/new-enhancement.md +456 -0
  331. package/pipeline/build/quick-task.md +381 -0
  332. package/pipeline/build/single-agent-resume.md +210 -0
  333. package/pipeline/build/single-agent-start.md +207 -0
  334. package/pipeline/consolidation/claude-md-optimization.md +76 -0
  335. package/pipeline/consolidation/workflow-audit.md +77 -0
  336. package/pipeline/decisions/adrs.md +21 -7
  337. package/pipeline/decisions/review-adrs.md +32 -11
  338. package/pipeline/environment/ai-memory-setup.md +76 -0
  339. package/pipeline/environment/automated-pr-review.md +76 -0
  340. package/pipeline/environment/design-system.md +75 -0
  341. package/pipeline/environment/dev-env-setup.md +68 -0
  342. package/pipeline/environment/git-workflow.md +73 -0
  343. package/pipeline/finalization/apply-fixes-and-freeze.md +17 -6
  344. package/pipeline/finalization/developer-onboarding-guide.md +23 -9
  345. package/pipeline/finalization/implementation-playbook.md +43 -14
  346. package/pipeline/foundation/beads.md +71 -0
  347. package/pipeline/foundation/coding-standards.md +71 -0
  348. package/pipeline/foundation/project-structure.md +73 -0
  349. package/pipeline/foundation/tdd.md +64 -0
  350. package/pipeline/foundation/tech-stack.md +74 -0
  351. package/pipeline/integration/add-e2e-testing.md +80 -0
  352. package/pipeline/modeling/domain-modeling.md +23 -8
  353. package/pipeline/modeling/review-domain-modeling.md +35 -11
  354. package/pipeline/parity/platform-parity-review.md +90 -0
  355. package/pipeline/planning/implementation-plan-review.md +67 -0
  356. package/pipeline/planning/implementation-plan.md +110 -0
  357. package/pipeline/pre/create-prd.md +34 -10
  358. package/pipeline/pre/innovate-prd.md +46 -15
  359. package/pipeline/pre/innovate-user-stories.md +47 -14
  360. package/pipeline/pre/review-prd.md +29 -8
  361. package/pipeline/pre/review-user-stories.md +34 -8
  362. package/pipeline/pre/user-stories.md +23 -8
  363. package/pipeline/quality/create-evals.md +106 -0
  364. package/pipeline/quality/operations.md +46 -17
  365. package/pipeline/quality/review-operations.md +32 -11
  366. package/pipeline/quality/review-security.md +34 -12
  367. package/pipeline/quality/review-testing.md +37 -14
  368. package/pipeline/quality/security.md +36 -10
  369. package/pipeline/quality/story-tests.md +75 -0
  370. package/pipeline/specification/api-contracts.md +28 -8
  371. package/pipeline/specification/database-schema.md +29 -8
  372. package/pipeline/specification/review-api.md +32 -11
  373. package/pipeline/specification/review-database.md +32 -11
  374. package/pipeline/specification/review-ux.md +34 -12
  375. package/pipeline/specification/ux-spec.md +35 -13
  376. package/pipeline/validation/critical-path-walkthrough.md +45 -11
  377. package/pipeline/validation/cross-phase-consistency.md +45 -11
  378. package/pipeline/validation/decision-completeness.md +45 -11
  379. package/pipeline/validation/dependency-graph-validation.md +46 -11
  380. package/pipeline/validation/implementability-dry-run.md +46 -11
  381. package/pipeline/validation/scope-creep-check.md +46 -11
  382. package/pipeline/validation/traceability-matrix.md +51 -11
  383. package/pipeline/vision/create-vision.md +267 -0
  384. package/pipeline/vision/innovate-vision.md +157 -0
  385. package/pipeline/vision/review-vision.md +149 -0
  386. package/skills/multi-model-dispatch/SKILL.md +326 -0
  387. package/skills/scaffold-pipeline/SKILL.md +210 -0
  388. package/skills/scaffold-runner/SKILL.md +619 -0
  389. package/pipeline/planning/implementation-tasks.md +0 -57
  390. package/pipeline/planning/review-tasks.md +0 -38
  391. package/pipeline/quality/testing-strategy.md +0 -42
@@ -0,0 +1,157 @@
1
+ ---
2
+ name: innovate-vision
3
+ description: Discover strategic innovation opportunities in the product vision
4
+ summary: "Explores untapped opportunities — adjacent markets, AI-native capabilities, ecosystem partnerships, and contrarian positioning — and proposes innovations for your approval."
5
+ phase: "vision"
6
+ order: 030
7
+ dependencies: [review-vision]
8
+ outputs: [docs/vision.md]
9
+ conditional: "if-needed"
10
+ knowledge-base: [vision-craft]
11
+ ---
12
+
13
+ ## Purpose
14
+ Discover strategic innovation opportunities within the product vision. This
15
+ covers market positioning, competitive strategy, ecosystem thinking, and
16
+ contrarian bets. It operates at the strategic level — should the product be
17
+ positioned differently? Are there market opportunities being missed? What
18
+ would an AI-native rethinking look like?
19
+
20
+ This is distinct from PRD innovation (innovate-prd), which covers feature-level
21
+ gaps. If an idea is about a specific feature, it belongs in PRD innovation,
22
+ not here.
23
+
24
+ ## Inputs
25
+ - docs/vision.md (required) — Vision document to analyze
26
+ - docs/reviews/vision-review-vision.md (optional) — review findings for context
27
+
28
+ ## Expected Outputs
29
+ - docs/vision.md — updated with approved strategic innovations
30
+
31
+ ## Quality Criteria
32
+ - Innovations are strategic-level, not feature-level
33
+ - (mvp) Each innovation categorized: market opportunity, positioning, AI-native, ecosystem, or contrarian
34
+ - (mvp) Each innovation includes: what to change, why, impact (high/medium/low), cost estimate
35
+ - (mvp) Each suggestion has an implementation cost estimate (trivial/moderate/significant)
36
+ - (mvp) Recommended disposition stated for each: must-have, backlog, or reject with rationale
37
+ - (deep) Impact assessments compared to existing document content
38
+ - (deep) Each approved innovation is integrated with the same subsection headings and detail level as existing vision sections
39
+ - Vision scope is respected — no uncontrolled strategic drift
40
+ - User approval is obtained before modifying the vision document
41
+
42
+ ## Methodology Scaling
43
+ - **deep**: Full innovation pass across all 5 dimensions. Competitive research
44
+ via web search. Detailed integration of approved innovations into vision.
45
+ - **mvp**: Not applicable — this step is conditional and skipped in MVP.
46
+ - **custom:depth(1-5)**: Depth 1-2: Quick scan only — identify 1-2 high-impact
47
+ strategic angles with brief rationale. Depth 3: quick scan for positioning
48
+ gaps and obvious market opportunities. Depth 4-5: full innovation pass
49
+ across all 5 dimensions.
50
+
51
+ ## Conditional Evaluation
52
+ Enable when: project has competitive landscape content in vision.md, user
53
+ explicitly requests a strategic innovation pass, or the vision review
54
+ (review-vision) identifies strategic gaps or weak positioning. Skip when:
55
+ vision is minimal/exploratory, depth < 3, or user explicitly declines innovation.
56
+
57
+ ## Mode Detection
58
+ If this step has been run before (tracking comment
59
+ `<!-- scaffold:innovate-vision -->` exists in docs/vision.md), this is a
60
+ re-innovation pass. Focus on new opportunities from vision changes since last run.
61
+
62
+ ## Update Mode Specifics
63
+ - **Detect prior artifact**: `<!-- scaffold:innovate-vision -->` tracking
64
+ comment in docs/vision.md
65
+ - **Preserve**: Previously accepted strategic decisions, positioning choices
66
+ approved by user
67
+ - **Triggers for update**: Vision strategy changed, new market data available,
68
+ user requests re-evaluation
69
+ - **Conflict resolution**: if a previously rejected strategic angle is now
70
+ relevant due to vision changes, re-propose with updated rationale
71
+
72
+ ## Instructions
73
+
74
+ Deeply research docs/vision.md and identify strategic innovation opportunities
75
+ across 5 dimensions. This is the last chance to strengthen the vision before
76
+ it drives the PRD and everything downstream.
77
+
78
+ ### Dimension 1: Market Opportunity Expansion
79
+
80
+ Research adjacent opportunities:
81
+ - Adjacent markets or segments not currently addressed
82
+ - Underserved niches within the target audience
83
+ - Timing advantages (regulatory changes, technology shifts, cultural moments)
84
+ - Platform or ecosystem opportunities that could amplify reach
85
+ - Geographic or demographic expansion possibilities
86
+
87
+ ### Dimension 2: Positioning Alternatives
88
+
89
+ Explore how the product could be positioned differently:
90
+ - Could the product be positioned differently for greater impact?
91
+ - Alternative framings of the value proposition
92
+ - Category creation vs category competition — which is the stronger play?
93
+ - Messaging angles that haven't been explored
94
+ - What would a "10x better positioning" look like?
95
+
96
+ ### Dimension 3: AI-Native Rethinking
97
+
98
+ If this product were conceived today with AI capabilities assumed:
99
+ - What changes fundamentally about the product concept?
100
+ - Features that become trivial with AI (and therefore table stakes)
101
+ - Experiences that become possible that were previously impractical
102
+ - Intelligence that can be embedded vs bolted on
103
+ - How does AI change the competitive landscape for this product?
104
+
105
+ ### Dimension 4: Ecosystem Thinking
106
+
107
+ Explore how the product fits into a broader ecosystem:
108
+ - Partners and integrations that amplify the product's value
109
+ - Platform effects or network effects available
110
+ - Data advantages that compound over time
111
+ - Build vs buy vs partner decisions at the strategic level
112
+ - Community or marketplace opportunities
113
+
114
+ ### Dimension 5: Contrarian Bets
115
+
116
+ Challenge the vision's assumptions:
117
+ - What does the vision assume that most people agree with? What if the opposite were true?
118
+ - Industry orthodoxies worth challenging
119
+ - One genuinely contrarian strategic angle, evaluated honestly
120
+ - "What would we do differently if we believed X?"
121
+ - Which assumptions, if wrong, would invalidate the entire vision?
122
+
123
+ ### For Each Innovation Idea, Present:
124
+ - **What**: The strategic innovation
125
+ - **Why**: Strategic rationale and market context
126
+ - **Impact**: How much better the product positioning gets (high / medium / low)
127
+ - **Cost**: Implementation effort (trivial / moderate / significant)
128
+ - **Recommendation**: Must-have for vision, or backlog for future consideration
129
+
130
+ ### Process
131
+
132
+ 1. Research competitive landscape and market trends via web search
133
+ 2. Generate innovation ideas across all 5 dimensions
134
+ 3. Use AskUserQuestionTool to present innovations grouped by dimension for user approval
135
+ 4. For each approved innovation, integrate it into the appropriate section of docs/vision.md
136
+ 5. Update tracking comment: add `<!-- scaffold:innovate-vision v1 YYYY-MM-DD -->` after the vision tracking comment
137
+ 6. Provide a summary of what was added, modified, or deferred
138
+
139
+ ### Quality Standards
140
+ - Strategic-level only — feature ideas belong in innovate-prd
141
+ - Honest about costs and risks — don't oversell
142
+ - Respect the existing guiding principles — innovations should align, not contradict
143
+ - Do NOT modify the vision statement without explicit user approval
144
+ - Do NOT add approved innovations as vague one-liners — document them to the same standard as existing sections
145
+
146
+ ## After This Step
147
+
148
+ When this step is complete, tell the user:
149
+
150
+ ---
151
+ **Innovation complete** — `docs/vision.md` updated with approved strategic innovations.
152
+
153
+ **Next:** Run `/scaffold:create-prd` — Translate the vision into product requirements.
154
+
155
+ **Pipeline reference:** `/scaffold:prompt-pipeline`
156
+
157
+ ---
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: review-vision
3
+ description: Multi-pass review of the product vision for clarity, coherence, and downstream readiness
4
+ summary: "Stress-tests the vision across five dimensions — clarity, audience precision, competitive rigor, strategic coherence, and whether the PRD can be written from it without ambiguity — and fixes what it finds."
5
+ phase: "vision"
6
+ order: 020
7
+ dependencies: [create-vision]
8
+ outputs: [docs/reviews/vision-review-vision.md]
9
+ conditional: null
10
+ knowledge-base: [review-methodology, vision-craft, multi-model-review-dispatch, review-step-template, review-vision]
11
+ ---
12
+
13
+ ## Purpose
14
+ Deep multi-pass review of the product vision document, targeting the specific
15
+ failure modes of strategic vision artifacts. Identify issues, create a fix plan,
16
+ execute fixes, and re-validate. Ensures the vision is inspiring, coherent,
17
+ strategically sound, and ready for the PRD to consume.
18
+
19
+ ## Inputs
20
+ - docs/vision.md (required) — Vision document to review
21
+ - Project idea or brief (context from user, if available)
22
+
23
+ ## Expected Outputs
24
+ - docs/reviews/vision-review-vision.md — review findings, fix plan, and resolution log
25
+ - docs/vision.md — updated with fixes
26
+
27
+ ## Quality Criteria
28
+ - (mvp) Passes 1 and 5 executed with findings documented
29
+ - All 5 review passes executed with findings documented
30
+ - Every finding categorized by severity (P0-P3)
31
+ - Fix plan created for P0 and P1 findings
32
+ - Fixes applied and re-validated
33
+ - (mvp) Every vision section has content specific enough to derive a PRD without asking strategic clarification questions
34
+ - (depth 4+) Multi-model review findings synthesized with consensus/disagreement analysis
35
+
36
+ ## Methodology Scaling
37
+ - **deep**: All 5 review passes. Full findings report with severity
38
+ categorization. Fixes applied and re-validated.
39
+ - **mvp**: Passes 1 and 5 only (Vision Clarity and Downstream Readiness).
40
+ Focus on blocking gaps — is the vision clear enough to write a PRD from?
41
+ - **custom:depth(1-5)**: Depth 1-2: passes 1 and 5 only. Depth 3: passes 1,
42
+ 2, 5 (add Audience Precision). Depth 4: passes 1-3, 5 (add Competitive
43
+ Rigor). Depth 5: all 5 passes.
44
+
45
+ ## Mode Detection
46
+ If docs/reviews/vision-review-vision.md exists, this is a re-review. Read
47
+ previous findings and focus on whether fixes were applied and any new issues
48
+ introduced.
49
+
50
+ ## Update Mode Specifics
51
+ - **Detect prior artifact**: docs/reviews/vision-review-vision.md exists
52
+ - **Preserve**: Findings from prior review that are still valid, resolution
53
+ decisions made by user
54
+ - **Triggers for update**: Vision document changed since last review, user
55
+ requests re-review after edits
56
+ - **Conflict resolution**: if a previously resolved finding reappears, note
57
+ it as a regression
58
+
59
+ ## Instructions
60
+
61
+ Review docs/vision.md using a structured 5-pass approach. Each pass targets
62
+ a specific failure mode of product vision documents.
63
+
64
+ ### Pass 1: Vision Clarity
65
+
66
+ Evaluate the vision statement and elevator pitch for quality:
67
+ - Is the vision statement inspiring, concise, and memorable?
68
+ - Could someone repeat it from memory after hearing it once?
69
+ - Does it describe positive change in the world, not a product feature?
70
+ - Is it enduring — would it survive a pivot in approach?
71
+ - Apply Roman Pichler's checklist: Inspiring, Shared, Ethical, Concise, Ambitious, Enduring
72
+ - Is the elevator pitch (Geoffrey Moore template) filled in with specific, non-generic language?
73
+ - Does the vision statement pass the "decision test" — could you evaluate a product decision against it?
74
+
75
+ ### Pass 2: Audience Precision
76
+
77
+ Evaluate whether the target audience is defined well enough for product decisions:
78
+ - Are personas defined by behaviors and motivations, not demographics?
79
+ - Is the primary persona clearly identified and distinct from secondary personas?
80
+ - Could two people read the persona descriptions and agree on design decisions?
81
+ - Are "context of use" descriptions specific enough to inform UX decisions?
82
+ - Is there an implicit "Everything User" persona (contradictory needs)?
83
+
84
+ ### Pass 3: Competitive Rigor
85
+
86
+ Evaluate the competitive analysis for honesty and completeness:
87
+ - Are direct competitors identified with specific strengths and weaknesses?
88
+ - Are indirect alternatives considered (different approaches to the same problem)?
89
+ - Is the "do nothing" option considered as a competitor?
90
+ - Is differentiation genuine or wishful thinking?
91
+ - Are competitor strengths acknowledged honestly, not dismissed?
92
+ - Is the market gap validated with evidence, not just asserted?
93
+
94
+ ### Pass 4: Strategic Coherence
95
+
96
+ Evaluate whether the strategic elements hold together:
97
+ - Do guiding principles actually constrain decisions (or are they platitudes)?
98
+ - Would a reasonable team choose the opposite of each principle?
99
+ - Does the anti-vision name specific traps, not just vague disclaimers?
100
+ - Are success criteria measurable and time-bound?
101
+ - Does the business model intuition hold together with the target audience and value proposition?
102
+ - Are strategic risks honest about severity, with actual mitigation thinking?
103
+ - Do all sections tell a consistent story about the same product?
104
+
105
+ ### Pass 5: Downstream Readiness
106
+
107
+ Evaluate whether the PRD can be written from this vision:
108
+ - Can the PRD's problem statement be derived directly from the Problem Space section?
109
+ - Is the target audience clear enough to write user personas and stories?
110
+ - Are guiding principles concrete enough to inform tech stack and architecture decisions?
111
+ - Is there enough competitive context to differentiate features?
112
+ - Are there unresolved Open Questions that would block product definition?
113
+ - Could an AI agent write a PRD from this vision without asking strategic questions?
114
+
115
+ ### Review Process
116
+
117
+ 1. Execute each pass, documenting findings with severity (P0-P3):
118
+ - P0: Vision is fundamentally unclear or contradictory — blocks all downstream work
119
+ - P1: Significant gap that would cause PRD to make wrong assumptions
120
+ - P2: Minor gap or vagueness that could be improved
121
+ - P3: Nitpick or style suggestion
122
+ 2. Create a fix plan for all P0 and P1 findings
123
+ 3. Present the fix plan to the user for approval
124
+ 4. Apply approved fixes to docs/vision.md
125
+ 5. Re-validate that fixes resolved the issues
126
+ 6. Document all findings and resolutions in the review report
127
+
128
+ ### Output Format
129
+
130
+ Create docs/reviews/vision-review-vision.md with:
131
+
132
+ | Pass | Finding | Severity | Fix | Status |
133
+ |------|---------|----------|-----|--------|
134
+ | 1 | Vision statement references a feature ("AI-powered...") | P1 | Reframe around positive change | Fixed |
135
+ | ... | ... | ... | ... | ... |
136
+
137
+ ## After This Step
138
+
139
+ When this step is complete, tell the user:
140
+
141
+ ---
142
+ **Review complete** — `docs/reviews/vision-review-vision.md` created, fixes applied to `docs/vision.md`.
143
+
144
+ **Next:** Run `/scaffold:innovate-vision` (optional) — Explore strategic innovation opportunities.
145
+ Or skip to: `/scaffold:create-prd` — Start product requirements.
146
+
147
+ **Pipeline reference:** `/scaffold:prompt-pipeline`
148
+
149
+ ---
@@ -0,0 +1,326 @@
1
+ ---
2
+ name: multi-model-dispatch
3
+ description: Correct patterns for invoking Codex CLI and Gemini CLI as independent reviewers from Claude Code. Covers headless invocation, context bundling, output parsing, dual-model reconciliation, and fallback handling.
4
+ ---
5
+
6
+ # Multi-Model Dispatch
7
+
8
+ This skill teaches Claude Code how to correctly invoke Codex and Gemini CLIs for independent review of artifacts. Use this whenever a pipeline step needs multi-model validation at depth 4-5.
9
+
10
+ ## When This Skill Activates
11
+
12
+ - A review or validation step is running at depth 4+ and wants independent model validation
13
+ - User asks to "run multi-model review" or "get a second opinion from Codex/Gemini"
14
+ - The `automated-pr-review` step is using local CLI review mode
15
+ - The `implementation-plan-review` step dispatches to external CLIs at depth 4+
16
+
17
+ ## CLI Detection & Auth Verification
18
+
19
+ Before attempting any dispatch, detect what's available AND verify authentication. A CLI that's installed but not authenticated is useless in headless mode — it will hang on an interactive auth prompt or fail silently.
20
+
21
+ ### Step 1: Check CLI Installation
22
+
23
+ ```bash
24
+ command -v codex && echo "codex installed" || echo "codex not found"
25
+ command -v gemini && echo "gemini installed" || echo "gemini not found"
26
+ ```
27
+
28
+ ### Step 2: Verify Authentication
29
+
30
+ **CRITICAL: Do not skip this step.** Auth tokens expire mid-session. A CLI that worked 30 minutes ago may fail now.
31
+
32
+ **CRITICAL: Previous auth failures do NOT exempt subsequent dispatches.** Auth tokens refresh — a CLI that failed auth during user story review may work fine for domain modeling review. Always re-check auth before EACH review step, not once per session.
33
+
34
+ **Codex auth check** (has a built-in status command):
35
+ ```bash
36
+ codex login status 2>/dev/null && echo "codex authenticated" || echo "codex NOT authenticated"
37
+ ```
38
+
39
+ **Gemini auth check** (no built-in status command — use a minimal prompt):
40
+ ```bash
41
+ GEMINI_AUTH_CHECK=$(NO_BROWSER=true gemini -p "respond with ok" -o json 2>&1)
42
+ GEMINI_EXIT=$?
43
+ if [ "$GEMINI_EXIT" -eq 0 ]; then
44
+ echo "gemini authenticated"
45
+ elif [ "$GEMINI_EXIT" -eq 41 ]; then
46
+ echo "gemini NOT authenticated (exit 41: auth error)"
47
+ else
48
+ echo "gemini auth unknown (exit $GEMINI_EXIT)"
49
+ fi
50
+ ```
51
+
52
+ **Why `NO_BROWSER=true`?** Gemini CLI relaunches itself as a child process for memory management. During the relaunch, it shows a "Do you want to continue? [Y/n]" consent prompt that hangs when stdin is not a TTY (as in Claude Code's Bash tool). `NO_BROWSER=true` suppresses this prompt and uses cached credentials directly.
53
+
54
+ ### Step 3: Handle Auth Failures
55
+
56
+ **If a CLI fails auth, do NOT silently fall back.** Instead:
57
+
58
+ 1. **Tell the user** which CLI failed auth and why
59
+ 2. **Offer interactive recovery**: Ask the user to run the auth command in their terminal:
60
+ - **Codex**: `! codex login` (opens browser for OAuth) or set `CODEX_API_KEY` env var
61
+ - **Gemini**: `! gemini -p "hello"` (triggers OAuth flow) or set `GEMINI_API_KEY` env var
62
+ 3. **After recovery**: Re-run the auth check. If it passes, proceed with dispatch.
63
+ 4. **If user declines**: Fall back to the other CLI or Claude-only review, but **document the auth failure** in the review summary.
64
+
65
+ The `!` prefix runs the command in the user's terminal session, allowing interactive auth flows (browser OAuth, Y/n prompts) that can't work in headless mode.
66
+
67
+ **If neither CLI is available or authenticated**: Fall back to structured Claude-only self-review. Re-read the artifact with an adversarial lens — actively try to find issues the initial review missed. Document this as "single-model review (no external CLIs available)."
68
+
69
+ ## Correct Invocation Patterns
70
+
71
+ ### Codex CLI (`codex exec`)
72
+
73
+ **CRITICAL: Use `codex exec`, NOT `codex` directly.** The bare `codex` command launches an interactive TUI that requires a TTY and will fail with "stdin is not a terminal" when run from Claude Code.
74
+
75
+ **CRITICAL: Always include `--skip-git-repo-check`.** Without this flag, Codex fails with "Not inside a trusted directory" when the project hasn't initialized git yet (common early in the pipeline).
76
+
77
+ ```bash
78
+ # Basic review dispatch
79
+ codex exec --skip-git-repo-check -s read-only --ephemeral "REVIEW_PROMPT_HERE" 2>/dev/null
80
+
81
+ # With specific model and reasoning effort
82
+ codex exec --skip-git-repo-check -m o4-mini -s read-only -c model_reasoning_effort=high --ephemeral "REVIEW_PROMPT_HERE" 2>/dev/null
83
+
84
+ # Reading prompt from stdin (use - flag)
85
+ echo "$REVIEW_PROMPT" | codex exec --skip-git-repo-check -s read-only --ephemeral - 2>/dev/null
86
+
87
+ # With JSON schema enforcement
88
+ codex exec --skip-git-repo-check -s read-only --ephemeral --output-schema schema.json "REVIEW_PROMPT_HERE" 2>/dev/null
89
+ ```
90
+
91
+ **Key flags:**
92
+ | Flag | Purpose |
93
+ |------|---------|
94
+ | `exec` | **Required** — headless mode, no TUI, no TTY needed |
95
+ | `--skip-git-repo-check` | **Required** — allows running outside a git repo or untrusted directory |
96
+ | `-s read-only` | Sandbox: reviewer cannot write files (read-only analysis) |
97
+ | `--ephemeral` | Don't persist session (one-shot review) |
98
+ | `2>/dev/null` | Suppress thinking tokens on stderr (keeps Claude Code context clean) |
99
+ | `--output-schema` | Enforce structured JSON output against a schema file |
100
+ | `-c model_reasoning_effort=high` | Increase reasoning depth for complex reviews |
101
+
102
+ **Output**: Progress streams to stderr (suppressed by `2>/dev/null`). Final answer prints to stdout.
103
+
104
+ ### Gemini CLI (`gemini -p`)
105
+
106
+ **Use `-p` / `--prompt` for headless mode.** Without this flag, Gemini launches interactive mode.
107
+
108
+ **CRITICAL: Always prepend `NO_BROWSER=true`.** Without this, Gemini's child process relaunch shows a consent prompt ("Do you want to continue? [Y/n]") that hangs when stdin is not a TTY. This affects ALL non-interactive contexts including Claude Code's Bash tool.
109
+
110
+ ```bash
111
+ # Basic review dispatch
112
+ NO_BROWSER=true gemini -p "REVIEW_PROMPT_HERE" --output-format json --approval-mode yolo 2>/dev/null
113
+
114
+ # With specific model
115
+ NO_BROWSER=true gemini -p "REVIEW_PROMPT_HERE" -m pro --output-format json --approval-mode yolo 2>/dev/null
116
+
117
+ # Reading context from stdin
118
+ cat artifact.md | NO_BROWSER=true gemini -p "Review this artifact for issues" --output-format json --approval-mode yolo 2>/dev/null
119
+
120
+ # With sandbox (no file writes)
121
+ NO_BROWSER=true gemini -p "REVIEW_PROMPT_HERE" --output-format json -s --approval-mode yolo 2>/dev/null
122
+ ```
123
+
124
+ **Key flags:**
125
+ | Flag | Purpose |
126
+ |------|---------|
127
+ | `NO_BROWSER=true` | **Required** — suppresses consent prompt that hangs in non-TTY shells |
128
+ | `-p "prompt"` | **Required** — headless mode, no interactive UI |
129
+ | `--output-format json` | Structured JSON output for parsing |
130
+ | `--approval-mode yolo` | Auto-approve all tool calls (reviewer doesn't need to write) |
131
+ | `-s` | Sandbox mode (extra safety for read-only review) |
132
+ | `-m pro` | Use Gemini Pro model (default is auto) |
133
+ | `2>/dev/null` | Suppress progress output |
134
+
135
+ **Output**: JSON on stdout with `{ response, stats, error }` structure.
136
+
137
+ ## Context Bundling
138
+
139
+ When dispatching a review, bundle all relevant context into the prompt. Each CLI gets the same bundle — do NOT share one model's review with the other.
140
+
141
+ ### Template for Artifact Review
142
+
143
+ ```
144
+ You are reviewing a project artifact for quality issues. Focus on P0 (critical) and P1 (high) issues only.
145
+
146
+ ## Severity Definitions
147
+ - P0: Will cause implementation failure, data loss, security vulnerability, or fundamental architectural flaw
148
+ - P1: Will cause bugs in normal usage, inconsistency across documents, or blocks downstream work
149
+ - Do NOT report P2/P3 issues (suggestions, style, minor improvements)
150
+
151
+ ## Review Standards
152
+ [paste contents of docs/review-standards.md if it exists, otherwise use severity definitions above]
153
+
154
+ ## Artifact to Review
155
+ [paste full artifact content]
156
+
157
+ ## Upstream References
158
+ [paste relevant upstream docs: PRD, tech-stack, coding-standards, etc.]
159
+
160
+ ## Output Format
161
+ Respond with a JSON object:
162
+ {
163
+ "approved": true/false,
164
+ "findings": [
165
+ {
166
+ "severity": "P0" or "P1",
167
+ "location": "section or line reference",
168
+ "description": "what's wrong",
169
+ "suggestion": "specific fix"
170
+ }
171
+ ],
172
+ "summary": "one-line assessment"
173
+ }
174
+
175
+ If no P0/P1 issues found, respond with: { "approved": true, "findings": [], "summary": "No P0/P1 issues found." }
176
+ ```
177
+
178
+ ### Template for PR Diff Review
179
+
180
+ ```
181
+ You are reviewing a pull request diff. Focus on P0 and P1 issues only.
182
+
183
+ ## Review Standards
184
+ [paste docs/review-standards.md]
185
+
186
+ ## Project Coding Standards
187
+ [paste docs/coding-standards.md]
188
+
189
+ ## Test Standards
190
+ [paste docs/tdd-standards.md]
191
+
192
+ ## PR Diff
193
+ [paste output of gh pr diff <number> or git diff origin/main...HEAD]
194
+
195
+ ## Output Format
196
+ [same JSON format as above, but location = file:line]
197
+ ```
198
+
199
+ ### Context Size Guidelines
200
+
201
+ | Artifact Type | Max Context | Strategy |
202
+ |--------------|------------|----------|
203
+ | PRD | Full document | Include entirely |
204
+ | User stories | Full document | Include entirely |
205
+ | Architecture | Full document | Include entirely |
206
+ | Domain models | Directory listing + key files | Summarize index, include 2-3 representative files |
207
+ | PR diff | Full diff | If >2000 lines, split into file groups |
208
+ | Implementation plan | Task list + representative tasks | Include full task list, detail for flagged tasks |
209
+
210
+ ## Dual-Model Reconciliation
211
+
212
+ When both CLIs produce results, reconcile findings using these rules:
213
+
214
+ | Scenario | Confidence | Action |
215
+ |----------|-----------|--------|
216
+ | Both flag same issue | **High** | Fix immediately — two independent models agree |
217
+ | Both approve (no findings) | **High** | Proceed confidently |
218
+ | One flags P0, other approves | **High** | Fix it — P0 is critical enough from a single source |
219
+ | One flags P1, other approves | **Medium** | Review the finding carefully before fixing. If the finding is specific and actionable, fix it. If vague, skip. |
220
+ | Models contradict each other | **Low** | Present both findings to the user for adjudication |
221
+
222
+ **Independence rule**: Never share one model's review output with the other. Each model must review the artifact independently to avoid confirmation bias.
223
+
224
+ **Round tracking**: For iterative reviews (like PR review loops), track the round number. After 3 fix rounds, merge with a warning and create a follow-up issue for remaining findings.
225
+
226
+ ## Fallback Behavior
227
+
228
+ | Situation | Fallback |
229
+ |-----------|----------|
230
+ | Neither CLI available | Structured Claude-only adversarial self-review |
231
+ | Codex only | Single-model review with Codex |
232
+ | Gemini only | Single-model review with Gemini |
233
+ | **CLI auth expired** | **Surface to user with recovery command — do NOT silently fall back** |
234
+ | One CLI fails mid-review (non-auth) | Continue with the other; note the failure in summary |
235
+ | Both CLIs fail (non-auth) | Fall back to Claude-only self-review; warn user |
236
+ | CLI output not parseable as JSON | Treat as text, extract findings manually |
237
+
238
+ **Auth failures are NOT silent fallbacks.** The difference between "CLI not installed" (fall back quietly) and "CLI auth expired" (user action required) is critical. Auth can be fixed in 30 seconds with an interactive command — silently skipping wastes the user's review infrastructure.
239
+
240
+ ## Integration with Review Steps
241
+
242
+ All review steps can reference this skill at depth 4-5. The pattern is:
243
+
244
+ 1. **Depth 1-3**: Claude-only multi-pass review (step's existing logic)
245
+ 2. **Depth 4**: Claude review + single external CLI review (if available)
246
+ 3. **Depth 5**: Claude review + dual-model CLI review with reconciliation
247
+
248
+ Each review step adds a "Multi-Model Validation" section at the end that:
249
+ 1. Detects available CLIs
250
+ 2. Bundles the artifact + upstream references into a review prompt
251
+ 3. Dispatches to available CLIs using the patterns above
252
+ 4. Reconciles findings using the dual-model rules
253
+ 5. Applies fixes for high-confidence findings
254
+ 6. Presents medium/low-confidence findings to the user
255
+
256
+ ## Error Handling
257
+
258
+ ```bash
259
+ # Capture exit code AND stderr separately (don't suppress stderr for error detection)
260
+ CODEX_STDERR=$(mktemp)
261
+ OUTPUT=$(codex exec --skip-git-repo-check -s read-only --ephemeral "prompt" 2>"$CODEX_STDERR") || {
262
+ EXIT_CODE=$?
263
+ STDERR_CONTENT=$(cat "$CODEX_STDERR")
264
+ if echo "$STDERR_CONTENT" | grep -qi "refresh token\|please re-run.*login\|sign in again\|auth"; then
265
+ echo "Codex auth expired. Ask user to run: ! codex login"
266
+ # DO NOT silently fall back — surface to user
267
+ else
268
+ echo "Codex CLI failed with exit code $EXIT_CODE"
269
+ # Fall back to Gemini or Claude-only
270
+ fi
271
+ rm -f "$CODEX_STDERR"
272
+ }
273
+
274
+ GEMINI_STDERR=$(mktemp)
275
+ OUTPUT=$(NO_BROWSER=true gemini -p "prompt" --output-format json --approval-mode yolo 2>"$GEMINI_STDERR") || {
276
+ EXIT_CODE=$?
277
+ if [ "$EXIT_CODE" -eq 41 ]; then
278
+ echo "Gemini auth failed (exit 41). Ask user to run: ! gemini -p \"hello\""
279
+ # DO NOT silently fall back — surface to user
280
+ else
281
+ echo "Gemini CLI failed with exit code $EXIT_CODE"
282
+ # Fall back to Codex or Claude-only
283
+ fi
284
+ rm -f "$GEMINI_STDERR"
285
+ }
286
+ ```
287
+
288
+ ### Exit Codes
289
+
290
+ **Gemini exit codes:**
291
+
292
+ | Code | Meaning | Action |
293
+ |------|---------|--------|
294
+ | 0 | Success | Parse output |
295
+ | 1 | General error | Fall back to other CLI |
296
+ | **41** | **Auth failure** | **Surface to user — offer `! gemini -p "hello"` recovery** |
297
+ | 42 | Input error | Check prompt format |
298
+ | 52 | Config error | Check `~/.gemini/settings.json` |
299
+ | 53 | Turn limit exceeded | Retry with shorter prompt |
300
+
301
+ **Codex exit codes:**
302
+
303
+ | Code | Meaning | Action |
304
+ |------|---------|--------|
305
+ | 0 | Success | Parse output |
306
+ | 1 | General failure | Check stderr for auth messages |
307
+
308
+ Codex uses exit code 1 for all failures. **Check stderr** for auth-specific messages: "refresh token", "please re-run", "sign in again", "ChatGPT account ID not available".
309
+
310
+ ### Auth Recovery Flow
311
+
312
+ When an auth failure is detected during dispatch (not during pre-flight):
313
+
314
+ 1. Stop the review dispatch immediately
315
+ 2. Tell the user: "Gemini/Codex auth has expired. To re-authenticate, run:"
316
+ 3. Suggest: `! codex login` or `! gemini -p "hello"` (the `!` prefix runs it interactively)
317
+ 4. After the user re-authenticates, re-run the auth check
318
+ 5. If auth succeeds, resume the review dispatch from where it stopped
319
+ 6. If the user declines, fall back to the other CLI or Claude-only review
320
+
321
+ ## What This Skill Does NOT Do
322
+
323
+ - Does not install CLIs (user must install `codex` and `gemini` separately)
324
+ - Does not authenticate CLIs — but it **detects auth failures** and guides the user through interactive recovery via `!` prefix commands
325
+ - Does not replace Claude's own review passes — it adds independent validation on top
326
+ - Does not work as an MCP server — it uses Bash tool invocations directly