create-hq 5.0.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 (310) hide show
  1. package/dist/deps.d.ts +4 -0
  2. package/dist/deps.d.ts.map +1 -0
  3. package/dist/deps.js +65 -0
  4. package/dist/deps.js.map +1 -0
  5. package/dist/git.d.ts +3 -0
  6. package/dist/git.d.ts.map +1 -0
  7. package/dist/git.js +19 -0
  8. package/dist/git.js.map +1 -0
  9. package/dist/index.d.ts +3 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +23 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/scaffold.d.ts +8 -0
  14. package/dist/scaffold.d.ts.map +1 -0
  15. package/dist/scaffold.js +130 -0
  16. package/dist/scaffold.js.map +1 -0
  17. package/dist/ui.d.ts +7 -0
  18. package/dist/ui.d.ts.map +1 -0
  19. package/dist/ui.js +36 -0
  20. package/dist/ui.js.map +1 -0
  21. package/package.json +41 -0
  22. package/template/.claude/CLAUDE.md +202 -0
  23. package/template/.claude/commands/checkpoint.md +127 -0
  24. package/template/.claude/commands/cleanup.md +307 -0
  25. package/template/.claude/commands/execute-task.md +440 -0
  26. package/template/.claude/commands/exit-plan.md +41 -0
  27. package/template/.claude/commands/handoff.md +97 -0
  28. package/template/.claude/commands/learn.md +218 -0
  29. package/template/.claude/commands/metrics.md +118 -0
  30. package/template/.claude/commands/newworker.md +162 -0
  31. package/template/.claude/commands/nexttask.md +67 -0
  32. package/template/.claude/commands/prd.md +238 -0
  33. package/template/.claude/commands/reanchor.md +51 -0
  34. package/template/.claude/commands/remember.md +126 -0
  35. package/template/.claude/commands/run-project.md +348 -0
  36. package/template/.claude/commands/run.md +110 -0
  37. package/template/.claude/commands/search-reindex.md +62 -0
  38. package/template/.claude/commands/search.md +100 -0
  39. package/template/.claude/commands/setup.md +381 -0
  40. package/template/.claude/scripts/pure-ralph-loop.ps1 +312 -0
  41. package/template/.claude/scripts/pure-ralph-loop.sh +859 -0
  42. package/template/CHANGELOG.md +220 -0
  43. package/template/LICENSE +21 -0
  44. package/template/MIGRATION.md +259 -0
  45. package/template/README.md +368 -0
  46. package/template/data/journal/.gitkeep +0 -0
  47. package/template/docs/images/ascii-banner-options.md +122 -0
  48. package/template/docs/images/hq-banner.svg +105 -0
  49. package/template/knowledge/Ralph/01-overview.md +71 -0
  50. package/template/knowledge/Ralph/02-core-concepts.md +114 -0
  51. package/template/knowledge/Ralph/03-how-ralph-works.md +184 -0
  52. package/template/knowledge/Ralph/04-back-pressure.md +222 -0
  53. package/template/knowledge/Ralph/05-specifications.md +210 -0
  54. package/template/knowledge/Ralph/06-agents-md.md +222 -0
  55. package/template/knowledge/Ralph/07-implementation.md +316 -0
  56. package/template/knowledge/Ralph/08-economics.md +182 -0
  57. package/template/knowledge/Ralph/09-resources.md +145 -0
  58. package/template/knowledge/Ralph/10-claude-code-workflow.md +212 -0
  59. package/template/knowledge/Ralph/11-team-training-guide.md +383 -0
  60. package/template/knowledge/Ralph/README.md +40 -0
  61. package/template/knowledge/ai-security-framework/CONTRIBUTING.md +139 -0
  62. package/template/knowledge/ai-security-framework/GLOSSARY.md +176 -0
  63. package/template/knowledge/ai-security-framework/LICENSE +21 -0
  64. package/template/knowledge/ai-security-framework/QUICK-START.md +172 -0
  65. package/template/knowledge/ai-security-framework/README.md +232 -0
  66. package/template/knowledge/ai-security-framework/checklists/browser-security.md +301 -0
  67. package/template/knowledge/ai-security-framework/checklists/credential-isolation.md +322 -0
  68. package/template/knowledge/ai-security-framework/checklists/incident-response.md +288 -0
  69. package/template/knowledge/ai-security-framework/checklists/pre-flight.md +249 -0
  70. package/template/knowledge/ai-security-framework/checklists/weekly-audit.md +159 -0
  71. package/template/knowledge/ai-security-framework/configs/audit-logging.md +372 -0
  72. package/template/knowledge/ai-security-framework/configs/kill-switches.md +354 -0
  73. package/template/knowledge/ai-security-framework/docs/01-core-principles.md +256 -0
  74. package/template/knowledge/ai-security-framework/docs/02-threat-landscape.md +326 -0
  75. package/template/knowledge/ai-security-framework/docs/03-security-posture.md +250 -0
  76. package/template/knowledge/ai-security-framework/templates/agents-security.md +233 -0
  77. package/template/knowledge/design-styles/README.md +42 -0
  78. package/template/knowledge/design-styles/american-industrial.md +136 -0
  79. package/template/knowledge/design-styles/ethereal-abstract.md +133 -0
  80. package/template/knowledge/design-styles/liminal-portal.md +111 -0
  81. package/template/knowledge/design-styles/swipes/american-industrial/G-3m4YPW0AADdu2.jpeg +0 -0
  82. package/template/knowledge/design-styles/swipes/american-industrial/G-JJlt5WwAABK3K.png +0 -0
  83. package/template/knowledge/design-styles/swipes/american-industrial/G-JJmj5W0AEbJ-7.png +0 -0
  84. package/template/knowledge/design-styles/swipes/american-industrial/G59fgNuXkAAKLJQ (1).jpeg +0 -0
  85. package/template/knowledge/design-styles/swipes/american-industrial/G59fgNuXkAAKLJQ.jpeg +0 -0
  86. package/template/knowledge/design-styles/swipes/american-industrial/G7fVkn3WEAAM-ST.jpeg +0 -0
  87. package/template/knowledge/design-styles/swipes/american-industrial/G8ECO5JWEAIksyn.png +0 -0
  88. package/template/knowledge/design-styles/swipes/american-industrial/G9-3GQSWoAA8eqZ.png +0 -0
  89. package/template/knowledge/design-styles/swipes/american-industrial/G9xEOqrXkAEZRcs.png +0 -0
  90. package/template/knowledge/design-styles/swipes/american-industrial/G_MVeJrXQAA8sx4.jpeg +0 -0
  91. package/template/knowledge/design-styles/swipes/american-industrial/G_RSkmGXkAAgAVZ.png +0 -0
  92. package/template/knowledge/design-styles/swipes/american-industrial/README.md +31 -0
  93. package/template/knowledge/design-styles/swipes/american-industrial/qyqtg7Dq.png +0 -0
  94. package/template/knowledge/dev-team/README.md +35 -0
  95. package/template/knowledge/dev-team/patterns/README.md +34 -0
  96. package/template/knowledge/dev-team/patterns/frontend/react-best-practices.md +178 -0
  97. package/template/knowledge/dev-team/troubleshooting/README.md +31 -0
  98. package/template/knowledge/dev-team/workflows/README.md +49 -0
  99. package/template/knowledge/hq/checkpoint-schema.json +51 -0
  100. package/template/knowledge/hq/index-md-spec.md +74 -0
  101. package/template/knowledge/hq/thread-schema.md +153 -0
  102. package/template/knowledge/hq-core/checkpoint-schema.json +51 -0
  103. package/template/knowledge/hq-core/index-md-spec.md +74 -0
  104. package/template/knowledge/hq-core/thread-schema.md +153 -0
  105. package/template/knowledge/loom/README.md +51 -0
  106. package/template/knowledge/loom/architecture.md +125 -0
  107. package/template/knowledge/loom/code-style.md +169 -0
  108. package/template/knowledge/loom/llm-proxy.md +132 -0
  109. package/template/knowledge/loom/state-machine.md +131 -0
  110. package/template/knowledge/loom/thread-system.md +117 -0
  111. package/template/knowledge/loom/tools.md +94 -0
  112. package/template/knowledge/loom/weaver.md +96 -0
  113. package/template/knowledge/loom/web-frontend.md +131 -0
  114. package/template/knowledge/projects/README.md +72 -0
  115. package/template/knowledge/projects/templates/README.template.md +28 -0
  116. package/template/knowledge/workers/README.md +195 -0
  117. package/template/knowledge/workers/ralph-loop-pattern.md +157 -0
  118. package/template/knowledge/workers/skill-schema.md +182 -0
  119. package/template/knowledge/workers/state-machine.md +102 -0
  120. package/template/knowledge/workers/templates/base-worker.yaml +73 -0
  121. package/template/knowledge/workers/templates/code-worker.yaml +85 -0
  122. package/template/knowledge/workers/templates/skill.yaml +49 -0
  123. package/template/knowledge/workers/templates/social-worker.yaml +70 -0
  124. package/template/modules/examples/full-manifest.yaml +92 -0
  125. package/template/modules/examples/minimal.yaml +14 -0
  126. package/template/modules/modules.yaml +59 -0
  127. package/template/projects/.gitkeep +0 -0
  128. package/template/projects/incorporate-workers-into-pure-ralph/prd.json +88 -0
  129. package/template/projects/pure-ralph-branch-isolation/README.md +114 -0
  130. package/template/projects/pure-ralph-branch-isolation/prd.json +123 -0
  131. package/template/projects/purist-ralph-loop/README.md +148 -0
  132. package/template/projects/purist-ralph-loop/prd.json +135 -0
  133. package/template/projects/ralph-test/prd.json +50 -0
  134. package/template/prompts/pure-ralph-base.md +551 -0
  135. package/template/settings/.gitkeep +0 -0
  136. package/template/settings/pure-ralph.json +42 -0
  137. package/template/social-content/drafts/INDEX.md +21 -0
  138. package/template/social-content/drafts/linkedin/.gitkeep +1 -0
  139. package/template/social-content/drafts/x/.gitkeep +1 -0
  140. package/template/social-content/images/.gitkeep +1 -0
  141. package/template/starter-projects/code-worker/README.md +97 -0
  142. package/template/starter-projects/code-worker/prd.json +45 -0
  143. package/template/starter-projects/personal-assistant/README.md +42 -0
  144. package/template/starter-projects/personal-assistant/prd.json +43 -0
  145. package/template/starter-projects/social-media/README.md +60 -0
  146. package/template/starter-projects/social-media/prd.json +43 -0
  147. package/template/workers/content-brand/README.md +59 -0
  148. package/template/workers/content-brand/skills/messaging-alignment.md +91 -0
  149. package/template/workers/content-brand/skills/tone-check.md +76 -0
  150. package/template/workers/content-brand/skills/voice-analysis.md +68 -0
  151. package/template/workers/content-brand/worker.yaml +81 -0
  152. package/template/workers/content-legal/README.md +80 -0
  153. package/template/workers/content-legal/skills/claim-substantiation.md +150 -0
  154. package/template/workers/content-legal/skills/compliance-scan.md +123 -0
  155. package/template/workers/content-legal/skills/disclaimer-check.md +146 -0
  156. package/template/workers/content-legal/worker.yaml +118 -0
  157. package/template/workers/content-product/README.md +77 -0
  158. package/template/workers/content-product/skills/claim-verification.md +96 -0
  159. package/template/workers/content-product/skills/feature-accuracy.md +117 -0
  160. package/template/workers/content-product/skills/stats-check.md +128 -0
  161. package/template/workers/content-product/worker.yaml +97 -0
  162. package/template/workers/content-sales/README.md +70 -0
  163. package/template/workers/content-sales/skills/conversion-analysis.md +96 -0
  164. package/template/workers/content-sales/skills/cta-audit.md +107 -0
  165. package/template/workers/content-sales/skills/value-prop-check.md +114 -0
  166. package/template/workers/content-sales/worker.yaml +93 -0
  167. package/template/workers/content-shared/cli.ts +242 -0
  168. package/template/workers/content-shared/index.ts +234 -0
  169. package/template/workers/content-shared/lib/accuracy-analyzer.ts +661 -0
  170. package/template/workers/content-shared/lib/analyze.ts +370 -0
  171. package/template/workers/content-shared/lib/brand-analyzer.ts +526 -0
  172. package/template/workers/content-shared/lib/cms-integration.ts +446 -0
  173. package/template/workers/content-shared/lib/compliance-analyzer.ts +655 -0
  174. package/template/workers/content-shared/lib/conversion-analyzer.ts +555 -0
  175. package/template/workers/content-shared/lib/github-integration.ts +582 -0
  176. package/template/workers/content-shared/lib/output.ts +373 -0
  177. package/template/workers/content-shared/lib/parser.ts +771 -0
  178. package/template/workers/content-shared/lib/priority.ts +439 -0
  179. package/template/workers/content-shared/lib/recommendations.ts +512 -0
  180. package/template/workers/content-shared/lib/reporter.ts +749 -0
  181. package/template/workers/content-shared/lib/restructure.ts +664 -0
  182. package/template/workers/content-shared/lib/scorer.ts +140 -0
  183. package/template/workers/content-shared/lib/types.ts +227 -0
  184. package/template/workers/content-shared/lib/variants.ts +595 -0
  185. package/template/workers/content-shared/package.json +51 -0
  186. package/template/workers/content-shared/pnpm-lock.yaml +39 -0
  187. package/template/workers/content-shared/test/sample-page.json +115 -0
  188. package/template/workers/content-shared/tsconfig.json +20 -0
  189. package/template/workers/dev-team/README.md +166 -0
  190. package/template/workers/dev-team/_template.yaml +70 -0
  191. package/template/workers/dev-team/architect/package.json +27 -0
  192. package/template/workers/dev-team/architect/skills/api-design.md +89 -0
  193. package/template/workers/dev-team/architect/skills/refactor-plan.md +96 -0
  194. package/template/workers/dev-team/architect/skills/system-design.md +100 -0
  195. package/template/workers/dev-team/architect/src/index.ts +49 -0
  196. package/template/workers/dev-team/architect/src/mcp-server.ts +122 -0
  197. package/template/workers/dev-team/architect/src/skills/api-design.ts +316 -0
  198. package/template/workers/dev-team/architect/src/skills/refactor-plan.ts +264 -0
  199. package/template/workers/dev-team/architect/src/skills/system-design.ts +212 -0
  200. package/template/workers/dev-team/architect/tsconfig.json +19 -0
  201. package/template/workers/dev-team/architect/worker.yaml +128 -0
  202. package/template/workers/dev-team/backend-dev/package-lock.json +1252 -0
  203. package/template/workers/dev-team/backend-dev/package.json +27 -0
  204. package/template/workers/dev-team/backend-dev/skills/implement-endpoint.md +70 -0
  205. package/template/workers/dev-team/backend-dev/skills/implement-service.md +62 -0
  206. package/template/workers/dev-team/backend-dev/src/index.ts +51 -0
  207. package/template/workers/dev-team/backend-dev/src/mcp-server.ts +109 -0
  208. package/template/workers/dev-team/backend-dev/src/skills/implement-endpoint.ts +122 -0
  209. package/template/workers/dev-team/backend-dev/src/skills/implement-service.ts +126 -0
  210. package/template/workers/dev-team/backend-dev/tsconfig.json +19 -0
  211. package/template/workers/dev-team/backend-dev/worker.yaml +128 -0
  212. package/template/workers/dev-team/code-reviewer/package-lock.json +1080 -0
  213. package/template/workers/dev-team/code-reviewer/package.json +24 -0
  214. package/template/workers/dev-team/code-reviewer/skills/merge-to-production.md +61 -0
  215. package/template/workers/dev-team/code-reviewer/skills/merge-to-staging.md +54 -0
  216. package/template/workers/dev-team/code-reviewer/skills/request-changes.md +63 -0
  217. package/template/workers/dev-team/code-reviewer/skills/review-pr.md +77 -0
  218. package/template/workers/dev-team/code-reviewer/src/index.ts +56 -0
  219. package/template/workers/dev-team/code-reviewer/src/mcp-server.ts +101 -0
  220. package/template/workers/dev-team/code-reviewer/tsconfig.json +19 -0
  221. package/template/workers/dev-team/code-reviewer/worker.yaml +90 -0
  222. package/template/workers/dev-team/database-dev/package.json +22 -0
  223. package/template/workers/dev-team/database-dev/skills/create-schema.md +48 -0
  224. package/template/workers/dev-team/database-dev/src/index.ts +50 -0
  225. package/template/workers/dev-team/database-dev/src/mcp-server.ts +76 -0
  226. package/template/workers/dev-team/database-dev/tsconfig.json +18 -0
  227. package/template/workers/dev-team/database-dev/worker.yaml +90 -0
  228. package/template/workers/dev-team/frontend-dev/package.json +22 -0
  229. package/template/workers/dev-team/frontend-dev/skills/create-component.md +26 -0
  230. package/template/workers/dev-team/frontend-dev/src/index.ts +50 -0
  231. package/template/workers/dev-team/frontend-dev/src/mcp-server.ts +77 -0
  232. package/template/workers/dev-team/frontend-dev/tsconfig.json +18 -0
  233. package/template/workers/dev-team/frontend-dev/worker.yaml +132 -0
  234. package/template/workers/dev-team/infra-dev/package.json +24 -0
  235. package/template/workers/dev-team/infra-dev/skills/add-monitoring.md +73 -0
  236. package/template/workers/dev-team/infra-dev/skills/configure-deployment.md +80 -0
  237. package/template/workers/dev-team/infra-dev/skills/create-dockerfile.md +62 -0
  238. package/template/workers/dev-team/infra-dev/skills/setup-cicd.md +63 -0
  239. package/template/workers/dev-team/infra-dev/src/index.ts +55 -0
  240. package/template/workers/dev-team/infra-dev/src/mcp-server.ts +82 -0
  241. package/template/workers/dev-team/infra-dev/tsconfig.json +19 -0
  242. package/template/workers/dev-team/infra-dev/worker.yaml +92 -0
  243. package/template/workers/dev-team/knowledge-curator/package.json +24 -0
  244. package/template/workers/dev-team/knowledge-curator/skills/curate-troubleshooting.md +63 -0
  245. package/template/workers/dev-team/knowledge-curator/skills/process-learnings.md +61 -0
  246. package/template/workers/dev-team/knowledge-curator/skills/sync-documentation.md +76 -0
  247. package/template/workers/dev-team/knowledge-curator/skills/update-patterns.md +63 -0
  248. package/template/workers/dev-team/knowledge-curator/src/index.ts +53 -0
  249. package/template/workers/dev-team/knowledge-curator/src/mcp-server.ts +92 -0
  250. package/template/workers/dev-team/knowledge-curator/tsconfig.json +19 -0
  251. package/template/workers/dev-team/knowledge-curator/worker.yaml +80 -0
  252. package/template/workers/dev-team/motion-designer/package.json +22 -0
  253. package/template/workers/dev-team/motion-designer/skills/add-animation.md +25 -0
  254. package/template/workers/dev-team/motion-designer/skills/generate-image.md +36 -0
  255. package/template/workers/dev-team/motion-designer/src/index.ts +63 -0
  256. package/template/workers/dev-team/motion-designer/src/mcp-server.ts +79 -0
  257. package/template/workers/dev-team/motion-designer/tsconfig.json +18 -0
  258. package/template/workers/dev-team/motion-designer/worker.yaml +84 -0
  259. package/template/workers/dev-team/product-planner/queue.json +4 -0
  260. package/template/workers/dev-team/product-planner/worker.yaml +220 -0
  261. package/template/workers/dev-team/project-manager/package-lock.json +1252 -0
  262. package/template/workers/dev-team/project-manager/package.json +27 -0
  263. package/template/workers/dev-team/project-manager/skills/create-prd.md +66 -0
  264. package/template/workers/dev-team/project-manager/skills/next-issue.md +51 -0
  265. package/template/workers/dev-team/project-manager/skills/project-status.md +59 -0
  266. package/template/workers/dev-team/project-manager/skills/update-learnings.md +65 -0
  267. package/template/workers/dev-team/project-manager/src/index.ts +54 -0
  268. package/template/workers/dev-team/project-manager/src/mcp-server.ts +207 -0
  269. package/template/workers/dev-team/project-manager/src/skills/create-prd.ts +86 -0
  270. package/template/workers/dev-team/project-manager/src/skills/next-issue.ts +137 -0
  271. package/template/workers/dev-team/project-manager/src/skills/project-status.ts +131 -0
  272. package/template/workers/dev-team/project-manager/src/skills/update-learnings.ts +94 -0
  273. package/template/workers/dev-team/project-manager/tsconfig.json +19 -0
  274. package/template/workers/dev-team/project-manager/worker.yaml +96 -0
  275. package/template/workers/dev-team/qa-tester/package.json +24 -0
  276. package/template/workers/dev-team/qa-tester/skills/create-demo-account.md +36 -0
  277. package/template/workers/dev-team/qa-tester/skills/run-tests.md +36 -0
  278. package/template/workers/dev-team/qa-tester/skills/write-test.md +27 -0
  279. package/template/workers/dev-team/qa-tester/src/index.ts +61 -0
  280. package/template/workers/dev-team/qa-tester/src/mcp-server.ts +88 -0
  281. package/template/workers/dev-team/qa-tester/tsconfig.json +18 -0
  282. package/template/workers/dev-team/qa-tester/worker.yaml +116 -0
  283. package/template/workers/dev-team/task-executor/package-lock.json +1252 -0
  284. package/template/workers/dev-team/task-executor/package.json +27 -0
  285. package/template/workers/dev-team/task-executor/skills/analyze-issue.md +101 -0
  286. package/template/workers/dev-team/task-executor/skills/execute.md +133 -0
  287. package/template/workers/dev-team/task-executor/skills/report-learnings.md +106 -0
  288. package/template/workers/dev-team/task-executor/skills/validate-completion.md +121 -0
  289. package/template/workers/dev-team/task-executor/src/index.ts +54 -0
  290. package/template/workers/dev-team/task-executor/src/mcp-server.ts +139 -0
  291. package/template/workers/dev-team/task-executor/src/skills/analyze-issue.ts +219 -0
  292. package/template/workers/dev-team/task-executor/src/skills/execute.ts +132 -0
  293. package/template/workers/dev-team/task-executor/src/skills/report-learnings.ts +119 -0
  294. package/template/workers/dev-team/task-executor/src/skills/validate-completion.ts +142 -0
  295. package/template/workers/dev-team/task-executor/tsconfig.json +19 -0
  296. package/template/workers/dev-team/task-executor/worker.yaml +110 -0
  297. package/template/workers/registry.yaml +171 -0
  298. package/template/workers/security-scanner/README.md +73 -0
  299. package/template/workers/security-scanner/skills/pre-deploy-check.md +205 -0
  300. package/template/workers/security-scanner/worker.yaml +26 -0
  301. package/template/workspace/checkpoints/.gitkeep +0 -0
  302. package/template/workspace/content-ideas/inbox.jsonl +0 -0
  303. package/template/workspace/drafts/.gitkeep +0 -0
  304. package/template/workspace/learnings/.gitkeep +3 -0
  305. package/template/workspace/orchestrator/.gitkeep +0 -0
  306. package/template/workspace/ralph-test/COMPLETE.md +18 -0
  307. package/template/workspace/ralph-test/hello.txt +2 -0
  308. package/template/workspace/reports/.gitkeep +0 -0
  309. package/template/workspace/scratch/.gitkeep +0 -0
  310. package/template/workspace/threads/.gitkeep +3 -0
@@ -0,0 +1,440 @@
1
+ ---
2
+ description: Execute a single task through coordinated worker phases (Ralph pattern)
3
+ allowed-tools: Task, Read, Write, Glob, Grep, Bash, AskUserQuestion
4
+ argument-hint: [project/task-id]
5
+ visibility: public
6
+ ---
7
+
8
+ # /execute-task - Worker-Coordinated Task Execution
9
+
10
+ Execute a single user story through coordinated worker phases. Each worker handles their domain, passes context to the next.
11
+
12
+ **Arguments:** $ARGUMENTS
13
+
14
+ ## Ralph Principle
15
+
16
+ "Pick a task, complete it, commit it."
17
+
18
+ - Fresh context per task
19
+ - Sub-agents do heavy lifting
20
+ - Back pressure keeps code on rails
21
+ - Handoffs preserve context between workers
22
+
23
+ ## Process
24
+
25
+ ### 1. Parse Arguments
26
+
27
+ Extract `{project}/{task-id}` from arguments.
28
+
29
+ If no arguments:
30
+ ```
31
+ Usage: /execute-task {project}/{task-id}
32
+
33
+ Example: /execute-task campaign-migration/CAM-003
34
+ ```
35
+
36
+ ### 2. Load Task Spec
37
+
38
+ Read and validate `projects/{project}/prd.json`:
39
+
40
+ ```javascript
41
+ // Strict: prd.json required. No README.md fallback.
42
+ const prdPath = `projects/${project}/prd.json`
43
+ if (!fileExists(prdPath)) {
44
+ STOP: `ERROR: ${prdPath} not found. Run /prd ${project} first.`
45
+ }
46
+
47
+ const prd = JSON.parse(read(prdPath))
48
+
49
+ // Strict: userStories required. No fallback.
50
+ const stories = prd.userStories
51
+ if (!stories || !Array.isArray(stories)) {
52
+ STOP: "prd.json missing userStories array. Migrate legacy 'features' key to 'userStories'."
53
+ }
54
+
55
+ // Validate required fields
56
+ for (const story of stories) {
57
+ const required = ['id', 'title', 'description', 'passes']
58
+ const missing = required.filter(f => !(f in story))
59
+ if (missing.length > 0) {
60
+ STOP: `Story ${story.id || '?'} missing fields: ${missing.join(', ')}`
61
+ }
62
+ }
63
+
64
+ const task = stories.find(s => s.id === taskId)
65
+ ```
66
+
67
+ Extract:
68
+ - `id`, `title`, `description`
69
+ - `acceptance_criteria`
70
+ - `files` (if specified)
71
+ - `dependsOn` (check these are complete)
72
+
73
+ If task not found or already `passes: true`:
74
+ ```
75
+ Task {taskId} not found or already complete.
76
+ ```
77
+
78
+ ### 3. Classify Task Type
79
+
80
+ Analyze task title, description, and acceptance criteria. Match against patterns:
81
+
82
+ | Type | Indicators |
83
+ |------|------------|
84
+ | `schema_change` | database, migration, schema, table, column, prisma, SQL |
85
+ | `api_development` | endpoint, API, REST, GraphQL, route, service |
86
+ | `ui_component` | component, page, form, button, React, UI, responsive |
87
+ | `full_stack` | Combination of backend + frontend indicators |
88
+ | `enhancement` | animation, polish, refactor, optimization, UX |
89
+
90
+ Report classification:
91
+ ```
92
+ Task: {task.id} - {task.title}
93
+ Type: {type} (matched: {indicators})
94
+ ```
95
+
96
+ ### 4. Select Worker Sequence
97
+
98
+ Based on task type, determine worker sequence:
99
+
100
+ ```yaml
101
+ schema_change:
102
+ - product-planner (if spec unclear)
103
+ - database-dev
104
+ - backend-dev
105
+ - code-reviewer
106
+ - dev-qa-tester
107
+
108
+ api_development:
109
+ - product-planner (if spec unclear)
110
+ - backend-dev
111
+ - code-reviewer
112
+ - dev-qa-tester
113
+
114
+ ui_component:
115
+ - product-planner (if spec unclear)
116
+ - frontend-dev
117
+ - motion-designer
118
+ - code-reviewer
119
+ - dev-qa-tester
120
+
121
+ full_stack:
122
+ - product-planner
123
+ - architect
124
+ - database-dev
125
+ - backend-dev
126
+ - frontend-dev
127
+ - code-reviewer
128
+ - dev-qa-tester
129
+
130
+ content:
131
+ - content-brand
132
+ - content-product
133
+ - content-sales
134
+ - content-legal
135
+
136
+ enhancement:
137
+ - (relevant dev based on files)
138
+ - code-reviewer
139
+ ```
140
+
141
+ **Skip product-planner** if task has detailed acceptance criteria already.
142
+
143
+ **Filter by active workers**: Check `workers/registry.yaml` for status: active.
144
+
145
+ Present plan:
146
+ ```
147
+ Execution Plan for {task.id}:
148
+
149
+ Phase 1: backend-engineer → Implement service
150
+ Phase 2: code-reviewer → Review changes
151
+ Phase 3: qa-tester → Verify implementation
152
+
153
+ Proceed? [Y/n]
154
+ ```
155
+
156
+ ### 5. Initialize Execution State
157
+
158
+ Create execution tracking file:
159
+
160
+ ```bash
161
+ mkdir -p workspace/orchestrator/{project}/executions
162
+ ```
163
+
164
+ Write to `workspace/orchestrator/{project}/executions/{task-id}.json`:
165
+ ```json
166
+ {
167
+ "task_id": "{task.id}",
168
+ "project": "{project}",
169
+ "started_at": "{ISO8601}",
170
+ "status": "in_progress",
171
+ "current_phase": 1,
172
+ "phases": [
173
+ {"worker": "backend-engineer", "status": "pending"},
174
+ {"worker": "code-reviewer", "status": "pending"},
175
+ {"worker": "qa-tester", "status": "pending"}
176
+ ],
177
+ "handoffs": []
178
+ }
179
+ ```
180
+
181
+ ### 5.5 Load Scoped Learnings
182
+
183
+ Learnings live inside the files they govern — no separate learnings files.
184
+
185
+ 1. For each worker in the selected sequence:
186
+ - Worker `instructions:` in `worker.yaml` includes a `## Learnings` subsection with accumulated rules from prior `/learn` injections
187
+ - These are loaded automatically in step 6a when reading worker config
188
+ 2. `.claude/CLAUDE.md` `## Learned Rules` (global hot rules) is already in session context
189
+
190
+ No extra file reads needed — learnings are part of the source files.
191
+
192
+ ### 6. Execute Each Phase
193
+
194
+ For each worker in sequence:
195
+
196
+ #### 6a. Load Worker Config
197
+
198
+ Read `workers/public/dev-team/{worker-id}/worker.yaml` (or `workers/{worker-id}/worker.yaml` for non-dev-team):
199
+ - `instructions` - Worker's role and process
200
+ - `context.base` - Files worker always needs
201
+ - `skills.installed` - Worker's skills
202
+ - `verification.post_execute` - Back pressure checks
203
+
204
+ #### 6b. Build Worker Prompt
205
+
206
+ ```markdown
207
+ ## You are: {worker.name}
208
+ ## Task: {task.id} - {task.title}
209
+
210
+ ### Description
211
+ {task.description}
212
+
213
+ ### Acceptance Criteria
214
+ {task.acceptance_criteria as checklist}
215
+
216
+ ### Files to Focus On
217
+ {task.files or inferred from description}
218
+
219
+ ### Context from Previous Phase
220
+ {handoff_context from previous worker, if any}
221
+
222
+ ### Your Instructions
223
+ {worker.instructions}
224
+
225
+ ### Back Pressure (Run Before Completing)
226
+ {worker.verification.post_execute commands}
227
+
228
+ ### Output Requirements
229
+ When complete, provide JSON:
230
+ {
231
+ "summary": "What you accomplished",
232
+ "files_created": ["paths"],
233
+ "files_modified": ["paths"],
234
+ "key_decisions": ["decision and rationale"],
235
+ "context_for_next": "Instructions for next worker",
236
+ "back_pressure": {
237
+ "tests": "pass|fail",
238
+ "lint": "pass|fail",
239
+ "typecheck": "pass|fail",
240
+ "build": "pass|fail"
241
+ },
242
+ "issues": ["any blocking issues"]
243
+ }
244
+ ```
245
+
246
+ #### 6c. Spawn Worker Sub-Agent
247
+
248
+ Use Task tool:
249
+ ```
250
+ Task({
251
+ subagent_type: "general-purpose",
252
+ prompt: {built prompt above},
253
+ description: "{worker.id} for {task.id}"
254
+ })
255
+ ```
256
+
257
+ #### 6d. Process Worker Output
258
+
259
+ Parse worker's JSON output.
260
+
261
+ If back pressure failed:
262
+ - Retry once with error context
263
+ - If still fails, pause and report
264
+
265
+ If success:
266
+ - Store handoff context
267
+ - Update execution state
268
+ - Continue to next phase
269
+
270
+ #### 6e. Update Execution State
271
+
272
+ After each phase:
273
+ ```json
274
+ {
275
+ "phases": [
276
+ {"worker": "backend-engineer", "status": "completed", "completed_at": "..."},
277
+ {"worker": "code-reviewer", "status": "in_progress"},
278
+ ...
279
+ ],
280
+ "handoffs": [
281
+ {
282
+ "from": "backend-engineer",
283
+ "to": "code-reviewer",
284
+ "context": {...worker output...}
285
+ }
286
+ ]
287
+ }
288
+ ```
289
+
290
+ ### 7. Complete Task
291
+
292
+ When all phases complete:
293
+
294
+ #### 7a. Update PRD
295
+
296
+ ```javascript
297
+ // Update projects/{project}/prd.json
298
+ task.passes = true
299
+ ```
300
+
301
+ #### 7b. Capture Learnings via /learn
302
+
303
+ Run `/learn` with structured input from execution:
304
+
305
+ ```json
306
+ {
307
+ "task_id": "{task.id}",
308
+ "project": "{project}",
309
+ "source": "task-completion",
310
+ "severity": "medium",
311
+ "scope": "auto",
312
+ "workers_used": ["list of workers that ran"],
313
+ "back_pressure_failures": [{"worker": "...", "check": "...", "error": "..."}],
314
+ "retries": N,
315
+ "key_decisions": ["aggregated from worker outputs"],
316
+ "issues_encountered": ["from worker outputs"],
317
+ "patterns_discovered": ["success patterns worth preserving"]
318
+ }
319
+ ```
320
+
321
+ `/learn` handles: injection into source files, global promotion, event logging, dedup.
322
+
323
+ If task completed cleanly with no failures/retries/notable patterns, `/learn` will log the event only (no rule injection).
324
+
325
+ #### 7c. Report Completion
326
+
327
+ ```
328
+ Task Complete: {task.id} - {task.title}
329
+
330
+ Phases: {N} completed
331
+ Workers: {list}
332
+ Files touched: {count}
333
+
334
+ Key decisions:
335
+ - {decision 1}
336
+ - {decision 2}
337
+
338
+ Learning captured: workspace/learnings/{project}/{task-id}.json
339
+ PRD updated: passes: true
340
+ ```
341
+
342
+ #### 7d. Structured Output for Orchestrator
343
+
344
+ When invoked as a sub-agent by `/run-project`, end with this JSON so the orchestrator can parse results without absorbing full context:
345
+
346
+ ```json
347
+ {
348
+ "task_id": "{task.id}",
349
+ "status": "completed",
350
+ "summary": "1-sentence summary of what was accomplished",
351
+ "workers_used": ["{worker1}", "{worker2}"],
352
+ "back_pressure": {
353
+ "tests": "pass|fail|skipped",
354
+ "lint": "pass|fail|skipped",
355
+ "typecheck": "pass|fail|skipped",
356
+ "build": "pass|fail|skipped",
357
+ "e2e_manifest": "pass|fail|skipped"
358
+ }
359
+ }
360
+ ```
361
+
362
+ ### 8. Handle Failures
363
+
364
+ If any phase fails after retry:
365
+
366
+ 0. **Auto-capture failure as learning:**
367
+ Run `/learn` with:
368
+ ```json
369
+ {
370
+ "source": "back-pressure-failure",
371
+ "severity": "high",
372
+ "scope": "worker:{failed-worker-id}",
373
+ "back_pressure_failures": [{"worker": "...", "check": "...", "error": "..."}],
374
+ "task_id": "{task.id}",
375
+ "project": "{project}"
376
+ }
377
+ ```
378
+ This ensures the failure becomes a rule BEFORE asking the user what to do.
379
+
380
+ 1. Update execution state: `status: "paused"`
381
+ 2. Log error details
382
+ 3. Present options:
383
+
384
+ ```
385
+ Phase {N} ({worker}) failed: {error}
386
+
387
+ Options:
388
+ 1. Fix manually and resume: /execute-task {project}/{task-id} --resume
389
+ 2. Skip this worker and continue
390
+ 3. Abort execution
391
+ ```
392
+
393
+ When invoked as a sub-agent, also output structured JSON on failure:
394
+
395
+ ```json
396
+ {
397
+ "task_id": "{task.id}",
398
+ "status": "failed",
399
+ "summary": "Phase {N} ({worker}) failed: {brief error}",
400
+ "workers_used": ["{workers that ran}"],
401
+ "back_pressure": {}
402
+ }
403
+ ```
404
+
405
+ ## Handoff Context Format
406
+
407
+ Context passed between workers:
408
+
409
+ ```json
410
+ {
411
+ "from_worker": "backend-engineer",
412
+ "to_worker": "code-reviewer",
413
+ "timestamp": "ISO8601",
414
+ "summary": "1-2 sentence description",
415
+ "files_created": ["src/services/foo.ts"],
416
+ "files_modified": ["src/index.ts"],
417
+ "key_decisions": [
418
+ "Used strategy pattern for flexibility",
419
+ "Added caching for performance"
420
+ ],
421
+ "context_for_next": "Focus review on cache invalidation logic",
422
+ "back_pressure": {
423
+ "tests": "pass",
424
+ "lint": "pass",
425
+ "typecheck": "pass"
426
+ }
427
+ }
428
+ ```
429
+
430
+ ## Rules
431
+
432
+ - **ONE task at a time** - Never work on multiple tasks
433
+ - **Fresh context per worker** - Spawn sub-agents, don't accumulate
434
+ - **Back pressure is mandatory** - No skipping tests/lint/typecheck
435
+ - **Capture learnings** - Every task generates learning entry
436
+ - **Handoffs preserve context** - Next worker knows what happened
437
+ - **Fail fast, fail loud** - Stop on errors, don't hide them
438
+ - **prd.json is required** - never read or fall back to README.md
439
+ - **Validate prd.json on load** - fail loudly on missing/malformed fields
440
+ - **Orchestrator-compatible output** - always end with structured JSON block (step 7d) so `/run-project` can parse results without absorbing full context
@@ -0,0 +1,41 @@
1
+ ---
2
+ description: Force exit from plan mode when stuck
3
+ allowed-tools: ExitPlanMode, Read, Bash
4
+ argument-hint:
5
+ visibility: public
6
+ ---
7
+
8
+ # Force Exit Plan Mode
9
+
10
+ User invoked this because Claude is stuck waiting on ExitPlanMode approval.
11
+
12
+ ## Immediate Action
13
+
14
+ Call ExitPlanMode NOW with empty allowedPrompts:
15
+
16
+ ```
17
+ ExitPlanMode({})
18
+ ```
19
+
20
+ Do not:
21
+ - Ask for confirmation
22
+ - Explain what you're doing
23
+ - Wait for anything
24
+ - Add allowed prompts unless plan file explicitly lists bash commands needed
25
+
26
+ Just call the tool immediately.
27
+
28
+ ## If ExitPlanMode Fails
29
+
30
+ 1. Tell user: "ExitPlanMode blocked. Options:"
31
+ - Type `yes` or `approve` in chat to approve plan
32
+ - Type `no` to reject and re-plan
33
+ - Type `skip` to abandon planning entirely
34
+
35
+ 2. If user says skip, acknowledge and proceed with task directly (no planning)
36
+
37
+ ## Common Stuck Scenarios
38
+
39
+ - **Waiting on approval loop**: Just call ExitPlanMode again
40
+ - **Plan file not written**: Write minimal plan to workspace/plans/current.md first, then exit
41
+ - **Permission denied**: User needs to approve in chat - prompt them explicitly
@@ -0,0 +1,97 @@
1
+ ---
2
+ description: Hand off to fresh session, work continues from checkpoint
3
+ allowed-tools: Write, Read, Bash
4
+ argument-hint: [message]
5
+ visibility: public
6
+ ---
7
+
8
+ # /handoff - Fresh Session Continuity
9
+
10
+ Prepare for a new session to continue this work.
11
+
12
+ **User's message (optional):** $ARGUMENTS
13
+
14
+ ## Process
15
+
16
+ 1. **Ensure thread exists**
17
+ - Check `workspace/threads/` for recent thread
18
+ - If none, run `/checkpoint` first to create one
19
+
20
+ 2. **Find latest thread**
21
+ ```bash
22
+ ls -t workspace/threads/*.json | head -1
23
+ ```
24
+
25
+ 3. **Commit dirty knowledge repos**
26
+ Knowledge folders are separate git repos (symlinked). Before handoff, commit any uncommitted knowledge changes:
27
+ ```bash
28
+ for symlink in knowledge/public/* knowledge/private/* companies/*/knowledge; do
29
+ [ -L "$symlink" ] || continue
30
+ repo_dir=$(cd "$symlink" && git rev-parse --show-toplevel 2>/dev/null) || continue
31
+ dirty=$(cd "$repo_dir" && git status --porcelain)
32
+ [ -z "$dirty" ] && continue
33
+ (cd "$repo_dir" && git add -A && git commit -m "checkpoint: auto-commit before handoff")
34
+ done
35
+ ```
36
+
37
+ 4. **Update INDEX.md files**
38
+ - Regenerate `INDEX.md` at HQ root with:
39
+ - Workers from `workers/registry.yaml`
40
+ - Recent threads from `workspace/threads/`
41
+ - Regenerate `workspace/threads/INDEX.md` (all threads, full table)
42
+ - Regenerate `workspace/orchestrator/INDEX.md` (project progress)
43
+ - Check files_touched for any `companies/*/knowledge/` paths — if found, regenerate that company's `knowledge/INDEX.md`
44
+ - See `knowledge/public/hq-core/index-md-spec.md` for INDEX format
45
+
46
+ 5. **Update search index**
47
+ ```bash
48
+ qmd update && qmd embed
49
+ ```
50
+ Ensures any content created this session is searchable in the next.
51
+
52
+ 6. **Write handoff note** to `workspace/threads/handoff.json`:
53
+ ```json
54
+ {
55
+ "created_at": "ISO8601 timestamp",
56
+ "message": "user's handoff message if provided",
57
+ "last_thread": "T-20260123-143052-mrr-report",
58
+ "thread_path": "workspace/threads/T-20260123-143052-mrr-report.json",
59
+ "context_notes": "important context for next session"
60
+ }
61
+ ```
62
+
63
+ 7. **Report**
64
+ ```
65
+ Handoff ready.
66
+
67
+ Latest thread: {thread_id}
68
+ Summary: {conversation_summary}
69
+ Git: {branch} @ {commit}
70
+
71
+ To continue in a fresh session:
72
+ 1. Start new Claude Code session
73
+ 2. Run: /nexttask (it will find your thread)
74
+
75
+ Or read: workspace/threads/handoff.json
76
+ ```
77
+
78
+ ## Thread vs Checkpoint
79
+
80
+ Threads are the new format with richer context:
81
+ - Git state (branch, commits, dirty)
82
+ - Worker state (skill, status)
83
+ - Better searchability
84
+
85
+ Legacy checkpoints in `workspace/checkpoints/` still work.
86
+
87
+ ## Why Fresh Sessions
88
+
89
+ Fresh context means:
90
+ - No accumulated noise from previous work
91
+ - Clean slate for complex tasks
92
+ - Follows Ralph methodology (fresh agent per task)
93
+
94
+ Use `/handoff` when:
95
+ - Session has been running a while
96
+ - Switching to a different type of task
97
+ - Want cleaner separation between work chunks