create-hq 5.1.0 → 5.2.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 (299) hide show
  1. package/dist/deps.d.ts +2 -2
  2. package/dist/deps.d.ts.map +1 -1
  3. package/dist/deps.js +138 -29
  4. package/dist/deps.js.map +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/scaffold.d.ts.map +1 -1
  7. package/dist/scaffold.js +16 -26
  8. package/dist/scaffold.js.map +1 -1
  9. package/dist/ui.js +1 -1
  10. package/package.json +3 -6
  11. package/template/.claude/CLAUDE.md +0 -202
  12. package/template/.claude/commands/checkpoint.md +0 -127
  13. package/template/.claude/commands/cleanup.md +0 -307
  14. package/template/.claude/commands/execute-task.md +0 -440
  15. package/template/.claude/commands/exit-plan.md +0 -41
  16. package/template/.claude/commands/handoff.md +0 -97
  17. package/template/.claude/commands/learn.md +0 -218
  18. package/template/.claude/commands/metrics.md +0 -118
  19. package/template/.claude/commands/newworker.md +0 -162
  20. package/template/.claude/commands/nexttask.md +0 -67
  21. package/template/.claude/commands/prd.md +0 -238
  22. package/template/.claude/commands/reanchor.md +0 -51
  23. package/template/.claude/commands/remember.md +0 -126
  24. package/template/.claude/commands/run-project.md +0 -348
  25. package/template/.claude/commands/run.md +0 -110
  26. package/template/.claude/commands/search-reindex.md +0 -62
  27. package/template/.claude/commands/search.md +0 -100
  28. package/template/.claude/commands/setup.md +0 -381
  29. package/template/.claude/scripts/pure-ralph-loop.ps1 +0 -312
  30. package/template/.claude/scripts/pure-ralph-loop.sh +0 -859
  31. package/template/CHANGELOG.md +0 -220
  32. package/template/LICENSE +0 -21
  33. package/template/MIGRATION.md +0 -259
  34. package/template/README.md +0 -368
  35. package/template/data/journal/.gitkeep +0 -0
  36. package/template/docs/images/ascii-banner-options.md +0 -122
  37. package/template/docs/images/hq-banner.svg +0 -105
  38. package/template/knowledge/Ralph/01-overview.md +0 -71
  39. package/template/knowledge/Ralph/02-core-concepts.md +0 -114
  40. package/template/knowledge/Ralph/03-how-ralph-works.md +0 -184
  41. package/template/knowledge/Ralph/04-back-pressure.md +0 -222
  42. package/template/knowledge/Ralph/05-specifications.md +0 -210
  43. package/template/knowledge/Ralph/06-agents-md.md +0 -222
  44. package/template/knowledge/Ralph/07-implementation.md +0 -316
  45. package/template/knowledge/Ralph/08-economics.md +0 -182
  46. package/template/knowledge/Ralph/09-resources.md +0 -145
  47. package/template/knowledge/Ralph/10-claude-code-workflow.md +0 -212
  48. package/template/knowledge/Ralph/11-team-training-guide.md +0 -383
  49. package/template/knowledge/Ralph/README.md +0 -40
  50. package/template/knowledge/ai-security-framework/CONTRIBUTING.md +0 -139
  51. package/template/knowledge/ai-security-framework/GLOSSARY.md +0 -176
  52. package/template/knowledge/ai-security-framework/LICENSE +0 -21
  53. package/template/knowledge/ai-security-framework/QUICK-START.md +0 -172
  54. package/template/knowledge/ai-security-framework/README.md +0 -232
  55. package/template/knowledge/ai-security-framework/checklists/browser-security.md +0 -301
  56. package/template/knowledge/ai-security-framework/checklists/credential-isolation.md +0 -322
  57. package/template/knowledge/ai-security-framework/checklists/incident-response.md +0 -288
  58. package/template/knowledge/ai-security-framework/checklists/pre-flight.md +0 -249
  59. package/template/knowledge/ai-security-framework/checklists/weekly-audit.md +0 -159
  60. package/template/knowledge/ai-security-framework/configs/audit-logging.md +0 -372
  61. package/template/knowledge/ai-security-framework/configs/kill-switches.md +0 -354
  62. package/template/knowledge/ai-security-framework/docs/01-core-principles.md +0 -256
  63. package/template/knowledge/ai-security-framework/docs/02-threat-landscape.md +0 -326
  64. package/template/knowledge/ai-security-framework/docs/03-security-posture.md +0 -250
  65. package/template/knowledge/ai-security-framework/templates/agents-security.md +0 -233
  66. package/template/knowledge/design-styles/README.md +0 -42
  67. package/template/knowledge/design-styles/american-industrial.md +0 -136
  68. package/template/knowledge/design-styles/ethereal-abstract.md +0 -133
  69. package/template/knowledge/design-styles/liminal-portal.md +0 -111
  70. package/template/knowledge/design-styles/swipes/american-industrial/G-3m4YPW0AADdu2.jpeg +0 -0
  71. package/template/knowledge/design-styles/swipes/american-industrial/G-JJlt5WwAABK3K.png +0 -0
  72. package/template/knowledge/design-styles/swipes/american-industrial/G-JJmj5W0AEbJ-7.png +0 -0
  73. package/template/knowledge/design-styles/swipes/american-industrial/G59fgNuXkAAKLJQ (1).jpeg +0 -0
  74. package/template/knowledge/design-styles/swipes/american-industrial/G59fgNuXkAAKLJQ.jpeg +0 -0
  75. package/template/knowledge/design-styles/swipes/american-industrial/G7fVkn3WEAAM-ST.jpeg +0 -0
  76. package/template/knowledge/design-styles/swipes/american-industrial/G8ECO5JWEAIksyn.png +0 -0
  77. package/template/knowledge/design-styles/swipes/american-industrial/G9-3GQSWoAA8eqZ.png +0 -0
  78. package/template/knowledge/design-styles/swipes/american-industrial/G9xEOqrXkAEZRcs.png +0 -0
  79. package/template/knowledge/design-styles/swipes/american-industrial/G_MVeJrXQAA8sx4.jpeg +0 -0
  80. package/template/knowledge/design-styles/swipes/american-industrial/G_RSkmGXkAAgAVZ.png +0 -0
  81. package/template/knowledge/design-styles/swipes/american-industrial/README.md +0 -31
  82. package/template/knowledge/design-styles/swipes/american-industrial/qyqtg7Dq.png +0 -0
  83. package/template/knowledge/dev-team/README.md +0 -35
  84. package/template/knowledge/dev-team/patterns/README.md +0 -34
  85. package/template/knowledge/dev-team/patterns/frontend/react-best-practices.md +0 -178
  86. package/template/knowledge/dev-team/troubleshooting/README.md +0 -31
  87. package/template/knowledge/dev-team/workflows/README.md +0 -49
  88. package/template/knowledge/hq/checkpoint-schema.json +0 -51
  89. package/template/knowledge/hq/index-md-spec.md +0 -74
  90. package/template/knowledge/hq/thread-schema.md +0 -153
  91. package/template/knowledge/hq-core/checkpoint-schema.json +0 -51
  92. package/template/knowledge/hq-core/index-md-spec.md +0 -74
  93. package/template/knowledge/hq-core/thread-schema.md +0 -153
  94. package/template/knowledge/loom/README.md +0 -51
  95. package/template/knowledge/loom/architecture.md +0 -125
  96. package/template/knowledge/loom/code-style.md +0 -169
  97. package/template/knowledge/loom/llm-proxy.md +0 -132
  98. package/template/knowledge/loom/state-machine.md +0 -131
  99. package/template/knowledge/loom/thread-system.md +0 -117
  100. package/template/knowledge/loom/tools.md +0 -94
  101. package/template/knowledge/loom/weaver.md +0 -96
  102. package/template/knowledge/loom/web-frontend.md +0 -131
  103. package/template/knowledge/projects/README.md +0 -72
  104. package/template/knowledge/projects/templates/README.template.md +0 -28
  105. package/template/knowledge/workers/README.md +0 -195
  106. package/template/knowledge/workers/ralph-loop-pattern.md +0 -157
  107. package/template/knowledge/workers/skill-schema.md +0 -182
  108. package/template/knowledge/workers/state-machine.md +0 -102
  109. package/template/knowledge/workers/templates/base-worker.yaml +0 -73
  110. package/template/knowledge/workers/templates/code-worker.yaml +0 -85
  111. package/template/knowledge/workers/templates/skill.yaml +0 -49
  112. package/template/knowledge/workers/templates/social-worker.yaml +0 -70
  113. package/template/modules/examples/full-manifest.yaml +0 -92
  114. package/template/modules/examples/minimal.yaml +0 -14
  115. package/template/modules/modules.yaml +0 -59
  116. package/template/projects/.gitkeep +0 -0
  117. package/template/projects/incorporate-workers-into-pure-ralph/prd.json +0 -88
  118. package/template/projects/pure-ralph-branch-isolation/README.md +0 -114
  119. package/template/projects/pure-ralph-branch-isolation/prd.json +0 -123
  120. package/template/projects/purist-ralph-loop/README.md +0 -148
  121. package/template/projects/purist-ralph-loop/prd.json +0 -135
  122. package/template/projects/ralph-test/prd.json +0 -50
  123. package/template/prompts/pure-ralph-base.md +0 -551
  124. package/template/settings/.gitkeep +0 -0
  125. package/template/settings/pure-ralph.json +0 -42
  126. package/template/social-content/drafts/INDEX.md +0 -21
  127. package/template/social-content/drafts/linkedin/.gitkeep +0 -1
  128. package/template/social-content/drafts/x/.gitkeep +0 -1
  129. package/template/social-content/images/.gitkeep +0 -1
  130. package/template/starter-projects/code-worker/README.md +0 -97
  131. package/template/starter-projects/code-worker/prd.json +0 -45
  132. package/template/starter-projects/personal-assistant/README.md +0 -42
  133. package/template/starter-projects/personal-assistant/prd.json +0 -43
  134. package/template/starter-projects/social-media/README.md +0 -60
  135. package/template/starter-projects/social-media/prd.json +0 -43
  136. package/template/workers/content-brand/README.md +0 -59
  137. package/template/workers/content-brand/skills/messaging-alignment.md +0 -91
  138. package/template/workers/content-brand/skills/tone-check.md +0 -76
  139. package/template/workers/content-brand/skills/voice-analysis.md +0 -68
  140. package/template/workers/content-brand/worker.yaml +0 -81
  141. package/template/workers/content-legal/README.md +0 -80
  142. package/template/workers/content-legal/skills/claim-substantiation.md +0 -150
  143. package/template/workers/content-legal/skills/compliance-scan.md +0 -123
  144. package/template/workers/content-legal/skills/disclaimer-check.md +0 -146
  145. package/template/workers/content-legal/worker.yaml +0 -118
  146. package/template/workers/content-product/README.md +0 -77
  147. package/template/workers/content-product/skills/claim-verification.md +0 -96
  148. package/template/workers/content-product/skills/feature-accuracy.md +0 -117
  149. package/template/workers/content-product/skills/stats-check.md +0 -128
  150. package/template/workers/content-product/worker.yaml +0 -97
  151. package/template/workers/content-sales/README.md +0 -70
  152. package/template/workers/content-sales/skills/conversion-analysis.md +0 -96
  153. package/template/workers/content-sales/skills/cta-audit.md +0 -107
  154. package/template/workers/content-sales/skills/value-prop-check.md +0 -114
  155. package/template/workers/content-sales/worker.yaml +0 -93
  156. package/template/workers/content-shared/cli.ts +0 -242
  157. package/template/workers/content-shared/index.ts +0 -234
  158. package/template/workers/content-shared/lib/accuracy-analyzer.ts +0 -661
  159. package/template/workers/content-shared/lib/analyze.ts +0 -370
  160. package/template/workers/content-shared/lib/brand-analyzer.ts +0 -526
  161. package/template/workers/content-shared/lib/cms-integration.ts +0 -446
  162. package/template/workers/content-shared/lib/compliance-analyzer.ts +0 -655
  163. package/template/workers/content-shared/lib/conversion-analyzer.ts +0 -555
  164. package/template/workers/content-shared/lib/github-integration.ts +0 -582
  165. package/template/workers/content-shared/lib/output.ts +0 -373
  166. package/template/workers/content-shared/lib/parser.ts +0 -771
  167. package/template/workers/content-shared/lib/priority.ts +0 -439
  168. package/template/workers/content-shared/lib/recommendations.ts +0 -512
  169. package/template/workers/content-shared/lib/reporter.ts +0 -749
  170. package/template/workers/content-shared/lib/restructure.ts +0 -664
  171. package/template/workers/content-shared/lib/scorer.ts +0 -140
  172. package/template/workers/content-shared/lib/types.ts +0 -227
  173. package/template/workers/content-shared/lib/variants.ts +0 -595
  174. package/template/workers/content-shared/package.json +0 -51
  175. package/template/workers/content-shared/pnpm-lock.yaml +0 -39
  176. package/template/workers/content-shared/test/sample-page.json +0 -115
  177. package/template/workers/content-shared/tsconfig.json +0 -20
  178. package/template/workers/dev-team/README.md +0 -166
  179. package/template/workers/dev-team/_template.yaml +0 -70
  180. package/template/workers/dev-team/architect/package.json +0 -27
  181. package/template/workers/dev-team/architect/skills/api-design.md +0 -89
  182. package/template/workers/dev-team/architect/skills/refactor-plan.md +0 -96
  183. package/template/workers/dev-team/architect/skills/system-design.md +0 -100
  184. package/template/workers/dev-team/architect/src/index.ts +0 -49
  185. package/template/workers/dev-team/architect/src/mcp-server.ts +0 -122
  186. package/template/workers/dev-team/architect/src/skills/api-design.ts +0 -316
  187. package/template/workers/dev-team/architect/src/skills/refactor-plan.ts +0 -264
  188. package/template/workers/dev-team/architect/src/skills/system-design.ts +0 -212
  189. package/template/workers/dev-team/architect/tsconfig.json +0 -19
  190. package/template/workers/dev-team/architect/worker.yaml +0 -128
  191. package/template/workers/dev-team/backend-dev/package-lock.json +0 -1252
  192. package/template/workers/dev-team/backend-dev/package.json +0 -27
  193. package/template/workers/dev-team/backend-dev/skills/implement-endpoint.md +0 -70
  194. package/template/workers/dev-team/backend-dev/skills/implement-service.md +0 -62
  195. package/template/workers/dev-team/backend-dev/src/index.ts +0 -51
  196. package/template/workers/dev-team/backend-dev/src/mcp-server.ts +0 -109
  197. package/template/workers/dev-team/backend-dev/src/skills/implement-endpoint.ts +0 -122
  198. package/template/workers/dev-team/backend-dev/src/skills/implement-service.ts +0 -126
  199. package/template/workers/dev-team/backend-dev/tsconfig.json +0 -19
  200. package/template/workers/dev-team/backend-dev/worker.yaml +0 -128
  201. package/template/workers/dev-team/code-reviewer/package-lock.json +0 -1080
  202. package/template/workers/dev-team/code-reviewer/package.json +0 -24
  203. package/template/workers/dev-team/code-reviewer/skills/merge-to-production.md +0 -61
  204. package/template/workers/dev-team/code-reviewer/skills/merge-to-staging.md +0 -54
  205. package/template/workers/dev-team/code-reviewer/skills/request-changes.md +0 -63
  206. package/template/workers/dev-team/code-reviewer/skills/review-pr.md +0 -77
  207. package/template/workers/dev-team/code-reviewer/src/index.ts +0 -56
  208. package/template/workers/dev-team/code-reviewer/src/mcp-server.ts +0 -101
  209. package/template/workers/dev-team/code-reviewer/tsconfig.json +0 -19
  210. package/template/workers/dev-team/code-reviewer/worker.yaml +0 -90
  211. package/template/workers/dev-team/database-dev/package.json +0 -22
  212. package/template/workers/dev-team/database-dev/skills/create-schema.md +0 -48
  213. package/template/workers/dev-team/database-dev/src/index.ts +0 -50
  214. package/template/workers/dev-team/database-dev/src/mcp-server.ts +0 -76
  215. package/template/workers/dev-team/database-dev/tsconfig.json +0 -18
  216. package/template/workers/dev-team/database-dev/worker.yaml +0 -90
  217. package/template/workers/dev-team/frontend-dev/package.json +0 -22
  218. package/template/workers/dev-team/frontend-dev/skills/create-component.md +0 -26
  219. package/template/workers/dev-team/frontend-dev/src/index.ts +0 -50
  220. package/template/workers/dev-team/frontend-dev/src/mcp-server.ts +0 -77
  221. package/template/workers/dev-team/frontend-dev/tsconfig.json +0 -18
  222. package/template/workers/dev-team/frontend-dev/worker.yaml +0 -132
  223. package/template/workers/dev-team/infra-dev/package.json +0 -24
  224. package/template/workers/dev-team/infra-dev/skills/add-monitoring.md +0 -73
  225. package/template/workers/dev-team/infra-dev/skills/configure-deployment.md +0 -80
  226. package/template/workers/dev-team/infra-dev/skills/create-dockerfile.md +0 -62
  227. package/template/workers/dev-team/infra-dev/skills/setup-cicd.md +0 -63
  228. package/template/workers/dev-team/infra-dev/src/index.ts +0 -55
  229. package/template/workers/dev-team/infra-dev/src/mcp-server.ts +0 -82
  230. package/template/workers/dev-team/infra-dev/tsconfig.json +0 -19
  231. package/template/workers/dev-team/infra-dev/worker.yaml +0 -92
  232. package/template/workers/dev-team/knowledge-curator/package.json +0 -24
  233. package/template/workers/dev-team/knowledge-curator/skills/curate-troubleshooting.md +0 -63
  234. package/template/workers/dev-team/knowledge-curator/skills/process-learnings.md +0 -61
  235. package/template/workers/dev-team/knowledge-curator/skills/sync-documentation.md +0 -76
  236. package/template/workers/dev-team/knowledge-curator/skills/update-patterns.md +0 -63
  237. package/template/workers/dev-team/knowledge-curator/src/index.ts +0 -53
  238. package/template/workers/dev-team/knowledge-curator/src/mcp-server.ts +0 -92
  239. package/template/workers/dev-team/knowledge-curator/tsconfig.json +0 -19
  240. package/template/workers/dev-team/knowledge-curator/worker.yaml +0 -80
  241. package/template/workers/dev-team/motion-designer/package.json +0 -22
  242. package/template/workers/dev-team/motion-designer/skills/add-animation.md +0 -25
  243. package/template/workers/dev-team/motion-designer/skills/generate-image.md +0 -36
  244. package/template/workers/dev-team/motion-designer/src/index.ts +0 -63
  245. package/template/workers/dev-team/motion-designer/src/mcp-server.ts +0 -79
  246. package/template/workers/dev-team/motion-designer/tsconfig.json +0 -18
  247. package/template/workers/dev-team/motion-designer/worker.yaml +0 -84
  248. package/template/workers/dev-team/product-planner/queue.json +0 -4
  249. package/template/workers/dev-team/product-planner/worker.yaml +0 -220
  250. package/template/workers/dev-team/project-manager/package-lock.json +0 -1252
  251. package/template/workers/dev-team/project-manager/package.json +0 -27
  252. package/template/workers/dev-team/project-manager/skills/create-prd.md +0 -66
  253. package/template/workers/dev-team/project-manager/skills/next-issue.md +0 -51
  254. package/template/workers/dev-team/project-manager/skills/project-status.md +0 -59
  255. package/template/workers/dev-team/project-manager/skills/update-learnings.md +0 -65
  256. package/template/workers/dev-team/project-manager/src/index.ts +0 -54
  257. package/template/workers/dev-team/project-manager/src/mcp-server.ts +0 -207
  258. package/template/workers/dev-team/project-manager/src/skills/create-prd.ts +0 -86
  259. package/template/workers/dev-team/project-manager/src/skills/next-issue.ts +0 -137
  260. package/template/workers/dev-team/project-manager/src/skills/project-status.ts +0 -131
  261. package/template/workers/dev-team/project-manager/src/skills/update-learnings.ts +0 -94
  262. package/template/workers/dev-team/project-manager/tsconfig.json +0 -19
  263. package/template/workers/dev-team/project-manager/worker.yaml +0 -96
  264. package/template/workers/dev-team/qa-tester/package.json +0 -24
  265. package/template/workers/dev-team/qa-tester/skills/create-demo-account.md +0 -36
  266. package/template/workers/dev-team/qa-tester/skills/run-tests.md +0 -36
  267. package/template/workers/dev-team/qa-tester/skills/write-test.md +0 -27
  268. package/template/workers/dev-team/qa-tester/src/index.ts +0 -61
  269. package/template/workers/dev-team/qa-tester/src/mcp-server.ts +0 -88
  270. package/template/workers/dev-team/qa-tester/tsconfig.json +0 -18
  271. package/template/workers/dev-team/qa-tester/worker.yaml +0 -116
  272. package/template/workers/dev-team/task-executor/package-lock.json +0 -1252
  273. package/template/workers/dev-team/task-executor/package.json +0 -27
  274. package/template/workers/dev-team/task-executor/skills/analyze-issue.md +0 -101
  275. package/template/workers/dev-team/task-executor/skills/execute.md +0 -133
  276. package/template/workers/dev-team/task-executor/skills/report-learnings.md +0 -106
  277. package/template/workers/dev-team/task-executor/skills/validate-completion.md +0 -121
  278. package/template/workers/dev-team/task-executor/src/index.ts +0 -54
  279. package/template/workers/dev-team/task-executor/src/mcp-server.ts +0 -139
  280. package/template/workers/dev-team/task-executor/src/skills/analyze-issue.ts +0 -219
  281. package/template/workers/dev-team/task-executor/src/skills/execute.ts +0 -132
  282. package/template/workers/dev-team/task-executor/src/skills/report-learnings.ts +0 -119
  283. package/template/workers/dev-team/task-executor/src/skills/validate-completion.ts +0 -142
  284. package/template/workers/dev-team/task-executor/tsconfig.json +0 -19
  285. package/template/workers/dev-team/task-executor/worker.yaml +0 -110
  286. package/template/workers/registry.yaml +0 -171
  287. package/template/workers/security-scanner/README.md +0 -73
  288. package/template/workers/security-scanner/skills/pre-deploy-check.md +0 -205
  289. package/template/workers/security-scanner/worker.yaml +0 -26
  290. package/template/workspace/checkpoints/.gitkeep +0 -0
  291. package/template/workspace/content-ideas/inbox.jsonl +0 -0
  292. package/template/workspace/drafts/.gitkeep +0 -0
  293. package/template/workspace/learnings/.gitkeep +0 -3
  294. package/template/workspace/orchestrator/.gitkeep +0 -0
  295. package/template/workspace/ralph-test/COMPLETE.md +0 -18
  296. package/template/workspace/ralph-test/hello.txt +0 -2
  297. package/template/workspace/reports/.gitkeep +0 -0
  298. package/template/workspace/scratch/.gitkeep +0 -0
  299. package/template/workspace/threads/.gitkeep +0 -3
@@ -1,348 +0,0 @@
1
- ---
2
- description: Run a project through the Ralph loop - orchestrator for multi-task execution
3
- allowed-tools: Task, Read, Write, Glob, Grep, Bash, AskUserQuestion
4
- argument-hint: [project-name] or [--resume project] or [--status]
5
- visibility: public
6
- ---
7
-
8
- # /run-project - Project Orchestrator Loop
9
-
10
- Ralph loop with fresh context per task. The orchestrator is an ultra-lean state machine — it delegates each task entirely to a sub-agent via `/execute-task`, receiving only a structured summary back. Each task gets clean context; nothing accumulates.
11
-
12
- **Arguments:** $ARGUMENTS
13
-
14
- ## Core Pattern (Ralph Fresh-Context)
15
-
16
- The orchestrator is an **ultra-lean state machine**. It picks tasks and delegates each one entirely to a sub-agent via `/execute-task`. The orchestrator:
17
- - Selects the next incomplete task from the PRD
18
- - Spawns ONE sub-agent per task (fresh context per task)
19
- - Receives only a structured JSON summary back
20
- - Updates state.json and progress.txt
21
- - Never accumulates worker outputs, handoff blobs, or implementation details
22
-
23
- Classification, worker selection, worker pipelines, PRD updates, and learning capture all happen inside the sub-agent. This mirrors Pure Ralph's fresh-terminal-per-task model.
24
-
25
- ## Usage
26
-
27
- ```bash
28
- /run-project campaign-migration # Start new
29
- /run-project --resume campaign-migration # Resume paused
30
- /run-project --status # Check all projects
31
- ```
32
-
33
- ## Process
34
-
35
- ### 1. Parse Arguments
36
-
37
- **If `--status`:**
38
- - Scan `workspace/orchestrator/*/state.json`
39
- - Display all project statuses
40
- - Exit
41
-
42
- **If `--resume {project}` (first-class operation — not a fallback):**
43
- - Load state from `workspace/orchestrator/{project}/state.json`
44
- - Read PRD to find next incomplete task
45
- - Continue from next incomplete + unblocked task
46
- - The orchestrator starts with ZERO accumulated context — only state.json + PRD
47
- - If a task was mid-pipeline (has execution state with incomplete phases), `/execute-task` will resume from the incomplete phase inside its sub-agent
48
-
49
- **If `{project}`:**
50
- - Check `projects/{project}/prd.json` exists
51
- - If prd.json **MISSING**: STOP immediately. Do not fall back to README.md.
52
- ```
53
- ERROR: projects/{project}/prd.json not found.
54
-
55
- /run-project requires prd.json (not README.md).
56
- Fix: Run /prd {project} to generate prd.json.
57
- ```
58
- - If prd.json **EXISTS**: validate structure (see Step 2)
59
- - Check if state.json exists (offer resume or restart)
60
- - Initialize fresh state if new
61
-
62
- ### 2. Load Project
63
-
64
- Read and validate `projects/{project}/prd.json`:
65
- ```javascript
66
- const prd = JSON.parse(read(`projects/${project}/prd.json`))
67
-
68
- // Strict: userStories required. No fallback.
69
- const stories = prd.userStories
70
- if (!stories || !Array.isArray(stories) || stories.length === 0) {
71
- STOP: "prd.json has no userStories array (or it's empty). Migrate legacy 'features' key to 'userStories'."
72
- }
73
-
74
- // Validate each story has required fields
75
- for (const story of stories) {
76
- const required = ['id', 'title', 'description', 'passes']
77
- const missing = required.filter(f => !(f in story))
78
- if (missing.length > 0) {
79
- STOP: `Story ${story.id || '?'} missing fields: ${missing.join(', ')}`
80
- }
81
- }
82
-
83
- const total = stories.length
84
- const completed = stories.filter(s => s.passes).length
85
- const remaining = stories.filter(s => !s.passes)
86
- ```
87
-
88
- ### 3. Display Status
89
-
90
- ```
91
- Project: {project}
92
- Progress: {completed}/{total} ({percentage}%)
93
-
94
- Remaining:
95
- 1. {id}: {title} (next)
96
- 2. {id}: {title}
97
-
98
- Continue? [Y/n]
99
- ```
100
-
101
- ### 4. Initialize/Load State
102
-
103
- ```bash
104
- mkdir -p workspace/orchestrator/{project}/executions
105
- ```
106
-
107
- Write `workspace/orchestrator/{project}/state.json`:
108
- ```json
109
- {
110
- "project": "{project}",
111
- "prd_path": "projects/{project}/prd.json",
112
- "status": "in_progress",
113
- "started_at": "{ISO8601}",
114
- "updated_at": "{ISO8601}",
115
- "progress": { "total": 0, "completed": 0, "failed": 0, "in_progress": 0 },
116
- "current_task": null,
117
- "completed_tasks": [],
118
- "retries": 0
119
- }
120
- ```
121
-
122
- ### 5. The Loop
123
-
124
- The orchestrator is an **ultra-lean state machine**. It picks tasks and delegates everything to sub-agents. Classification, worker selection, worker pipelines, PRD updates, and learning capture all happen inside the sub-agent via `/execute-task`. The orchestrator NEVER accumulates implementation context.
125
-
126
- ```
127
- while (remaining tasks with passes: false):
128
-
129
- 5a. SELECT next task
130
- - Priority order from PRD
131
- - Respect dependsOn (skip if deps incomplete)
132
- - First incomplete + unblocked task
133
-
134
- Report:
135
- ```
136
- Next: {task.id} - {task.title}
137
- Progress: {completed}/{total}
138
- ```
139
-
140
- 5b. EXECUTE task via sub-agent
141
-
142
- Spawn a SINGLE sub-agent for the entire task.
143
- The sub-agent handles classification, worker selection,
144
- the full worker pipeline, PRD update, execution state,
145
- and learning capture — all via /execute-task.
146
-
147
- Task({
148
- subagent_type: "general-purpose",
149
- description: "Execute {task.id}: {task.title}",
150
- prompt: "Run /execute-task {project}/{task.id}
151
-
152
- After completion, output ONLY this structured JSON:
153
- {
154
- \"task_id\": \"{task.id}\",
155
- \"status\": \"completed|failed|blocked\",
156
- \"summary\": \"1-sentence summary\",
157
- \"workers_used\": [\"list\"],
158
- \"back_pressure\": {
159
- \"tests\": \"pass|fail|skipped\",
160
- \"lint\": \"pass|fail|skipped\",
161
- \"typecheck\": \"pass|fail|skipped\",
162
- \"build\": \"pass|fail|skipped\"
163
- }
164
- }"
165
- })
166
-
167
- The sub-agent's full context (worker outputs, handoff blobs,
168
- file diffs, error traces) is freed when it returns.
169
- Only the structured JSON crosses the boundary.
170
-
171
- 5c. POST-TASK (orchestrator side — minimal)
172
-
173
- Parse the sub-agent's JSON output.
174
-
175
- i. If status == "completed":
176
- - Update state.json:
177
- completed_tasks.push({id, completed_at, workers_used})
178
- progress.completed++
179
- current_task = null
180
- - Log 1-line to progress.txt:
181
- [{timestamp}] {task.id}: {summary} ({completed}/{total})
182
-
183
- ii. If status == "failed" or "blocked":
184
- - Log error
185
- - AskUserQuestion:
186
- 1. Retry this task
187
- 2. Skip and continue
188
- 3. Pause project (run /run-project --resume {project})
189
-
190
- iv. Update `workspace/orchestrator/INDEX.md` with new progress.
191
-
192
- v. DISCARD everything else.
193
- The orchestrator MUST NOT store worker outputs,
194
- handoff blobs, file lists, or error traces.
195
- Only retain: task_id, status, 1-sentence summary.
196
-
197
- 5c.5 AUTO-REANCHOR (between tasks, silent)
198
-
199
- After processing each task result, refresh context:
200
- 1. Re-read PRD from disk (sub-agent may have updated passes/notes)
201
- 2. Refresh git state: `git log --oneline -3`
202
- 3. If task failed: search for known fixes via `qmd vsearch "{error}" --json -n 5`
203
- (searches across all knowledge, worker yamls, and command files)
204
- 4. Re-read CLAUDE.md `## Learned Rules`
205
- (another session may have added rules via /learn)
206
-
207
- This is silent — no user interaction. Prevents stale context
208
- between tasks, especially for multi-session projects.
209
-
210
- 5d. CONTEXT SAFETY NET
211
-
212
- If > 10 tasks completed this session OR context heavy:
213
- - Save state.json
214
- - Print: "Context boundary reached. Run: /run-project --resume {project}"
215
- - STOP
216
-
217
- This rarely triggers because each task sub-agent releases
218
- its context. But it provides a hard ceiling.
219
- ```
220
-
221
- ### 6. Handle Task Failure
222
-
223
- If any worker phase fails after retry:
224
-
225
- ```
226
- Phase {N} ({worker}) failed for {task.id}
227
-
228
- Error: {details}
229
- Attempts: {count}
230
-
231
- Options:
232
- 1. Retry this worker phase
233
- 2. Skip worker, continue pipeline
234
- 3. Pause project (/run-project --resume {project})
235
- 4. Abort
236
- ```
237
-
238
- Use AskUserQuestion.
239
-
240
- ### 7. Complete Project
241
-
242
- When all stories have `passes: true`:
243
-
244
- **Generate report:**
245
- ```
246
- Project Complete: {project}
247
-
248
- Tasks: {completed}/{total}
249
- Workers Used: {worker}: {N} tasks, ...
250
- Learnings: {count}
251
- ```
252
-
253
- **Aggregate learnings:**
254
- 1. Scan Tier 3 logs: `workspace/learnings/learn-*.json` matching this project
255
- 2. Identify repeated patterns (same rule triggered 3+ times across tasks)
256
- 3. Promote repeated patterns to Tier 1 via `/learn` (severity: high, source: pattern-repetition)
257
- 4. Write project retrospective to `workspace/reports/{project}-retro.md`
258
-
259
- **Update state:** `status: "completed"`, `completed_at: "{ISO8601}"`
260
-
261
- **Update INDEX.md files:** Regenerate `projects/INDEX.md` and `workspace/orchestrator/INDEX.md` per `knowledge/public/hq-core/index-md-spec.md`.
262
-
263
- ### 8. Status Display (--status)
264
-
265
- ```
266
- Project Status
267
-
268
- ACTIVE:
269
- campaign-migration — 5/11 (45%) — backend-dev phase on CAM-006
270
-
271
- PAUSED:
272
- (none)
273
-
274
- COMPLETED:
275
- user-auth (3d ago) — 8/8
276
- ```
277
-
278
- ## Worker Pipeline Reference
279
-
280
- | Task Type | Worker Sequence |
281
- |-----------|----------------|
282
- | schema_change | database-dev → backend-dev → code-reviewer → dev-qa-tester |
283
- | api_development | backend-dev → code-reviewer → dev-qa-tester |
284
- | ui_component | frontend-dev → motion-designer → code-reviewer → dev-qa-tester |
285
- | full_stack | architect → database-dev → backend-dev → frontend-dev → code-reviewer → dev-qa-tester |
286
- | content | content-brand → content-product → content-sales → content-legal |
287
- | enhancement | (relevant dev) → code-reviewer |
288
-
289
- Prepend **product-planner** if task spec is unclear or acceptance criteria are vague.
290
-
291
- ## Handoff Context Format
292
-
293
- ```json
294
- {
295
- "from_worker": "backend-dev",
296
- "to_worker": "code-reviewer",
297
- "timestamp": "ISO8601",
298
- "summary": "What was accomplished",
299
- "files_created": ["src/services/foo.ts"],
300
- "files_modified": ["src/index.ts"],
301
- "key_decisions": ["Used strategy pattern"],
302
- "context_for_next": "Focus review on cache invalidation",
303
- "back_pressure": { "tests": "pass", "lint": "pass", "typecheck": "pass" }
304
- }
305
- ```
306
-
307
- ## State File Format
308
-
309
- `workspace/orchestrator/{project}/state.json`:
310
- ```json
311
- {
312
- "project": "campaign-migration",
313
- "prd_path": "projects/campaign-migration/prd.json",
314
- "status": "in_progress|paused|completed",
315
- "started_at": "ISO8601",
316
- "updated_at": "ISO8601",
317
- "progress": { "total": 11, "completed": 5, "failed": 0, "in_progress": 1 },
318
- "current_task": {
319
- "id": "CAM-006",
320
- "started_at": "ISO8601",
321
- "phase": 2,
322
- "worker": "backend-dev"
323
- },
324
- "completed_tasks": [
325
- { "id": "CAM-001", "completed_at": "ISO8601", "workers_used": ["backend-dev", "code-reviewer"] }
326
- ],
327
- "retries": 0
328
- }
329
- ```
330
-
331
- ## Rules
332
-
333
- - **ONE project at a time**
334
- - **Sub-agent per task** — each task runs in its own Task() sub-agent via `/execute-task`. The orchestrator NEVER executes worker phases directly.
335
- - **Context discipline** — the orchestrator stores ONLY task_id, status, and 1-sentence summary per task. No worker outputs, no handoff blobs, no file lists.
336
- - **Fresh context per task** — sub-agent context is freed when it returns.
337
- - **Resume is first-class** — `--resume` is how multi-session projects continue. Not a fallback — the expected path for large projects.
338
- - **Back pressure is mandatory** — enforced inside `/execute-task`, not by the orchestrator
339
- - **Fail fast** — pause on errors, surface to user
340
- - **prd.json is required** — never read or fall back to README.md
341
- - **Validate prd.json on load** — fail loudly on missing/malformed fields
342
-
343
- ## Integration
344
-
345
- - `/prd` → creates PRD → `/run-project {name}` executes it
346
- - `/execute-task {project}/{id}` → runs single task with same pipeline (standalone or as sub-agent)
347
- - `/run-project --resume` → continues from next incomplete task with fresh context
348
- - `/nexttask` → shows active projects from /run-project
@@ -1,110 +0,0 @@
1
- ---
2
- description: Run a worker or list available workers
3
- allowed-tools: Task, Read, Glob, Grep, Bash, Edit, Write, WebSearch, WebFetch, AskUserQuestion
4
- argument-hint: [worker-id] [skill] [args]
5
- visibility: public
6
- ---
7
-
8
- # /run - Worker Execution
9
-
10
- Unified interface to run workers and their skills.
11
-
12
- **Usage:**
13
- ```
14
- /run # List available workers
15
- /run {worker-id} # Show worker skills
16
- /run {worker-id} {skill} # Run specific skill
17
- /run {worker-id} {skill} arg # Run with argument
18
- ```
19
-
20
- **User's input:** $ARGUMENTS
21
-
22
- ## Process
23
-
24
- ### No Arguments → List Workers
25
-
26
- If no arguments provided, read `workers/registry.yaml` and display:
27
-
28
- ```
29
- Available Workers:
30
-
31
- x-{your-name} X/Twitter posting
32
- cfo-{company} Financial reporting
33
- {company}-analyst Data analysis
34
- ...
35
-
36
- Usage: /run {worker-id} to see skills
37
- ```
38
-
39
- ### Worker ID Only → Show Skills
40
-
41
- If only worker-id provided:
42
- 1. Find worker in registry
43
- 2. Read `workers/{worker-path}/worker.yaml`
44
- 3. List available skills
45
-
46
- ```
47
- Worker: x-{your-name}
48
- Description: X/Twitter posting
49
-
50
- Skills:
51
- contentidea Build out a content idea into posts
52
- suggestposts Research and suggest posts
53
- scheduleposts Choose what to post now
54
-
55
- Usage: /run x-{your-name} {skill}
56
- ```
57
-
58
- ### Worker + Skill → Execute
59
-
60
- 1. Load worker context from `workers/{path}/`
61
- 2. Load skill definition from `workers/{path}/skills/{skill}.md`
62
- 3. Execute the skill instructions
63
- 4. Write checkpoint after completion
64
-
65
- ### Worker + Skill + Args → Execute with Args
66
-
67
- Pass arguments to the skill. The skill file will reference `$ARGUMENTS`.
68
-
69
- ## Execution Pattern
70
-
71
- When executing a skill:
72
- 1. **Load context** - Read worker.yaml (includes accumulated learnings in `instructions:`), any knowledge files referenced
73
- 2. **Execute** - Follow the skill's instructions
74
- 3. **Verify** - Run any verification steps defined
75
- 4. **PostToolsHook** - Auto-save thread to `workspace/threads/`
76
-
77
- ### PostToolsHook (Auto-Checkpoint)
78
-
79
- After skill completion, automatically create a thread:
80
-
81
- ```json
82
- {
83
- "thread_id": "T-{YYYYMMDD}-{HHMMSS}-{worker}-{skill}",
84
- "worker": { "id": "{worker-id}", "skill": "{skill}", "state": "completed" },
85
- "git": { /* capture current git state */ },
86
- "conversation_summary": "What was accomplished",
87
- "files_touched": ["files created/modified"],
88
- "metadata": { "tags": ["{worker-id}", "{skill}"] }
89
- }
90
- ```
91
-
92
- Write to: `workspace/threads/{thread_id}.json`
93
-
94
- Also append to metrics: `workspace/metrics/metrics.jsonl`
95
-
96
- ## Examples
97
-
98
- ```
99
- /run # See all workers
100
- /run x-{your-name} # See skills
101
- /run x-{your-name} contentidea # Run contentidea
102
- /run x-{your-name} contentidea "AI workforce" # Run with topic
103
- /run cfo-{company} mrr # Run MRR report
104
- ```
105
-
106
- ## Notes
107
-
108
- - Mode (work vs build) is determined by what the skill does, not declared upfront
109
- - Workers have scoped permissions - only tools listed in their worker.yaml
110
- - Skills can reference knowledge bases and other workers
@@ -1,62 +0,0 @@
1
- ---
2
- description: Reindex and re-embed HQ for qmd search
3
- allowed-tools: Bash
4
- argument-hint: [--force]
5
- visibility: public
6
- ---
7
-
8
- # /search-reindex - Rebuild Search Index
9
-
10
- Re-index and re-embed HQ content for qmd search.
11
-
12
- **Args:** $ARGUMENTS
13
-
14
- ## Process
15
-
16
- ### 1. Update index (re-scan files)
17
- ```bash
18
- qmd update
19
- ```
20
-
21
- ### 2. Re-embed
22
-
23
- If `--force` in $ARGUMENTS:
24
- ```bash
25
- qmd embed -f
26
- ```
27
-
28
- Otherwise (incremental — only new/changed files):
29
- ```bash
30
- qmd embed
31
- ```
32
-
33
- ### 3. Show status
34
- ```bash
35
- qmd status
36
- ```
37
-
38
- Display collection stats, document count, embedding coverage.
39
-
40
- ## When to Reindex
41
-
42
- Run after:
43
- - Adding new knowledge bases or company docs
44
- - Creating new workers or skills
45
- - Generating reports or content
46
- - Major workspace changes
47
-
48
- ## Full Reset
49
-
50
- To completely rebuild:
51
- ```bash
52
- qmd cleanup
53
- qmd collection add ~/Documents/HQ --name hq --mask "**/*.md"
54
- qmd context add qmd://hq "HQ knowledge base: company knowledge, AI worker definitions, project PRDs, slash commands, reports, social drafts, and session threads."
55
- qmd context add qmd://hq/knowledge "HQ-level knowledge bases: Ralph coding methodology, worker framework patterns, dev-team practices, design styles, security framework, project templates."
56
- qmd context add qmd://hq/.claude/commands "Claude Code slash commands: agent skills for session management, worker execution, project management, content creation, design, deployment."
57
- qmd context add qmd://hq/companies "Company-scoped directories (your companies -- configure in companies/ dir) each with knowledge bases, settings, and data."
58
- qmd context add qmd://hq/workers "AI worker definitions with YAML configs and skill markdown files. Top-level ops workers, 12-person dev-team, 5-person content team."
59
- qmd context add qmd://hq/projects "Project PRDs and READMEs for active and planned projects across all companies."
60
- qmd context add qmd://hq/workspace "Runtime workspace: session threads, checkpoints, orchestrator state, reports, social drafts, content ideas, metrics."
61
- qmd embed
62
- ```
@@ -1,100 +0,0 @@
1
- ---
2
- description: Search across HQ (qmd-powered semantic + full-text)
3
- allowed-tools: Bash, Read
4
- argument-hint: <query> [--mode search|vsearch|query] [-n count] [--full]
5
- visibility: public
6
- ---
7
-
8
- # /search - HQ Search (qmd)
9
-
10
- Semantic + full-text search across all HQ content using qmd.
11
-
12
- **Query:** $ARGUMENTS
13
-
14
- ## Parse Arguments
15
-
16
- Extract from $ARGUMENTS:
17
- - `query` — search text (everything except flags)
18
- - `--mode` — `search` (BM25), `vsearch` (semantic), `query` (hybrid). Default: `search`
19
- - `-n` — result count (default: 10)
20
- - `--full` — show full content of top result
21
-
22
- ## Execute Search
23
-
24
- Run the matching qmd command:
25
-
26
- **Default (BM25 full-text):**
27
- ```bash
28
- qmd search "$QUERY" -n 10 --json
29
- ```
30
-
31
- **Semantic (conceptual match):**
32
- ```bash
33
- qmd vsearch "$QUERY" -n 10 --json
34
- ```
35
-
36
- **Hybrid (BM25 + vector + re-rank):**
37
- ```bash
38
- qmd query "$QUERY" -n 10 --json
39
- ```
40
-
41
- ## Display Results
42
-
43
- Parse JSON output. Display:
44
-
45
- ```
46
- Search: "{query}" (mode: {mode})
47
-
48
- Results:
49
- 1. [0.92] knowledge/public/Ralph/02-core-concepts.md
50
- "Ralph methodology emphasizes small loops with human checkpoints..."
51
-
52
- 2. [0.84] .claude/commands/run-project.md
53
- "Run a project through the Ralph loop..."
54
-
55
- 3. [0.71] workers/public/dev-team/architect/skills/design-review.md
56
- "Architecture review following Ralph back-pressure patterns..."
57
-
58
- {n} results. Use --full to show top result content.
59
- ```
60
-
61
- - Score in brackets
62
- - Relative path (strip `qmd://hq/` prefix)
63
- - Snippet truncated to ~100 chars
64
-
65
- ## Full Content
66
-
67
- If `--full` flag, after listing results, read top result file with Read tool.
68
-
69
- ## Fallback
70
-
71
- If qmd errors or isn't installed:
72
-
73
- ```bash
74
- grep -rl "$QUERY" ~/Documents/HQ/knowledge/ \
75
- ~/Documents/HQ/companies/ \
76
- ~/Documents/HQ/workers/ \
77
- ~/Documents/HQ/.claude/commands/ \
78
- ~/Documents/HQ/workspace/ 2>/dev/null | head -20
79
- ```
80
-
81
- Display: "qmd unavailable, falling back to grep"
82
-
83
- ## Examples
84
-
85
- ```bash
86
- /search ralph # BM25 keyword search (default)
87
- /search "how do workers execute" --mode vsearch # Semantic
88
- /search acme brand --mode query # Hybrid with re-ranking
89
- /search stripe -n 20 # More results
90
- /search authentication --full # Show top match content
91
- ```
92
-
93
- ## Notes
94
-
95
- - Default `search` mode is fastest — use for exact keywords
96
- - Use `--mode vsearch` for conceptual/semantic queries
97
- - Use `--mode query` for highest quality (slower, uses LLM re-ranking)
98
- - Scores 0.0-1.0; above 0.5 is a good match
99
- - Run `/search-reindex` after adding new content
100
- - For code search in repos, use Grep tool directly