@williambeto/ai-workflow 1.19.1 → 2.1.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/CHANGELOG.md +56 -838
  2. package/PUBLISH_MANIFEST.json +34 -0
  3. package/README.md +70 -149
  4. package/{packages/ai-workflow/bin → bin}/ai-workflow.js +0 -0
  5. package/dist-assets/AGENTS.md +27 -0
  6. package/dist-assets/agents/astra.md +63 -0
  7. package/dist-assets/agents/atlas.md +169 -0
  8. package/dist-assets/agents/nexus.md +42 -0
  9. package/dist-assets/agents/orion.md +44 -0
  10. package/dist-assets/agents/phoenix.md +42 -0
  11. package/dist-assets/agents/sage.md +54 -0
  12. package/dist-assets/commands/README.md +14 -0
  13. package/dist-assets/commands/atlas.md +12 -0
  14. package/dist-assets/commands/audit.md +10 -0
  15. package/dist-assets/commands/deploy.md +12 -0
  16. package/dist-assets/commands/discover.md +10 -0
  17. package/dist-assets/commands/implement.md +28 -0
  18. package/dist-assets/commands/optimize-tokens.md +10 -0
  19. package/dist-assets/commands/plan.md +10 -0
  20. package/dist-assets/commands/release.md +12 -0
  21. package/dist-assets/commands/run.md +26 -0
  22. package/dist-assets/commands/spec-create.md +10 -0
  23. package/dist-assets/commands/spec-implement.md +10 -0
  24. package/dist-assets/commands/spec-review.md +10 -0
  25. package/dist-assets/commands/update-memory.md +10 -0
  26. package/dist-assets/commands/validate.md +12 -0
  27. package/dist-assets/docs/INDEX.md +21 -0
  28. package/dist-assets/docs/QUICKSTART.md +23 -0
  29. package/dist-assets/docs/adr/ADR-0000.md +19 -0
  30. package/dist-assets/docs/adr/ADR-0001.md +45 -0
  31. package/dist-assets/docs/adr/ADR-0002.md +62 -0
  32. package/dist-assets/docs/adr/ADR-0003.md +60 -0
  33. package/dist-assets/docs/adr/ADR-0004.md +71 -0
  34. package/dist-assets/docs/adr/ADR-0005.md +22 -0
  35. package/dist-assets/docs/adr/ADR-0006.md +82 -0
  36. package/dist-assets/docs/adr/ADR-0007.md +78 -0
  37. package/dist-assets/docs/api-engine-reference.md +7 -0
  38. package/{docs → dist-assets/docs}/architecture-policy.md +1 -1
  39. package/dist-assets/docs/cli-reference.md +27 -0
  40. package/dist-assets/docs/compatibility/provider-usage.md +38 -0
  41. package/dist-assets/docs/compatibility/runtime-matrix.md +30 -0
  42. package/dist-assets/docs/consumer-onboarding.md +17 -0
  43. package/dist-assets/docs/contributing-guide.md +11 -0
  44. package/{docs → dist-assets/docs}/design-patterns-policy.md +2 -2
  45. package/dist-assets/docs/full-documentation.md +113 -0
  46. package/{docs → dist-assets/docs}/npm-consumer-quickstart.md +18 -46
  47. package/dist-assets/docs/opencode-readme.md +8 -0
  48. package/dist-assets/docs/policies/01-BRANCH_GATE.md +63 -0
  49. package/dist-assets/docs/policies/02-SDD_METHODOLOGY.md +95 -0
  50. package/dist-assets/docs/policies/03-QUALITY_GATE.md +22 -0
  51. package/dist-assets/docs/policies/05-AGENT_CONTRACT.md +7 -0
  52. package/dist-assets/docs/policies/06-FINAL_EVIDENCE_CONTRACT.md +31 -0
  53. package/dist-assets/docs/policies/07-RELEASE_GATE.md +47 -0
  54. package/dist-assets/docs/policies/08-PRODUCT_TRUTHFULNESS_AND_PROJECT_DOCS.md +18 -0
  55. package/dist-assets/docs/policies/09-SPEC_VISIBILITY_AND_PUBLICATION.md +28 -0
  56. package/dist-assets/docs/policies/10-BEHAVIORAL_CONTRACT_HARDENING.md +9 -0
  57. package/dist-assets/docs/policies/11-EXECUTABLE_DELEGATION_AND_TRUTHFULNESS.md +7 -0
  58. package/dist-assets/docs/policies/ORCHESTRATION_PROTOCOL.md +15 -0
  59. package/dist-assets/docs/policies/PROCEDURE_DELIVERY_ARTIFACTS.md +21 -0
  60. package/dist-assets/docs/policies/PROCEDURE_DOCUMENTATION_CHECKLIST.md +24 -0
  61. package/dist-assets/docs/policies/PROCEDURE_UI_CHECKLIST.md +54 -0
  62. package/dist-assets/docs/profiles/README.md +19 -0
  63. package/dist-assets/docs/profiles/backend-api.md +5 -0
  64. package/dist-assets/docs/profiles/documentation.md +3 -0
  65. package/dist-assets/docs/profiles/frontend-product.md +19 -0
  66. package/dist-assets/docs/profiles/frontend-utility.md +19 -0
  67. package/dist-assets/docs/profiles/refactor.md +3 -0
  68. package/dist-assets/docs/profiles/security-review.md +3 -0
  69. package/dist-assets/docs/references/frontend-quality/landing-page-quality-checklist.md +11 -0
  70. package/dist-assets/docs/references/frontend-quality/product-copy-truthfulness.md +7 -0
  71. package/dist-assets/docs/references/frontend-quality/quality-failure-examples.md +20 -0
  72. package/dist-assets/docs/references/frontend-quality/visual-composition-patterns.md +10 -0
  73. package/dist-assets/docs/specs/runtime-operational-contract.md +39 -0
  74. package/dist-assets/docs/troubleshooting-guide.md +21 -0
  75. package/dist-assets/examples/README.md +10 -0
  76. package/dist-assets/examples/autopilot-cycle/00-CONTEXT.md +3 -0
  77. package/dist-assets/examples/autopilot-cycle/01-requirement.md +16 -0
  78. package/dist-assets/examples/autopilot-cycle/02-gate-a-check.md +23 -0
  79. package/dist-assets/examples/autopilot-cycle/03-orion-planning.md +20 -0
  80. package/dist-assets/examples/autopilot-cycle/04-astra-implementation.md +17 -0
  81. package/dist-assets/examples/autopilot-cycle/05-sage-validation.md +15 -0
  82. package/dist-assets/examples/autopilot-cycle/06-phoenix-healing.md +12 -0
  83. package/dist-assets/examples/autopilot-cycle/07-orchestration-report.md +18 -0
  84. package/dist-assets/examples/backend-api/00-CONTEXT.md +12 -0
  85. package/dist-assets/examples/backend-api/01-requirement.md +19 -0
  86. package/dist-assets/examples/backend-api/02-functional-spec.md +20 -0
  87. package/dist-assets/examples/backend-api/03-technical-plan.md +15 -0
  88. package/dist-assets/examples/backend-api/04-pr-breakdown.md +10 -0
  89. package/dist-assets/examples/backend-api/05-execution-handoff.md +13 -0
  90. package/dist-assets/examples/backend-api/06-validation-report.md +11 -0
  91. package/dist-assets/examples/backend-api/07-orchestration-report.md +7 -0
  92. package/dist-assets/examples/blocked-scenarios/00-CONTEXT.md +9 -0
  93. package/dist-assets/examples/blocked-scenarios/01-branch-gate-block.md +12 -0
  94. package/dist-assets/examples/blocked-scenarios/02-quality-gate-block.md +13 -0
  95. package/dist-assets/examples/blocked-scenarios/03-scope-creep-block.md +13 -0
  96. package/dist-assets/examples/blocked-scenarios/04-unblock-resolution.md +9 -0
  97. package/dist-assets/examples/blocked-scenarios/05-orchestration-decision-log.md +11 -0
  98. package/dist-assets/examples/bugfix-critical/00-CONTEXT.md +12 -0
  99. package/dist-assets/examples/bugfix-critical/01-bug-report.md +11 -0
  100. package/dist-assets/examples/bugfix-critical/02-diagnosis-hypothesis.md +11 -0
  101. package/dist-assets/examples/bugfix-critical/03-technical-plan.md +12 -0
  102. package/dist-assets/examples/bugfix-critical/04-implementation-handoff.md +8 -0
  103. package/dist-assets/examples/bugfix-critical/05-validation-report.md +10 -0
  104. package/dist-assets/examples/bugfix-critical/06-orchestration-report.md +7 -0
  105. package/dist-assets/examples/cli-package/00-CONTEXT.md +9 -0
  106. package/dist-assets/examples/cli-package/01-requirement.md +14 -0
  107. package/dist-assets/examples/cli-package/02-technical-spec.md +16 -0
  108. package/dist-assets/examples/cli-package/03-technical-plan.md +12 -0
  109. package/dist-assets/examples/cli-package/04-pr-breakdown.md +9 -0
  110. package/dist-assets/examples/cli-package/05-release-report.md +15 -0
  111. package/dist-assets/examples/docs-only-repo/01-requirement.md +31 -0
  112. package/dist-assets/examples/docs-only-repo/02-functional-spec.md +25 -0
  113. package/dist-assets/examples/docs-only-repo/03-technical-plan.md +21 -0
  114. package/dist-assets/examples/docs-only-repo/04-pr-breakdown.md +13 -0
  115. package/dist-assets/examples/docs-only-repo/05-execution-handoff.md +17 -0
  116. package/dist-assets/examples/docs-only-repo/06-validation-report.md +16 -0
  117. package/dist-assets/examples/docs-only-repo/README.md +26 -0
  118. package/dist-assets/examples/full-stack-checkout/00-CONTEXT.md +9 -0
  119. package/dist-assets/examples/full-stack-checkout/01-requirement.md +12 -0
  120. package/dist-assets/examples/full-stack-checkout/02-functional-spec.md +15 -0
  121. package/dist-assets/examples/full-stack-checkout/03-technical-plan.md +15 -0
  122. package/dist-assets/examples/full-stack-checkout/04-pr-breakdown.md +8 -0
  123. package/dist-assets/examples/full-stack-checkout/05-execution-handoff.md +14 -0
  124. package/dist-assets/examples/full-stack-checkout/06-validation-report.md +12 -0
  125. package/dist-assets/examples/healing-cycle/00-CONTEXT.md +15 -0
  126. package/dist-assets/examples/healing-cycle/01-broken-implementation.md +10 -0
  127. package/dist-assets/examples/healing-cycle/02-sage-fails.md +14 -0
  128. package/dist-assets/examples/healing-cycle/03-phoenix-diagnosis.md +17 -0
  129. package/dist-assets/examples/healing-cycle/04-phoenix-fix.md +18 -0
  130. package/dist-assets/examples/healing-cycle/05-sage-revalidation.md +12 -0
  131. package/dist-assets/examples/healing-cycle/06-orchestration-log.md +14 -0
  132. package/dist-assets/examples/infra-deploy/00-CONTEXT.md +9 -0
  133. package/dist-assets/examples/infra-deploy/01-operational-goal.md +12 -0
  134. package/dist-assets/examples/infra-deploy/02-architecture-specs.md +15 -0
  135. package/dist-assets/examples/infra-deploy/03-implementation-plan.md +14 -0
  136. package/dist-assets/examples/infra-deploy/04-step-breakdown.md +9 -0
  137. package/dist-assets/examples/infra-deploy/05-execution-handoff.md +13 -0
  138. package/dist-assets/examples/infra-deploy/06-operational-report.md +11 -0
  139. package/dist-assets/examples/multi-pr-release/00-CONTEXT.md +9 -0
  140. package/dist-assets/examples/multi-pr-release/01-requirement.md +13 -0
  141. package/dist-assets/examples/multi-pr-release/02-strategic-plan.md +13 -0
  142. package/dist-assets/examples/multi-pr-release/03-pr-breakdown.md +14 -0
  143. package/dist-assets/examples/multi-pr-release/04-release-plan.md +12 -0
  144. package/dist-assets/examples/multi-pr-release/05-orchestration-report.md +7 -0
  145. package/dist-assets/examples/nuxt-dashboard/01-requirement.md +81 -0
  146. package/dist-assets/examples/nuxt-dashboard/02-functional-spec.md +88 -0
  147. package/dist-assets/examples/nuxt-dashboard/03-technical-plan.md +76 -0
  148. package/dist-assets/examples/nuxt-dashboard/04-pr-breakdown.md +219 -0
  149. package/dist-assets/examples/nuxt-dashboard/05-execution-handoff.md +88 -0
  150. package/dist-assets/examples/nuxt-dashboard/06-validation-report.md +56 -0
  151. package/dist-assets/examples/nuxt-dashboard/07-orchestration-report.md +79 -0
  152. package/dist-assets/examples/nuxt-dashboard/README.md +52 -0
  153. package/dist-assets/examples/react-dashboard/01-requirement.md +84 -0
  154. package/dist-assets/examples/react-dashboard/02-functional-spec.md +88 -0
  155. package/dist-assets/examples/react-dashboard/03-technical-plan.md +76 -0
  156. package/dist-assets/examples/react-dashboard/04-pr-breakdown.md +218 -0
  157. package/dist-assets/examples/react-dashboard/05-execution-handoff.md +13 -0
  158. package/dist-assets/examples/react-dashboard/06-validation-report.md +12 -0
  159. package/dist-assets/examples/react-dashboard/07-orchestration-report.md +7 -0
  160. package/dist-assets/examples/react-dashboard/README.md +70 -0
  161. package/dist-assets/examples/refactoring-service/00-CONTEXT.md +9 -0
  162. package/dist-assets/examples/refactoring-service/01-debt-report.md +12 -0
  163. package/dist-assets/examples/refactoring-service/02-behavior-spec.md +11 -0
  164. package/dist-assets/examples/refactoring-service/03-technical-plan.md +13 -0
  165. package/dist-assets/examples/refactoring-service/04-pr-breakdown.md +9 -0
  166. package/dist-assets/examples/refactoring-service/05-execution-handoff.md +14 -0
  167. package/dist-assets/examples/refactoring-service/06-stability-report.md +12 -0
  168. package/dist-assets/examples/sdd-cycle/00-CONTEXT.md +12 -0
  169. package/dist-assets/examples/sdd-cycle/01-raw-request.md +13 -0
  170. package/dist-assets/examples/sdd-cycle/02-spec-creation.md +18 -0
  171. package/dist-assets/examples/sdd-cycle/03-spec-review.md +12 -0
  172. package/dist-assets/examples/sdd-cycle/04-technical-plan.md +16 -0
  173. package/dist-assets/examples/sdd-cycle/05-pr-breakdown.md +9 -0
  174. package/dist-assets/examples/sdd-cycle/06-spec-implement.md +13 -0
  175. package/dist-assets/examples/sdd-cycle/07-validation-against-spec.md +13 -0
  176. package/dist-assets/examples/wordpress-theme/01-requirement.md +29 -0
  177. package/dist-assets/examples/wordpress-theme/02-functional-spec.md +22 -0
  178. package/dist-assets/examples/wordpress-theme/03-technical-plan.md +22 -0
  179. package/dist-assets/examples/wordpress-theme/04-pr-breakdown.md +14 -0
  180. package/dist-assets/examples/wordpress-theme/05-execution-handoff.md +17 -0
  181. package/dist-assets/examples/wordpress-theme/06-validation-report.md +16 -0
  182. package/dist-assets/examples/wordpress-theme/README.md +32 -0
  183. package/{harness → dist-assets/harness}/handoffs/HANDOFF.template.md +2 -2
  184. package/{harness → dist-assets/harness}/workflows/agent-evaluation-checklist.md +5 -5
  185. package/{harness → dist-assets/harness}/workflows/implement-review-validate.md +24 -0
  186. package/{harness → dist-assets/harness}/workflows/multi-agent-handoff.md +4 -4
  187. package/{harness → dist-assets/harness}/workflows/planner-executor-workflow.md +5 -5
  188. package/{harness → dist-assets/harness}/workflows/requirement-to-pr.md +1 -1
  189. package/dist-assets/runbooks/agent-delegation-workflow.md +50 -0
  190. package/dist-assets/runbooks/apply-starter-to-real-project.md +45 -0
  191. package/dist-assets/runbooks/commands-cheatsheet.md +44 -0
  192. package/dist-assets/runbooks/how-to-use-skills.md +44 -0
  193. package/dist-assets/runbooks/private-spec-publication-safety.md +35 -0
  194. package/{runbooks → dist-assets/runbooks}/spec-driven-development.md +3 -6
  195. package/dist-assets/runbooks/tutorial-walkthroughs.md +23 -0
  196. package/dist-assets/runbooks/use-linear-for-operational-planning.md +45 -0
  197. package/dist-assets/runbooks/use-napkin-project-memory.md +33 -0
  198. package/dist-assets/skills/architecture/SKILL.md +166 -0
  199. package/dist-assets/skills/backend-development/SKILL.md +166 -0
  200. package/dist-assets/skills/deployment/SKILL.md +166 -0
  201. package/dist-assets/skills/design-principles/SKILL.md +166 -0
  202. package/dist-assets/skills/documentation/SKILL.md +171 -0
  203. package/dist-assets/skills/frontend-development/SKILL.md +225 -0
  204. package/dist-assets/skills/full-stack-development/SKILL.md +166 -0
  205. package/dist-assets/skills/optimize-tokens/SKILL.md +166 -0
  206. package/dist-assets/skills/pr-workflow/SKILL.md +166 -0
  207. package/dist-assets/skills/product-discovery/SKILL.md +166 -0
  208. package/dist-assets/skills/product-planning/SKILL.md +166 -0
  209. package/dist-assets/skills/project-memory/SKILL.md +166 -0
  210. package/dist-assets/skills/prompt-engineer/SKILL.md +166 -0
  211. package/dist-assets/skills/qa-workflow/SKILL.md +186 -0
  212. package/dist-assets/skills/refactoring/SKILL.md +166 -0
  213. package/dist-assets/skills/release-workflow/SKILL.md +166 -0
  214. package/dist-assets/skills/spec-driven-development/SKILL.md +166 -0
  215. package/dist-assets/skills/technical-leadership/SKILL.md +166 -0
  216. package/dist-assets/skills/ui-ux-design/SKILL.md +202 -0
  217. package/dist-assets/templates/.geminiignore.template +8 -0
  218. package/dist-assets/templates/CLAUDE.md.template +20 -0
  219. package/dist-assets/templates/CODEX.md.template +20 -0
  220. package/dist-assets/templates/GEMINI.md.template +20 -0
  221. package/dist-assets/templates/HANDOFF.template.md +45 -0
  222. package/dist-assets/templates/SPEC.template.md +38 -0
  223. package/dist-assets/templates/change-proposal.template.md +14 -0
  224. package/dist-assets/templates/owner-evidence/astra-implementation.json +10 -0
  225. package/dist-assets/templates/owner-evidence/phoenix-remediation.json +8 -0
  226. package/dist-assets/templates/owner-evidence/sage-revalidation.json +8 -0
  227. package/dist-assets/templates/owner-evidence/sage-validation.json +8 -0
  228. package/dist-assets/templates/specs/deep.md +48 -0
  229. package/dist-assets/templates/specs/standard.md +38 -0
  230. package/dist-assets/templates/specs/tiny.md +19 -0
  231. package/package.json +42 -47
  232. package/src/adapters/index.js +3 -0
  233. package/src/adapters/platforms/claude.js +126 -0
  234. package/src/adapters/platforms/codex.js +100 -0
  235. package/src/adapters/platforms/gemini.js +232 -0
  236. package/src/cli.js +96 -0
  237. package/src/commands/collect-evidence.js +61 -0
  238. package/src/commands/doctor.js +186 -0
  239. package/{packages/ai-workflow/src → src}/commands/init.js +119 -20
  240. package/src/commands/run.js +111 -0
  241. package/src/core/completion-contract.js +35 -0
  242. package/src/core/gates/branch-gate.js +113 -0
  243. package/src/core/handoff/handoff-engine.js +78 -0
  244. package/src/core/healing/cli-remediation-executor.js +151 -0
  245. package/src/core/healing/healer-engine.js +179 -0
  246. package/src/core/identity.js +43 -0
  247. package/{packages/ai-workflow/src → src}/core/install-plan.js +3 -3
  248. package/src/core/opencode-merge.js +149 -0
  249. package/{packages/ai-workflow/src → src}/core/package-assets.js +29 -10
  250. package/src/core/sdd/validator.js +67 -0
  251. package/src/core/statuses.js +29 -0
  252. package/src/core/symlink-layout.js +93 -0
  253. package/src/core/templates.js +218 -0
  254. package/src/core/validation/canonical-finalization.js +43 -0
  255. package/src/core/validation/evidence-collector.js +109 -0
  256. package/src/core/validation/quality-guard.js +243 -0
  257. package/src/core/workflow-profiles.js +107 -0
  258. package/.agents/napkin.md +0 -89
  259. package/.agents/skills/backend-implementer/SKILL.md +0 -490
  260. package/.agents/skills/build-and-validate/SKILL.md +0 -442
  261. package/.agents/skills/deploy-engineer/SKILL.md +0 -541
  262. package/.agents/skills/docs-writer/SKILL.md +0 -430
  263. package/.agents/skills/frontend-implementer/SKILL.md +0 -488
  264. package/.agents/skills/interface-design/SKILL.md +0 -428
  265. package/.agents/skills/interface-design/references/critique.md +0 -67
  266. package/.agents/skills/interface-design/references/example.md +0 -86
  267. package/.agents/skills/interface-design/references/principles.md +0 -235
  268. package/.agents/skills/interface-design/references/validation.md +0 -48
  269. package/.agents/skills/minimal-context/SKILL.md +0 -177
  270. package/.agents/skills/napkin/SKILL.md +0 -84
  271. package/.agents/skills/opencode-agent-design/SKILL.md +0 -77
  272. package/.agents/skills/playwright-cli/SKILL.md +0 -62
  273. package/.agents/skills/pr-orchestrator/SKILL.md +0 -366
  274. package/.agents/skills/product-manager/SKILL.md +0 -519
  275. package/.agents/skills/seo-audit/SKILL.md +0 -176
  276. package/.agents/skills/stack-variant-creator/SKILL.md +0 -265
  277. package/.agents/skills/tech-lead/SKILL.md +0 -453
  278. package/.agents/skills/tester/SKILL.md +0 -399
  279. package/.agents/skills/token-economy/SKILL.md +0 -137
  280. package/.agents/skills/vue-nuxt/SKILL.md +0 -102
  281. package/.agents/skills/wordpress-engineer/SKILL.md +0 -75
  282. package/.codex/prompts/README.md +0 -44
  283. package/.codex/prompts/autopilot.md +0 -50
  284. package/.codex/prompts/deploy.md +0 -33
  285. package/.codex/prompts/execute-selected-pr.md +0 -35
  286. package/.codex/prompts/fix-issue.md +0 -34
  287. package/.codex/prompts/minimal-context-mode.md +0 -55
  288. package/.codex/prompts/orchestrate-next.md +0 -33
  289. package/.codex/prompts/plan-from-requirement.md +0 -37
  290. package/.codex/prompts/review-implementation.md +0 -33
  291. package/.codex/prompts/roadmap-audit.md +0 -22
  292. package/.codex/prompts/specs/create-spec-from-requirement.md +0 -26
  293. package/.codex/prompts/specs/review-spec.md +0 -29
  294. package/.codex/prompts/specs/spec-to-pr-breakdown.md +0 -23
  295. package/.codex/prompts/specs/spec-to-technical-plan.md +0 -28
  296. package/.codex/prompts/start-project.md +0 -29
  297. package/.codex/prompts/token-economy-mode.md +0 -48
  298. package/.codex/prompts/validate-work.md +0 -28
  299. package/checklists/change-spec-readiness-checklist.md +0 -34
  300. package/docs/full-documentation.md +0 -661
  301. package/docs/setup-codex-opencode.md +0 -313
  302. package/harness/README.md +0 -106
  303. package/opencode/README.md +0 -84
  304. package/opencode/agents/README.md +0 -113
  305. package/opencode/agents/atlas.md +0 -127
  306. package/opencode/agents/discovery.md +0 -61
  307. package/opencode/agents/fixer.md +0 -51
  308. package/opencode/agents/implementer.md +0 -61
  309. package/opencode/agents/orchestrator.md +0 -145
  310. package/opencode/agents/planner.md +0 -60
  311. package/opencode/agents/prompt-engineer.md +0 -50
  312. package/opencode/agents/release-manager.md +0 -50
  313. package/opencode/agents/reviewer.md +0 -51
  314. package/opencode/agents/spec-engineer.md +0 -85
  315. package/opencode/agents/validator.md +0 -50
  316. package/opencode/agents/wordpress-engineer.md +0 -49
  317. package/opencode/commands/README.md +0 -48
  318. package/opencode/commands/autopilot.md +0 -50
  319. package/opencode/commands/deploy.md +0 -35
  320. package/opencode/commands/execute.md +0 -47
  321. package/opencode/commands/orchestrate.md +0 -37
  322. package/opencode/commands/plan.md +0 -39
  323. package/opencode/commands/review.md +0 -33
  324. package/opencode/commands/roadmap-audit.md +0 -30
  325. package/opencode/commands/ship.md +0 -48
  326. package/opencode/commands/specs/create-spec-from-request.md +0 -27
  327. package/opencode/commands/specs/create-spec-from-requirement.md +0 -25
  328. package/opencode/commands/specs/review-spec.md +0 -26
  329. package/opencode/commands/specs/spec-to-pr-breakdown.md +0 -19
  330. package/opencode/commands/specs/spec-to-tasks.md +0 -26
  331. package/opencode/commands/specs/spec-to-technical-plan.md +0 -27
  332. package/opencode/commands/start.md +0 -45
  333. package/opencode/commands/token-economy.md +0 -29
  334. package/opencode/commands/validate.md +0 -33
  335. package/opencode.jsonc +0 -235
  336. package/packages/ai-workflow/README.md +0 -82
  337. package/packages/ai-workflow/src/cli.js +0 -70
  338. package/packages/ai-workflow/src/commands/codex.js +0 -37
  339. package/packages/ai-workflow/src/commands/doctor.js +0 -168
  340. package/packages/ai-workflow/src/commands/guide.js +0 -194
  341. package/packages/ai-workflow/src/core/opencode-merge.js +0 -172
  342. package/packages/ai-workflow/src/core/symlink-layout.js +0 -54
  343. package/packages/ai-workflow/src/core/templates.js +0 -276
  344. package/runbooks/agent-delegation-workflow.md +0 -111
  345. package/runbooks/apply-starter-to-real-project.md +0 -445
  346. package/runbooks/commands-cheatsheet.md +0 -71
  347. package/runbooks/how-to-use-skills.md +0 -713
  348. package/runbooks/quick-start-guide.md +0 -213
  349. package/runbooks/tutorial-walkthroughs.md +0 -416
  350. package/runbooks/use-linear-for-operational-planning.md +0 -185
  351. package/runbooks/use-napkin-project-memory.md +0 -77
  352. package/templates/AGENTS.template.md +0 -397
  353. package/templates/DESIGN.template.md +0 -484
  354. package/templates/PR-PLAN.template.md +0 -172
  355. package/templates/README.template.md +0 -293
  356. package/templates/REQUIREMENT.template.md +0 -165
  357. package/templates/SPEC.template.md +0 -397
  358. package/templates/TECH-PLAN.template.md +0 -244
  359. package/templates/change-proposal.template.md +0 -97
  360. /package/{checklists/spec-readiness-checklist.md → dist-assets/docs/policies/SPEC_READINESS.md} +0 -0
  361. /package/{prompts → dist-assets/prompts}/00-bootstrap-project.md +0 -0
  362. /package/{prompts → dist-assets/prompts}/01-create-requirement.md +0 -0
  363. /package/{prompts → dist-assets/prompts}/02-create-spec.md +0 -0
  364. /package/{prompts → dist-assets/prompts}/03-create-tech-plan.md +0 -0
  365. /package/{prompts → dist-assets/prompts}/04-breakdown-prs.md +0 -0
  366. /package/{prompts → dist-assets/prompts}/05-implement-pr.md +0 -0
  367. /package/{prompts → dist-assets/prompts}/06-review-and-fix.md +0 -0
  368. /package/{prompts → dist-assets/prompts}/07-apply-design.md +0 -0
  369. /package/{prompts → dist-assets/prompts}/08-validate.md +0 -0
  370. /package/{prompts → dist-assets/prompts}/09-deploy.md +0 -0
  371. /package/{prompts → dist-assets/prompts}/commands/implement.md +0 -0
  372. /package/{prompts → dist-assets/prompts}/commands/requirement.md +0 -0
  373. /package/{prompts → dist-assets/prompts}/commands/spec.md +0 -0
  374. /package/{prompts → dist-assets/prompts}/commands/tech-plan.md +0 -0
  375. /package/{prompts → dist-assets/prompts}/commands/validate.md +0 -0
  376. /package/{runbooks → dist-assets/runbooks}/branch-cleanup.md +0 -0
  377. /package/{runbooks → dist-assets/runbooks}/deploy-checklist.md +0 -0
  378. /package/{runbooks → dist-assets/runbooks}/publication-readiness-checklist.md +0 -0
  379. /package/{runbooks → dist-assets/runbooks}/publish-package-checklist.md +0 -0
  380. /package/{runbooks → dist-assets/runbooks}/team-governance-pr-readiness.md +0 -0
  381. /package/{runbooks → dist-assets/runbooks}/validate-starter-in-real-project.md +0 -0
  382. /package/{runbooks → dist-assets/runbooks}/validation-checklist.md +0 -0
  383. /package/{schemas → dist-assets/schemas}/README.md +0 -0
  384. /package/{schemas → dist-assets/schemas}/functional-spec.schema.json +0 -0
  385. /package/{schemas → dist-assets/schemas}/handoff.schema.json +0 -0
  386. /package/{schemas → dist-assets/schemas}/pr-breakdown.schema.json +0 -0
  387. /package/{schemas → dist-assets/schemas}/requirement.schema.json +0 -0
  388. /package/{schemas → dist-assets/schemas}/technical-plan.schema.json +0 -0
  389. /package/{schemas → dist-assets/schemas}/validation-report.schema.json +0 -0
  390. /package/{packages/ai-workflow/src → src}/core/backup.js +0 -0
  391. /package/{packages/ai-workflow/src → src}/core/filesystem.js +0 -0
@@ -0,0 +1,76 @@
1
+ # Technical Plan: Products Dashboard Area
2
+
3
+ ## Architecture Summary
4
+
5
+ Add a small products domain that isolates DummyJSON access from dashboard pages using Next.js App Router conventions. Dashboard pages should consume typed product contracts and repository functions or server actions instead of calling fetch directly in every component.
6
+
7
+ The UI should reuse the existing dashboard shell, middleware, UI primitives (e.g., shadcn/ui), and Tailwind CSS conventions. The plan assumes a Next.js app may use `app/dashboard/products/page.tsx`, `app/dashboard/products/[id]/page.tsx`, `lib/products/`, shared API utilities, middleware for auth, and a componentized dashboard shell.
8
+
9
+ ## Proposed Folders And Files
10
+
11
+ | Path | Purpose |
12
+ | ---- | ------- |
13
+ | `lib/products/types.ts` | Product and product list contracts |
14
+ | `lib/products/repository.ts` | DummyJSON product fetch functions or server actions |
15
+ | `lib/products/mappers.ts` | Optional response normalization if needed |
16
+ | `app/dashboard/products/page.tsx` | Products list route (RSC or client component as needed) |
17
+ | `app/dashboard/products/[id]/page.tsx` | Product detail route |
18
+ | `components/dashboard/products/` | Product-specific UI components if page files become too large |
19
+ | `lib/api/` | Existing shared API utilities if already present |
20
+
21
+ Do not assume all paths exist. Inspect the target repository before editing and follow the local folder pattern.
22
+
23
+ ## Implementation Steps
24
+
25
+ 1. Inspect the existing dashboard routes, auth middleware, component structure, and data-fetching helpers.
26
+ 2. Add products domain types and repository functions or server actions for list, search, pagination, and detail fetches.
27
+ 3. Implement the products list page using existing dashboard layout conventions.
28
+ 4. Wire search and pagination state with clear loading, empty, and error states.
29
+ 5. Add the product detail page using the products detail fetch.
30
+ 6. Add create, edit, and delete placeholders without real mutation calls.
31
+ 7. Add or update focused tests where the project already has test infrastructure (e.g., Vitest, React Testing Library, Playwright).
32
+ 8. Run typecheck, lint, tests, and build before reporting completion.
33
+
34
+ ## Dependencies
35
+
36
+ - Existing Next.js 14+ and React 18+ app.
37
+ - Existing TypeScript configuration.
38
+ - Existing shadcn/ui and Tailwind setup.
39
+ - Existing middleware for protected dashboard pages.
40
+ - DummyJSON product endpoints.
41
+ - Existing test and validation commands, when available.
42
+
43
+ No new runtime dependency is required for this plan.
44
+
45
+ ## Risks
46
+
47
+ - DummyJSON response fields may need mapping before UI use.
48
+ - Product list search and pagination can produce stale results if query state is not handled carefully.
49
+ - Page files can become too large if list, empty, error, and placeholder action UI are all inline.
50
+ - Placeholder actions can be mistaken for real persistence if labels are unclear.
51
+ - Tests may not exist yet in the target project.
52
+
53
+ ## Trade-Offs
54
+
55
+ - A small repository layer adds one extra file but keeps DummyJSON details out of pages.
56
+ - Keeping placeholders non-persistent limits scope but still shows intended CRUD workflow.
57
+ - URL query synchronization improves shareability but may be deferred if it increases PR size.
58
+ - Component extraction should happen only when page complexity justifies it.
59
+ - Server Components vs Client Components: default to Server Components for data fetching; use "use client" only when interactivity is needed.
60
+
61
+ ## Validation Plan
62
+
63
+ - Run `npm run typecheck` or `tsc --noEmit`.
64
+ - Run `npm run lint`.
65
+ - Run `npm test` or `vitest` if the target project defines it.
66
+ - Run `npm run build`.
67
+ - Manually verify protected route behavior.
68
+ - Manually verify list loading, search, pagination, empty state, error state, and detail navigation.
69
+ - Confirm CRUD placeholders do not send mutation requests.
70
+
71
+ ## Rollback Plan
72
+
73
+ - Revert the selected PR if validation fails and the fix is not small.
74
+ - Remove added product routes from dashboard navigation if navigation was modified.
75
+ - Remove the products domain files added by the failing PR.
76
+ - Keep unrelated dashboard routes and auth middleware unchanged.
@@ -0,0 +1,218 @@
1
+ # PR Breakdown: Products Dashboard Area
2
+
3
+ ## Strategy
4
+
5
+ Build the products area through small PRs that separate data contracts, list behavior, detail behavior, placeholder actions, and validation hardening. Each PR should preserve existing dashboard behavior and avoid implementing future PR scope.
6
+
7
+ ## PR 1 — Products Domain Contracts And Repository
8
+
9
+ Goal:
10
+
11
+ Create the typed products domain boundary for DummyJSON access.
12
+
13
+ Scope:
14
+
15
+ - Define product and product list types.
16
+ - Add repository functions or server actions for list/search/pagination and detail fetches.
17
+ - Add response mapping only if DummyJSON fields need normalization.
18
+
19
+ Likely files:
20
+
21
+ - `lib/products/types.ts`
22
+ - `lib/products/repository.ts`
23
+ - `lib/products/mappers.ts`
24
+ - Existing shared API utility files if already present
25
+
26
+ Validation:
27
+
28
+ - Run `npm run typecheck` or `tsc --noEmit`.
29
+ - Run `npm run lint`.
30
+ - Add or run focused repository tests if the project has test infrastructure.
31
+
32
+ Risks:
33
+
34
+ - Response contracts may not match DummyJSON exactly.
35
+ - Repository helpers may duplicate existing API utilities.
36
+
37
+ Dependencies:
38
+
39
+ - Existing API utility conventions.
40
+
41
+ Estimated size:
42
+
43
+ ```txt
44
+ small
45
+ ```
46
+
47
+ ## PR 2 — Products List Page With Search And Pagination
48
+
49
+ Goal:
50
+
51
+ Add the protected products list page with search, pagination, and core list states.
52
+
53
+ Scope:
54
+
55
+ - Add the products list dashboard route.
56
+ - Render product cards or rows using existing dashboard components.
57
+ - Wire search and pagination to the products repository.
58
+ - Show loading, empty, and error states.
59
+
60
+ Likely files:
61
+
62
+ - `app/dashboard/products/page.tsx`
63
+ - `components/dashboard/products/ProductList.tsx`
64
+ - `components/dashboard/products/ProductSearch.tsx`
65
+ - `lib/products/repository.ts`
66
+
67
+ Validation:
68
+
69
+ - Run `npm run typecheck` or `tsc --noEmit`.
70
+ - Run `npm run lint`.
71
+ - Run `npm test` if available.
72
+ - Run `npm run build`.
73
+ - Manually verify protected route access, search, pagination, loading, empty, and error states.
74
+
75
+ Risks:
76
+
77
+ - Query state may become inconsistent when search changes.
78
+ - Long product names or missing thumbnails may affect layout.
79
+
80
+ Dependencies:
81
+
82
+ - PR 1.
83
+
84
+ Estimated size:
85
+
86
+ ```txt
87
+ medium
88
+ ```
89
+
90
+ ## PR 3 — Product Detail Page
91
+
92
+ Goal:
93
+
94
+ Add a protected product detail route for individual product inspection.
95
+
96
+ Scope:
97
+
98
+ - Add the product detail page.
99
+ - Fetch product by ID through the products repository.
100
+ - Render key product attributes and navigation back to the list.
101
+ - Handle loading, not found, and error states.
102
+
103
+ Likely files:
104
+
105
+ - `app/dashboard/products/[id]/page.tsx`
106
+ - `components/dashboard/products/ProductDetail.tsx`
107
+ - `lib/products/repository.ts`
108
+
109
+ Validation:
110
+
111
+ - Run `npm run typecheck` or `tsc --noEmit`.
112
+ - Run `npm run lint`.
113
+ - Run `npm test` if available.
114
+ - Run `npm run build`.
115
+ - Manually verify valid, invalid, and failing product detail states.
116
+
117
+ Risks:
118
+
119
+ - Dynamic route pattern may differ from the target project.
120
+ - Invalid IDs may show a generic error instead of a useful not found state.
121
+
122
+ Dependencies:
123
+
124
+ - PR 1.
125
+ - PR 2 for list-to-detail navigation.
126
+
127
+ Estimated size:
128
+
129
+ ```txt
130
+ small
131
+ ```
132
+
133
+ ## PR 4 — Create, Edit, Delete Placeholders And UX States
134
+
135
+ Goal:
136
+
137
+ Expose CRUD-style entry points without implementing persistence.
138
+
139
+ Scope:
140
+
141
+ - Add create entry point from the list page.
142
+ - Add edit and delete entry points from detail or list actions.
143
+ - Make placeholder behavior explicit and non-persistent.
144
+ - Refine empty and error state copy if needed.
145
+
146
+ Likely files:
147
+
148
+ - `app/dashboard/products/page.tsx`
149
+ - Product detail route file selected in PR 3
150
+ - `components/dashboard/products/`
151
+
152
+ Validation:
153
+
154
+ - Run `npm run typecheck` or `tsc --noEmit`.
155
+ - Run `npm run lint`.
156
+ - Run `npm test` if available.
157
+ - Confirm no mutation requests are sent.
158
+ - Manually verify placeholder copy is clear.
159
+
160
+ Risks:
161
+
162
+ - Users may mistake placeholder actions for real persistence.
163
+ - Delete controls may look destructive even though no mutation exists.
164
+
165
+ Dependencies:
166
+
167
+ - PR 2.
168
+ - PR 3.
169
+
170
+ Estimated size:
171
+
172
+ ```txt
173
+ small
174
+ ```
175
+
176
+ ## PR 5 — Tests And Validation Hardening
177
+
178
+ Goal:
179
+
180
+ Strengthen confidence that the products workflow is stable and ready for future backend integration.
181
+
182
+ Scope:
183
+
184
+ - Add missing tests for repository behavior, list states, and detail states where the project supports tests.
185
+ - Confirm build, lint, typecheck, and existing tests pass.
186
+ - Document validation evidence and remaining risks.
187
+
188
+ Likely files:
189
+
190
+ - Existing test folders used by the target project
191
+ - `lib/products/`
192
+ - `components/dashboard/products/`
193
+ - PR validation notes or pull request description
194
+
195
+ Validation:
196
+
197
+ - Run `npm run typecheck` or `tsc --noEmit`.
198
+ - Run `npm run lint`.
199
+ - Run `npm test` or `vitest`.
200
+ - Run `npm run build`.
201
+
202
+ Risks:
203
+
204
+ - The target project may not have test infrastructure yet.
205
+ - Tests may need to mock DummyJSON to stay deterministic.
206
+
207
+ Dependencies:
208
+
209
+ - PR 1.
210
+ - PR 2.
211
+ - PR 3.
212
+ - PR 4.
213
+
214
+ Estimated size:
215
+
216
+ ```txt
217
+ medium
218
+ ```
@@ -0,0 +1,13 @@
1
+ # 05 - Execution Handoff
2
+
3
+ **Agent**: Astra (Developer)
4
+ **Task**: Initial setup of React Dashboard.
5
+
6
+ ## Actions
7
+ - Initialized Vite + React + Tailwind project.
8
+ - Configured React Router.
9
+ - Implemented `AuthLayout` and `Login` page mock.
10
+
11
+ ## Verification
12
+ - `npm run dev` starts correctly.
13
+ - Lint: [PASS].
@@ -0,0 +1,12 @@
1
+ # 06 - Validation Report (Sage)
2
+
3
+ **Target**: React Dashboard Boilerplate.
4
+
5
+ ## Audit findings
6
+ - **Component Structure**: [PASS] - Follows Atomic Design principles.
7
+ - **Tailwind Config**: [PASS] - Consistent with design specs.
8
+ - **Accessibility**: [PASS] - Aria labels present on interactive elements.
9
+
10
+ ---
11
+ ## Gate C Verdict
12
+ **[APPROVED]**
@@ -0,0 +1,7 @@
1
+ # 07 - Orchestration Report
2
+
3
+ **Task**: React Dashboard Foundation.
4
+ **Status**: [COMPLETE]
5
+
6
+ ---
7
+ *Maintained by Atlas*
@@ -0,0 +1,70 @@
1
+ # React Dashboard Example
2
+
3
+ ## Context
4
+
5
+ Project:
6
+
7
+ ```txt
8
+ React Dashboard Boilerplate
9
+ ```
10
+
11
+ Stack:
12
+
13
+ ```txt
14
+ Next.js 14+
15
+ React 18+
16
+ TypeScript
17
+ shadcn/ui
18
+ Tailwind CSS
19
+ DummyJSON
20
+ ```
21
+
22
+ Objective:
23
+
24
+ Evolve a controlled dashboard boilerplate through small PRs, using the OpenCode-first workflow to plan, implement, review, and validate one scoped change at a time.
25
+
26
+ ## Workflow
27
+
28
+ Read the files in order:
29
+
30
+ ```txt
31
+ 01-requirement.md
32
+ 02-functional-spec.md
33
+ 03-technical-plan.md
34
+ 04-pr-breakdown.md
35
+ ```
36
+
37
+ The example follows this path:
38
+
39
+ ```txt
40
+ requirement
41
+ → functional spec
42
+ → technical plan
43
+ → PR breakdown
44
+ ```
45
+
46
+ This is not a Next.js starter project. It is a workflow example for planning and validating dashboard work in a real React/Next.js repository.
47
+
48
+ ## Stack Conventions Used
49
+
50
+ | Convention | Example |
51
+ |---|---|
52
+ | App Router | `app/dashboard/products/page.tsx` |
53
+ | Dynamic routes | `app/dashboard/products/[id]/page.tsx` |
54
+ | Domain layer | `lib/products/types.ts`, `lib/products/repository.ts` |
55
+ | Components | `components/dashboard/products/ProductList.tsx` |
56
+ | Server Components | Default for data fetching |
57
+ | Client Components | `"use client"` only when interactivity needed |
58
+ | Validation | `tsc --noEmit`, `npm run lint`, `npm run build` |
59
+
60
+ ## Reference Variants
61
+
62
+ This example mirrors the pattern established by:
63
+
64
+ ```txt
65
+ examples/nuxt-dashboard/ — Nuxt/Vue stack variant
66
+ examples/wordpress-theme/ — WordPress/PHP stack variant
67
+ examples/docs-only-repo/ — Non-code stack variant
68
+ ```
69
+
70
+ Use `stack-variant-creator` skill when creating new variants.
@@ -0,0 +1,9 @@
1
+ # Refactoring Service - Technical Debt Removal
2
+
3
+ ## 0. Context
4
+ This example demonstrates how to perform a large-scale refactoring task (extracting a service) while preserving existing behavioral contracts, using the `Refactoring-Specialist` agent.
5
+
6
+ ---
7
+
8
+ ## The Request
9
+ **User**: "The payment logic in my routes file is getting too complex. I want to extract it into a dedicated `PaymentService` to improve maintainability and testability."
@@ -0,0 +1,12 @@
1
+ # 01 - Technical Debt Report
2
+
3
+ ## 1. Description
4
+ The `payment.routes.ts` file contains over 500 lines of business logic, including tax calculation, third-party API calls, and database updates.
5
+
6
+ ## 2. Identified Risks
7
+ - **Testing Difficulty**: Hard to unit test logic without spinning up the entire route.
8
+ - **Duplication**: Similar logic is being copied to other routes.
9
+ - **Fragility**: High risk of breaking payments during minor UI changes.
10
+
11
+ ---
12
+ *Status: [REFACTORING_APPROVED]*
@@ -0,0 +1,11 @@
1
+ # 02 - Behavioral Contract Specification
2
+
3
+ **Agent**: Nexus (Spec Architect)
4
+
5
+ ## 1. Existing Behavior (MUST PRESERVE)
6
+ - `POST /pay`: Accepts amount and method. Returns transaction ID.
7
+ - Success Scenario: Returns 200 and triggers email confirmation.
8
+ - Error Scenario: Returns 400 for insufficient funds.
9
+
10
+ ## 2. Refactoring Goal
11
+ Move logic to `PaymentService.ts`. No changes allowed in external API signatures.
@@ -0,0 +1,13 @@
1
+ # 03 - Technical Plan: Safe Migration
2
+
3
+ **Agent**: Refactoring-Specialist
4
+
5
+ ## 1. Safety Strategy
6
+ 1. Create `PaymentService` class.
7
+ 2. Write unit tests for the NEW service based on EXISTING behavior.
8
+ 3. Replace route logic with service call.
9
+ 4. Run integration tests on the route.
10
+
11
+ ## 2. Refactoring Patterns
12
+ - **Extract Class**: Move methods to the new service.
13
+ - **Dependency Injection**: Inject service into the route handler.
@@ -0,0 +1,9 @@
1
+ # 04 - PR Breakdown
2
+
3
+ **Sequence**:
4
+ 1. **PR 1**: `PaymentService` skeleton + behavioral tests.
5
+ 2. **PR 2**: Logic migration (internal methods).
6
+ 3. **PR 3**: Route integration + final cleanup.
7
+
8
+ ---
9
+ *Ready for Astra*
@@ -0,0 +1,14 @@
1
+ # 05 - Execution Handoff
2
+
3
+ **Agent**: Refactoring-Specialist
4
+ **Task**: Extract Payment Service.
5
+
6
+ ## Actions
7
+ - Created `src/services/PaymentService.ts`.
8
+ - Migrated 450 lines of code.
9
+ - Reduced `payment.routes.ts` from 580 to 30 lines.
10
+
11
+ ## Verification
12
+ - Unit tests for `PaymentService`: [PASS].
13
+ - Integration tests for `/pay`: [PASS].
14
+ - Manual regression: [SUCCESS].
@@ -0,0 +1,12 @@
1
+ # 06 - Stability Report
2
+
3
+ **Task**: Technical Debt Removal (Payment Service).
4
+ **Outcome**: 100% Behavioral Parity maintained.
5
+
6
+ ## Metrics
7
+ - Code removed from routes: 95%.
8
+ - Test coverage of new service: 98%.
9
+ - Performance impact: Neutral.
10
+
11
+ ---
12
+ *Maintained by Atlas — The Quality Partner*
@@ -0,0 +1,12 @@
1
+ # SDD Full Cycle - Spec-Driven Development
2
+
3
+ ## 0. Context
4
+ This example demonstrates the complete Spec-Driven Development (SDD) process of the AI Workflow Kit, from an ambiguous user request to a validated implementation.
5
+
6
+ ## The Goal
7
+ Show how the agents (Nexus, Orion, Astra, Sage) work together using formal specifications to ensure 100% compliance.
8
+
9
+ ---
10
+
11
+ ## The Request
12
+ **User**: "I want JWT authentication for my API. It needs to be secure and use environment variables for the secret."
@@ -0,0 +1,13 @@
1
+ # 01 - Raw Requirement
2
+
3
+ **Source**: User Request.
4
+ **Priority**: High.
5
+
6
+ ## Description
7
+ Implement JWT-based authentication for the backend API.
8
+
9
+ ## High-Level Desires
10
+ - Use `jsonwebtoken` library.
11
+ - Secret must be in `.env`.
12
+ - Middleware to protect private routes.
13
+ - Login endpoint returns a token.
@@ -0,0 +1,18 @@
1
+ # 02 - Functional Specification (STANDARD)
2
+
3
+ **Agent**: Nexus (Spec Architect)
4
+ **Status**: [DRAFT]
5
+
6
+ ## 1. Goal
7
+ Implement a robust JWT authentication system to protect private resources.
8
+
9
+ ## 2. Requirements
10
+ - **R1**: Provide a `/auth/login` endpoint that accepts credentials and returns a signed JWT.
11
+ - **R2**: Implement a `verifyToken` middleware for route protection.
12
+ - **R3**: Tokens must expire in 1 hour.
13
+ - **R4**: The JWT secret MUST be loaded from `JWT_SECRET` environment variable.
14
+
15
+ ## 3. Acceptance Criteria
16
+ - [ ] `/auth/login` returns 200 with `{ token: string }` on success.
17
+ - [ ] Middleware returns 401 if header `Authorization: Bearer <token>` is missing or invalid.
18
+ - [ ] Secret is NOT hardcoded in source code.
@@ -0,0 +1,12 @@
1
+ # 03 - Spec Review Report
2
+
3
+ **Agent**: Nexus (Spec Architect)
4
+ **Audit Date**: 2026-05-29
5
+
6
+ ## Quality Check
7
+ - **Completeness**: [PASS] - Covers login, middleware, and config.
8
+ - **Ambiguity**: [PASS] - Clear error codes and header requirements.
9
+ - **Feasibility**: [PASS] - Uses standard libraries.
10
+
11
+ ## Verdict
12
+ **[APPROVED]** - Ready for technical planning.
@@ -0,0 +1,16 @@
1
+ # 04 - Technical Plan
2
+
3
+ **Agent**: Orion (Strategist)
4
+
5
+ ## 1. Architecture
6
+ - Use `jsonwebtoken` for signing and verification.
7
+ - Create `AuthService` to encapsulate logic.
8
+ - Create `AuthMiddleware` for Fastify/Express.
9
+
10
+ ## 2. Security Patterns
11
+ - **Secret Management**: Use `dotenv` to load `JWT_SECRET`.
12
+ - **Payload**: Minimal data (user ID only).
13
+
14
+ ## 3. Testing Strategy
15
+ - Unit tests for `AuthService` (valid/invalid tokens).
16
+ - Integration tests for middleware using mock tokens.
@@ -0,0 +1,9 @@
1
+ # 05 - PR Breakdown
2
+
3
+ **Sequence**:
4
+ 1. **PR 1**: AuthService implementation + Unit Tests.
5
+ 2. **PR 2**: AuthMiddleware + Integration Tests.
6
+ 3. **PR 3**: Login route wiring.
7
+
8
+ ---
9
+ *Ready for Astra*
@@ -0,0 +1,13 @@
1
+ # 06 - Implementation Handoff
2
+
3
+ **Agent**: Astra (Developer)
4
+ **Task**: Complete JWT Cycle.
5
+
6
+ ## Actions
7
+ - Implemented `AuthService` with `sign` and `verify`.
8
+ - Created middleware to validate Bearer tokens.
9
+ - Secured the `/private` routes.
10
+
11
+ ## Verification
12
+ - `npm run test:unit` [PASS].
13
+ - `npm run test:integration` [PASS].
@@ -0,0 +1,13 @@
1
+ # 07 - Validation Report (Sage)
2
+
3
+ **Target**: SDD Full Cycle.
4
+
5
+ ## Spec Adherence
6
+ - **R1 (Login)**: [PASS] - Correct format returned.
7
+ - **R2 (Middleware)**: [PASS] - Blocked unauthorized access.
8
+ - **R3 (Expiration)**: [PASS] - 1h TTL confirmed.
9
+ - **R4 (Secret)**: [PASS] - Loaded from env.
10
+
11
+ ---
12
+ ## Gate C Verdict
13
+ **[STABLE]** - High fidelity implementation.
@@ -0,0 +1,29 @@
1
+ # Requirement
2
+
3
+ ## Title
4
+ Add Accessible Product Grid Template for Theme
5
+
6
+ ## Problem
7
+ Theme lacks a reusable product grid template with clear empty/error states and accessibility baseline.
8
+
9
+ ## Target user
10
+ Store visitors and maintainers of the WordPress theme.
11
+
12
+ ## Goal
13
+ Deliver a reusable template part for product cards with consistent structure and safe fallback states.
14
+
15
+ ## Scope
16
+ ### Included
17
+ - New template part for product card rendering
18
+ - Empty-state output when no products exist
19
+ - Basic accessibility semantics
20
+
21
+ ### Not included
22
+ - Checkout customization
23
+ - Search indexing changes
24
+ - Plugin installation changes
25
+
26
+ ## Acceptance criteria
27
+ - Product card template renders title, price, and link.
28
+ - Empty-state appears when no products exist.
29
+ - Markup includes semantic headings and link labels.
@@ -0,0 +1,22 @@
1
+ # Functional Specification
2
+
3
+ ## Summary
4
+ Define behavior for reusable WooCommerce product-card template part.
5
+
6
+ ## Main flow
7
+ 1. Shop/archive page loops products.
8
+ 2. Each product is rendered via template part.
9
+ 3. Card displays image, title, price, and CTA link.
10
+
11
+ ## Alternative flow
12
+ - If no products are available, show configured empty-state message.
13
+
14
+ ## Validation rules
15
+ - Product title must be escaped.
16
+ - Product URL must be valid and escaped.
17
+ - Price output must use WooCommerce formatter.
18
+
19
+ ## Acceptance criteria
20
+ - Product cards render consistently across archive pages.
21
+ - Empty-state appears with no PHP warnings.
22
+ - Output remains PHP 7-compatible.