@josstei/maestro 1.6.4-rc.1

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 (655) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/CHANGELOG.md +485 -0
  3. package/EXAMPLES.md +255 -0
  4. package/GEMINI.md +231 -0
  5. package/LICENSE +201 -0
  6. package/QWEN.md +241 -0
  7. package/README.md +220 -0
  8. package/agents/accessibility_specialist.md +20 -0
  9. package/agents/analytics_engineer.md +22 -0
  10. package/agents/api_designer.md +19 -0
  11. package/agents/architect.md +19 -0
  12. package/agents/cloud_architect.md +19 -0
  13. package/agents/cobol_engineer.md +22 -0
  14. package/agents/code_reviewer.md +17 -0
  15. package/agents/coder.md +22 -0
  16. package/agents/compliance_reviewer.md +19 -0
  17. package/agents/content_strategist.md +19 -0
  18. package/agents/copywriter.md +19 -0
  19. package/agents/data_engineer.md +22 -0
  20. package/agents/database_administrator.md +21 -0
  21. package/agents/db2_dba.md +21 -0
  22. package/agents/debugger.md +19 -0
  23. package/agents/design_system_engineer.md +22 -0
  24. package/agents/devops_engineer.md +23 -0
  25. package/agents/hlasm_assembler_specialist.md +22 -0
  26. package/agents/i18n_specialist.md +21 -0
  27. package/agents/ibm_i_specialist.md +22 -0
  28. package/agents/integration_engineer.md +23 -0
  29. package/agents/ml_engineer.md +23 -0
  30. package/agents/mlops_engineer.md +23 -0
  31. package/agents/mobile_engineer.md +23 -0
  32. package/agents/observability_engineer.md +23 -0
  33. package/agents/performance_engineer.md +21 -0
  34. package/agents/platform_engineer.md +24 -0
  35. package/agents/product_manager.md +20 -0
  36. package/agents/prompt_engineer.md +22 -0
  37. package/agents/refactor.md +22 -0
  38. package/agents/release_manager.md +22 -0
  39. package/agents/security_engineer.md +21 -0
  40. package/agents/seo_specialist.md +21 -0
  41. package/agents/site_reliability_engineer.md +21 -0
  42. package/agents/solutions_architect.md +19 -0
  43. package/agents/technical_writer.md +21 -0
  44. package/agents/tester.md +23 -0
  45. package/agents/ux_designer.md +20 -0
  46. package/agents/zos_sysprog.md +21 -0
  47. package/bin/maestro-mcp-server.js +10 -0
  48. package/claude/.claude-plugin/plugin.json +21 -0
  49. package/claude/.mcp.json +11 -0
  50. package/claude/README.md +191 -0
  51. package/claude/agents/accessibility-specialist.md +36 -0
  52. package/claude/agents/analytics-engineer.md +38 -0
  53. package/claude/agents/api-designer.md +33 -0
  54. package/claude/agents/architect.md +33 -0
  55. package/claude/agents/cloud-architect.md +33 -0
  56. package/claude/agents/cobol-engineer.md +38 -0
  57. package/claude/agents/code-reviewer.md +31 -0
  58. package/claude/agents/coder.md +38 -0
  59. package/claude/agents/compliance-reviewer.md +33 -0
  60. package/claude/agents/content-strategist.md +33 -0
  61. package/claude/agents/copywriter.md +33 -0
  62. package/claude/agents/data-engineer.md +37 -0
  63. package/claude/agents/database-administrator.md +37 -0
  64. package/claude/agents/db2-dba.md +37 -0
  65. package/claude/agents/debugger.md +32 -0
  66. package/claude/agents/design-system-engineer.md +38 -0
  67. package/claude/agents/devops-engineer.md +39 -0
  68. package/claude/agents/hlasm-assembler-specialist.md +38 -0
  69. package/claude/agents/i18n-specialist.md +37 -0
  70. package/claude/agents/ibm-i-specialist.md +38 -0
  71. package/claude/agents/integration-engineer.md +39 -0
  72. package/claude/agents/ml-engineer.md +39 -0
  73. package/claude/agents/mlops-engineer.md +39 -0
  74. package/claude/agents/mobile-engineer.md +39 -0
  75. package/claude/agents/observability-engineer.md +39 -0
  76. package/claude/agents/performance-engineer.md +34 -0
  77. package/claude/agents/platform-engineer.md +40 -0
  78. package/claude/agents/product-manager.md +34 -0
  79. package/claude/agents/prompt-engineer.md +38 -0
  80. package/claude/agents/refactor.md +38 -0
  81. package/claude/agents/release-manager.md +38 -0
  82. package/claude/agents/security-engineer.md +37 -0
  83. package/claude/agents/seo-specialist.md +37 -0
  84. package/claude/agents/site-reliability-engineer.md +37 -0
  85. package/claude/agents/solutions-architect.md +33 -0
  86. package/claude/agents/technical-writer.md +37 -0
  87. package/claude/agents/tester.md +39 -0
  88. package/claude/agents/ux-designer.md +34 -0
  89. package/claude/agents/zos-sysprog.md +37 -0
  90. package/claude/hooks/claude-hooks.json +48 -0
  91. package/claude/mcp/maestro-server.js +9 -0
  92. package/claude/mcp-config.example.json +9 -0
  93. package/claude/scripts/adapters/claude-adapter.js +7 -0
  94. package/claude/scripts/hook-runner.js +8 -0
  95. package/claude/scripts/policy-enforcer.js +294 -0
  96. package/claude/skills/a11y-audit/SKILL.md +26 -0
  97. package/claude/skills/archive/SKILL.md +24 -0
  98. package/claude/skills/code-review/SKILL.md +7 -0
  99. package/claude/skills/compliance-check/SKILL.md +26 -0
  100. package/claude/skills/debug-workflow/SKILL.md +27 -0
  101. package/claude/skills/delegation/SKILL.md +7 -0
  102. package/claude/skills/design-dialogue/SKILL.md +7 -0
  103. package/claude/skills/execute/SKILL.md +38 -0
  104. package/claude/skills/execution/SKILL.md +7 -0
  105. package/claude/skills/implementation-planning/SKILL.md +7 -0
  106. package/claude/skills/orchestrate/SKILL.md +38 -0
  107. package/claude/skills/perf-check/SKILL.md +26 -0
  108. package/claude/skills/resume-session/SKILL.md +38 -0
  109. package/claude/skills/review-code/SKILL.md +27 -0
  110. package/claude/skills/security-audit/SKILL.md +28 -0
  111. package/claude/skills/seo-audit/SKILL.md +26 -0
  112. package/claude/skills/session-management/SKILL.md +7 -0
  113. package/claude/skills/status/SKILL.md +22 -0
  114. package/claude/skills/validation/SKILL.md +7 -0
  115. package/claude/src/agents/accessibility-specialist.md +163 -0
  116. package/claude/src/agents/analytics-engineer.md +182 -0
  117. package/claude/src/agents/api-designer.md +124 -0
  118. package/claude/src/agents/architect.md +120 -0
  119. package/claude/src/agents/cloud-architect.md +134 -0
  120. package/claude/src/agents/cobol-engineer.md +127 -0
  121. package/claude/src/agents/code-reviewer.md +123 -0
  122. package/claude/src/agents/coder.md +132 -0
  123. package/claude/src/agents/compliance-reviewer.md +219 -0
  124. package/claude/src/agents/content-strategist.md +111 -0
  125. package/claude/src/agents/copywriter.md +113 -0
  126. package/claude/src/agents/data-engineer.md +130 -0
  127. package/claude/src/agents/database-administrator.md +126 -0
  128. package/claude/src/agents/db2-dba.md +124 -0
  129. package/claude/src/agents/debugger.md +133 -0
  130. package/claude/src/agents/design-system-engineer.md +258 -0
  131. package/claude/src/agents/devops-engineer.md +138 -0
  132. package/claude/src/agents/hlasm-assembler-specialist.md +134 -0
  133. package/claude/src/agents/i18n-specialist.md +241 -0
  134. package/claude/src/agents/ibm-i-specialist.md +132 -0
  135. package/claude/src/agents/integration-engineer.md +133 -0
  136. package/claude/src/agents/ml-engineer.md +115 -0
  137. package/claude/src/agents/mlops-engineer.md +116 -0
  138. package/claude/src/agents/mobile-engineer.md +115 -0
  139. package/claude/src/agents/observability-engineer.md +133 -0
  140. package/claude/src/agents/performance-engineer.md +139 -0
  141. package/claude/src/agents/platform-engineer.md +129 -0
  142. package/claude/src/agents/product-manager.md +170 -0
  143. package/claude/src/agents/prompt-engineer.md +129 -0
  144. package/claude/src/agents/refactor.md +138 -0
  145. package/claude/src/agents/release-manager.md +132 -0
  146. package/claude/src/agents/security-engineer.md +143 -0
  147. package/claude/src/agents/seo-specialist.md +129 -0
  148. package/claude/src/agents/site-reliability-engineer.md +131 -0
  149. package/claude/src/agents/solutions-architect.md +137 -0
  150. package/claude/src/agents/technical-writer.md +129 -0
  151. package/claude/src/agents/tester.md +135 -0
  152. package/claude/src/agents/ux-designer.md +168 -0
  153. package/claude/src/agents/zos-sysprog.md +134 -0
  154. package/claude/src/config/setting-resolver.js +32 -0
  155. package/claude/src/core/agent-registry.js +67 -0
  156. package/claude/src/core/canonical-source.js +39 -0
  157. package/claude/src/core/env-file-parser.js +82 -0
  158. package/claude/src/core/feature-blocks.js +34 -0
  159. package/claude/src/core/logger.js +12 -0
  160. package/claude/src/core/markdown-state.js +36 -0
  161. package/claude/src/core/policy-rules.js +32 -0
  162. package/claude/src/core/project-root-resolver.js +184 -0
  163. package/claude/src/core/stdin-reader.js +77 -0
  164. package/claude/src/core/version.js +50 -0
  165. package/claude/src/entry-points/core-command-registry.js +37 -0
  166. package/claude/src/entry-points/preamble-builders.js +54 -0
  167. package/claude/src/entry-points/registry.js +199 -0
  168. package/claude/src/entry-points/templates/claude-core-command.md.tmpl +38 -0
  169. package/claude/src/entry-points/templates/claude-skill.md.tmpl +18 -0
  170. package/claude/src/entry-points/templates/codex-core-command.md.tmpl +16 -0
  171. package/claude/src/entry-points/templates/codex-skill.md.tmpl +11 -0
  172. package/claude/src/entry-points/templates/gemini-command.toml.tmpl +17 -0
  173. package/claude/src/entry-points/templates/gemini-core-command.toml.tmpl +30 -0
  174. package/claude/src/generated/agent-registry.json +630 -0
  175. package/claude/src/generated/hook-registry.json +18 -0
  176. package/claude/src/generated/resource-registry.json +16 -0
  177. package/claude/src/hooks/logic/after-agent-logic.js +54 -0
  178. package/claude/src/hooks/logic/before-agent-logic.js +57 -0
  179. package/claude/src/hooks/logic/hook-state.js +127 -0
  180. package/claude/src/hooks/logic/session-end-logic.js +17 -0
  181. package/claude/src/hooks/logic/session-start-logic.js +25 -0
  182. package/claude/src/lib/discovery/index.js +172 -0
  183. package/claude/src/lib/errors/index.js +104 -0
  184. package/claude/src/lib/framework-detection.js +50 -0
  185. package/claude/src/lib/frontmatter/index.js +262 -0
  186. package/claude/src/lib/io/index.js +96 -0
  187. package/claude/src/lib/naming/index.js +94 -0
  188. package/claude/src/lib/validation/index.js +124 -0
  189. package/claude/src/lib/yaml-emit.js +38 -0
  190. package/claude/src/mcp/content/provider.js +68 -0
  191. package/claude/src/mcp/content/runtime-content.js +188 -0
  192. package/claude/src/mcp/contracts/cache-path-rejector.js +39 -0
  193. package/claude/src/mcp/contracts/downstream-context.js +106 -0
  194. package/claude/src/mcp/contracts/plan-schema.js +148 -0
  195. package/claude/src/mcp/contracts/workspace-marker.js +61 -0
  196. package/claude/src/mcp/core/create-server.js +76 -0
  197. package/claude/src/mcp/core/line-reader.js +35 -0
  198. package/claude/src/mcp/core/project-root-cache.js +120 -0
  199. package/claude/src/mcp/core/protocol-dispatcher.js +274 -0
  200. package/claude/src/mcp/core/recovery-hints.js +43 -0
  201. package/claude/src/mcp/core/tool-outcome.js +77 -0
  202. package/claude/src/mcp/core/tool-registry.js +82 -0
  203. package/claude/src/mcp/handlers/assess-task-complexity.js +108 -0
  204. package/claude/src/mcp/handlers/blocker-parser.js +34 -0
  205. package/claude/src/mcp/handlers/design-gate.js +393 -0
  206. package/claude/src/mcp/handlers/get-agent.js +54 -0
  207. package/claude/src/mcp/handlers/get-runtime-context.js +49 -0
  208. package/claude/src/mcp/handlers/get-skill-content.js +51 -0
  209. package/claude/src/mcp/handlers/initialize-workspace.js +45 -0
  210. package/claude/src/mcp/handlers/reconciliation.js +224 -0
  211. package/claude/src/mcp/handlers/resolve-settings.js +39 -0
  212. package/claude/src/mcp/handlers/session-state-core.js +108 -0
  213. package/claude/src/mcp/handlers/session-state-tools.js +562 -0
  214. package/claude/src/mcp/handlers/validate-plan.js +76 -0
  215. package/claude/src/mcp/maestro-server.js +122 -0
  216. package/claude/src/mcp/runtime/runtime-config-map.js +70 -0
  217. package/claude/src/mcp/tool-packs/content/index.js +80 -0
  218. package/claude/src/mcp/tool-packs/contracts.js +30 -0
  219. package/claude/src/mcp/tool-packs/index.js +15 -0
  220. package/claude/src/mcp/tool-packs/session/index.js +243 -0
  221. package/claude/src/mcp/tool-packs/workspace/index.js +98 -0
  222. package/claude/src/mcp/utils/extension-root.js +31 -0
  223. package/claude/src/mcp/validation/agent-checker.js +81 -0
  224. package/claude/src/mcp/validation/dag-checker.js +214 -0
  225. package/claude/src/mcp/validation/file-overlap-checker.js +63 -0
  226. package/claude/src/mcp/validation/schema-checker.js +108 -0
  227. package/claude/src/platforms/claude/runtime-config.js +60 -0
  228. package/claude/src/platforms/shared/adapters/claude-adapter.js +36 -0
  229. package/claude/src/platforms/shared/adapters/conventions.js +29 -0
  230. package/claude/src/platforms/shared/adapters/exit-codes.js +6 -0
  231. package/claude/src/platforms/shared/adapters/factory.js +40 -0
  232. package/claude/src/platforms/shared/agent-names.js +10 -0
  233. package/claude/src/platforms/shared/hook-runner.js +52 -0
  234. package/claude/src/references/architecture.md +139 -0
  235. package/claude/src/references/orchestration-steps.md +193 -0
  236. package/claude/src/skills/shared/code-review/SKILL.md +145 -0
  237. package/claude/src/skills/shared/delegation/SKILL.md +370 -0
  238. package/claude/src/skills/shared/delegation/protocols/agent-base-protocol.md +145 -0
  239. package/claude/src/skills/shared/delegation/protocols/filesystem-safety-protocol.md +31 -0
  240. package/claude/src/skills/shared/design-dialogue/SKILL.md +284 -0
  241. package/claude/src/skills/shared/execution/SKILL.md +258 -0
  242. package/claude/src/skills/shared/implementation-planning/SKILL.md +303 -0
  243. package/claude/src/skills/shared/session-management/SKILL.md +314 -0
  244. package/claude/src/skills/shared/validation/SKILL.md +204 -0
  245. package/claude/src/state/session-state.js +113 -0
  246. package/claude/src/templates/design-document.md +95 -0
  247. package/claude/src/templates/implementation-plan.md +86 -0
  248. package/claude/src/templates/session-state.md +68 -0
  249. package/claude/src/version.json +3 -0
  250. package/commands/maestro/a11y-audit.toml +22 -0
  251. package/commands/maestro/archive.toml +23 -0
  252. package/commands/maestro/compliance-check.toml +22 -0
  253. package/commands/maestro/debug.toml +23 -0
  254. package/commands/maestro/execute.toml +30 -0
  255. package/commands/maestro/orchestrate.toml +30 -0
  256. package/commands/maestro/perf-check.toml +22 -0
  257. package/commands/maestro/resume.toml +38 -0
  258. package/commands/maestro/review.toml +23 -0
  259. package/commands/maestro/security-audit.toml +24 -0
  260. package/commands/maestro/seo-audit.toml +22 -0
  261. package/commands/maestro/status.toml +21 -0
  262. package/docs/architecture.md +310 -0
  263. package/docs/cicd.md +647 -0
  264. package/docs/flow.md +255 -0
  265. package/docs/maestro-cheatsheet.md +199 -0
  266. package/docs/overview.md +141 -0
  267. package/docs/runtime-claude.md +190 -0
  268. package/docs/runtime-codex.md +197 -0
  269. package/docs/runtime-gemini.md +170 -0
  270. package/docs/runtime-qwen.md +147 -0
  271. package/docs/usage.md +312 -0
  272. package/gemini-extension.json +55 -0
  273. package/hooks/adapters/gemini-adapter.js +2 -0
  274. package/hooks/adapters/qwen-adapter.js +2 -0
  275. package/hooks/hook-runner.js +3 -0
  276. package/hooks/hooks.json +56 -0
  277. package/mcp/maestro-server.js +4 -0
  278. package/package.json +93 -0
  279. package/plugins/maestro/.app.json +3 -0
  280. package/plugins/maestro/.codex-plugin/plugin.json +41 -0
  281. package/plugins/maestro/.mcp.json +16 -0
  282. package/plugins/maestro/README.md +57 -0
  283. package/plugins/maestro/references/runtime-guide.md +125 -0
  284. package/plugins/maestro/skills/a11y-audit/SKILL.md +16 -0
  285. package/plugins/maestro/skills/archive/SKILL.md +16 -0
  286. package/plugins/maestro/skills/code-review/SKILL.md +6 -0
  287. package/plugins/maestro/skills/compliance-check/SKILL.md +16 -0
  288. package/plugins/maestro/skills/debug-workflow/SKILL.md +16 -0
  289. package/plugins/maestro/skills/delegation/SKILL.md +6 -0
  290. package/plugins/maestro/skills/design-dialogue/SKILL.md +6 -0
  291. package/plugins/maestro/skills/execute/SKILL.md +16 -0
  292. package/plugins/maestro/skills/execution/SKILL.md +6 -0
  293. package/plugins/maestro/skills/implementation-planning/SKILL.md +6 -0
  294. package/plugins/maestro/skills/orchestrate/SKILL.md +16 -0
  295. package/plugins/maestro/skills/perf-check/SKILL.md +16 -0
  296. package/plugins/maestro/skills/resume-session/SKILL.md +16 -0
  297. package/plugins/maestro/skills/review-code/SKILL.md +16 -0
  298. package/plugins/maestro/skills/security-audit/SKILL.md +16 -0
  299. package/plugins/maestro/skills/seo-audit/SKILL.md +16 -0
  300. package/plugins/maestro/skills/session-management/SKILL.md +6 -0
  301. package/plugins/maestro/skills/status/SKILL.md +14 -0
  302. package/plugins/maestro/skills/validation/SKILL.md +6 -0
  303. package/plugins/maestro/src/agents/accessibility-specialist.md +163 -0
  304. package/plugins/maestro/src/agents/analytics-engineer.md +182 -0
  305. package/plugins/maestro/src/agents/api-designer.md +124 -0
  306. package/plugins/maestro/src/agents/architect.md +120 -0
  307. package/plugins/maestro/src/agents/cloud-architect.md +134 -0
  308. package/plugins/maestro/src/agents/cobol-engineer.md +127 -0
  309. package/plugins/maestro/src/agents/code-reviewer.md +123 -0
  310. package/plugins/maestro/src/agents/coder.md +132 -0
  311. package/plugins/maestro/src/agents/compliance-reviewer.md +219 -0
  312. package/plugins/maestro/src/agents/content-strategist.md +111 -0
  313. package/plugins/maestro/src/agents/copywriter.md +113 -0
  314. package/plugins/maestro/src/agents/data-engineer.md +130 -0
  315. package/plugins/maestro/src/agents/database-administrator.md +126 -0
  316. package/plugins/maestro/src/agents/db2-dba.md +124 -0
  317. package/plugins/maestro/src/agents/debugger.md +133 -0
  318. package/plugins/maestro/src/agents/design-system-engineer.md +258 -0
  319. package/plugins/maestro/src/agents/devops-engineer.md +138 -0
  320. package/plugins/maestro/src/agents/hlasm-assembler-specialist.md +134 -0
  321. package/plugins/maestro/src/agents/i18n-specialist.md +241 -0
  322. package/plugins/maestro/src/agents/ibm-i-specialist.md +132 -0
  323. package/plugins/maestro/src/agents/integration-engineer.md +133 -0
  324. package/plugins/maestro/src/agents/ml-engineer.md +115 -0
  325. package/plugins/maestro/src/agents/mlops-engineer.md +116 -0
  326. package/plugins/maestro/src/agents/mobile-engineer.md +115 -0
  327. package/plugins/maestro/src/agents/observability-engineer.md +133 -0
  328. package/plugins/maestro/src/agents/performance-engineer.md +139 -0
  329. package/plugins/maestro/src/agents/platform-engineer.md +129 -0
  330. package/plugins/maestro/src/agents/product-manager.md +170 -0
  331. package/plugins/maestro/src/agents/prompt-engineer.md +129 -0
  332. package/plugins/maestro/src/agents/refactor.md +138 -0
  333. package/plugins/maestro/src/agents/release-manager.md +132 -0
  334. package/plugins/maestro/src/agents/security-engineer.md +143 -0
  335. package/plugins/maestro/src/agents/seo-specialist.md +129 -0
  336. package/plugins/maestro/src/agents/site-reliability-engineer.md +131 -0
  337. package/plugins/maestro/src/agents/solutions-architect.md +137 -0
  338. package/plugins/maestro/src/agents/technical-writer.md +129 -0
  339. package/plugins/maestro/src/agents/tester.md +135 -0
  340. package/plugins/maestro/src/agents/ux-designer.md +168 -0
  341. package/plugins/maestro/src/agents/zos-sysprog.md +134 -0
  342. package/plugins/maestro/src/config/setting-resolver.js +32 -0
  343. package/plugins/maestro/src/core/agent-registry.js +67 -0
  344. package/plugins/maestro/src/core/canonical-source.js +39 -0
  345. package/plugins/maestro/src/core/env-file-parser.js +82 -0
  346. package/plugins/maestro/src/core/feature-blocks.js +34 -0
  347. package/plugins/maestro/src/core/logger.js +12 -0
  348. package/plugins/maestro/src/core/markdown-state.js +36 -0
  349. package/plugins/maestro/src/core/policy-rules.js +32 -0
  350. package/plugins/maestro/src/core/project-root-resolver.js +184 -0
  351. package/plugins/maestro/src/core/stdin-reader.js +77 -0
  352. package/plugins/maestro/src/core/version.js +50 -0
  353. package/plugins/maestro/src/entry-points/core-command-registry.js +37 -0
  354. package/plugins/maestro/src/entry-points/preamble-builders.js +54 -0
  355. package/plugins/maestro/src/entry-points/registry.js +199 -0
  356. package/plugins/maestro/src/entry-points/templates/claude-core-command.md.tmpl +38 -0
  357. package/plugins/maestro/src/entry-points/templates/claude-skill.md.tmpl +18 -0
  358. package/plugins/maestro/src/entry-points/templates/codex-core-command.md.tmpl +16 -0
  359. package/plugins/maestro/src/entry-points/templates/codex-skill.md.tmpl +11 -0
  360. package/plugins/maestro/src/entry-points/templates/gemini-command.toml.tmpl +17 -0
  361. package/plugins/maestro/src/entry-points/templates/gemini-core-command.toml.tmpl +30 -0
  362. package/plugins/maestro/src/generated/agent-registry.json +630 -0
  363. package/plugins/maestro/src/generated/hook-registry.json +18 -0
  364. package/plugins/maestro/src/generated/resource-registry.json +16 -0
  365. package/plugins/maestro/src/hooks/logic/after-agent-logic.js +54 -0
  366. package/plugins/maestro/src/hooks/logic/before-agent-logic.js +57 -0
  367. package/plugins/maestro/src/hooks/logic/hook-state.js +127 -0
  368. package/plugins/maestro/src/hooks/logic/session-end-logic.js +17 -0
  369. package/plugins/maestro/src/hooks/logic/session-start-logic.js +25 -0
  370. package/plugins/maestro/src/lib/discovery/index.js +172 -0
  371. package/plugins/maestro/src/lib/errors/index.js +104 -0
  372. package/plugins/maestro/src/lib/framework-detection.js +50 -0
  373. package/plugins/maestro/src/lib/frontmatter/index.js +262 -0
  374. package/plugins/maestro/src/lib/io/index.js +96 -0
  375. package/plugins/maestro/src/lib/naming/index.js +94 -0
  376. package/plugins/maestro/src/lib/validation/index.js +124 -0
  377. package/plugins/maestro/src/lib/yaml-emit.js +38 -0
  378. package/plugins/maestro/src/mcp/content/provider.js +68 -0
  379. package/plugins/maestro/src/mcp/content/runtime-content.js +188 -0
  380. package/plugins/maestro/src/mcp/contracts/cache-path-rejector.js +39 -0
  381. package/plugins/maestro/src/mcp/contracts/downstream-context.js +106 -0
  382. package/plugins/maestro/src/mcp/contracts/plan-schema.js +148 -0
  383. package/plugins/maestro/src/mcp/contracts/workspace-marker.js +61 -0
  384. package/plugins/maestro/src/mcp/core/create-server.js +76 -0
  385. package/plugins/maestro/src/mcp/core/line-reader.js +35 -0
  386. package/plugins/maestro/src/mcp/core/project-root-cache.js +120 -0
  387. package/plugins/maestro/src/mcp/core/protocol-dispatcher.js +274 -0
  388. package/plugins/maestro/src/mcp/core/recovery-hints.js +43 -0
  389. package/plugins/maestro/src/mcp/core/tool-outcome.js +77 -0
  390. package/plugins/maestro/src/mcp/core/tool-registry.js +82 -0
  391. package/plugins/maestro/src/mcp/handlers/assess-task-complexity.js +108 -0
  392. package/plugins/maestro/src/mcp/handlers/blocker-parser.js +34 -0
  393. package/plugins/maestro/src/mcp/handlers/design-gate.js +393 -0
  394. package/plugins/maestro/src/mcp/handlers/get-agent.js +54 -0
  395. package/plugins/maestro/src/mcp/handlers/get-runtime-context.js +49 -0
  396. package/plugins/maestro/src/mcp/handlers/get-skill-content.js +51 -0
  397. package/plugins/maestro/src/mcp/handlers/initialize-workspace.js +45 -0
  398. package/plugins/maestro/src/mcp/handlers/reconciliation.js +224 -0
  399. package/plugins/maestro/src/mcp/handlers/resolve-settings.js +39 -0
  400. package/plugins/maestro/src/mcp/handlers/session-state-core.js +108 -0
  401. package/plugins/maestro/src/mcp/handlers/session-state-tools.js +562 -0
  402. package/plugins/maestro/src/mcp/handlers/validate-plan.js +76 -0
  403. package/plugins/maestro/src/mcp/maestro-server.js +122 -0
  404. package/plugins/maestro/src/mcp/runtime/runtime-config-map.js +70 -0
  405. package/plugins/maestro/src/mcp/tool-packs/content/index.js +80 -0
  406. package/plugins/maestro/src/mcp/tool-packs/contracts.js +30 -0
  407. package/plugins/maestro/src/mcp/tool-packs/index.js +15 -0
  408. package/plugins/maestro/src/mcp/tool-packs/session/index.js +243 -0
  409. package/plugins/maestro/src/mcp/tool-packs/workspace/index.js +98 -0
  410. package/plugins/maestro/src/mcp/utils/extension-root.js +31 -0
  411. package/plugins/maestro/src/mcp/validation/agent-checker.js +81 -0
  412. package/plugins/maestro/src/mcp/validation/dag-checker.js +214 -0
  413. package/plugins/maestro/src/mcp/validation/file-overlap-checker.js +63 -0
  414. package/plugins/maestro/src/mcp/validation/schema-checker.js +108 -0
  415. package/plugins/maestro/src/platforms/codex/runtime-config.js +58 -0
  416. package/plugins/maestro/src/platforms/shared/adapters/conventions.js +29 -0
  417. package/plugins/maestro/src/platforms/shared/adapters/exit-codes.js +6 -0
  418. package/plugins/maestro/src/platforms/shared/adapters/factory.js +40 -0
  419. package/plugins/maestro/src/platforms/shared/agent-names.js +10 -0
  420. package/plugins/maestro/src/platforms/shared/hook-runner.js +52 -0
  421. package/plugins/maestro/src/references/architecture.md +139 -0
  422. package/plugins/maestro/src/references/orchestration-steps.md +193 -0
  423. package/plugins/maestro/src/skills/shared/code-review/SKILL.md +145 -0
  424. package/plugins/maestro/src/skills/shared/delegation/SKILL.md +370 -0
  425. package/plugins/maestro/src/skills/shared/delegation/protocols/agent-base-protocol.md +145 -0
  426. package/plugins/maestro/src/skills/shared/delegation/protocols/filesystem-safety-protocol.md +31 -0
  427. package/plugins/maestro/src/skills/shared/design-dialogue/SKILL.md +284 -0
  428. package/plugins/maestro/src/skills/shared/execution/SKILL.md +258 -0
  429. package/plugins/maestro/src/skills/shared/implementation-planning/SKILL.md +303 -0
  430. package/plugins/maestro/src/skills/shared/session-management/SKILL.md +314 -0
  431. package/plugins/maestro/src/skills/shared/validation/SKILL.md +204 -0
  432. package/plugins/maestro/src/state/session-state.js +113 -0
  433. package/plugins/maestro/src/templates/design-document.md +95 -0
  434. package/plugins/maestro/src/templates/implementation-plan.md +86 -0
  435. package/plugins/maestro/src/templates/session-state.md +68 -0
  436. package/plugins/maestro/src/version.json +3 -0
  437. package/policies/maestro.toml +44 -0
  438. package/qwen/agents/accessibility_specialist.md +18 -0
  439. package/qwen/agents/analytics_engineer.md +20 -0
  440. package/qwen/agents/api_designer.md +17 -0
  441. package/qwen/agents/architect.md +17 -0
  442. package/qwen/agents/cloud_architect.md +17 -0
  443. package/qwen/agents/cobol_engineer.md +20 -0
  444. package/qwen/agents/code_reviewer.md +15 -0
  445. package/qwen/agents/coder.md +20 -0
  446. package/qwen/agents/compliance_reviewer.md +17 -0
  447. package/qwen/agents/content_strategist.md +17 -0
  448. package/qwen/agents/copywriter.md +17 -0
  449. package/qwen/agents/data_engineer.md +20 -0
  450. package/qwen/agents/database_administrator.md +19 -0
  451. package/qwen/agents/db2_dba.md +19 -0
  452. package/qwen/agents/debugger.md +17 -0
  453. package/qwen/agents/design_system_engineer.md +20 -0
  454. package/qwen/agents/devops_engineer.md +21 -0
  455. package/qwen/agents/hlasm_assembler_specialist.md +20 -0
  456. package/qwen/agents/i18n_specialist.md +19 -0
  457. package/qwen/agents/ibm_i_specialist.md +20 -0
  458. package/qwen/agents/integration_engineer.md +21 -0
  459. package/qwen/agents/ml_engineer.md +21 -0
  460. package/qwen/agents/mlops_engineer.md +21 -0
  461. package/qwen/agents/mobile_engineer.md +21 -0
  462. package/qwen/agents/observability_engineer.md +21 -0
  463. package/qwen/agents/performance_engineer.md +19 -0
  464. package/qwen/agents/platform_engineer.md +22 -0
  465. package/qwen/agents/product_manager.md +18 -0
  466. package/qwen/agents/prompt_engineer.md +20 -0
  467. package/qwen/agents/refactor.md +20 -0
  468. package/qwen/agents/release_manager.md +20 -0
  469. package/qwen/agents/security_engineer.md +19 -0
  470. package/qwen/agents/seo_specialist.md +19 -0
  471. package/qwen/agents/site_reliability_engineer.md +19 -0
  472. package/qwen/agents/solutions_architect.md +17 -0
  473. package/qwen/agents/technical_writer.md +19 -0
  474. package/qwen/agents/tester.md +21 -0
  475. package/qwen/agents/ux_designer.md +18 -0
  476. package/qwen/agents/zos_sysprog.md +19 -0
  477. package/qwen/hooks.json +56 -0
  478. package/qwen-extension.json +55 -0
  479. package/scripts/check-layer-boundaries.js +74 -0
  480. package/scripts/generate.js +155 -0
  481. package/scripts/install-codex-plugin.js +167 -0
  482. package/scripts/install-git-hooks.js +43 -0
  483. package/scripts/npm-publish-idempotent.js +150 -0
  484. package/scripts/package-release-artifacts.js +156 -0
  485. package/scripts/release-artifact-manifest.js +378 -0
  486. package/scripts/release-version-metadata.js +129 -0
  487. package/scripts/update-versions.js +33 -0
  488. package/scripts/verify-npm-pack.js +85 -0
  489. package/scripts/verify-release-artifacts.js +95 -0
  490. package/src/agents/accessibility-specialist.md +163 -0
  491. package/src/agents/analytics-engineer.md +182 -0
  492. package/src/agents/api-designer.md +124 -0
  493. package/src/agents/architect.md +120 -0
  494. package/src/agents/cloud-architect.md +134 -0
  495. package/src/agents/cobol-engineer.md +127 -0
  496. package/src/agents/code-reviewer.md +123 -0
  497. package/src/agents/coder.md +132 -0
  498. package/src/agents/compliance-reviewer.md +219 -0
  499. package/src/agents/content-strategist.md +111 -0
  500. package/src/agents/copywriter.md +113 -0
  501. package/src/agents/data-engineer.md +130 -0
  502. package/src/agents/database-administrator.md +126 -0
  503. package/src/agents/db2-dba.md +124 -0
  504. package/src/agents/debugger.md +133 -0
  505. package/src/agents/design-system-engineer.md +258 -0
  506. package/src/agents/devops-engineer.md +138 -0
  507. package/src/agents/hlasm-assembler-specialist.md +134 -0
  508. package/src/agents/i18n-specialist.md +241 -0
  509. package/src/agents/ibm-i-specialist.md +132 -0
  510. package/src/agents/integration-engineer.md +133 -0
  511. package/src/agents/ml-engineer.md +115 -0
  512. package/src/agents/mlops-engineer.md +116 -0
  513. package/src/agents/mobile-engineer.md +115 -0
  514. package/src/agents/observability-engineer.md +133 -0
  515. package/src/agents/performance-engineer.md +139 -0
  516. package/src/agents/platform-engineer.md +129 -0
  517. package/src/agents/product-manager.md +170 -0
  518. package/src/agents/prompt-engineer.md +129 -0
  519. package/src/agents/refactor.md +138 -0
  520. package/src/agents/release-manager.md +132 -0
  521. package/src/agents/security-engineer.md +143 -0
  522. package/src/agents/seo-specialist.md +129 -0
  523. package/src/agents/site-reliability-engineer.md +131 -0
  524. package/src/agents/solutions-architect.md +137 -0
  525. package/src/agents/technical-writer.md +129 -0
  526. package/src/agents/tester.md +135 -0
  527. package/src/agents/ux-designer.md +168 -0
  528. package/src/agents/zos-sysprog.md +134 -0
  529. package/src/config/setting-resolver.js +32 -0
  530. package/src/core/agent-registry.js +67 -0
  531. package/src/core/canonical-source.js +39 -0
  532. package/src/core/env-file-parser.js +82 -0
  533. package/src/core/feature-blocks.js +34 -0
  534. package/src/core/logger.js +12 -0
  535. package/src/core/markdown-state.js +36 -0
  536. package/src/core/policy-rules.js +32 -0
  537. package/src/core/project-root-resolver.js +184 -0
  538. package/src/core/stdin-reader.js +77 -0
  539. package/src/core/version.js +50 -0
  540. package/src/entry-points/core-command-registry.js +37 -0
  541. package/src/entry-points/preamble-builders.js +54 -0
  542. package/src/entry-points/registry.js +199 -0
  543. package/src/entry-points/templates/claude-core-command.md.tmpl +38 -0
  544. package/src/entry-points/templates/claude-skill.md.tmpl +18 -0
  545. package/src/entry-points/templates/codex-core-command.md.tmpl +16 -0
  546. package/src/entry-points/templates/codex-skill.md.tmpl +11 -0
  547. package/src/entry-points/templates/gemini-command.toml.tmpl +17 -0
  548. package/src/entry-points/templates/gemini-core-command.toml.tmpl +30 -0
  549. package/src/generated/agent-registry.json +630 -0
  550. package/src/generated/hook-registry.json +18 -0
  551. package/src/generated/resource-registry.json +16 -0
  552. package/src/generator/entry-point-expander.js +182 -0
  553. package/src/generator/file-writer.js +167 -0
  554. package/src/generator/generation-session.js +62 -0
  555. package/src/generator/manifest-curator.js +31 -0
  556. package/src/generator/manifest-expander.js +256 -0
  557. package/src/generator/payload-builder.js +217 -0
  558. package/src/generator/registry-scanner.js +130 -0
  559. package/src/generator/stale-pruner.js +101 -0
  560. package/src/hooks/logic/after-agent-logic.js +54 -0
  561. package/src/hooks/logic/before-agent-logic.js +57 -0
  562. package/src/hooks/logic/hook-state.js +127 -0
  563. package/src/hooks/logic/session-end-logic.js +17 -0
  564. package/src/hooks/logic/session-start-logic.js +25 -0
  565. package/src/lib/discovery/index.js +172 -0
  566. package/src/lib/errors/index.js +104 -0
  567. package/src/lib/framework-detection.js +50 -0
  568. package/src/lib/frontmatter/index.js +262 -0
  569. package/src/lib/io/index.js +96 -0
  570. package/src/lib/naming/index.js +94 -0
  571. package/src/lib/validation/index.js +124 -0
  572. package/src/lib/yaml-emit.js +38 -0
  573. package/src/manifest.js +11 -0
  574. package/src/mcp/content/provider.js +68 -0
  575. package/src/mcp/content/runtime-content.js +188 -0
  576. package/src/mcp/contracts/cache-path-rejector.js +39 -0
  577. package/src/mcp/contracts/downstream-context.js +106 -0
  578. package/src/mcp/contracts/plan-schema.js +148 -0
  579. package/src/mcp/contracts/workspace-marker.js +61 -0
  580. package/src/mcp/core/create-server.js +76 -0
  581. package/src/mcp/core/line-reader.js +35 -0
  582. package/src/mcp/core/project-root-cache.js +120 -0
  583. package/src/mcp/core/protocol-dispatcher.js +274 -0
  584. package/src/mcp/core/recovery-hints.js +43 -0
  585. package/src/mcp/core/tool-outcome.js +77 -0
  586. package/src/mcp/core/tool-registry.js +82 -0
  587. package/src/mcp/handlers/assess-task-complexity.js +108 -0
  588. package/src/mcp/handlers/blocker-parser.js +34 -0
  589. package/src/mcp/handlers/design-gate.js +393 -0
  590. package/src/mcp/handlers/get-agent.js +54 -0
  591. package/src/mcp/handlers/get-runtime-context.js +49 -0
  592. package/src/mcp/handlers/get-skill-content.js +51 -0
  593. package/src/mcp/handlers/initialize-workspace.js +45 -0
  594. package/src/mcp/handlers/reconciliation.js +224 -0
  595. package/src/mcp/handlers/resolve-settings.js +39 -0
  596. package/src/mcp/handlers/session-state-core.js +108 -0
  597. package/src/mcp/handlers/session-state-tools.js +562 -0
  598. package/src/mcp/handlers/validate-plan.js +76 -0
  599. package/src/mcp/maestro-server.js +122 -0
  600. package/src/mcp/runtime/runtime-config-map.js +70 -0
  601. package/src/mcp/tool-packs/content/index.js +80 -0
  602. package/src/mcp/tool-packs/contracts.js +30 -0
  603. package/src/mcp/tool-packs/index.js +15 -0
  604. package/src/mcp/tool-packs/session/index.js +243 -0
  605. package/src/mcp/tool-packs/workspace/index.js +98 -0
  606. package/src/mcp/utils/extension-root.js +31 -0
  607. package/src/mcp/validation/agent-checker.js +81 -0
  608. package/src/mcp/validation/dag-checker.js +214 -0
  609. package/src/mcp/validation/file-overlap-checker.js +63 -0
  610. package/src/mcp/validation/schema-checker.js +108 -0
  611. package/src/platforms/claude/metadata.js +96 -0
  612. package/src/platforms/claude/runtime-config.js +60 -0
  613. package/src/platforms/codex/metadata.js +107 -0
  614. package/src/platforms/codex/runtime-config.js +58 -0
  615. package/src/platforms/gemini/metadata.js +27 -0
  616. package/src/platforms/gemini/runtime-config.js +62 -0
  617. package/src/platforms/metadata-shared.js +131 -0
  618. package/src/platforms/metadata.js +29 -0
  619. package/src/platforms/qwen/metadata.js +27 -0
  620. package/src/platforms/qwen/runtime-config.js +62 -0
  621. package/src/platforms/shared/adapters/claude-adapter.js +36 -0
  622. package/src/platforms/shared/adapters/conventions.js +29 -0
  623. package/src/platforms/shared/adapters/exit-codes.js +6 -0
  624. package/src/platforms/shared/adapters/factory.js +40 -0
  625. package/src/platforms/shared/adapters/gemini-adapter.js +34 -0
  626. package/src/platforms/shared/adapters/qwen-adapter.js +93 -0
  627. package/src/platforms/shared/agent-names.js +10 -0
  628. package/src/platforms/shared/hook-runner.js +52 -0
  629. package/src/references/architecture.md +139 -0
  630. package/src/references/orchestration-steps.md +193 -0
  631. package/src/scripts/ensure-workspace.js +14 -0
  632. package/src/scripts/read-active-session.js +26 -0
  633. package/src/scripts/read-setting.js +18 -0
  634. package/src/scripts/read-state.js +17 -0
  635. package/src/scripts/write-state.js +22 -0
  636. package/src/skills/shared/code-review/SKILL.md +145 -0
  637. package/src/skills/shared/delegation/SKILL.md +370 -0
  638. package/src/skills/shared/delegation/protocols/agent-base-protocol.md +145 -0
  639. package/src/skills/shared/delegation/protocols/filesystem-safety-protocol.md +31 -0
  640. package/src/skills/shared/design-dialogue/SKILL.md +284 -0
  641. package/src/skills/shared/execution/SKILL.md +258 -0
  642. package/src/skills/shared/implementation-planning/SKILL.md +303 -0
  643. package/src/skills/shared/session-management/SKILL.md +314 -0
  644. package/src/skills/shared/validation/SKILL.md +204 -0
  645. package/src/state/session-state.js +113 -0
  646. package/src/templates/design-document.md +95 -0
  647. package/src/templates/implementation-plan.md +86 -0
  648. package/src/templates/session-state.md +68 -0
  649. package/src/transforms/agent-stub.js +29 -0
  650. package/src/transforms/extract-examples.js +63 -0
  651. package/src/transforms/index.js +35 -0
  652. package/src/transforms/parse-frontmatter.js +23 -0
  653. package/src/transforms/rebuild-frontmatter.js +147 -0
  654. package/src/transforms/skill-discovery-stub.js +27 -0
  655. package/src/transforms/skill-metadata.js +14 -0
package/docs/cicd.md ADDED
@@ -0,0 +1,647 @@
1
+ <!-- Source: .github/workflows/*.yml, justfile -->
2
+
3
+ # CI/CD Pipeline
4
+
5
+ Maestro uses seven GitHub Actions workflows. Six are organized around a **source-of-truth enforcement** model — each regenerates runtime adapters from canonical `src/` and verifies zero drift before proceeding. The seventh, **Commit Message Check**, validates semantic git conventions for PR branch names, PR titles, and commit subjects targeting `main`. Together they span continuous integration on every push/PR through automated release publishing to npm.
6
+
7
+ ## Workflow Overview
8
+
9
+ ```mermaid
10
+ graph LR
11
+ subgraph "Continuous Integration"
12
+ A["Push / PR to main"] --> B["Source Of Truth Check"]
13
+ A --> M["Commit Message Check"]
14
+ end
15
+
16
+ subgraph "Pre-release Publishing"
17
+ C["PR labeled 'preview'"] --> D["Preview Build"]
18
+ E["Manual dispatch from main"] --> F["Prepare Release"]
19
+ F --> |"Creates release/vX.Y.Z branch<br/>Opens PR to main with<br/>'release' + 'rc' labels"| G["Release Candidate"]
20
+ end
21
+
22
+ subgraph "Release Publishing"
23
+ G --> |"PR merged to main"| H["Release"]
24
+ end
25
+
26
+ subgraph "Scheduled"
27
+ J["Cron: daily 06:00 UTC"] --> K["Nightly Build"]
28
+ end
29
+ ```
30
+
31
+ The six source-of-truth workflows share a common validation core: generate runtime adapters, check for drift, and run the full test suite. Source Of Truth Check and stable Release also verify npm package contents and the self-contained release archive. Nightly Build, Preview Build, and Release Candidate keep best-effort npm publishing gated on `NPM_TOKEN`; stable Release publishes through npm Trusted Publishing with GitHub Actions OIDC. Commit Message Check is independent: it does not regenerate or test, it only validates branch naming, PR-title formatting, and commit-subject formatting.
32
+
33
+ ## Source Of Truth Check
34
+
35
+ ### Purpose
36
+
37
+ The foundational CI gate. Enforces that all generated runtime adapters (Gemini, Claude Code, Codex) are in sync with canonical source in `src/`, and that the full test suite passes. Runs on every push and pull request targeting `main`.
38
+
39
+ ### Trigger
40
+
41
+ | Event | Branches |
42
+ |-------|----------|
43
+ | `push` | `main` |
44
+ | `pull_request` | `main` |
45
+
46
+ ### Flow
47
+
48
+ ```mermaid
49
+ graph TD
50
+ A["Push or PR to main"] --> B["Checkout repository"]
51
+ B --> C["Setup Node.js 20"]
52
+ C --> D["Generate runtime adapters"]
53
+ D --> E{"Adapter drift?"}
54
+ E --> |"Yes"| F["Fail: adapters out of sync"]
55
+ E --> |"No"| G["Run full test suite"]
56
+ G --> H{"Tests pass?"}
57
+ H --> |"Yes"| I["Verify npm pack<br/>and release artifact"]
58
+ H --> |"No"| J["Fail: test failures"]
59
+ I --> K["Check passes"]
60
+ ```
61
+
62
+ ### Job Breakdown
63
+
64
+ **Job: `check-architecture` (name: `source-of-truth-check`)**
65
+
66
+ | Step | Description |
67
+ |------|-------------|
68
+ | Checkout | Pins `actions/checkout` to SHA `11bd71901bbe5b1630ceea73d27597364c9af683` (v4.2.2) |
69
+ | Setup Node.js | Installs Node.js 20 via `actions/setup-node@v4` |
70
+ | Generate runtime adapters | Runs `node scripts/generate.js` to rebuild all runtime outputs |
71
+ | Check adapter drift | Runs `git diff --exit-code --name-only`; fails with annotation if any generated file differs from what is committed |
72
+ | Run full test suite | Executes `node --test tests/unit/*.test.js tests/transforms/*.test.js tests/integration/*.test.js` |
73
+ | Verify npm package contents | Runs `npm run pack:verify` to ensure npm dry-run packaging contains required runtime files and no test-only directories |
74
+ | Package and verify release artifact | Runs `npm run release:artifacts` and `npm run release:verify-artifacts` to validate the generic GitHub Release archive |
75
+
76
+ ### Environment and Secrets
77
+
78
+ Uses default permissions (read-only). No secrets or environment variables required.
79
+
80
+ ### Artifacts
81
+
82
+ Creates an ignored local `dist/release/maestro-vX.Y.Z-extension.tar.gz` during validation, but does not upload it from PR CI.
83
+
84
+ ### Key Behaviors
85
+
86
+ - The drift check emits a GitHub Actions error annotation (`::error::`) with a `git diff --stat` summary on failure, providing immediate visibility into which files drifted.
87
+ - This workflow serves as the required status check that blocks PR merges.
88
+
89
+ ---
90
+
91
+ ## Commit Message Check
92
+
93
+ ### Purpose
94
+
95
+ Enforces semantic git conventions for work targeting `main`: PR branch names must use the repo's semantic branch format, PR titles must follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/), and every commit subject in the PR range must be conventional. This closes the local-hook bypass (`git commit --no-verify`) by re-validating in CI. The workflow also runs on direct pushes to `main` to cover admin overrides and emergency hotfixes that bypass the PR flow.
96
+
97
+ ### Trigger
98
+
99
+ | Event | Branches | Types |
100
+ |-------|----------|-------|
101
+ | `pull_request` | `main` | `opened`, `edited`, `reopened`, `synchronize` |
102
+ | `push` | `main` | — |
103
+
104
+ ### Flow
105
+
106
+ ```mermaid
107
+ graph TD
108
+ A["Push / PR to main"] --> B{"Event type?"}
109
+ B --> |"pull_request"| C["Job: pr-title-check"]
110
+ B --> |"pull_request"| C2["Job: branch-name-check"]
111
+ B --> |"push or pull_request"| D["Job: commit-subjects-check"]
112
+ C --> E{"PR title matches<br/>Conventional Commits?"}
113
+ E --> |"No"| F["Fail with::error annotation<br/>and remediation hint"]
114
+ E --> |"Yes"| G["Pass"]
115
+ C2 --> L{"PR branch matches<br/>semantic branch convention?"}
116
+ L --> |"No"| M["Fail with::error annotation<br/>and rename hint"]
117
+ L --> |"Yes"| N["Pass"]
118
+ D --> H["Resolve commit range<br/>(PR base..head, or push before..after)"]
119
+ H --> I{"All subjects match<br/>(skipping Merge / Revert / fixup!)?"}
120
+ I --> |"No"| J["Fail with per-commit annotations"]
121
+ I --> |"Yes"| K["Pass"]
122
+ ```
123
+
124
+ ### Job Breakdown
125
+
126
+ **Job: `check-pr-title` (name: `pr-title-check`)** — runs only on `pull_request` events.
127
+
128
+ | Step | Description |
129
+ |------|-------------|
130
+ | Validate PR title | Reads `github.event.pull_request.title` via the `PR_TITLE` env var; tests it against the Conventional Commits regex; emits `::error::` annotation with format guidance on failure |
131
+
132
+ No checkout step — the job reads only event-payload metadata.
133
+
134
+ **Job: `check-pr-branch` (name: `branch-name-check`)** — runs only on `pull_request` events.
135
+
136
+ | Step | Description |
137
+ |------|-------------|
138
+ | Validate PR branch | Reads `github.event.pull_request.head.ref`; accepts `<type>/<slug>`, `<namespace>/<type>/<slug>`, `release/vX.Y.Z`, protected branch names, and known automation prefixes; emits `::error::` annotation with rename guidance on failure |
139
+
140
+ No checkout step — the job reads only event-payload metadata.
141
+
142
+ **Job: `check-commits` (name: `commit-subjects-check`)** — runs on both event types.
143
+
144
+ | Step | Description |
145
+ |------|-------------|
146
+ | Checkout | Pins `actions/checkout` to SHA `11bd71901bbe5b1630ceea73d27597364c9af683` (v4.2.2) with `fetch-depth: 0` to access the full history |
147
+ | Validate commit subjects | Resolves the commit range from the event (PR: `base.sha..head.sha`; push: `before..after`, or `after~1..after` on initial push); iterates `git log --format='%H %s'`; tests each subject against the regex with pass-throughs for `Merge`, `Revert`, `fixup!`, `squash!`, `amend!` |
148
+
149
+ ### Environment and Secrets
150
+
151
+ `permissions: contents: read` (least privilege; only needs to read the repository). No secrets required. Safe for fork PRs.
152
+
153
+ ### Artifacts
154
+
155
+ None produced or consumed.
156
+
157
+ ### Key Behaviors
158
+
159
+ - The PR-title regex matches the local hook regex character-for-character, ensuring local-pass and CI-pass agree.
160
+ - The PR-branch regex mirrors `.githooks/pre-commit` and `.githooks/pre-push`, so branch names are checked locally before committing, locally before pushing, and in CI before merging.
161
+ - Pass-throughs (`Merge `, `Revert `, `fixup!`, `squash!`, `amend!`) match those in `.githooks/commit-msg`, so git-generated subjects (interactive rebases, merges, reverts) are accepted in both layers.
162
+ - Bot-authored release commits (`release: vX.Y.Z` from Prepare Release) match the regex without exception.
163
+ - The `push` trigger means even a direct admin push to `main` is validated post-hoc — failures appear as red checks on the commit on `main`.
164
+
165
+ ---
166
+
167
+ ## Nightly Build
168
+
169
+ ### Purpose
170
+
171
+ Publishes a nightly snapshot of the `main` branch to npm under the `nightly` dist-tag. Validates the `main` branch has no drift and passes all tests before publishing. Runs on a daily schedule and can be triggered manually.
172
+
173
+ ### Trigger
174
+
175
+ | Event | Details |
176
+ |-------|---------|
177
+ | `schedule` | Cron: `0 6 * * *` (daily at 06:00 UTC) |
178
+ | `workflow_dispatch` | Manual trigger with no inputs |
179
+
180
+ ### Flow
181
+
182
+ ```mermaid
183
+ graph TD
184
+ A["Schedule or manual dispatch"] --> B["Checkout main branch"]
185
+ B --> C["Setup Node.js 20 with npm registry"]
186
+ C --> D["Generate runtime adapters"]
187
+ D --> E{"Adapter drift?"}
188
+ E --> |"Yes"| F["Fail: nightly drift on main"]
189
+ E --> |"No"| G["Run full test suite"]
190
+ G --> H{"Tests pass?"}
191
+ H --> |"No"| I["Fail: test failures"]
192
+ H --> |"Yes"| J{"NPM_TOKEN available?"}
193
+ J --> |"No"| K["Skip publish"]
194
+ J --> |"Yes"| L["Set nightly version<br/>X.Y.Z-nightly.YYYYMMDD"]
195
+ L --> M["Publish to npm<br/>--tag nightly"]
196
+ ```
197
+
198
+ ### Job Breakdown
199
+
200
+ **Job: `nightly`**
201
+
202
+ | Step | Description |
203
+ |------|-------------|
204
+ | Checkout | Checks out `refs/heads/main` explicitly, pinned to SHA `11bd71901bbe5b1630ceea73d27597364c9af683` |
205
+ | Setup Node.js | Node.js 20 with `registry-url` set to `https://registry.npmjs.org` |
206
+ | Generate runtime adapters | Runs `node scripts/generate.js` |
207
+ | Check adapter drift | Fails with `::error::Nightly drift detected on main` if generated files differ |
208
+ | Run full test suite | Executes the full test suite |
209
+ | Determine publish eligibility | Sets `enabled=true` output if `NPM_TOKEN` secret is present |
210
+ | Set nightly version | Computes version as `{base}-nightly.{YYYYMMDD}` using `npm version --no-git-tag-version` |
211
+ | Regenerate runtime metadata | Runs `node scripts/generate.js` so runtime manifests and MCP package specs use the nightly version |
212
+ | Verify npm package contents | Runs `npm run pack:verify` against the nightly package surface |
213
+ | Publish nightly | Publishes through `node scripts/npm-publish-idempotent.js --tag nightly --access public`, skipping if the exact version already exists |
214
+
215
+ ### Environment and Secrets
216
+
217
+ | Item | Type | Purpose |
218
+ |------|------|---------|
219
+ | `NPM_TOKEN` | Secret | Authenticates with npm registry for publishing |
220
+ | `NODE_AUTH_TOKEN` | Env (derived) | Set to `$NPM_TOKEN` value for npm CLI authentication |
221
+
222
+ **Permissions**: `contents: read`
223
+
224
+ ### Artifacts
225
+
226
+ Publishes `@josstei/maestro@X.Y.Z-nightly.YYYYMMDD` to npm with the `nightly` dist-tag.
227
+
228
+ ### Key Behaviors
229
+
230
+ - Always checks out the `main` branch regardless of what triggered it.
231
+ - The version string includes the date stamp, so each nightly replaces the previous day's version on the `nightly` tag.
232
+ - When `NPM_TOKEN` is absent, the workflow still validates drift and runs tests, providing health checks for forks.
233
+
234
+ ---
235
+
236
+ ## Preview Build
237
+
238
+ ### Purpose
239
+
240
+ Publishes a preview package from a pull request so reviewers can install and test changes before merging. Activated by adding the `preview` label to any PR.
241
+
242
+ ### Trigger
243
+
244
+ | Event | Details |
245
+ |-------|---------|
246
+ | `pull_request` | Types: `labeled`, `synchronize`, `reopened` |
247
+ | **Condition** | PR must have the `preview` label |
248
+
249
+ ### Flow
250
+
251
+ ```mermaid
252
+ graph TD
253
+ A["PR labeled/synchronize/reopened"] --> B{"Has 'preview' label?"}
254
+ B --> |"No"| C["Skip workflow"]
255
+ B --> |"Yes"| D["Checkout PR head SHA"]
256
+ D --> E["Setup Node.js 20 with npm registry"]
257
+ E --> F["Generate runtime adapters"]
258
+ F --> G{"Adapter drift?"}
259
+ G --> |"Yes"| H["Fail: preview drift detected"]
260
+ G --> |"No"| I["Run full test suite"]
261
+ I --> J{"Tests pass?"}
262
+ J --> |"No"| K["Fail: test failures"]
263
+ J --> |"Yes"| L{"NPM_TOKEN available?"}
264
+ L --> |"No"| M["Skip publish"]
265
+ L --> |"Yes"| N["Set preview version<br/>X.Y.Z-preview.SHORT_SHA"]
266
+ N --> O["Publish to npm<br/>--tag preview"]
267
+ O --> P["Upsert PR comment<br/>with install command"]
268
+ ```
269
+
270
+ ### Job Breakdown
271
+
272
+ **Job: `preview`**
273
+
274
+ | Step | Description |
275
+ |------|-------------|
276
+ | Checkout | Checks out the PR head repository and SHA (supports fork PRs) |
277
+ | Setup Node.js | Node.js 20 with npm registry URL |
278
+ | Generate runtime adapters | Runs `node scripts/generate.js` |
279
+ | Check adapter drift | Fails with `::error::Preview drift detected` if drift exists |
280
+ | Run full test suite | Executes the full test suite |
281
+ | Determine publish eligibility | Gates on `NPM_TOKEN` presence |
282
+ | Set preview version | Computes version as `{base}-preview.{7-char SHA}` |
283
+ | Regenerate runtime metadata | Runs `node scripts/generate.js` so runtime manifests and MCP package specs use the preview version |
284
+ | Verify npm package contents | Runs `npm run pack:verify` against the preview package surface |
285
+ | Publish preview | Publishes through `node scripts/npm-publish-idempotent.js --tag preview --access public`, skipping if the exact version already exists |
286
+ | Upsert PR comment | Posts or updates a PR comment with the install command |
287
+
288
+ ### Environment and Secrets
289
+
290
+ | Item | Type | Purpose |
291
+ |------|------|---------|
292
+ | `NPM_TOKEN` | Secret | npm registry authentication |
293
+ | `NODE_AUTH_TOKEN` | Env (derived) | Set to `$NPM_TOKEN` for npm CLI |
294
+ | `GH_TOKEN` | Env (derived) | Set to `${{ github.token }}` for PR comment API calls |
295
+
296
+ **Permissions**: `contents: read`, `pull-requests: write`
297
+
298
+ ### Artifacts
299
+
300
+ Publishes `@josstei/maestro@X.Y.Z-preview.SHORT_SHA` to npm with the `preview` dist-tag.
301
+
302
+ ### Key Behaviors
303
+
304
+ - Uses concurrency group `preview-{PR number}` with `cancel-in-progress: true`, so pushing new commits cancels any in-flight preview build for the same PR.
305
+ - The PR comment is **upserted**: if a comment starting with "Preview published:" already exists, it is updated in place rather than posting a duplicate.
306
+ - The version embeds the first 7 characters of the commit SHA, making each preview uniquely traceable to a specific commit.
307
+
308
+ ---
309
+
310
+ ## Prepare Release
311
+
312
+ ### Purpose
313
+
314
+ Orchestrates the release preparation process. Creates a release branch from `main`, bumps version numbers, and opens a pull request targeting `main` (the actual release PR). This is the entry point for the release pipeline.
315
+
316
+ ### Trigger
317
+
318
+ | Event | Details |
319
+ |-------|---------|
320
+ | `workflow_dispatch` | Manual trigger from the `main` branch only |
321
+ | **Input** | `version` (optional string): explicit version to release; when omitted, the version is inferred from commit history |
322
+
323
+ ### Flow
324
+
325
+ ```mermaid
326
+ graph TD
327
+ A["Manual dispatch from main"] --> B{"Running on main branch?"}
328
+ B --> |"No"| C["Fail: must run from main"]
329
+ B --> |"Yes"| D["Checkout with full history"]
330
+ D --> E{"Version input provided?"}
331
+ E --> |"Yes"| F["Use provided version"]
332
+ E --> |"No"| G["Infer version from commits<br/>major/minor/patch"]
333
+ F --> H["Validate version format<br/>X.Y.Z"]
334
+ G --> H
335
+ H --> I["Validate CHANGELOG<br/>has unreleased content"]
336
+ I --> J["Generate and check drift"]
337
+ J --> K["Run full test suite"]
338
+ K --> L["Create release/vX.Y.Z branch"]
339
+ L --> M["Update canonical release inputs<br/>via scripts/update-versions.js"]
340
+ M --> N["Regenerate with new version"]
341
+ N --> O["Commit: 'release: vX.Y.Z'"]
342
+ O --> P["Push release branch"]
343
+ P --> Q["Open PR to main<br/>with CHANGELOG excerpt"]
344
+ Q --> R["Label main PR:<br/>'release' + 'rc'"]
345
+ ```
346
+
347
+ ### Job Breakdown
348
+
349
+ **Job: `prepare`**
350
+
351
+ | Step | Description |
352
+ |------|-------------|
353
+ | Validate branch | Fails if not running from `refs/heads/main` |
354
+ | Checkout | Full history (`fetch-depth: 0`) using `RELEASE_TOKEN` for push permissions |
355
+ | Setup Node.js | Installs Node.js 20 via `actions/setup-node@v4` |
356
+ | Infer version from commits | Scans commit logs since last tag; determines bump level: `BREAKING CHANGE` or `!:` triggers major, `feat` triggers minor, otherwise patch |
357
+ | Resolve target version | Uses explicit input if provided, otherwise uses inferred version |
358
+ | Validate target version | Ensures version matches `X.Y.Z` semver pattern |
359
+ | Validate CHANGELOG | Fails if the `[Unreleased]` section in `CHANGELOG.md` has no content |
360
+ | Generate and check drift | Runs generator and fails if `main` has uncommitted drift |
361
+ | Run full test suite | Executes the full test suite |
362
+ | Create release branch | Creates `release/vX.Y.Z` from current `main` |
363
+ | Update canonical release inputs | Runs `node scripts/update-versions.js` with the target version to update `package.json`, README badges, and CHANGELOG |
364
+ | Regenerate with new version | Reruns generator to derive runtime metadata from `package.json`, then runs `npm install --package-lock-only` to update lockfile |
365
+ | Commit release | Commits all changes as `release: vX.Y.Z` using the `github-actions[bot]` identity |
366
+ | Push release branch | Pushes `release/vX.Y.Z` to origin |
367
+ | Open PR to main | Creates a PR merging `release/vX.Y.Z` into `main` with CHANGELOG excerpt as body |
368
+ | Label release PR | Adds `release` and `rc` labels to the main-targeting PR |
369
+
370
+ ### Environment and Secrets
371
+
372
+ | Item | Type | Purpose |
373
+ |------|------|---------|
374
+ | `RELEASE_TOKEN` | Secret | Personal access token with write permissions; used for checkout, branch push, PR creation, and auto-merge. Required because the default `GITHUB_TOKEN` cannot trigger downstream workflows. |
375
+
376
+ **Permissions**: `contents: write`, `pull-requests: write`
377
+
378
+ ### Artifacts
379
+
380
+ Creates the `release/vX.Y.Z` branch and a pull request targeting `main` with the CHANGELOG excerpt.
381
+
382
+ ### Key Behaviors
383
+
384
+ - The version inference algorithm uses conventional commit patterns: `BREAKING CHANGE` or `!:` in commit messages triggers a major bump, `feat` commits trigger minor, everything else triggers patch.
385
+ - The CHANGELOG validation ensures no release ships without documented changes.
386
+ - The `release` and `rc` labels on the main-targeting PR are what trigger the Release Candidate workflow.
387
+ - Uses `RELEASE_TOKEN` (not the default `GITHUB_TOKEN`) so that the push and PR creation events trigger downstream workflow runs (Source Of Truth Check on the new PR, and Release Candidate when labels are applied).
388
+
389
+ ---
390
+
391
+ ## Release Candidate
392
+
393
+ ### Purpose
394
+
395
+ Publishes release candidate packages to npm from release PRs targeting `main`. Activates automatically when the Prepare Release workflow labels a PR with both `release` and `rc`. Provides an installable RC package for final validation before the release merges.
396
+
397
+ ### Trigger
398
+
399
+ | Event | Details |
400
+ |-------|---------|
401
+ | `pull_request` | Types: `labeled`, `synchronize`, `reopened` |
402
+ | **Conditions (all must be true)** | Base branch is `main` |
403
+ | | PR has both `rc` and `release` labels |
404
+ | | Head branch starts with `release/v` |
405
+
406
+ ### Flow
407
+
408
+ ```mermaid
409
+ graph TD
410
+ A["PR event on release/vX.Y.Z to main"] --> B{"Base is main?<br/>Has 'rc' + 'release' labels?<br/>Head starts with 'release/v'?"}
411
+ B -->|"Any condition false"| C["Skip workflow"]
412
+ B -->|"All true"| D["Checkout PR head SHA"]
413
+ D --> E["Setup Node.js 20 with npm registry"]
414
+ E --> F["Generate runtime adapters"]
415
+ F --> G{"Adapter drift?"}
416
+ G --> |"Yes"| H["Fail: RC drift detected"]
417
+ G --> |"No"| I["Run full test suite"]
418
+ I --> J{"Tests pass?"}
419
+ J --> |"No"| K["Fail: test failures"]
420
+ J --> |"Yes"| L{"NPM_TOKEN available?"}
421
+ L --> |"No"| M["Skip publish"]
422
+ L --> |"Yes"| N["Determine RC version<br/>Query npm for existing RCs<br/>Increment RC number"]
423
+ N --> O["Publish to npm<br/>--tag rc"]
424
+ O --> P["Upsert PR comment<br/>with install command"]
425
+ ```
426
+
427
+ ### Job Breakdown
428
+
429
+ **Job: `rc`**
430
+
431
+ | Step | Description |
432
+ |------|-------------|
433
+ | Checkout | Checks out the PR head repository and SHA |
434
+ | Setup Node.js | Node.js 20 with npm registry URL |
435
+ | Generate runtime adapters | Runs `node scripts/generate.js` |
436
+ | Check adapter drift | Fails with `::error::RC drift detected` |
437
+ | Run full test suite | Executes the full test suite |
438
+ | Determine publish eligibility | Gates on `NPM_TOKEN` presence |
439
+ | Determine RC version | Reads base version from `package.json`, queries npm registry for existing RC versions of this base, increments the RC number to avoid collisions |
440
+ | Regenerate runtime metadata | Runs `node scripts/generate.js` so runtime manifests and MCP package specs use the RC version |
441
+ | Verify npm package contents | Runs `npm run pack:verify` against the RC package surface |
442
+ | Publish RC | Publishes through `node scripts/npm-publish-idempotent.js --tag rc --access public`, skipping if the exact version already exists |
443
+ | Upsert PR comment | Posts or updates a comment with install command and short SHA |
444
+
445
+ ### Environment and Secrets
446
+
447
+ | Item | Type | Purpose |
448
+ |------|------|---------|
449
+ | `NPM_TOKEN` | Secret | npm registry authentication |
450
+ | `NODE_AUTH_TOKEN` | Env (derived) | Set to `$NPM_TOKEN` for npm CLI |
451
+ | `GH_TOKEN` | Env (derived) | Set to `${{ github.token }}` for PR comment API calls |
452
+
453
+ **Permissions**: `contents: read`, `pull-requests: write`
454
+
455
+ ### Artifacts
456
+
457
+ Publishes `@josstei/maestro@X.Y.Z-rc.N` to npm with the `rc` dist-tag, where `N` is auto-incremented.
458
+
459
+ ### Key Behaviors
460
+
461
+ - Uses concurrency group `rc-{PR number}` with `cancel-in-progress: true` to avoid duplicate RC publishes when new commits are pushed to the release branch.
462
+ - The RC number auto-increments by querying `npm view` for existing versions, ensuring no version collision even when the workflow runs multiple times for the same base version.
463
+ - The PR comment is upserted (update existing or create new) to keep a single, current RC reference on the PR.
464
+
465
+ ---
466
+
467
+ ## Release
468
+
469
+ ### Purpose
470
+
471
+ The final step of the release pipeline. Triggers on any push to `main`, but only acts when the push is a merged pull request carrying the `release` label. Validates package and archive contents, creates a Git tag, publishes the stable package to npm, then publishes a GitHub Release with CHANGELOG notes and the self-contained extension archive attached.
472
+
473
+ ### Trigger
474
+
475
+ | Event | Details |
476
+ |-------|---------|
477
+ | `push` | Branch: `main` |
478
+ | **Condition** | The pushed commit must be the merge commit of a PR labeled `release` that targeted `main` |
479
+
480
+ ### Flow
481
+
482
+ ```mermaid
483
+ graph TD
484
+ A["Push to main"] --> B["Checkout with full history"]
485
+ B --> C["Resolve release PR from commit"]
486
+ C --> D{"Merged PR with<br/>'release' label found?"}
487
+ D --> |"No"| E["Skip: not a release commit"]
488
+ D --> |"Yes"| F["Setup Node.js 24 with npm registry"]
489
+ F --> I["Extract and validate version"]
490
+ I --> J["Generate runtime adapters"]
491
+ J --> K{"Adapter drift?"}
492
+ K --> |"Yes"| L["Fail: adapters out of sync"]
493
+ K --> |"No"| M["Run full test suite"]
494
+ M --> N{"Tests pass?"}
495
+ N --> |"No"| O["Fail: test failures"]
496
+ N --> |"Yes"| P["Verify npm pack<br/>and release artifact"]
497
+ P --> Q["Create and push Git tag<br/>vX.Y.Z"]
498
+ Q --> R["Publish to npm<br/>--access public"]
499
+ R --> S["Extract CHANGELOG<br/>for this version"]
500
+ S --> T["Create GitHub Release<br/>with archive attached"]
501
+ ```
502
+
503
+ ### Job Breakdown
504
+
505
+ **Job: `release`**
506
+
507
+ | Step | Description |
508
+ |------|-------------|
509
+ | Checkout | Full history (`fetch-depth: 0`) for tag operations |
510
+ | Resolve release PR from commit | Queries the GitHub API for PRs associated with the current commit SHA; filters for merged PRs targeting `main` with the `release` label. If none found, sets `is_release=false` and all subsequent steps are skipped. |
511
+ | Setup Node.js | Conditional on `is_release=true`; Node.js 24 with npm registry URL for npm Trusted Publishing |
512
+ | Extract and validate version | Reads version from `package.json` and cross-validates: the CHANGELOG must have a matching section (unconditional). When the release branch name matches `release/vX.Y.Z` and the PR title matches `release: vX.Y.Z`, their embedded versions must agree with `package.json`. |
513
+ | Generate runtime adapters | Runs `node scripts/generate.js` |
514
+ | Check adapter drift | Final drift check before release; fails with error annotation |
515
+ | Run full test suite | Final test gate before release |
516
+ | Verify npm package contents | Runs `npm run pack:verify` before any tag or publish operation |
517
+ | Package release artifact | Runs `npm run release:artifacts` to create `dist/release/maestro-vX.Y.Z-extension.tar.gz` |
518
+ | Verify release artifact | Runs `npm run release:verify-artifacts` against the generated archive |
519
+ | Create and push tag | Creates Git tag `vX.Y.Z` at the merge commit SHA; handles idempotency (skips if tag exists at same SHA, fails if tag exists at different SHA) |
520
+ | Publish to npm | Publishes stable release through `node scripts/npm-publish-idempotent.js --access public` and GitHub Actions OIDC trusted publishing, skipping if the exact version already exists |
521
+ | Extract changelog | Extracts the version-specific section from `CHANGELOG.md` using `awk` |
522
+ | Create GitHub Release | Uses `softprops/action-gh-release` (pinned to SHA `c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda`, v2.2.1) with CHANGELOG excerpt as body and the generic extension archive attached |
523
+
524
+ ### Environment and Secrets
525
+
526
+ | Item | Type | Purpose |
527
+ |------|------|---------|
528
+ | `GH_TOKEN` | Env (derived) | Set to `${{ github.token }}` for PR creation and GitHub API calls |
529
+
530
+ **Permissions**: `contents: write`, `id-token: write`, `pull-requests: write`
531
+
532
+ ### Artifacts
533
+
534
+ - Git tag `vX.Y.Z` pushed to origin
535
+ - Stable npm package `@josstei/maestro@X.Y.Z` published with the `latest` dist-tag
536
+ - GitHub Release with CHANGELOG body and `maestro-vX.Y.Z-extension.tar.gz`
537
+
538
+ ### Key Behaviors
539
+
540
+ - The release detection uses the GitHub API to find the PR associated with the merge commit, filtering for the `release` label. Non-release pushes to `main` exit early and cleanly.
541
+ - Version validation cross-checks `package.json` against the CHANGELOG (unconditional) and, when applicable, against the release branch name (`release/vX.Y.Z`) and the PR title (`release: vX.Y.Z`). A mismatch in any available source fails the workflow.
542
+ - Stable releases require npm Trusted Publishing to be configured for `@josstei/maestro` with GitHub Actions workflow `release.yml`; the workflow does not use a long-lived npm token.
543
+ - Tag creation is idempotent: if the tag already exists at the same commit, the step is skipped. If it exists at a different commit, the workflow fails to prevent overwriting a release.
544
+
545
+ ---
546
+
547
+ ## Build Commands
548
+
549
+ The `justfile` provides local development commands that mirror CI behavior.
550
+
551
+ ### Command Reference
552
+
553
+ | Command | Description | CI Equivalent |
554
+ |---------|-------------|---------------|
555
+ | `just generate` | Generate all runtime files from `src/` | Used in all 6 generator workflows |
556
+ | `just dry-run` | Preview changes without writing | No CI equivalent |
557
+ | `just diff` | Show unified diff of pending changes | No CI equivalent |
558
+ | `just clean` | Delete generated files and regenerate from scratch | No CI equivalent |
559
+ | `just test` | Run all tests (unit + transform + integration) | Used in all 6 generator workflows |
560
+ | `just test-unit` | Run only unit tests | No CI equivalent |
561
+ | `just test-transforms` | Run only transform unit tests | No CI equivalent |
562
+ | `just test-integration` | Run only integration tests | No CI equivalent |
563
+ | `just check` | Generate + verify zero drift | Replicated in all 6 generator workflows |
564
+ | `just check-layers` | Verify `lib/` layer boundary imports | No CI workflow equivalent |
565
+ | `just ci` | Full CI equivalent: `check` + `check-layers` + `test` | Superset of CI (includes `check-layers`) |
566
+ | `just cleanup-branches` | Delete local branches whose remote is gone | No CI equivalent |
567
+
568
+ ### CI Mapping
569
+
570
+ The workflows replicate the following `just` commands:
571
+
572
+ ```
573
+ just generate --> node scripts/generate.js
574
+ just check --> git diff --exit-code --name-only (after generate)
575
+ just test --> node --test tests/unit/*.test.js tests/transforms/*.test.js tests/integration/*.test.js
576
+ pack verify --> npm run pack:verify
577
+ artifact check --> npm run release:artifacts && npm run release:verify-artifacts
578
+ ```
579
+
580
+ The local `just ci` recipe runs `check`, `check-layers`, and `test`. The GitHub source-of-truth workflow runs `generate`, drift check, `test`, npm pack verification, and release artifact verification, but does not run `check-layers` (`node scripts/check-layer-boundaries.js`). The layer boundary check is a local-only validation.
581
+
582
+ ---
583
+
584
+ ## Workflow Relationships
585
+
586
+ ### Release Pipeline Chain
587
+
588
+ The release pipeline is a multi-workflow chain where each stage triggers the next through Git events and PR labels.
589
+
590
+ ```mermaid
591
+ graph LR
592
+ A["Developer triggers<br/>Prepare Release<br/>on main branch"] --> B["Prepare Release<br/>creates release/vX.Y.Z"]
593
+ B --> D["PR to main<br/>labeled 'release' + 'rc'"]
594
+ D --> E["Source Of Truth Check<br/>runs on PR"]
595
+ D --> F["Release Candidate<br/>publishes X.Y.Z-rc.N"]
596
+ F --> |"RC validated<br/>PR merged to main"| G["Release<br/>publishes X.Y.Z"]
597
+ ```
598
+
599
+ ### Step-by-Step Release Flow
600
+
601
+ 1. A maintainer manually triggers **Prepare Release** from the `main` branch (optionally specifying a version).
602
+ 2. The workflow validates `main` (drift check, tests, CHANGELOG content), creates a `release/vX.Y.Z` branch, bumps version files, and pushes the branch.
603
+ 3. One PR is opened:
604
+ - **PR to `main`**: the release PR, labeled with `release` and `rc`, containing the CHANGELOG excerpt.
605
+ 4. The release PR triggers **Source Of Truth Check** (standard CI on PRs to `main`).
606
+ 5. The `release` + `rc` labels on a PR from `release/v*` to `main` trigger the **Release Candidate** workflow, which publishes an RC to npm.
607
+ 6. If additional commits are pushed to the release branch, both Source Of Truth Check and Release Candidate re-run (RC number auto-increments).
608
+ 7. When the release PR is merged to `main`, the push event triggers **Release**.
609
+ 8. Release detects the merged release PR via the GitHub API, validates version consistency, runs final checks, creates a Git tag, publishes to npm, and creates a GitHub Release with the generic extension archive attached.
610
+
611
+ ### Branch Strategy
612
+
613
+ ```mermaid
614
+ graph LR
615
+ A["main<br/>primary development + releases"] --> |"Prepare Release"| B["release/vX.Y.Z<br/>short-lived"]
616
+ B --> |"Release PR"| A
617
+ ```
618
+
619
+ | Branch | Purpose | Protected |
620
+ |--------|---------|-----------|
621
+ | `main` | Primary development and release branch; all feature work and releases merge here | Yes (CI required) |
622
+ | `<type>/<slug>` | Contributor work branches using the same type vocabulary as Conventional Commits | PR check required |
623
+ | `<namespace>/<type>/<slug>` | Namespaced contributor/tool work branches, such as `codex/chore/enforce-git-conventions` | PR check required |
624
+ | `release/vX.Y.Z` | Short-lived release branches created by Prepare Release | Transient |
625
+
626
+ ### Permissions and Secrets Summary
627
+
628
+ | Workflow | Permissions | Secrets |
629
+ |----------|-------------|---------|
630
+ | Source Of Truth Check | Default (read) | None |
631
+ | Commit Message Check | `contents: read` | None |
632
+ | Nightly Build | `contents: read` | `NPM_TOKEN` |
633
+ | Preview Build | `contents: read`, `pull-requests: write` | `NPM_TOKEN` |
634
+ | Prepare Release | `contents: write`, `pull-requests: write` | `RELEASE_TOKEN` |
635
+ | Release Candidate | `contents: read`, `pull-requests: write` | `NPM_TOKEN` |
636
+ | Release | `contents: write`, `id-token: write`, `pull-requests: write` | None |
637
+
638
+ The `RELEASE_TOKEN` used by Prepare Release is a personal access token with elevated permissions. The default `GITHUB_TOKEN` does not trigger downstream workflow runs, so `RELEASE_TOKEN` is required for branch pushes and PR creation that need to activate Source Of Truth Check and Release Candidate on the newly created PR.
639
+
640
+ ### npm Dist-Tags
641
+
642
+ | Tag | Source | Version Pattern | Workflow |
643
+ |-----|--------|-----------------|----------|
644
+ | `latest` | Stable release from `main` | `X.Y.Z` | Release |
645
+ | `rc` | Release candidate from release PR | `X.Y.Z-rc.N` | Release Candidate |
646
+ | `preview` | PR preview build | `X.Y.Z-preview.SHORT_SHA` | Preview Build |
647
+ | `nightly` | Daily main snapshot | `X.Y.Z-nightly.YYYYMMDD` | Nightly Build |