@delorenj/pjangler 1.2.21 → 1.2.33

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 (835) hide show
  1. package/README.md +12 -3
  2. package/dist/index.js +8577 -4137
  3. package/dist/mcp-server.js +8115 -4079
  4. package/package.json +19 -4
  5. package/templates/commonproject/copier.yml +6 -3
  6. package/templates/commonproject/template/.agents/skills.json +2 -1
  7. package/templates/commonproject/template/.env.op +6 -2
  8. package/templates/commonproject/template/.github/workflows/code-review.yml.jinja +48 -0
  9. package/templates/commonproject/template/.mise/scripts/materialize-env.sh +28 -0
  10. package/templates/commonproject/template/.mise/scripts/provision-packs.py +565 -0
  11. package/templates/commonproject/template/.mise/scripts/sync-skills.py +1728 -0
  12. package/templates/commonproject/template/mise.toml.jinja +14 -4
  13. package/templates/hermes-agent/copier.yml +11 -7
  14. package/templates/hermes-agent/template/.gitignore.jinja +6 -2
  15. package/templates/hermes-agent/template/.runtime-scaffold/README.md +4 -2
  16. package/templates/hermes-agent/template/.scripts/00-banner.sh +1 -1
  17. package/templates/hermes-agent/template/.scripts/01-config.sh +3 -0
  18. package/templates/hermes-agent/template/.scripts/10-hermes-profile.sh +12 -1
  19. package/templates/hermes-agent/template/.scripts/20-runtime-repo.sh +114 -131
  20. package/templates/hermes-agent/template/.scripts/30-telegram.sh +276 -22
  21. package/templates/hermes-agent/template/.scripts/31-slack.sh +362 -0
  22. package/templates/hermes-agent/template/.scripts/60-bloodbank.sh +8 -66
  23. package/templates/hermes-agent/template/.scripts/70-systemd.sh +50 -29
  24. package/templates/hermes-agent/template/.scripts/80-registry.sh +93 -13
  25. package/templates/hermes-agent/template/.scripts/99-summary.sh +1 -4
  26. package/templates/hermes-agent/template/.scripts/_lib.sh +66 -1
  27. package/templates/hermes-agent/template/.scripts/checkpoint.sh +3 -2
  28. package/templates/hermes-agent/template/.scripts/config.example.toml +10 -10
  29. package/templates/hermes-agent/template/.scripts/heartbeat.sh +1 -1
  30. package/templates/hermes-agent/template/.scripts/lib/ticket-provider.sh +15 -7
  31. package/templates/hermes-agent/template/.scripts/providers/linear.sh +41 -1
  32. package/templates/hermes-agent/template/.scripts/providers/plane.sh +91 -21
  33. package/templates/hermes-agent/template/.scripts/providers/trello.sh +34 -1
  34. package/templates/hermes-agent/template/.scripts/reporter-watchdog.py +242 -0
  35. package/templates/hermes-agent/template/.scripts/secret-scan.py +68 -0
  36. package/templates/hermes-agent/template/.scripts/sentinel.prompt.md.jinja +3 -2
  37. package/templates/hermes-agent/template/SOUL.md.jinja +32 -10
  38. package/templates/hermes-agent/template/hermes.jinja +6 -3
  39. package/templates/hermes-agent/template/role.yaml.jinja +25 -13
  40. package/templates/commonproject/.augment/commands/bmad/agents/bmb-agent-builder.md +0 -14
  41. package/templates/commonproject/.augment/commands/bmad/agents/bmb-module-builder.md +0 -14
  42. package/templates/commonproject/.augment/commands/bmad/agents/bmb-workflow-builder.md +0 -14
  43. package/templates/commonproject/.augment/commands/bmad/agents/bmm-analyst.md +0 -14
  44. package/templates/commonproject/.augment/commands/bmad/agents/bmm-architect.md +0 -14
  45. package/templates/commonproject/.augment/commands/bmad/agents/bmm-dev.md +0 -14
  46. package/templates/commonproject/.augment/commands/bmad/agents/bmm-pm.md +0 -14
  47. package/templates/commonproject/.augment/commands/bmad/agents/bmm-quick-flow-solo-dev.md +0 -14
  48. package/templates/commonproject/.augment/commands/bmad/agents/bmm-sm.md +0 -14
  49. package/templates/commonproject/.augment/commands/bmad/agents/bmm-tea.md +0 -14
  50. package/templates/commonproject/.augment/commands/bmad/agents/bmm-tech-writer.md +0 -14
  51. package/templates/commonproject/.augment/commands/bmad/agents/bmm-ux-designer.md +0 -14
  52. package/templates/commonproject/.augment/commands/bmad/agents/cis-brainstorming-coach.md +0 -14
  53. package/templates/commonproject/.augment/commands/bmad/agents/cis-creative-problem-solver.md +0 -14
  54. package/templates/commonproject/.augment/commands/bmad/agents/cis-design-thinking-coach.md +0 -14
  55. package/templates/commonproject/.augment/commands/bmad/agents/cis-innovation-strategist.md +0 -14
  56. package/templates/commonproject/.augment/commands/bmad/agents/cis-presentation-master.md +0 -14
  57. package/templates/commonproject/.augment/commands/bmad/agents/cis-storyteller.md +0 -14
  58. package/templates/commonproject/.augment/commands/bmad/agents/core-bmad-master.md +0 -14
  59. package/templates/commonproject/.augment/commands/bmad/tasks/core-index-docs.md +0 -74
  60. package/templates/commonproject/.augment/commands/bmad/tasks/core-shard-doc.md +0 -118
  61. package/templates/commonproject/.augment/commands/bmad/workflows/bmb-agent.md +0 -5
  62. package/templates/commonproject/.augment/commands/bmad/workflows/bmb-module.md +0 -5
  63. package/templates/commonproject/.augment/commands/bmad/workflows/bmb-workflow.md +0 -5
  64. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-check-implementation-readiness.md +0 -5
  65. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-code-review.md +0 -13
  66. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-correct-course.md +0 -13
  67. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-architecture.md +0 -5
  68. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-epics-and-stories.md +0 -5
  69. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-excalidraw-dataflow.md +0 -13
  70. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-excalidraw-diagram.md +0 -13
  71. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-excalidraw-flowchart.md +0 -13
  72. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-excalidraw-wireframe.md +0 -13
  73. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-product-brief.md +0 -5
  74. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-story.md +0 -13
  75. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-ux-design.md +0 -5
  76. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-dev-story.md +0 -13
  77. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-document-project.md +0 -13
  78. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-generate-project-context.md +0 -5
  79. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-prd.md +0 -5
  80. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-quick-dev.md +0 -5
  81. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-quick-spec.md +0 -5
  82. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-research.md +0 -5
  83. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-retrospective.md +0 -13
  84. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-sprint-planning.md +0 -13
  85. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-sprint-status.md +0 -13
  86. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-atdd.md +0 -13
  87. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-automate.md +0 -13
  88. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-ci.md +0 -13
  89. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-framework.md +0 -13
  90. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-nfr.md +0 -13
  91. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-test-design.md +0 -13
  92. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-test-review.md +0 -13
  93. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-trace.md +0 -13
  94. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-workflow-init.md +0 -13
  95. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-workflow-status.md +0 -13
  96. package/templates/commonproject/.augment/commands/bmad/workflows/cis-design-thinking.md +0 -13
  97. package/templates/commonproject/.augment/commands/bmad/workflows/cis-innovation-strategy.md +0 -13
  98. package/templates/commonproject/.augment/commands/bmad/workflows/cis-problem-solving.md +0 -13
  99. package/templates/commonproject/.augment/commands/bmad/workflows/cis-storytelling.md +0 -13
  100. package/templates/commonproject/.augment/commands/bmad/workflows/core-brainstorming.md +0 -5
  101. package/templates/commonproject/.augment/commands/bmad/workflows/core-party-mode.md +0 -5
  102. package/templates/commonproject/.augment/commands/bmad/workflows/custom-ticket-lifecycle.md +0 -5
  103. package/templates/commonproject/.copier-answers.yml +0 -4
  104. package/templates/commonproject/.gemini/commands/bmad-agent-bmb-agent-builder.toml +0 -12
  105. package/templates/commonproject/.gemini/commands/bmad-agent-bmb-module-builder.toml +0 -12
  106. package/templates/commonproject/.gemini/commands/bmad-agent-bmb-workflow-builder.toml +0 -12
  107. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-analyst.toml +0 -12
  108. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-architect.toml +0 -12
  109. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-dev.toml +0 -12
  110. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-pm.toml +0 -12
  111. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-quick-flow-solo-dev.toml +0 -12
  112. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-sm.toml +0 -12
  113. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-tea.toml +0 -12
  114. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-tech-writer.toml +0 -12
  115. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-ux-designer.toml +0 -12
  116. package/templates/commonproject/.gemini/commands/bmad-agent-cis-brainstorming-coach.toml +0 -12
  117. package/templates/commonproject/.gemini/commands/bmad-agent-cis-creative-problem-solver.toml +0 -12
  118. package/templates/commonproject/.gemini/commands/bmad-agent-cis-design-thinking-coach.toml +0 -12
  119. package/templates/commonproject/.gemini/commands/bmad-agent-cis-innovation-strategist.toml +0 -12
  120. package/templates/commonproject/.gemini/commands/bmad-agent-cis-presentation-master.toml +0 -12
  121. package/templates/commonproject/.gemini/commands/bmad-agent-cis-storyteller.toml +0 -12
  122. package/templates/commonproject/.gemini/commands/bmad-agent-core-bmad-master.toml +0 -12
  123. package/templates/commonproject/.gemini/commands/bmad-task-core-index-docs.toml +0 -12
  124. package/templates/commonproject/.gemini/commands/bmad-task-core-review-adversarial-general.toml +0 -12
  125. package/templates/commonproject/.gemini/commands/bmad-task-core-shard-doc.toml +0 -12
  126. package/templates/commonproject/.gemini/commands/bmad-task-core-workflow.toml +0 -12
  127. package/templates/commonproject/.gemini/commands/bmad-workflow-bmb-agent.toml +0 -4
  128. package/templates/commonproject/.gemini/commands/bmad-workflow-bmb-module.toml +0 -4
  129. package/templates/commonproject/.gemini/commands/bmad-workflow-bmb-workflow.toml +0 -4
  130. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-check-implementation-readiness.toml +0 -4
  131. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-code-review.toml +0 -12
  132. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-correct-course.toml +0 -12
  133. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-architecture.toml +0 -4
  134. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-epics-and-stories.toml +0 -4
  135. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-excalidraw-dataflow.toml +0 -12
  136. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-excalidraw-diagram.toml +0 -12
  137. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-excalidraw-flowchart.toml +0 -12
  138. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-excalidraw-wireframe.toml +0 -12
  139. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-product-brief.toml +0 -4
  140. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-story.toml +0 -12
  141. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-ux-design.toml +0 -4
  142. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-dev-story.toml +0 -12
  143. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-document-project.toml +0 -12
  144. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-generate-project-context.toml +0 -4
  145. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-prd.toml +0 -4
  146. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-quick-dev.toml +0 -4
  147. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-quick-spec.toml +0 -4
  148. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-research.toml +0 -4
  149. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-retrospective.toml +0 -12
  150. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-sprint-planning.toml +0 -12
  151. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-sprint-status.toml +0 -12
  152. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-atdd.toml +0 -12
  153. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-automate.toml +0 -12
  154. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-ci.toml +0 -12
  155. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-framework.toml +0 -12
  156. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-nfr.toml +0 -12
  157. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-test-design.toml +0 -12
  158. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-test-review.toml +0 -12
  159. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-trace.toml +0 -12
  160. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-workflow-init.toml +0 -12
  161. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-workflow-status.toml +0 -12
  162. package/templates/commonproject/.gemini/commands/bmad-workflow-cis-design-thinking.toml +0 -12
  163. package/templates/commonproject/.gemini/commands/bmad-workflow-cis-innovation-strategy.toml +0 -12
  164. package/templates/commonproject/.gemini/commands/bmad-workflow-cis-problem-solving.toml +0 -12
  165. package/templates/commonproject/.gemini/commands/bmad-workflow-cis-storytelling.toml +0 -12
  166. package/templates/commonproject/.gemini/commands/bmad-workflow-core-brainstorming.toml +0 -4
  167. package/templates/commonproject/.gemini/commands/bmad-workflow-core-party-mode.toml +0 -4
  168. package/templates/commonproject/.gemini/commands/bmad-workflow-custom-ticket-lifecycle.toml +0 -4
  169. package/templates/commonproject/.github/agents/bmd-custom-bmb-agent-builder.agent.md +0 -17
  170. package/templates/commonproject/.github/agents/bmd-custom-bmb-module-builder.agent.md +0 -17
  171. package/templates/commonproject/.github/agents/bmd-custom-bmb-workflow-builder.agent.md +0 -17
  172. package/templates/commonproject/.github/agents/bmd-custom-bmm-analyst.agent.md +0 -17
  173. package/templates/commonproject/.github/agents/bmd-custom-bmm-architect.agent.md +0 -17
  174. package/templates/commonproject/.github/agents/bmd-custom-bmm-dev.agent.md +0 -17
  175. package/templates/commonproject/.github/agents/bmd-custom-bmm-pm.agent.md +0 -17
  176. package/templates/commonproject/.github/agents/bmd-custom-bmm-quick-flow-solo-dev.agent.md +0 -17
  177. package/templates/commonproject/.github/agents/bmd-custom-bmm-sm.agent.md +0 -17
  178. package/templates/commonproject/.github/agents/bmd-custom-bmm-tea.agent.md +0 -17
  179. package/templates/commonproject/.github/agents/bmd-custom-bmm-tech-writer.agent.md +0 -17
  180. package/templates/commonproject/.github/agents/bmd-custom-bmm-ux-designer.agent.md +0 -17
  181. package/templates/commonproject/.github/agents/bmd-custom-cis-brainstorming-coach.agent.md +0 -17
  182. package/templates/commonproject/.github/agents/bmd-custom-cis-creative-problem-solver.agent.md +0 -17
  183. package/templates/commonproject/.github/agents/bmd-custom-cis-design-thinking-coach.agent.md +0 -17
  184. package/templates/commonproject/.github/agents/bmd-custom-cis-innovation-strategist.agent.md +0 -17
  185. package/templates/commonproject/.github/agents/bmd-custom-cis-presentation-master.agent.md +0 -17
  186. package/templates/commonproject/.github/agents/bmd-custom-cis-storyteller.agent.md +0 -17
  187. package/templates/commonproject/.github/agents/bmd-custom-core-bmad-master.agent.md +0 -17
  188. package/templates/commonproject/.mcp.json +0 -12
  189. package/templates/commonproject/.mise/scripts/claude +0 -13
  190. package/templates/commonproject/.mise/scripts/create-plane-project.sh +0 -149
  191. package/templates/commonproject/.mise/scripts/init-project.sh +0 -314
  192. package/templates/commonproject/.mise/scripts/link-agentfiles.sh +0 -9
  193. package/templates/commonproject/.opencode/agent/bmad-agent-bmb-agent-builder.md +0 -14
  194. package/templates/commonproject/.opencode/agent/bmad-agent-bmb-module-builder.md +0 -14
  195. package/templates/commonproject/.opencode/agent/bmad-agent-bmb-workflow-builder.md +0 -14
  196. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-analyst.md +0 -14
  197. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-architect.md +0 -14
  198. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-dev.md +0 -14
  199. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-pm.md +0 -14
  200. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-quick-flow-solo-dev.md +0 -14
  201. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-sm.md +0 -14
  202. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-tea.md +0 -14
  203. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-tech-writer.md +0 -14
  204. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-ux-designer.md +0 -14
  205. package/templates/commonproject/.opencode/agent/bmad-agent-cis-brainstorming-coach.md +0 -14
  206. package/templates/commonproject/.opencode/agent/bmad-agent-cis-creative-problem-solver.md +0 -14
  207. package/templates/commonproject/.opencode/agent/bmad-agent-cis-design-thinking-coach.md +0 -14
  208. package/templates/commonproject/.opencode/agent/bmad-agent-cis-innovation-strategist.md +0 -14
  209. package/templates/commonproject/.opencode/agent/bmad-agent-cis-presentation-master.md +0 -14
  210. package/templates/commonproject/.opencode/agent/bmad-agent-cis-storyteller.md +0 -14
  211. package/templates/commonproject/.opencode/agent/bmad-agent-core-bmad-master.md +0 -14
  212. package/templates/commonproject/.opencode/command/bmad-bmb-agent.md +0 -5
  213. package/templates/commonproject/.opencode/command/bmad-bmb-module.md +0 -5
  214. package/templates/commonproject/.opencode/command/bmad-bmb-workflow.md +0 -5
  215. package/templates/commonproject/.opencode/command/bmad-bmm-check-implementation-readiness.md +0 -5
  216. package/templates/commonproject/.opencode/command/bmad-bmm-code-review.md +0 -13
  217. package/templates/commonproject/.opencode/command/bmad-bmm-correct-course.md +0 -13
  218. package/templates/commonproject/.opencode/command/bmad-bmm-create-architecture.md +0 -5
  219. package/templates/commonproject/.opencode/command/bmad-bmm-create-epics-and-stories.md +0 -5
  220. package/templates/commonproject/.opencode/command/bmad-bmm-create-excalidraw-dataflow.md +0 -13
  221. package/templates/commonproject/.opencode/command/bmad-bmm-create-excalidraw-diagram.md +0 -13
  222. package/templates/commonproject/.opencode/command/bmad-bmm-create-excalidraw-flowchart.md +0 -13
  223. package/templates/commonproject/.opencode/command/bmad-bmm-create-excalidraw-wireframe.md +0 -13
  224. package/templates/commonproject/.opencode/command/bmad-bmm-create-product-brief.md +0 -5
  225. package/templates/commonproject/.opencode/command/bmad-bmm-create-story.md +0 -13
  226. package/templates/commonproject/.opencode/command/bmad-bmm-create-ux-design.md +0 -5
  227. package/templates/commonproject/.opencode/command/bmad-bmm-dev-story.md +0 -13
  228. package/templates/commonproject/.opencode/command/bmad-bmm-document-project.md +0 -13
  229. package/templates/commonproject/.opencode/command/bmad-bmm-generate-project-context.md +0 -5
  230. package/templates/commonproject/.opencode/command/bmad-bmm-prd.md +0 -5
  231. package/templates/commonproject/.opencode/command/bmad-bmm-quick-dev.md +0 -5
  232. package/templates/commonproject/.opencode/command/bmad-bmm-quick-spec.md +0 -5
  233. package/templates/commonproject/.opencode/command/bmad-bmm-research.md +0 -5
  234. package/templates/commonproject/.opencode/command/bmad-bmm-retrospective.md +0 -13
  235. package/templates/commonproject/.opencode/command/bmad-bmm-sprint-planning.md +0 -13
  236. package/templates/commonproject/.opencode/command/bmad-bmm-sprint-status.md +0 -13
  237. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-atdd.md +0 -13
  238. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-automate.md +0 -13
  239. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-ci.md +0 -13
  240. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-framework.md +0 -13
  241. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-nfr.md +0 -13
  242. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-test-design.md +0 -13
  243. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-test-review.md +0 -13
  244. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-trace.md +0 -13
  245. package/templates/commonproject/.opencode/command/bmad-bmm-workflow-init.md +0 -13
  246. package/templates/commonproject/.opencode/command/bmad-bmm-workflow-status.md +0 -13
  247. package/templates/commonproject/.opencode/command/bmad-cis-design-thinking.md +0 -13
  248. package/templates/commonproject/.opencode/command/bmad-cis-innovation-strategy.md +0 -13
  249. package/templates/commonproject/.opencode/command/bmad-cis-problem-solving.md +0 -13
  250. package/templates/commonproject/.opencode/command/bmad-cis-storytelling.md +0 -13
  251. package/templates/commonproject/.opencode/command/bmad-core-brainstorming.md +0 -5
  252. package/templates/commonproject/.opencode/command/bmad-core-party-mode.md +0 -5
  253. package/templates/commonproject/.opencode/command/bmad-custom-ticket-lifecycle.md +0 -5
  254. package/templates/commonproject/.opencode/command/bmad-task-core-index-docs.md +0 -9
  255. package/templates/commonproject/.opencode/command/bmad-task-core-shard-doc.md +0 -9
  256. package/templates/commonproject/.plane.json +0 -6
  257. package/templates/commonproject/.scripts/test-template.sh +0 -63
  258. package/templates/commonproject/AGENTS.md +0 -86
  259. package/templates/commonproject/README.md +0 -172
  260. package/templates/commonproject/_bmad/_config/agent-manifest.csv +0 -20
  261. package/templates/commonproject/_bmad/_config/agents/bmb-agent-builder.customize.yaml +0 -41
  262. package/templates/commonproject/_bmad/_config/agents/bmb-module-builder.customize.yaml +0 -41
  263. package/templates/commonproject/_bmad/_config/agents/bmb-workflow-builder.customize.yaml +0 -41
  264. package/templates/commonproject/_bmad/_config/agents/bmm-analyst.customize.yaml +0 -41
  265. package/templates/commonproject/_bmad/_config/agents/bmm-architect.customize.yaml +0 -41
  266. package/templates/commonproject/_bmad/_config/agents/bmm-dev.customize.yaml +0 -41
  267. package/templates/commonproject/_bmad/_config/agents/bmm-pm.customize.yaml +0 -41
  268. package/templates/commonproject/_bmad/_config/agents/bmm-quick-flow-solo-dev.customize.yaml +0 -41
  269. package/templates/commonproject/_bmad/_config/agents/bmm-sm.customize.yaml +0 -41
  270. package/templates/commonproject/_bmad/_config/agents/bmm-tea.customize.yaml +0 -41
  271. package/templates/commonproject/_bmad/_config/agents/bmm-tech-writer.customize.yaml +0 -41
  272. package/templates/commonproject/_bmad/_config/agents/bmm-ux-designer.customize.yaml +0 -41
  273. package/templates/commonproject/_bmad/_config/agents/cis-brainstorming-coach.customize.yaml +0 -41
  274. package/templates/commonproject/_bmad/_config/agents/cis-creative-problem-solver.customize.yaml +0 -41
  275. package/templates/commonproject/_bmad/_config/agents/cis-design-thinking-coach.customize.yaml +0 -41
  276. package/templates/commonproject/_bmad/_config/agents/cis-innovation-strategist.customize.yaml +0 -41
  277. package/templates/commonproject/_bmad/_config/agents/cis-presentation-master.customize.yaml +0 -41
  278. package/templates/commonproject/_bmad/_config/agents/cis-storyteller.customize.yaml +0 -41
  279. package/templates/commonproject/_bmad/_config/agents/core-bmad-master.customize.yaml +0 -41
  280. package/templates/commonproject/_bmad/_config/custom/cache-manifest.yaml +0 -4
  281. package/templates/commonproject/_bmad/_config/custom/custom/module.yaml +0 -8
  282. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/data/ac-sufficiency-rubric.md +0 -33
  283. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/data/audit-comment-template.md +0 -54
  284. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/data/event-schemas.md +0 -58
  285. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-c/step-01-init.md +0 -173
  286. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-c/step-02-triage.md +0 -159
  287. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-c/step-03-refine.md +0 -149
  288. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-c/step-04-implement.md +0 -147
  289. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-c/step-05-review.md +0 -146
  290. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-c/step-06-qa.md +0 -199
  291. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-c/step-07-complete.md +0 -141
  292. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-e/step-01-assess.md +0 -102
  293. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-e/step-02-apply.md +0 -85
  294. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-v/step-01-validate.md +0 -154
  295. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/workflow-plan-ticket-lifecycle.md +0 -346
  296. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/workflow.md +0 -84
  297. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/workflow.yaml +0 -39
  298. package/templates/commonproject/_bmad/_config/files-manifest.csv +0 -483
  299. package/templates/commonproject/_bmad/_config/ides/claude-code.yaml +0 -6
  300. package/templates/commonproject/_bmad/_config/ides/codex.yaml +0 -5
  301. package/templates/commonproject/_bmad/_config/manifest.yaml +0 -18
  302. package/templates/commonproject/_bmad/_config/task-manifest.csv +0 -5
  303. package/templates/commonproject/_bmad/_config/tool-manifest.csv +0 -1
  304. package/templates/commonproject/_bmad/_config/workflow-manifest.csv +0 -43
  305. package/templates/commonproject/_bmad/_memory/config.yaml +0 -11
  306. package/templates/commonproject/_bmad/_memory/storyteller-sidecar/stories-told.md +0 -7
  307. package/templates/commonproject/_bmad/_memory/storyteller-sidecar/story-preferences.md +0 -7
  308. package/templates/commonproject/_bmad/bmb/README.md +0 -25
  309. package/templates/commonproject/_bmad/bmb/agents/agent-builder.md +0 -64
  310. package/templates/commonproject/_bmad/bmb/agents/module-builder.md +0 -65
  311. package/templates/commonproject/_bmad/bmb/agents/workflow-builder.md +0 -66
  312. package/templates/commonproject/_bmad/bmb/config.yaml +0 -12
  313. package/templates/commonproject/_bmad/bmb/workflows/agent/data/agent-compilation.md +0 -273
  314. package/templates/commonproject/_bmad/bmb/workflows/agent/data/agent-menu-patterns.md +0 -233
  315. package/templates/commonproject/_bmad/bmb/workflows/agent/data/agent-metadata.md +0 -208
  316. package/templates/commonproject/_bmad/bmb/workflows/agent/data/brainstorm-context.md +0 -146
  317. package/templates/commonproject/_bmad/bmb/workflows/agent/data/communication-presets.csv +0 -61
  318. package/templates/commonproject/_bmad/bmb/workflows/agent/data/critical-actions.md +0 -120
  319. package/templates/commonproject/_bmad/bmb/workflows/agent/data/expert-agent-architecture.md +0 -236
  320. package/templates/commonproject/_bmad/bmb/workflows/agent/data/expert-agent-validation.md +0 -174
  321. package/templates/commonproject/_bmad/bmb/workflows/agent/data/module-agent-validation.md +0 -126
  322. package/templates/commonproject/_bmad/bmb/workflows/agent/data/persona-properties.md +0 -266
  323. package/templates/commonproject/_bmad/bmb/workflows/agent/data/principles-crafting.md +0 -292
  324. package/templates/commonproject/_bmad/bmb/workflows/agent/data/reference/module-examples/architect.md +0 -68
  325. package/templates/commonproject/_bmad/bmb/workflows/agent/data/simple-agent-architecture.md +0 -204
  326. package/templates/commonproject/_bmad/bmb/workflows/agent/data/simple-agent-validation.md +0 -133
  327. package/templates/commonproject/_bmad/bmb/workflows/agent/data/understanding-agent-types.md +0 -222
  328. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-01-brainstorm.md +0 -128
  329. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-02-discovery.md +0 -170
  330. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-03-type-metadata.md +0 -296
  331. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-04-persona.md +0 -212
  332. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-05-commands-menu.md +0 -178
  333. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-06-activation.md +0 -279
  334. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-07a-build-simple.md +0 -187
  335. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-07b-build-expert.md +0 -201
  336. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-07c-build-module.md +0 -258
  337. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-08-celebrate.md +0 -249
  338. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-01-load-existing.md +0 -221
  339. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-02-discover-edits.md +0 -193
  340. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-03-placeholder.md +0 -1
  341. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-04-type-metadata.md +0 -124
  342. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-05-persona.md +0 -134
  343. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-06-commands-menu.md +0 -122
  344. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-07-activation.md +0 -125
  345. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-08a-edit-simple.md +0 -137
  346. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-08b-edit-expert.md +0 -119
  347. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-08c-edit-module.md +0 -123
  348. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-09-celebrate.md +0 -155
  349. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-v/v-01-load-review.md +0 -136
  350. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-v/v-02a-validate-metadata.md +0 -116
  351. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-v/v-02b-validate-persona.md +0 -124
  352. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-v/v-02c-validate-menu.md +0 -145
  353. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-v/v-02d-validate-structure.md +0 -136
  354. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-v/v-02e-validate-sidecar.md +0 -136
  355. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-v/v-03-summary.md +0 -104
  356. package/templates/commonproject/_bmad/bmb/workflows/agent/templates/agent-plan.template.md +0 -5
  357. package/templates/commonproject/_bmad/bmb/workflows/agent/templates/expert-agent-template/expert-agent.template.md +0 -77
  358. package/templates/commonproject/_bmad/bmb/workflows/agent/templates/simple-agent.template.md +0 -72
  359. package/templates/commonproject/_bmad/bmb/workflows/agent/workflow.md +0 -123
  360. package/templates/commonproject/_bmad/bmb/workflows/module/data/agent-architecture.md +0 -179
  361. package/templates/commonproject/_bmad/bmb/workflows/module/data/agent-spec-template.md +0 -79
  362. package/templates/commonproject/_bmad/bmb/workflows/module/data/module-installer-standards.md +0 -348
  363. package/templates/commonproject/_bmad/bmb/workflows/module/data/module-standards.md +0 -280
  364. package/templates/commonproject/_bmad/bmb/workflows/module/data/module-yaml-conventions.md +0 -392
  365. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-01-welcome.md +0 -147
  366. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-02-spark.md +0 -140
  367. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-03-module-type.md +0 -148
  368. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-04-vision.md +0 -82
  369. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-05-identity.md +0 -96
  370. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-06-users.md +0 -85
  371. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-07-value.md +0 -75
  372. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-08-agents.md +0 -96
  373. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-09-workflows.md +0 -82
  374. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-10-tools.md +0 -90
  375. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-11-scenarios.md +0 -83
  376. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-12-creative.md +0 -94
  377. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-13-review.md +0 -104
  378. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-14-finalize.md +0 -117
  379. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-01-load-brief.md +0 -178
  380. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-01b-continue.md +0 -83
  381. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-02-structure.md +0 -109
  382. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-03-config.md +0 -118
  383. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-04-installer.md +0 -160
  384. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-05-agents.md +0 -167
  385. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-06-workflows.md +0 -183
  386. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-07-docs.md +0 -402
  387. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-08-complete.md +0 -123
  388. package/templates/commonproject/_bmad/bmb/workflows/module/steps-e/step-01-load-target.md +0 -81
  389. package/templates/commonproject/_bmad/bmb/workflows/module/steps-e/step-02-select-edit.md +0 -77
  390. package/templates/commonproject/_bmad/bmb/workflows/module/steps-e/step-03-apply-edit.md +0 -77
  391. package/templates/commonproject/_bmad/bmb/workflows/module/steps-e/step-04-review.md +0 -80
  392. package/templates/commonproject/_bmad/bmb/workflows/module/steps-e/step-05-confirm.md +0 -75
  393. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-01-load-target.md +0 -96
  394. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-02-file-structure.md +0 -94
  395. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-03-module-yaml.md +0 -99
  396. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-04-agent-specs.md +0 -152
  397. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-05-workflow-specs.md +0 -152
  398. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-06-documentation.md +0 -143
  399. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-07-installation.md +0 -113
  400. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-08-report.md +0 -197
  401. package/templates/commonproject/_bmad/bmb/workflows/module/templates/brief-template.md +0 -154
  402. package/templates/commonproject/_bmad/bmb/workflows/module/templates/workflow-spec-template.md +0 -96
  403. package/templates/commonproject/_bmad/bmb/workflows/module/workflow.md +0 -100
  404. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/architecture.md +0 -152
  405. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/common-workflow-tools.csv +0 -19
  406. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/csv-data-file-standards.md +0 -81
  407. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/frontmatter-standards.md +0 -225
  408. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/input-discovery-standards.md +0 -269
  409. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/intent-vs-prescriptive-spectrum.md +0 -50
  410. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/menu-handling-standards.md +0 -167
  411. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/output-format-standards.md +0 -188
  412. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/step-file-rules.md +0 -235
  413. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/step-type-patterns.md +0 -311
  414. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/subprocess-optimization-patterns.md +0 -386
  415. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/trimodal-workflow-structure.md +0 -209
  416. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/workflow-chaining-standards.md +0 -271
  417. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/workflow-examples.md +0 -276
  418. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/workflow-type-criteria.md +0 -172
  419. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-00-conversion.md +0 -262
  420. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-01-discovery.md +0 -194
  421. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-01b-continuation.md +0 -3
  422. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-02-classification.md +0 -269
  423. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-03-requirements.md +0 -282
  424. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-04-tools.md +0 -281
  425. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-05-plan-review.md +0 -242
  426. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-06-design.md +0 -329
  427. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-07-foundation.md +0 -238
  428. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-08-build-step-01.md +0 -377
  429. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-09-build-next-step.md +0 -350
  430. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-10-confirmation.md +0 -320
  431. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-11-completion.md +0 -191
  432. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-e/step-e-01-assess-workflow.md +0 -237
  433. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-e/step-e-02-discover-edits.md +0 -248
  434. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-e/step-e-03-fix-validation.md +0 -252
  435. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-e/step-e-04-direct-edit.md +0 -275
  436. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-e/step-e-05-apply-edit.md +0 -154
  437. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-e/step-e-06-validate-after.md +0 -190
  438. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-e/step-e-07-complete.md +0 -206
  439. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-01-validate-max-mode.md +0 -109
  440. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-01-validate.md +0 -221
  441. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-01b-structure.md +0 -152
  442. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-02-frontmatter-validation.md +0 -199
  443. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-02b-path-violations.md +0 -265
  444. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-03-menu-validation.md +0 -164
  445. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-04-step-type-validation.md +0 -211
  446. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-05-output-format-validation.md +0 -200
  447. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-06-validation-design-check.md +0 -195
  448. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-07-instruction-style-check.md +0 -209
  449. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-08-collaborative-experience-check.md +0 -199
  450. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-08b-subprocess-optimization.md +0 -179
  451. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-09-cohesive-review.md +0 -186
  452. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-10-report-complete.md +0 -154
  453. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-11-plan-validation.md +0 -237
  454. package/templates/commonproject/_bmad/bmb/workflows/workflow/templates/minimal-output-template.md +0 -11
  455. package/templates/commonproject/_bmad/bmb/workflows/workflow/templates/step-01-init-continuable-template.md +0 -241
  456. package/templates/commonproject/_bmad/bmb/workflows/workflow/templates/step-1b-template.md +0 -223
  457. package/templates/commonproject/_bmad/bmb/workflows/workflow/templates/step-template.md +0 -290
  458. package/templates/commonproject/_bmad/bmb/workflows/workflow/templates/workflow-template.md +0 -102
  459. package/templates/commonproject/_bmad/bmb/workflows/workflow/workflow.md +0 -109
  460. package/templates/commonproject/_bmad/bmm/agents/analyst.md +0 -82
  461. package/templates/commonproject/_bmad/bmm/agents/architect.md +0 -74
  462. package/templates/commonproject/_bmad/bmm/agents/dev.md +0 -76
  463. package/templates/commonproject/_bmad/bmm/agents/pm.md +0 -78
  464. package/templates/commonproject/_bmad/bmm/agents/quick-flow-solo-dev.md +0 -74
  465. package/templates/commonproject/_bmad/bmm/agents/sm.md +0 -77
  466. package/templates/commonproject/_bmad/bmm/agents/tea.md +0 -77
  467. package/templates/commonproject/_bmad/bmm/agents/tech-writer.md +0 -78
  468. package/templates/commonproject/_bmad/bmm/agents/ux-designer.md +0 -74
  469. package/templates/commonproject/_bmad/bmm/config.yaml +0 -18
  470. package/templates/commonproject/_bmad/bmm/data/README.md +0 -29
  471. package/templates/commonproject/_bmad/bmm/data/documentation-standards.md +0 -262
  472. package/templates/commonproject/_bmad/bmm/data/project-context-template.md +0 -40
  473. package/templates/commonproject/_bmad/bmm/teams/default-party.csv +0 -21
  474. package/templates/commonproject/_bmad/bmm/teams/team-fullstack.yaml +0 -12
  475. package/templates/commonproject/_bmad/bmm/testarch/knowledge/api-request.md +0 -442
  476. package/templates/commonproject/_bmad/bmm/testarch/knowledge/api-testing-patterns.md +0 -843
  477. package/templates/commonproject/_bmad/bmm/testarch/knowledge/auth-session.md +0 -552
  478. package/templates/commonproject/_bmad/bmm/testarch/knowledge/burn-in.md +0 -273
  479. package/templates/commonproject/_bmad/bmm/testarch/knowledge/ci-burn-in.md +0 -675
  480. package/templates/commonproject/_bmad/bmm/testarch/knowledge/component-tdd.md +0 -486
  481. package/templates/commonproject/_bmad/bmm/testarch/knowledge/contract-testing.md +0 -957
  482. package/templates/commonproject/_bmad/bmm/testarch/knowledge/data-factories.md +0 -500
  483. package/templates/commonproject/_bmad/bmm/testarch/knowledge/email-auth.md +0 -721
  484. package/templates/commonproject/_bmad/bmm/testarch/knowledge/error-handling.md +0 -725
  485. package/templates/commonproject/_bmad/bmm/testarch/knowledge/feature-flags.md +0 -750
  486. package/templates/commonproject/_bmad/bmm/testarch/knowledge/file-utils.md +0 -463
  487. package/templates/commonproject/_bmad/bmm/testarch/knowledge/fixture-architecture.md +0 -401
  488. package/templates/commonproject/_bmad/bmm/testarch/knowledge/fixtures-composition.md +0 -382
  489. package/templates/commonproject/_bmad/bmm/testarch/knowledge/intercept-network-call.md +0 -430
  490. package/templates/commonproject/_bmad/bmm/testarch/knowledge/log.md +0 -429
  491. package/templates/commonproject/_bmad/bmm/testarch/knowledge/network-error-monitor.md +0 -405
  492. package/templates/commonproject/_bmad/bmm/testarch/knowledge/network-first.md +0 -486
  493. package/templates/commonproject/_bmad/bmm/testarch/knowledge/network-recorder.md +0 -527
  494. package/templates/commonproject/_bmad/bmm/testarch/knowledge/nfr-criteria.md +0 -670
  495. package/templates/commonproject/_bmad/bmm/testarch/knowledge/overview.md +0 -286
  496. package/templates/commonproject/_bmad/bmm/testarch/knowledge/playwright-config.md +0 -730
  497. package/templates/commonproject/_bmad/bmm/testarch/knowledge/probability-impact.md +0 -601
  498. package/templates/commonproject/_bmad/bmm/testarch/knowledge/recurse.md +0 -421
  499. package/templates/commonproject/_bmad/bmm/testarch/knowledge/risk-governance.md +0 -615
  500. package/templates/commonproject/_bmad/bmm/testarch/knowledge/selective-testing.md +0 -732
  501. package/templates/commonproject/_bmad/bmm/testarch/knowledge/selector-resilience.md +0 -527
  502. package/templates/commonproject/_bmad/bmm/testarch/knowledge/test-healing-patterns.md +0 -644
  503. package/templates/commonproject/_bmad/bmm/testarch/knowledge/test-levels-framework.md +0 -473
  504. package/templates/commonproject/_bmad/bmm/testarch/knowledge/test-priorities-matrix.md +0 -373
  505. package/templates/commonproject/_bmad/bmm/testarch/knowledge/test-quality.md +0 -664
  506. package/templates/commonproject/_bmad/bmm/testarch/knowledge/timing-debugging.md +0 -372
  507. package/templates/commonproject/_bmad/bmm/testarch/knowledge/visual-debugging.md +0 -524
  508. package/templates/commonproject/_bmad/bmm/testarch/tea-index.csv +0 -34
  509. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/product-brief.template.md +0 -10
  510. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-01-init.md +0 -177
  511. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-01b-continue.md +0 -161
  512. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-02-vision.md +0 -199
  513. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-03-users.md +0 -202
  514. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-04-metrics.md +0 -205
  515. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-05-scope.md +0 -219
  516. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-06-complete.md +0 -194
  517. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/workflow.md +0 -58
  518. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-01-init.md +0 -137
  519. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-02-domain-analysis.md +0 -229
  520. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-03-competitive-landscape.md +0 -238
  521. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-04-regulatory-focus.md +0 -206
  522. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-05-technical-trends.md +0 -234
  523. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-06-research-synthesis.md +0 -443
  524. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/market-steps/step-01-init.md +0 -182
  525. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/market-steps/step-02-customer-behavior.md +0 -237
  526. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/market-steps/step-02-customer-insights.md +0 -200
  527. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/market-steps/step-03-customer-pain-points.md +0 -249
  528. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/market-steps/step-04-customer-decisions.md +0 -259
  529. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/market-steps/step-05-competitive-analysis.md +0 -177
  530. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/market-steps/step-06-research-completion.md +0 -475
  531. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/research.template.md +0 -29
  532. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-01-init.md +0 -137
  533. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-02-technical-overview.md +0 -239
  534. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-03-integration-patterns.md +0 -248
  535. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-04-architectural-patterns.md +0 -202
  536. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-05-implementation-research.md +0 -239
  537. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-06-research-synthesis.md +0 -486
  538. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/workflow.md +0 -173
  539. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-01-init.md +0 -135
  540. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-01b-continue.md +0 -127
  541. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-02-discovery.md +0 -190
  542. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-03-core-experience.md +0 -216
  543. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-04-emotional-response.md +0 -219
  544. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-05-inspiration.md +0 -234
  545. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-06-design-system.md +0 -252
  546. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-07-defining-experience.md +0 -254
  547. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-08-visual-foundation.md +0 -224
  548. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-09-design-directions.md +0 -224
  549. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-10-user-journeys.md +0 -241
  550. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-11-component-strategy.md +0 -248
  551. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-12-ux-patterns.md +0 -237
  552. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-13-responsive-accessibility.md +0 -264
  553. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-14-complete.md +0 -228
  554. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/ux-design-template.md +0 -13
  555. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/workflow.md +0 -43
  556. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/data/domain-complexity.csv +0 -13
  557. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/data/prd-purpose.md +0 -197
  558. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/data/project-types.csv +0 -11
  559. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-01-init.md +0 -191
  560. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-01b-continue.md +0 -153
  561. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-02-discovery.md +0 -224
  562. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-03-success.md +0 -226
  563. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-04-journeys.md +0 -213
  564. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-05-domain.md +0 -207
  565. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-06-innovation.md +0 -226
  566. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-07-project-type.md +0 -237
  567. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-08-scoping.md +0 -228
  568. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-09-functional.md +0 -231
  569. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-10-nonfunctional.md +0 -242
  570. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-11-polish.md +0 -217
  571. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-12-complete.md +0 -180
  572. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-e/step-e-01-discovery.md +0 -247
  573. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-e/step-e-01b-legacy-conversion.md +0 -208
  574. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-e/step-e-02-review.md +0 -249
  575. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-e/step-e-03-edit.md +0 -253
  576. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-e/step-e-04-complete.md +0 -168
  577. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-01-discovery.md +0 -218
  578. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-02-format-detection.md +0 -191
  579. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-02b-parity-check.md +0 -209
  580. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-03-density-validation.md +0 -174
  581. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-04-brief-coverage-validation.md +0 -214
  582. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-05-measurability-validation.md +0 -228
  583. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-06-traceability-validation.md +0 -217
  584. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-07-implementation-leakage-validation.md +0 -205
  585. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-08-domain-compliance-validation.md +0 -243
  586. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-09-project-type-validation.md +0 -263
  587. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-10-smart-validation.md +0 -209
  588. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-11-holistic-quality-validation.md +0 -264
  589. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-12-completeness-validation.md +0 -242
  590. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-13-report-complete.md +0 -232
  591. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/templates/prd-template.md +0 -10
  592. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/validation-report-prd-workflow.md +0 -433
  593. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/workflow.md +0 -150
  594. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-01-document-discovery.md +0 -190
  595. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-02-prd-analysis.md +0 -178
  596. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-03-epic-coverage-validation.md +0 -179
  597. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-04-ux-alignment.md +0 -139
  598. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-05-epic-quality-review.md +0 -252
  599. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-06-final-assessment.md +0 -133
  600. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/templates/readiness-report-template.md +0 -4
  601. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/workflow.md +0 -55
  602. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/architecture-decision-template.md +0 -12
  603. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/data/domain-complexity.csv +0 -11
  604. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/data/project-types.csv +0 -7
  605. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-01-init.md +0 -153
  606. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-01b-continue.md +0 -164
  607. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-02-context.md +0 -224
  608. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-03-starter.md +0 -331
  609. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-04-decisions.md +0 -318
  610. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-05-patterns.md +0 -359
  611. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-06-structure.md +0 -379
  612. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-07-validation.md +0 -359
  613. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-08-complete.md +0 -352
  614. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/workflow.md +0 -50
  615. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-01-validate-prerequisites.md +0 -259
  616. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-02-design-epics.md +0 -233
  617. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-03-create-stories.md +0 -272
  618. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-04-final-validation.md +0 -145
  619. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/templates/epics-template.md +0 -57
  620. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/workflow.md +0 -59
  621. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/code-review/checklist.md +0 -23
  622. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/code-review/instructions.xml +0 -227
  623. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/code-review/workflow.yaml +0 -50
  624. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/correct-course/checklist.md +0 -279
  625. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/correct-course/instructions.md +0 -206
  626. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml +0 -58
  627. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/create-story/checklist.md +0 -358
  628. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/create-story/instructions.xml +0 -345
  629. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/create-story/template.md +0 -49
  630. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml +0 -59
  631. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/dev-story/checklist.md +0 -80
  632. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/dev-story/instructions.xml +0 -410
  633. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml +0 -25
  634. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/retrospective/instructions.md +0 -1443
  635. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/retrospective/workflow.yaml +0 -57
  636. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/sprint-planning/checklist.md +0 -33
  637. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/sprint-planning/instructions.md +0 -225
  638. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/sprint-planning/sprint-status-template.yaml +0 -55
  639. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.yaml +0 -52
  640. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/sprint-status/instructions.md +0 -229
  641. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/sprint-status/workflow.yaml +0 -35
  642. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-01-mode-detection.md +0 -156
  643. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-02-context-gathering.md +0 -120
  644. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-03-execute.md +0 -113
  645. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-04-self-check.md +0 -113
  646. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-05-adversarial-review.md +0 -106
  647. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-06-resolve-findings.md +0 -140
  648. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md +0 -52
  649. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-01-understand.md +0 -189
  650. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-02-investigate.md +0 -144
  651. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-03-generate.md +0 -128
  652. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-04-review.md +0 -173
  653. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/tech-spec-template.md +0 -74
  654. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md +0 -79
  655. package/templates/commonproject/_bmad/bmm/workflows/document-project/checklist.md +0 -245
  656. package/templates/commonproject/_bmad/bmm/workflows/document-project/documentation-requirements.csv +0 -12
  657. package/templates/commonproject/_bmad/bmm/workflows/document-project/instructions.md +0 -221
  658. package/templates/commonproject/_bmad/bmm/workflows/document-project/templates/deep-dive-template.md +0 -345
  659. package/templates/commonproject/_bmad/bmm/workflows/document-project/templates/index-template.md +0 -169
  660. package/templates/commonproject/_bmad/bmm/workflows/document-project/templates/project-overview-template.md +0 -103
  661. package/templates/commonproject/_bmad/bmm/workflows/document-project/templates/project-scan-report-schema.json +0 -160
  662. package/templates/commonproject/_bmad/bmm/workflows/document-project/templates/source-tree-template.md +0 -135
  663. package/templates/commonproject/_bmad/bmm/workflows/document-project/workflow.yaml +0 -28
  664. package/templates/commonproject/_bmad/bmm/workflows/document-project/workflows/deep-dive-instructions.md +0 -298
  665. package/templates/commonproject/_bmad/bmm/workflows/document-project/workflows/deep-dive.yaml +0 -31
  666. package/templates/commonproject/_bmad/bmm/workflows/document-project/workflows/full-scan-instructions.md +0 -1106
  667. package/templates/commonproject/_bmad/bmm/workflows/document-project/workflows/full-scan.yaml +0 -31
  668. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/_shared/excalidraw-library.json +0 -90
  669. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/_shared/excalidraw-templates.yaml +0 -127
  670. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-dataflow/checklist.md +0 -39
  671. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-dataflow/instructions.md +0 -130
  672. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-dataflow/workflow.yaml +0 -26
  673. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-diagram/checklist.md +0 -43
  674. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-diagram/instructions.md +0 -141
  675. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-diagram/workflow.yaml +0 -26
  676. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-flowchart/checklist.md +0 -49
  677. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-flowchart/instructions.md +0 -241
  678. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-flowchart/workflow.yaml +0 -26
  679. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-wireframe/checklist.md +0 -38
  680. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-wireframe/instructions.md +0 -133
  681. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-wireframe/workflow.yaml +0 -26
  682. package/templates/commonproject/_bmad/bmm/workflows/generate-project-context/project-context-template.md +0 -21
  683. package/templates/commonproject/_bmad/bmm/workflows/generate-project-context/steps/step-01-discover.md +0 -184
  684. package/templates/commonproject/_bmad/bmm/workflows/generate-project-context/steps/step-02-generate.md +0 -318
  685. package/templates/commonproject/_bmad/bmm/workflows/generate-project-context/steps/step-03-complete.md +0 -278
  686. package/templates/commonproject/_bmad/bmm/workflows/generate-project-context/workflow.md +0 -49
  687. package/templates/commonproject/_bmad/bmm/workflows/testarch/atdd/atdd-checklist-template.md +0 -364
  688. package/templates/commonproject/_bmad/bmm/workflows/testarch/atdd/checklist.md +0 -374
  689. package/templates/commonproject/_bmad/bmm/workflows/testarch/atdd/instructions.md +0 -806
  690. package/templates/commonproject/_bmad/bmm/workflows/testarch/atdd/workflow.yaml +0 -45
  691. package/templates/commonproject/_bmad/bmm/workflows/testarch/automate/checklist.md +0 -582
  692. package/templates/commonproject/_bmad/bmm/workflows/testarch/automate/instructions.md +0 -1324
  693. package/templates/commonproject/_bmad/bmm/workflows/testarch/automate/workflow.yaml +0 -52
  694. package/templates/commonproject/_bmad/bmm/workflows/testarch/ci/checklist.md +0 -248
  695. package/templates/commonproject/_bmad/bmm/workflows/testarch/ci/github-actions-template.yaml +0 -198
  696. package/templates/commonproject/_bmad/bmm/workflows/testarch/ci/gitlab-ci-template.yaml +0 -149
  697. package/templates/commonproject/_bmad/bmm/workflows/testarch/ci/instructions.md +0 -536
  698. package/templates/commonproject/_bmad/bmm/workflows/testarch/ci/workflow.yaml +0 -45
  699. package/templates/commonproject/_bmad/bmm/workflows/testarch/framework/checklist.md +0 -321
  700. package/templates/commonproject/_bmad/bmm/workflows/testarch/framework/instructions.md +0 -481
  701. package/templates/commonproject/_bmad/bmm/workflows/testarch/framework/workflow.yaml +0 -47
  702. package/templates/commonproject/_bmad/bmm/workflows/testarch/nfr-assess/checklist.md +0 -407
  703. package/templates/commonproject/_bmad/bmm/workflows/testarch/nfr-assess/instructions.md +0 -722
  704. package/templates/commonproject/_bmad/bmm/workflows/testarch/nfr-assess/nfr-report-template.md +0 -445
  705. package/templates/commonproject/_bmad/bmm/workflows/testarch/nfr-assess/workflow.yaml +0 -47
  706. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-design/checklist.md +0 -235
  707. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-design/instructions.md +0 -788
  708. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-design/test-design-template.md +0 -294
  709. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-design/workflow.yaml +0 -54
  710. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-review/checklist.md +0 -472
  711. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-review/instructions.md +0 -628
  712. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-review/test-review-template.md +0 -390
  713. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-review/workflow.yaml +0 -46
  714. package/templates/commonproject/_bmad/bmm/workflows/testarch/trace/checklist.md +0 -655
  715. package/templates/commonproject/_bmad/bmm/workflows/testarch/trace/instructions.md +0 -1047
  716. package/templates/commonproject/_bmad/bmm/workflows/testarch/trace/trace-template.md +0 -675
  717. package/templates/commonproject/_bmad/bmm/workflows/testarch/trace/workflow.yaml +0 -55
  718. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/init/instructions.md +0 -346
  719. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/init/workflow.yaml +0 -29
  720. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/instructions.md +0 -395
  721. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/paths/enterprise-brownfield.yaml +0 -103
  722. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/paths/enterprise-greenfield.yaml +0 -100
  723. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/paths/method-brownfield.yaml +0 -103
  724. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/paths/method-greenfield.yaml +0 -100
  725. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/project-levels.yaml +0 -59
  726. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/workflow-status-template.yaml +0 -24
  727. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/workflow.yaml +0 -30
  728. package/templates/commonproject/_bmad/cis/agents/brainstorming-coach.md +0 -66
  729. package/templates/commonproject/_bmad/cis/agents/creative-problem-solver.md +0 -66
  730. package/templates/commonproject/_bmad/cis/agents/design-thinking-coach.md +0 -66
  731. package/templates/commonproject/_bmad/cis/agents/innovation-strategist.md +0 -66
  732. package/templates/commonproject/_bmad/cis/agents/presentation-master.md +0 -72
  733. package/templates/commonproject/_bmad/cis/agents/storyteller/storyteller.md +0 -63
  734. package/templates/commonproject/_bmad/cis/config.yaml +0 -11
  735. package/templates/commonproject/_bmad/cis/teams/creative-squad.yaml +0 -7
  736. package/templates/commonproject/_bmad/cis/teams/default-party.csv +0 -12
  737. package/templates/commonproject/_bmad/cis/workflows/README.md +0 -139
  738. package/templates/commonproject/_bmad/cis/workflows/design-thinking/README.md +0 -56
  739. package/templates/commonproject/_bmad/cis/workflows/design-thinking/design-methods.csv +0 -31
  740. package/templates/commonproject/_bmad/cis/workflows/design-thinking/instructions.md +0 -202
  741. package/templates/commonproject/_bmad/cis/workflows/design-thinking/template.md +0 -111
  742. package/templates/commonproject/_bmad/cis/workflows/design-thinking/workflow.yaml +0 -27
  743. package/templates/commonproject/_bmad/cis/workflows/innovation-strategy/README.md +0 -56
  744. package/templates/commonproject/_bmad/cis/workflows/innovation-strategy/innovation-frameworks.csv +0 -31
  745. package/templates/commonproject/_bmad/cis/workflows/innovation-strategy/instructions.md +0 -276
  746. package/templates/commonproject/_bmad/cis/workflows/innovation-strategy/template.md +0 -189
  747. package/templates/commonproject/_bmad/cis/workflows/innovation-strategy/workflow.yaml +0 -27
  748. package/templates/commonproject/_bmad/cis/workflows/problem-solving/README.md +0 -56
  749. package/templates/commonproject/_bmad/cis/workflows/problem-solving/instructions.md +0 -252
  750. package/templates/commonproject/_bmad/cis/workflows/problem-solving/solving-methods.csv +0 -31
  751. package/templates/commonproject/_bmad/cis/workflows/problem-solving/template.md +0 -165
  752. package/templates/commonproject/_bmad/cis/workflows/problem-solving/workflow.yaml +0 -27
  753. package/templates/commonproject/_bmad/cis/workflows/storytelling/README.md +0 -58
  754. package/templates/commonproject/_bmad/cis/workflows/storytelling/instructions.md +0 -293
  755. package/templates/commonproject/_bmad/cis/workflows/storytelling/story-types.csv +0 -26
  756. package/templates/commonproject/_bmad/cis/workflows/storytelling/template.md +0 -113
  757. package/templates/commonproject/_bmad/cis/workflows/storytelling/workflow.yaml +0 -27
  758. package/templates/commonproject/_bmad/core/agents/bmad-master.md +0 -63
  759. package/templates/commonproject/_bmad/core/config.yaml +0 -9
  760. package/templates/commonproject/_bmad/core/resources/excalidraw/README.md +0 -160
  761. package/templates/commonproject/_bmad/core/resources/excalidraw/excalidraw-helpers.md +0 -127
  762. package/templates/commonproject/_bmad/core/resources/excalidraw/library-loader.md +0 -50
  763. package/templates/commonproject/_bmad/core/resources/excalidraw/validate-json-instructions.md +0 -79
  764. package/templates/commonproject/_bmad/core/tasks/index-docs.xml +0 -65
  765. package/templates/commonproject/_bmad/core/tasks/review-adversarial-general.xml +0 -41
  766. package/templates/commonproject/_bmad/core/tasks/shard-doc.xml +0 -109
  767. package/templates/commonproject/_bmad/core/tasks/workflow.xml +0 -235
  768. package/templates/commonproject/_bmad/core/workflows/advanced-elicitation/methods.csv +0 -51
  769. package/templates/commonproject/_bmad/core/workflows/advanced-elicitation/workflow.xml +0 -117
  770. package/templates/commonproject/_bmad/core/workflows/brainstorming/brain-methods.csv +0 -62
  771. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-01-session-setup.md +0 -197
  772. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-01b-continue.md +0 -122
  773. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-02a-user-selected.md +0 -225
  774. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-02b-ai-recommended.md +0 -237
  775. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-02c-random-selection.md +0 -209
  776. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-02d-progressive-flow.md +0 -264
  777. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-03-technique-execution.md +0 -399
  778. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-04-idea-organization.md +0 -303
  779. package/templates/commonproject/_bmad/core/workflows/brainstorming/template.md +0 -15
  780. package/templates/commonproject/_bmad/core/workflows/brainstorming/workflow.md +0 -58
  781. package/templates/commonproject/_bmad/core/workflows/party-mode/steps/step-01-agent-loading.md +0 -139
  782. package/templates/commonproject/_bmad/core/workflows/party-mode/steps/step-02-discussion-orchestration.md +0 -204
  783. package/templates/commonproject/_bmad/core/workflows/party-mode/steps/step-03-graceful-exit.md +0 -159
  784. package/templates/commonproject/_bmad/core/workflows/party-mode/workflow.md +0 -206
  785. package/templates/commonproject/_bmad/custom/config.yaml +0 -11
  786. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/data/ac-sufficiency-rubric.md +0 -33
  787. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/data/audit-comment-template.md +0 -54
  788. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/data/event-schemas.md +0 -58
  789. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-c/step-01-init.md +0 -173
  790. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-c/step-02-triage.md +0 -159
  791. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-c/step-03-refine.md +0 -149
  792. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-c/step-04-implement.md +0 -147
  793. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-c/step-05-review.md +0 -146
  794. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-c/step-06-qa.md +0 -199
  795. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-c/step-07-complete.md +0 -141
  796. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-e/step-01-assess.md +0 -102
  797. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-e/step-02-apply.md +0 -85
  798. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-v/step-01-validate.md +0 -154
  799. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/workflow-plan-ticket-lifecycle.md +0 -346
  800. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/workflow.md +0 -84
  801. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/workflow.yaml +0 -39
  802. package/templates/commonproject/mise.toml +0 -38
  803. package/templates/hermes-agent/.codegraph/daemon.pid +0 -6
  804. package/templates/hermes-agent/.omo/run-continuation/ses_0e5b28303ffeXxL53hZjKggXDW.json +0 -10
  805. package/templates/hermes-agent/README.md +0 -151
  806. package/templates/hermes-agent/config.example.toml +0 -1
  807. package/templates/hermes-agent/docs/architecture.md +0 -111
  808. package/templates/hermes-agent/docs/fleet-control-plane/README.md +0 -35
  809. package/templates/hermes-agent/docs/fleet-control-plane/architecture.md +0 -253
  810. package/templates/hermes-agent/docs/fleet-control-plane/epics-and-stories.md +0 -280
  811. package/templates/hermes-agent/docs/fleet-control-plane/implementation-readiness-report-2026-06-27.md +0 -118
  812. package/templates/hermes-agent/docs/fleet-control-plane/prd.md +0 -141
  813. package/templates/hermes-agent/docs/operations.md +0 -237
  814. package/templates/hermes-agent/docs/runbooks/runtime-checkpoint-repair.md +0 -171
  815. package/templates/hermes-agent/docs/sentinel/README.md +0 -119
  816. package/templates/hermes-agent/docs/sentinel/architecture.md +0 -204
  817. package/templates/hermes-agent/docs/sentinel/development.md +0 -277
  818. package/templates/hermes-agent/docs/sentinel/providers.md +0 -203
  819. package/templates/hermes-agent/docs/sentinel.md +0 -18
  820. package/templates/hermes-agent/install-local.sh +0 -216
  821. package/templates/hermes-agent/runtime-scaffold/.gitattributes +0 -10
  822. package/templates/hermes-agent/runtime-scaffold/README.md +0 -53
  823. package/templates/hermes-agent/runtime-scaffold/bloodbank-consumer.py +0 -181
  824. package/templates/hermes-agent/runtime-scaffold/decisions/.gitkeep +0 -2
  825. package/templates/hermes-agent/runtime-scaffold/logs/.gitkeep +0 -1
  826. package/templates/hermes-agent/runtime-scaffold/memories/MEMORY.md +0 -47
  827. package/templates/hermes-agent/runtime-scaffold/memories/USER.md +0 -51
  828. package/templates/hermes-agent/scripts/backfill-fleet-sot.sh +0 -270
  829. package/templates/hermes-agent/scripts/fleet-sync.sh +0 -369
  830. package/templates/hermes-agent/scripts/migrate-unify.sh +0 -252
  831. package/templates/hermes-agent/scripts/repair-runtime-checkpoint.sh +0 -122
  832. package/templates/hermes-agent/scripts/retrofit-70-envfile.sh +0 -129
  833. package/templates/hermes-agent/scripts/unify-pm.sh +0 -148
  834. package/templates/hermes-agent/template/.runtime-scaffold/bloodbank-consumer.py +0 -181
  835. package/templates/hermes-agent/tests/test_bloodbank_consumer_contract.py +0 -138
@@ -0,0 +1,1728 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ sync-skills.py — manifest-driven skill fanout.
4
+
5
+ Projects the `skills[]` entries and the `packs[]` members declared by the global
6
+ and project `.agents/skills.json` manifests into every supported agent CLI
7
+ skills directory. Replaces the old symlink-based skillex monolithic fanout.
8
+ """
9
+
10
+ import argparse
11
+ import hashlib
12
+ import json
13
+ import os
14
+ import re
15
+ import shutil
16
+ import stat
17
+ import subprocess
18
+ import sys
19
+ import tomllib
20
+ from pathlib import Path
21
+ from urllib.parse import unquote, urlparse
22
+
23
+ DEFAULT_REGISTRY = "https://github.com/delorenj/skillex.git"
24
+
25
+ # The supported agent CLI skill directories, per scope (relative to home for
26
+ # `--scope global`, to the project root for `--scope project`). Exactly six
27
+ # CLIs are supported; opencode uses a different path per scope.
28
+ CLI_SKILL_DIRS = {
29
+ "global": [
30
+ ".claude/skills",
31
+ ".codex/skills",
32
+ ".gemini/skills",
33
+ ".copilot/skills",
34
+ ".config/opencode/skills",
35
+ ".kimi-code/skills",
36
+ ],
37
+ "project": [
38
+ ".claude/skills",
39
+ ".codex/skills",
40
+ ".gemini/skills",
41
+ ".copilot/skills",
42
+ ".opencode/skills",
43
+ ".kimi-code/skills",
44
+ ],
45
+ }
46
+
47
+ # Directories this engine used to write to. They are never written to any more
48
+ # and never auto-deleted; `--prune-retired` opts in to removing ONLY managed
49
+ # symlinks left behind inside them.
50
+ RETIRED_CLI_SKILL_DIRS = [
51
+ ".augment/skills",
52
+ ".hermes/skills",
53
+ ".openclaw/skills",
54
+ ".kimi/skills",
55
+ ".crush/skills",
56
+ ".cursor/skills",
57
+ ]
58
+
59
+ # `~/.hermes/skills` is a writable Hermes runtime OVERLAY, not a projection of
60
+ # this manifest. It is never written to, never reported, and never pruned.
61
+ NEVER_PRUNE_DIRS = {".hermes/skills"}
62
+
63
+ # The single managed projection every CLI skills directory may alias.
64
+ MANAGED_SKILLS_RELATIVE = (".agents", "skills")
65
+
66
+ # The canonical identifier shape the contract mandates for pack and skill names
67
+ # (section 1): lowercase alphanumerics and dashes, no leading/trailing dash.
68
+ CANONICAL_NAME_PATTERN = re.compile(r"^[a-z0-9]([a-z0-9-]*[a-z0-9])?$")
69
+
70
+ # Canonical pack identifier shape. Enforced as a WARNING so packs that predate
71
+ # the convention stay resolvable; the hard requirement (one safe path
72
+ # component) is enforced by validate_skill_name().
73
+ PACK_NAME_PATTERN = CANONICAL_NAME_PATTERN
74
+
75
+
76
+ class PackUnavailable(Exception):
77
+ """The pack (or a declared member of it) is simply not installed here.
78
+
79
+ Only this failure class is downgraded to a warning by `"optional": true`.
80
+ Integrity failures — symlinks in the payload, path escapes, identity
81
+ mismatches, checksum mismatches — always raise and are never suppressed.
82
+ """
83
+
84
+
85
+ def parse_args():
86
+ parser = argparse.ArgumentParser(
87
+ description="Sync skills from manifest to agent CLIs."
88
+ )
89
+ parser.add_argument(
90
+ "--scope",
91
+ choices=["global", "project"],
92
+ required=True,
93
+ help="Whether to sync global skills or project-local skills.",
94
+ )
95
+ parser.add_argument(
96
+ "--prune-retired",
97
+ action="store_true",
98
+ help=(
99
+ "Remove managed symlinks left behind in retired CLI skill "
100
+ "directories. Without this flag they are only reported."
101
+ ),
102
+ )
103
+ return parser.parse_args()
104
+
105
+
106
+ def load_manifest(manifest_path):
107
+ if not manifest_path.exists():
108
+ return {"skills": []}
109
+ with open(manifest_path, "r") as handle:
110
+ return json.load(handle)
111
+
112
+
113
+ def validate_skill_name(name):
114
+ if not isinstance(name, str) or not name:
115
+ raise ValueError("Skill name must be a non-empty string")
116
+ if name in {".", ".."} or Path(name).is_absolute():
117
+ raise ValueError(f"Unsafe skill name: {name!r}")
118
+ if "/" in name or "\\" in name or Path(name).name != name:
119
+ raise ValueError(f"Skill name must be one path component: {name!r}")
120
+ return name
121
+
122
+
123
+ def manifest_skill_name(skill):
124
+ if isinstance(skill, str):
125
+ path = skill if "/" in skill else f"all-skills/{skill}"
126
+ return validate_skill_name(path.split("/")[-1])
127
+ if not isinstance(skill, dict):
128
+ raise ValueError(f"Skill entry must be a string or object: {skill!r}")
129
+ return validate_skill_name(skill.get("name"))
130
+
131
+
132
+ def validate_manifest_skill_names(manifest):
133
+ skills = manifest.get("skills", [])
134
+ if not isinstance(skills, list):
135
+ raise ValueError("Manifest skills must be an array")
136
+ for skill in skills:
137
+ manifest_skill_name(skill)
138
+
139
+
140
+ def validate_manifest_packs(manifest):
141
+ """Normalize + validate every `packs[]` entry without touching the disk."""
142
+ packs = manifest.get("packs", [])
143
+ if packs is None:
144
+ return []
145
+ if not isinstance(packs, list):
146
+ raise ValueError("Manifest packs must be an array")
147
+ return [normalize_pack_entry(entry) for entry in packs]
148
+
149
+
150
+ def assert_real_directory_chain(root, target):
151
+ root = root.resolve(strict=True)
152
+ target = target.absolute()
153
+ try:
154
+ relative = target.relative_to(root)
155
+ except ValueError as error:
156
+ raise ValueError(f"Destination escapes root {root}: {target}") from error
157
+ current = root
158
+ for part in relative.parts:
159
+ current = current / part
160
+ if not current.exists() and not current.is_symlink():
161
+ break
162
+ if current.is_symlink():
163
+ raise ValueError(f"Refusing symlinked destination directory: {current}")
164
+ if not current.is_dir():
165
+ raise ValueError(f"Destination parent is not a directory: {current}")
166
+
167
+
168
+ def cli_skill_dirs(scope):
169
+ try:
170
+ return CLI_SKILL_DIRS[scope]
171
+ except KeyError as error:
172
+ raise ValueError(f"Unknown scope: {scope!r}") from error
173
+
174
+
175
+ def managed_skills_dir(base):
176
+ return base.joinpath(*MANAGED_SKILLS_RELATIVE)
177
+
178
+
179
+ def lexical_symlink_target(link):
180
+ """Lexically expand a symlink WITHOUT resolving it.
181
+
182
+ Resolving an arbitrary directory symlink here would let the cleanup below
183
+ traverse outside the project (or through a broken target) before failing.
184
+ """
185
+ raw_target = Path(os.readlink(link))
186
+ lexical = raw_target if raw_target.is_absolute() else link.parent / raw_target
187
+ return Path(os.path.normpath(str(lexical)))
188
+
189
+
190
+ def preflight_cli_dirs(
191
+ cli_dirs_base,
192
+ skill_names,
193
+ scope="project",
194
+ skill_sources=None,
195
+ ):
196
+ # Re-validate here rather than trusting the caller: this is the guard that
197
+ # decides where mutations may land, and `expected_cli / ".."` would satisfy
198
+ # the containment check below on its own.
199
+ skill_names = [validate_skill_name(name) for name in skill_names]
200
+ base = cli_dirs_base.resolve(strict=True)
201
+ active = []
202
+ claimed = set()
203
+
204
+ def assert_destinations_contained(expected_cli):
205
+ for name in skill_names:
206
+ destination = expected_cli / name
207
+ if destination.parent != expected_cli or len(destination.relative_to(expected_cli).parts) != 1:
208
+ raise ValueError(f"Skill destination escapes CLI directory: {destination}")
209
+
210
+ def add_target(cli_dir, expected_cli):
211
+ assert_destinations_contained(expected_cli)
212
+ # Every CLI that aliases `.agents/skills` names the SAME destination.
213
+ # Project into it once; a second pass would only churn its own links.
214
+ if expected_cli in claimed:
215
+ return
216
+ claimed.add(expected_cli)
217
+ active.append((cli_dir, expected_cli))
218
+
219
+ for cli_rel_path in cli_skill_dirs(scope):
220
+ cli_dir = base / cli_rel_path
221
+ parent = cli_dir.parent
222
+ if not parent.exists() and not parent.is_symlink():
223
+ continue
224
+ assert_real_directory_chain(base, parent)
225
+ if parent.is_symlink() or not parent.is_dir():
226
+ raise ValueError(f"Unsafe CLI destination parent: {parent}")
227
+ if cli_dir.is_symlink():
228
+ # Generated projects intentionally expose the single managed skill
229
+ # projection to the agent CLIs as `<cli>/skills -> .agents/skills`.
230
+ # Accept only that exact lexical alias (relative or absolute form).
231
+ managed_skills = managed_skills_dir(base)
232
+ canonical_alias = lexical_symlink_target(cli_dir) == managed_skills
233
+ if not canonical_alias:
234
+ raise ValueError(f"Refusing symlinked CLI skills directory: {cli_dir}")
235
+ assert_real_directory_chain(base, managed_skills)
236
+ if (
237
+ not managed_skills.exists()
238
+ or managed_skills.is_symlink()
239
+ or not managed_skills.is_dir()
240
+ ):
241
+ raise ValueError(
242
+ f"Managed skills alias target is not a real directory: {managed_skills}"
243
+ )
244
+ resolved_cli = cli_dir.resolve(strict=True)
245
+ if resolved_cli != managed_skills.resolve(strict=True):
246
+ raise ValueError(
247
+ f"Managed skills alias escapes managed project skills: {cli_dir}"
248
+ )
249
+ # The alias makes `.agents/skills` this CLI's skills directory, so
250
+ # that IS where this CLI's projection has to land. Skipping it
251
+ # instead would silently drop every `skills[]` entry on a project
252
+ # where every supported CLI is aliased -- `provision-packs.py`
253
+ # only ever materializes pack members.
254
+ managed_expected = managed_skills.parent.resolve(strict=True) / managed_skills.name
255
+ # Containment first, so an escaping name is reported as an escape
256
+ # rather than as whatever it happens to collide with.
257
+ assert_destinations_contained(managed_expected)
258
+ # `.agents/skills` is shared with the pack provisioner and may hold
259
+ # real, hand-authored skill directories. Never let the fanout
260
+ # rmtree one of those; fail here, before anything is mutated.
261
+ for name in skill_names:
262
+ destination = managed_skills / name
263
+ if not is_real_directory(destination):
264
+ continue
265
+ source = skill_sources.get(name) if skill_sources is not None else None
266
+ if source is not None and destination.resolve(strict=True) == Path(source).resolve(strict=True):
267
+ # A project-local skill may deliberately live in the
268
+ # canonical managed directory. Every supported CLI aliases
269
+ # this same projection, so the directory is already in its
270
+ # final location and must remain real.
271
+ continue
272
+ if skill_sources is not None:
273
+ raise ValueError(
274
+ "Refusing to replace a real skill directory in the managed "
275
+ f"projection: {destination}"
276
+ )
277
+ add_target(managed_skills, managed_expected)
278
+ continue
279
+ else:
280
+ if cli_dir.exists() and not cli_dir.is_dir():
281
+ raise ValueError(f"CLI skills destination is not a directory: {cli_dir}")
282
+ real_parent = parent.resolve(strict=True)
283
+ expected_cli = real_parent / cli_dir.name
284
+ if cli_dir.exists() and cli_dir.resolve(strict=True) != expected_cli:
285
+ raise ValueError(f"CLI skills directory escapes its parent: {cli_dir}")
286
+ add_target(cli_dir, expected_cli)
287
+ return active
288
+
289
+
290
+ def revalidate_cli_dir(cli_dirs_base, cli_dir, expected_cli):
291
+ """Revalidate the complete destination chain at the mutation boundary."""
292
+ base = cli_dirs_base.resolve(strict=True)
293
+ assert_real_directory_chain(base, cli_dir.parent)
294
+ if cli_dir.parent.is_symlink() or not cli_dir.parent.is_dir():
295
+ raise ValueError(f"Unsafe CLI destination parent after preflight: {cli_dir.parent}")
296
+ current_expected = cli_dir.parent.resolve(strict=True) / cli_dir.name
297
+ if current_expected != expected_cli:
298
+ raise ValueError(f"CLI destination parent changed after preflight: {cli_dir}")
299
+ if cli_dir.is_symlink():
300
+ raise ValueError(f"CLI skills directory changed to a symlink after preflight: {cli_dir}")
301
+ if cli_dir.exists():
302
+ if not cli_dir.is_dir() or cli_dir.resolve(strict=True) != expected_cli:
303
+ raise ValueError(f"Unsafe CLI skills directory after preflight: {cli_dir}")
304
+
305
+
306
+ def ensure_cache_dir():
307
+ cache_dir = Path(os.path.expanduser("~/.agents/.cache/skills"))
308
+ cache_dir.mkdir(parents=True, exist_ok=True)
309
+ return cache_dir
310
+
311
+
312
+ def registry_cache_dir(registry_url):
313
+ """Where a registry URL is cloned to / read back from.
314
+
315
+ The directory NAME is a wire format shared with two other surfaces that
316
+ address this exact directory on this exact machine:
317
+
318
+ * skillex ``src/skillex/paths.py`` -> ``sanitize_registry_url()``
319
+ * pjangler ``src/parity/index.ts`` -> ``registryCacheDirName()``
320
+
321
+ If they disagree, one manifest resolves to two different checkouts on one
322
+ machine and one of them is an unverified stale clone. This script is the
323
+ only surface allowed to CLONE, so it owns the name and the others follow.
324
+ Every non-alphanumeric byte becomes ``_``, so the result is always exactly
325
+ one safe path component - no separator, no ``.``, no ``..``.
326
+
327
+ Do not change this regex here alone.
328
+ """
329
+ safe_name = re.sub(r"[^a-zA-Z0-9]", "_", registry_url)
330
+ if not safe_name:
331
+ # Would collapse to the registries/ parent and hand back the cache dir
332
+ # itself as if it were a checkout.
333
+ raise ValueError(f"Registry URL has no usable cache directory name: {registry_url!r}")
334
+ return Path(os.path.expanduser("~/.agents/.cache/registries")) / safe_name
335
+
336
+
337
+ def sync_registry(registry_url):
338
+ cache_dir = registry_cache_dir(registry_url)
339
+
340
+ if cache_dir.exists():
341
+ try:
342
+ print(f"Updating registry {registry_url}...")
343
+ subprocess.run(
344
+ ["git", "-C", str(cache_dir), "pull"],
345
+ check=True,
346
+ capture_output=True,
347
+ )
348
+ except subprocess.CalledProcessError as error:
349
+ print(
350
+ f"Warning: Failed to update registry {registry_url}: "
351
+ f"{error.stderr.decode()}",
352
+ file=sys.stderr,
353
+ )
354
+ else:
355
+ cache_dir.parent.mkdir(parents=True, exist_ok=True)
356
+ print(f"Cloning registry {registry_url}...")
357
+ subprocess.run(["git", "clone", registry_url, str(cache_dir)], check=True)
358
+
359
+ return cache_dir
360
+
361
+
362
+ def sync_git_skill(name, source, version, cache_dir):
363
+ target_dir = cache_dir / name
364
+ if target_dir.exists():
365
+ # Just pull if it exists
366
+ try:
367
+ print(f"Updating git skill {name} in cache...")
368
+ subprocess.run(
369
+ ["git", "-C", str(target_dir), "pull"],
370
+ check=True,
371
+ capture_output=True,
372
+ )
373
+ except subprocess.CalledProcessError as error:
374
+ print(
375
+ f"Warning: Failed to update {name}: {error.stderr.decode()}",
376
+ file=sys.stderr,
377
+ )
378
+ else:
379
+ print(f"Cloning git skill {name} to cache...")
380
+ subprocess.run(["git", "clone", source, str(target_dir)], check=True)
381
+
382
+ if version:
383
+ subprocess.run(
384
+ ["git", "-C", str(target_dir), "checkout", version], check=True
385
+ )
386
+
387
+ return target_dir
388
+
389
+
390
+ def resolve_skill_path(
391
+ skill, cache_dir, base_dir, default_registry, registry_roots
392
+ ):
393
+ if isinstance(skill, str):
394
+ path = skill if "/" in skill else f"all-skills/{skill}"
395
+ name = validate_skill_name(path.split("/")[-1])
396
+ skill = {"name": name, "registry_path": path}
397
+
398
+ name = validate_skill_name(skill.get("name"))
399
+
400
+ if "registry_path" in skill:
401
+ registry_url = skill.get("registry", default_registry)
402
+ # Walk the same stable, memoized checkout ladder as packs[]. A path
403
+ # absent from the cache may legitimately exist in the developer
404
+ # checkout; existing checkouts are never fetched as a side effect.
405
+ attempted = []
406
+ for root in registry_root_candidates(registry_url, registry_roots):
407
+ full_path = root / skill["registry_path"]
408
+ attempted.append(full_path)
409
+ if full_path.exists():
410
+ return name, full_path
411
+ print(
412
+ f"Warning: Registry skill {name} not found in: {attempted}",
413
+ file=sys.stderr,
414
+ )
415
+ return name, None
416
+
417
+ source = skill.get("source", "")
418
+ if source.startswith("git@") or source.startswith("https://"):
419
+ return name, sync_git_skill(
420
+ name, source, skill.get("version"), cache_dir
421
+ )
422
+ parsed = urlparse(source)
423
+ if parsed.scheme == "file":
424
+ if parsed.netloc not in {"", "localhost"}:
425
+ raise ValueError(f"Non-local file URI authority for skill {name}: {parsed.netloc}")
426
+ if parsed.query or parsed.fragment:
427
+ raise ValueError(f"file:// source must encode query/fragment characters: {source}")
428
+ local_path = Path(unquote(parsed.path))
429
+ full_path = (base_dir / local_path).resolve()
430
+ if not full_path.exists():
431
+ print(
432
+ f"Warning: Local skill {name} not found at {full_path}",
433
+ file=sys.stderr,
434
+ )
435
+ return name, None
436
+ return name, full_path
437
+
438
+ print(
439
+ f"Warning: Unknown source type for skill {name}: {source}",
440
+ file=sys.stderr,
441
+ )
442
+ return name, None
443
+
444
+
445
+ # --------------------------------------------------------------------------- #
446
+ # Packs
447
+ # --------------------------------------------------------------------------- #
448
+
449
+
450
+ def validate_path_component(value, label):
451
+ if not isinstance(value, str) or not value:
452
+ raise ValueError(f"{label} must be a non-empty string")
453
+ if value in {".", ".."} or Path(value).is_absolute():
454
+ raise ValueError(f"Unsafe {label}: {value!r}")
455
+ if "/" in value or "\\" in value or Path(value).name != value:
456
+ raise ValueError(f"{label} must be one path component: {value!r}")
457
+ return value
458
+
459
+
460
+ def safe_relative_path(value, label):
461
+ if not isinstance(value, str) or not value:
462
+ raise ValueError(f"{label} must be a non-empty string")
463
+ if "\\" in value:
464
+ raise ValueError(f"{label} must not contain backslashes: {value!r}")
465
+ path = Path(value)
466
+ if path.is_absolute() or any(part in {"", ".", ".."} for part in path.parts):
467
+ raise ValueError(f"Unsafe {label}: {value!r}")
468
+ return path
469
+
470
+
471
+ def manifest_entry_source_path(value):
472
+ """The `file:` source of a `skills[]` entry as a normalized absolute path.
473
+
474
+ LEXICAL on purpose: `os.path.abspath` normalizes without resolving symlinks,
475
+ so this matches `provision-packs.py` and pjangler byte-for-byte. It is a pure
476
+ predicate helper — it decides precedence, never safety, and never touches the
477
+ filesystem. `None` for anything that is not a local `file:` source.
478
+ """
479
+ if not isinstance(value, dict):
480
+ return None
481
+ source = value.get("source")
482
+ if not isinstance(source, str) or not source.startswith("file:"):
483
+ return None
484
+ try:
485
+ parsed = urlparse(source)
486
+ if parsed.netloc not in {"", "localhost"}:
487
+ return None
488
+ return Path(os.path.abspath(unquote(parsed.path)))
489
+ except (OSError, ValueError):
490
+ return None
491
+
492
+
493
+ def is_contained_by(root, target):
494
+ try:
495
+ target.relative_to(root)
496
+ except ValueError:
497
+ return False
498
+ return True
499
+
500
+
501
+ class PackScope:
502
+ """Declared-pack ownership for ONE manifest (PACKS-CONTRACT section 6).
503
+
504
+ Section 6 pruning runs BEFORE the section 5 override: a `skills[]` entry a
505
+ declared pack already provides is redundant, not an override. Keeping that
506
+ decision here — and scoped to a single manifest — is what makes
507
+ `sync-skills.py`, `provision-packs.py`, and `pj audit` resolve every name to
508
+ the same path.
509
+
510
+ Deliberately narrow. An entry only counts as redundant when its own resolved
511
+ source lands inside the pack, or when it is a declared member pointing into
512
+ another version of the same pack family. An entry pointing anywhere else — a
513
+ local tree, a different registry, a customized copy — is the user's and is
514
+ never pruned.
515
+ """
516
+
517
+ def __init__(self):
518
+ self.roots = []
519
+ self.family_roots = {}
520
+
521
+ def record(self, resolved):
522
+ """Absorb one `resolve_pack` `on_resolved` record."""
523
+ root = resolved["root"]
524
+ if root not in self.roots:
525
+ self.roots.append(root)
526
+ family_root = resolved.get("family_root")
527
+ if family_root is not None:
528
+ # `packs/<name>/<version>` -> `packs/<name>` is the pack family. Only
529
+ # DECLARED names are attached: the family root is not the pack's own
530
+ # extent, so a sibling version only shadows names this pack provides.
531
+ # Under flatten those names are the FLATTENED ones — see
532
+ # `resolve_pack` — which is what a `skills[]` entry would be named.
533
+ self.family_roots.setdefault(family_root, set()).update(resolved["declared"])
534
+
535
+ def is_redundant(self, skill_entry):
536
+ source_path = manifest_entry_source_path(skill_entry)
537
+ if source_path is None:
538
+ return False
539
+ # (a) the entry's own source lands inside a resolved pack root. Holds
540
+ # unchanged under flatten: a hand-written entry pointing at the leaf
541
+ # `<root>/apple/apple-notes` is contained by `<root>`, so the pack still
542
+ # wins and the entry is still pruned.
543
+ if any(is_contained_by(root, source_path) for root in self.roots):
544
+ return True
545
+ # (b) a declared member pointing into ANY version of the same pack.
546
+ # Name lookup is TOLERANT here, matching pjangler's
547
+ # `skillManifestEntryName`: redundancy is a precedence question, so a
548
+ # malformed entry is simply "not redundant" rather than a hard failure.
549
+ # The strict `validate_skill_name()` gate still runs before any symlink.
550
+ name = skill_entry.get("name")
551
+ if not isinstance(name, str):
552
+ return False
553
+ return any(
554
+ name in members and is_contained_by(family, source_path)
555
+ for family, members in self.family_roots.items()
556
+ )
557
+
558
+
559
+ def normalize_pack_entry(entry):
560
+ """String shorthand or object -> validated object form."""
561
+ if isinstance(entry, str):
562
+ raw = entry.strip()
563
+ if "@" in raw:
564
+ name, _, version = raw.partition("@")
565
+ entry = {"name": name, "version": version}
566
+ else:
567
+ entry = {"name": raw}
568
+ if not isinstance(entry, dict):
569
+ raise ValueError(f"Pack entry must be a string or object: {entry!r}")
570
+
571
+ normalized = dict(entry)
572
+ name = validate_skill_name(normalized.get("name"))
573
+ if not PACK_NAME_PATTERN.match(name):
574
+ print(
575
+ f"Warning: pack name {name!r} does not match the canonical "
576
+ f"{PACK_NAME_PATTERN.pattern} shape",
577
+ file=sys.stderr,
578
+ )
579
+ normalized["name"] = name
580
+
581
+ if normalized.get("version") is not None:
582
+ normalized["version"] = validate_path_component(
583
+ normalized["version"], f"pack {name} version"
584
+ )
585
+ if normalized.get("source") and normalized.get("registry_path"):
586
+ raise ValueError(
587
+ f"Pack {name} may not set both `source` and `registry_path`"
588
+ )
589
+ if normalized.get("source") is not None and not isinstance(normalized["source"], str):
590
+ raise ValueError(f"Pack {name} source must be a string")
591
+ if normalized.get("registry") is not None and not isinstance(normalized["registry"], str):
592
+ raise ValueError(f"Pack {name} registry must be a string")
593
+ if normalized.get("registry_path") is not None:
594
+ safe_relative_path(normalized["registry_path"], f"pack {name} registry_path")
595
+ for key in ("include", "exclude"):
596
+ values = normalized.get(key)
597
+ if values is None:
598
+ continue
599
+ if not isinstance(values, list):
600
+ raise ValueError(f"Pack {name} {key} must be an array of skill names")
601
+ for value in values:
602
+ validate_skill_name(value)
603
+ for key in ("optional", "sealed", "flatten"):
604
+ if key in normalized and normalized[key] is not None and not isinstance(normalized[key], bool):
605
+ raise ValueError(f"Pack {name} {key} must be a boolean")
606
+ return normalized
607
+
608
+
609
+ def version_sort_key(version):
610
+ """PEP440/semver-ish ordering: numeric-segment aware, prereleases sort low."""
611
+
612
+ def segments(text):
613
+ parts = []
614
+ for chunk in re.split(r"[._]", text):
615
+ if not chunk:
616
+ continue
617
+ if chunk.isdigit():
618
+ parts.append((0, int(chunk), ""))
619
+ else:
620
+ parts.append((1, 0, chunk))
621
+ return tuple(parts)
622
+
623
+ release, separator, prerelease = version.partition("-")
624
+ return (
625
+ segments(release),
626
+ 1 if not separator else 0,
627
+ segments(prerelease),
628
+ )
629
+
630
+
631
+ def read_regular_file(path):
632
+ descriptor = os.open(path, os.O_RDONLY | getattr(os, "O_NOFOLLOW", 0))
633
+ try:
634
+ if not stat.S_ISREG(os.fstat(descriptor).st_mode):
635
+ raise ValueError(f"Pack entry is not a regular file: {path}")
636
+ with os.fdopen(os.dup(descriptor), "rb") as handle:
637
+ return handle.read()
638
+ finally:
639
+ os.close(descriptor)
640
+
641
+
642
+ def hash_regular_file(path):
643
+ descriptor = os.open(path, os.O_RDONLY | getattr(os, "O_NOFOLLOW", 0))
644
+ try:
645
+ if not stat.S_ISREG(os.fstat(descriptor).st_mode):
646
+ raise ValueError(f"Pack entry is not a regular file: {path}")
647
+ digest = hashlib.sha256()
648
+ with os.fdopen(os.dup(descriptor), "rb") as handle:
649
+ for chunk in iter(lambda: handle.read(1 << 20), b""):
650
+ digest.update(chunk)
651
+ return digest.hexdigest()
652
+ finally:
653
+ os.close(descriptor)
654
+
655
+
656
+ def is_real_directory(path):
657
+ try:
658
+ return stat.S_ISDIR(os.lstat(path).st_mode)
659
+ except OSError:
660
+ return False
661
+
662
+
663
+ def is_regular_file(path):
664
+ try:
665
+ return stat.S_ISREG(os.lstat(path).st_mode)
666
+ except OSError:
667
+ return False
668
+
669
+
670
+ def assert_real_pack_directory(path, label):
671
+ try:
672
+ mode = os.lstat(path).st_mode
673
+ except OSError as error:
674
+ raise PackUnavailable(f"{label} is not present: {path}") from error
675
+ if stat.S_ISLNK(mode) or not stat.S_ISDIR(mode):
676
+ raise ValueError(f"{label} must be a real directory: {path}")
677
+ return path
678
+
679
+
680
+ def assert_no_symlink_components(root, relative):
681
+ current = Path(root)
682
+ for part in Path(relative).parts:
683
+ current = current / part
684
+ try:
685
+ mode = os.lstat(current).st_mode
686
+ except FileNotFoundError as error:
687
+ raise PackUnavailable(f"Pack path is not present: {current}") from error
688
+ if stat.S_ISLNK(mode):
689
+ raise ValueError(f"Refusing symlinked pack path component: {current}")
690
+ return current
691
+
692
+
693
+ def safe_checksum_path(value):
694
+ path = Path(value)
695
+ if (
696
+ not value
697
+ or "\\" in value
698
+ or path.is_absolute()
699
+ or any(part in {"", ".", ".."} for part in path.parts)
700
+ ):
701
+ raise ValueError(f"Unsafe checksum path: {value!r}")
702
+ return path
703
+
704
+
705
+ def scan_children(directory):
706
+ with os.scandir(directory) as entries:
707
+ return sorted(entries, key=lambda item: item.name)
708
+
709
+
710
+ def registry_root_candidates(registry_url, roots_cache, allow_clone=True):
711
+ """Existing registry checkouts for `registry_url`, in contract order.
712
+
713
+ Candidate order is contract section 2 step 3:
714
+ `PJ_SKILLS_REGISTRY_ROOT` | `~/.agents/.cache/registries/<sanitized-url>` |
715
+ `~/code/skillex`.
716
+
717
+ `packs[]` and `skills[]` share this resolver and its memo. Existing
718
+ checkouts are never fetched: pinned packs must resolve offline and a sync
719
+ must not mutate a checkout merely by reading it. When no checkout exists,
720
+ this script may clone the registry once because it is the only surface
721
+ authorized to do so.
722
+ """
723
+ if registry_url in roots_cache:
724
+ return roots_cache[registry_url]
725
+
726
+ def adopt(candidate):
727
+ try:
728
+ if candidate.is_dir():
729
+ return candidate.resolve(strict=True)
730
+ except OSError:
731
+ pass
732
+ return None
733
+
734
+ override = os.environ.get("PJ_SKILLS_REGISTRY_ROOT", "").strip()
735
+ if override:
736
+ pinned = adopt(Path(override).expanduser())
737
+ if pinned is None:
738
+ raise PackUnavailable(
739
+ f"Explicit registry checkout is not available for {registry_url}: {override}"
740
+ )
741
+ roots_cache[registry_url] = [pinned]
742
+ return roots_cache[registry_url]
743
+
744
+ roots = []
745
+ for candidate in (registry_cache_dir(registry_url), Path(os.path.expanduser("~/code/skillex"))):
746
+ existing = adopt(candidate)
747
+ if existing is not None and existing not in roots:
748
+ roots.append(existing)
749
+
750
+ if not roots and allow_clone:
751
+ try:
752
+ roots.append(sync_registry(registry_url).resolve(strict=True))
753
+ except (subprocess.CalledProcessError, OSError) as error:
754
+ raise PackUnavailable(
755
+ f"No registry checkout available for {registry_url}: {error}"
756
+ ) from error
757
+
758
+ if not roots:
759
+ raise PackUnavailable(f"No registry checkout available for {registry_url}")
760
+ roots_cache[registry_url] = roots
761
+ return roots
762
+
763
+
764
+ def registry_root(registry_url, roots_cache, allow_clone=True):
765
+ """Compatibility helper for callers that need the first checkout only."""
766
+ return registry_root_candidates(registry_url, roots_cache, allow_clone)[0]
767
+
768
+
769
+ def select_pack_version(pack_dir):
770
+ """Highest version subdirectory, or None when this is not a version layout.
771
+
772
+ "Only subdirectories" is necessary but NOT sufficient. A pack.toml-less
773
+ `packs/<name>/` whose children are REAL directories that each hold a regular
774
+ SKILL.md satisfies that test and is emphatically not a version layout -- it
775
+ is a flat pack, and the contract section 3 glob inventory applies instead.
776
+ The discriminator is what those children ARE: a child holding a regular
777
+ SKILL.md is a skill, so its parent cannot be a version root. Contrast
778
+ `packs/bmad/`, also pack.toml-less and also all real directories, but whose
779
+ children (6.10.1-next.31/, 6.10.2/) hold no top-level SKILL.md -- that IS a
780
+ version layout and the highest version is selected.
781
+
782
+ `packs/Kurzgesagt/` is NOT an example of this: its twelve children are all
783
+ symlinks, so it is disqualified one check earlier by the S_ISDIR-on-lstat
784
+ test below and never reaches the SKILL.md test. (Earlier revisions of this
785
+ comment cited it as "twelve skill directories"; that was wrong.)
786
+ """
787
+ versions = []
788
+ for entry in scan_children(pack_dir):
789
+ if entry.name.startswith("."):
790
+ continue
791
+ if not stat.S_ISDIR(entry.stat(follow_symlinks=False).st_mode):
792
+ # Not a pure "only subdirectories" layout -> flat pack.
793
+ return None
794
+ if is_regular_file(Path(entry.path) / "SKILL.md"):
795
+ return None
796
+ versions.append(entry.name)
797
+ if not versions:
798
+ return None
799
+ return max(versions, key=version_sort_key)
800
+
801
+
802
+ def resolve_pack_root_in_registry(checkout_root, entry, registry_url):
803
+ """Resolve one pack inside one checkout, distinguishing absence from hostility."""
804
+ name = entry["name"]
805
+ version = entry.get("version")
806
+ if entry.get("registry_path"):
807
+ relative = safe_relative_path(entry["registry_path"], f"pack {name} registry_path")
808
+ else:
809
+ relative = Path("packs") / name
810
+ pack_dir = checkout_root / relative
811
+ assert_no_symlink_components(checkout_root, relative)
812
+ assert_real_pack_directory(pack_dir, f"Pack {name} directory")
813
+ if version:
814
+ relative = relative / version
815
+ elif not is_regular_file(pack_dir / "pack.toml"):
816
+ selected = select_pack_version(pack_dir)
817
+ if selected is not None:
818
+ relative = relative / selected
819
+
820
+ root = checkout_root / relative
821
+ assert_no_symlink_components(checkout_root, relative)
822
+ assert_real_pack_directory(root, f"Pack {name} root")
823
+
824
+ metadata = read_pack_metadata(root)
825
+ attested = metadata is not None
826
+ if metadata is not None:
827
+ pack = metadata.get("pack", {})
828
+ if not isinstance(pack, dict):
829
+ raise ValueError(f"Pack {name} pack.toml [pack] must be a table")
830
+ if pack.get("name") != name:
831
+ raise ValueError(f"Pack {name} pack.toml declares name {pack.get('name')!r}")
832
+ if version and pack.get("version") != version:
833
+ raise ValueError(
834
+ f"Pack {name} pack.toml declares version {pack.get('version')!r}, "
835
+ f"manifest pins {version!r}"
836
+ )
837
+ return root, f"{registry_url}:{relative.as_posix()}", attested
838
+
839
+
840
+ def resolve_pack_root(entry, base_dir, cache_dir, registry_roots, default_registry):
841
+ """(pack_root, description) for a normalized pack entry."""
842
+ name = entry["name"]
843
+ version = entry.get("version")
844
+ source = entry.get("source")
845
+
846
+ if source:
847
+ if source.startswith("git@") or source.startswith("https://"):
848
+ root = sync_git_skill(name, source, version, cache_dir)
849
+ return assert_real_pack_directory(Path(root).absolute(), f"Pack {name} root"), source
850
+ parsed = urlparse(source)
851
+ if parsed.scheme != "file":
852
+ raise ValueError(f"Unknown pack source type for {name}: {source}")
853
+ if parsed.netloc not in {"", "localhost"}:
854
+ raise ValueError(f"Non-local file URI authority for pack {name}: {parsed.netloc}")
855
+ if parsed.query or parsed.fragment:
856
+ raise ValueError(f"file:// pack source must encode query/fragment characters: {source}")
857
+ local_path = Path(unquote(parsed.path))
858
+ root = (base_dir / local_path).absolute()
859
+ return assert_real_pack_directory(root, f"Pack {name} root"), source
860
+
861
+ registry_url = entry.get("registry", default_registry)
862
+ matches = []
863
+ first_unavailable = None
864
+ for checkout_root in registry_root_candidates(registry_url, registry_roots):
865
+ try:
866
+ matches.append(resolve_pack_root_in_registry(checkout_root, entry, registry_url))
867
+ except PackUnavailable as error:
868
+ if first_unavailable is None:
869
+ first_unavailable = error
870
+ if not matches:
871
+ raise first_unavailable or PackUnavailable(
872
+ f"Pack {name} is unavailable in every registry checkout for {registry_url}"
873
+ )
874
+ # A positively identified pack outranks a same-shaped but unattested tree;
875
+ # contract order still breaks ties. Present-but-hostile metadata raises in
876
+ # resolve_pack_root_in_registry and is never bypassed.
877
+ root, description, _attested = next(
878
+ (match for match in matches if match[2]), matches[0]
879
+ )
880
+ return root, description
881
+
882
+
883
+ def read_pack_metadata(root):
884
+ try:
885
+ raw = read_regular_file(root / "pack.toml")
886
+ except FileNotFoundError:
887
+ return None
888
+ try:
889
+ return tomllib.loads(raw.decode("utf-8"))
890
+ except (UnicodeDecodeError, tomllib.TOMLDecodeError) as error:
891
+ raise ValueError(f"Pack metadata at {root / 'pack.toml'} does not parse: {error}") from error
892
+
893
+
894
+ def pack_flatten_enabled(metadata, entry):
895
+ """Contract section 3b: is this pack projected through a flatten expansion?
896
+
897
+ Enabled when EITHER `pack.toml [policy] flatten = true` OR the manifest pack
898
+ entry sets `"flatten": true`. Layout is a property of the PACK, so pack.toml
899
+ is the natural home; the manifest field exists for packs that ship no
900
+ pack.toml. Neither side can turn the other OFF — this is a union, not an
901
+ override, because a nested pack projected flat-side-up would produce
902
+ container directories where the CLIs expect skills.
903
+
904
+ OFF unless someone says otherwise: every pack that predates 3b keeps its
905
+ exact section 3 inventory.
906
+ """
907
+ if entry.get("flatten") is True:
908
+ return True
909
+ policy = metadata.get("policy", {}) if isinstance(metadata, dict) else {}
910
+ return isinstance(policy, dict) and policy.get("flatten") is True
911
+
912
+
913
+ def container_leaves(container):
914
+ """Every skill reachable under `container`, at ANY depth (contract 3b).
915
+
916
+ Returns `(leaves, symlinked)`, both lists of POSIX-style paths relative to
917
+ `container`, in walk order.
918
+
919
+ The descent rule is the whole of the expansion: descend while a node is a
920
+ container; a node holding a regular SKILL.md IS a skill and is never
921
+ descended into. That mirrors upstream `agent/skill_utils.py`'s
922
+ `iter_skill_index_files`, a depth-agnostic `os.walk`, and it is why
923
+ hermes-base's `mlops/evaluation/lm-evaluation-harness` IS a member —
924
+ `mlops/evaluation` carries only a DESCRIPTION.md, so it is another container
925
+ and the walk continues through it.
926
+
927
+ Stopping at the first SKILL.md on each branch is also what keeps a skill's own
928
+ references/, scripts/, assets/ and templates/ subtree from contributing a
929
+ second member — the same reason upstream prunes SKILL_SUPPORT_DIRS only under
930
+ a directory that already has a SKILL.md.
931
+
932
+ Skip rules match section 3's glob exactly, at every level. Symlinks are never
933
+ followed, so the descent cannot cycle.
934
+
935
+ Deliberately iterative, not recursive. Nesting depth here is a property of a
936
+ directory tree this process did not create, and Python's recursion limit
937
+ (~1000 frames) is FAR below the depth a filesystem accepts — PATH_MAX allows
938
+ roughly 2000 levels of two-character segments. A recursive walk raises
939
+ `RecursionError` on such a tree, which is a hard crash of `sync-skills.py`
940
+ rather than a finding, and it would disagree with the two surfaces that do
941
+ resolve it (skillex's `flatten_inventory` and pjangler's `packContainerLeaves`
942
+ both handle it). `frames` is an explicit stack of partially-consumed child
943
+ iterators, so it reproduces the recursive pre-order EXACTLY — a container's
944
+ subtree is emitted in the position the container itself occupied — while the
945
+ depth it can carry is bounded by the heap instead of the C stack.
946
+ """
947
+ leaves = []
948
+ symlinked = []
949
+ # Each frame is (prefix, iterator over that directory's sorted children).
950
+ frames = [("", iter(scan_children(container)))]
951
+
952
+ while frames:
953
+ prefix, children = frames[-1]
954
+ descended = False
955
+ for child in children:
956
+ if child.name.startswith(".") or child.name.startswith("_"):
957
+ continue
958
+ relative = f"{prefix}/{child.name}" if prefix else child.name
959
+ mode = child.stat(follow_symlinks=False).st_mode
960
+ if stat.S_ISLNK(mode):
961
+ symlinked.append(relative)
962
+ continue
963
+ if not stat.S_ISDIR(mode):
964
+ continue
965
+ child_path = Path(child.path)
966
+ # A symlinked SKILL.md is not a regular file, so the leaf is skipped.
967
+ if is_regular_file(child_path / "SKILL.md"):
968
+ leaves.append(relative)
969
+ continue
970
+ # Still a container: keep descending. Suspending THIS frame mid-iterator
971
+ # is what preserves pre-order; the loop resumes it once the child's
972
+ # subtree is exhausted.
973
+ frames.append((relative, iter(scan_children(child_path))))
974
+ descended = True
975
+ break
976
+ if not descended:
977
+ frames.pop()
978
+
979
+ return leaves, symlinked
980
+
981
+
982
+ def has_flattenable_children(directory):
983
+ """True when a skill is reachable ANYWHERE under `directory`.
984
+
985
+ The discriminator between "a CONTAINER of skills" and "an ordinary directory
986
+ that happens to sit in the pack root" (docs/, assets/, ...). Used only on the
987
+ section 3 GLOB path, where a container has to be recognized without a
988
+ pack.toml to declare it.
989
+
990
+ Written in terms of `container_leaves` so the glob's notion of "container" can
991
+ never drift from what the expansion actually reaches: a directory that
992
+ qualifies here always contributes at least one member, and one that does not
993
+ could never have contributed any.
994
+ """
995
+ leaves, _ = container_leaves(directory)
996
+ return bool(leaves)
997
+
998
+
999
+ def flatten_pack_inventory(root, name, declared):
1000
+ """Contract section 3b: expand a declared inventory by DESCENT.
1001
+
1002
+ Returns an ordered list of `(projected_name, relative_path)`. The projected
1003
+ name is the LEAF basename; the relative path is where that leaf actually
1004
+ lives, which under flatten is no longer `<root>/<name>` — `apple-notes`
1005
+ resolves to `<root>/apple/apple-notes` and `vllm` to
1006
+ `<root>/mlops/inference/vllm`. The path may be ANY number of segments deep, so
1007
+ every caller has to carry the pair and never rebuild the path from the name.
1008
+
1009
+ Container-level files (Hermes' `DESCRIPTION.md`) are NOT projected, at any
1010
+ level. They stay in the pack and remain part of the sealed payload, because
1011
+ the payload is still "every file under each DECLARED entry" and the container
1012
+ is what was declared. Sealing is completely unaffected by this expansion.
1013
+ """
1014
+ inventory = []
1015
+ seen = {}
1016
+
1017
+ def claim(leaf_name, relative, declared_as_is=False):
1018
+ """Project one leaf. Returns True when it was actually claimed.
1019
+
1020
+ `declared_as_is` marks the one case where the name was NOT lifted off
1021
+ the filesystem: a declared entry that is already a skill keeps the
1022
+ author's string, exactly as it would without flatten. It defaults to
1023
+ False so the canonical gate below is the fail-safe direction for any
1024
+ future call site.
1025
+ """
1026
+ if not declared_as_is and not CANONICAL_NAME_PATTERN.match(leaf_name):
1027
+ # Contract 3b. Flatten is the ONLY place a projected skill name is
1028
+ # lifted straight off the filesystem — without it a pack.toml pack
1029
+ # projects exactly the strings its author typed into
1030
+ # `[freeform].skills`. `validate_skill_name()` only asks for one
1031
+ # safe path component, which happily admits `-rf`, `--help`, `*`,
1032
+ # and names carrying newlines or tabs; those become argv- and
1033
+ # glob-hostile symlink names in all six CLI skill directories.
1034
+ # Skipped rather than raised so one odd upstream directory cannot
1035
+ # brick a whole pack. `!r` keeps control characters escaped in the
1036
+ # warning itself.
1037
+ print(
1038
+ f"Warning: pack {name} leaf {leaf_name!r} at {relative} is not a canonical "
1039
+ f"skill name ({CANONICAL_NAME_PATTERN.pattern}); skipping",
1040
+ file=sys.stderr,
1041
+ )
1042
+ return False
1043
+ validate_skill_name(leaf_name)
1044
+ previous = seen.get(leaf_name)
1045
+ if previous is not None:
1046
+ # Ambiguous pack: two leaves would project onto one CLI destination,
1047
+ # and which one won would depend on inventory order. Refuse rather
1048
+ # than silently pick. (Across packs this is fine — section 5
1049
+ # precedence decides — but within ONE pack there is no rule to
1050
+ # apply.)
1051
+ raise ValueError(
1052
+ f"Pack {name} flattens to a duplicate skill name {leaf_name!r}: "
1053
+ f"{root / previous} and {root / relative}"
1054
+ )
1055
+ seen[leaf_name] = relative
1056
+ inventory.append((leaf_name, relative))
1057
+ return True
1058
+
1059
+ for entry_name in declared:
1060
+ container = root / entry_name
1061
+ assert_real_pack_directory(container, f"Pack skill {entry_name}")
1062
+ if is_regular_file(container / "SKILL.md"):
1063
+ # Already a leaf. Taken as-is, exactly as without flatten — the name
1064
+ # is the author's declared string, not a filesystem basename.
1065
+ claim(entry_name, Path(entry_name), declared_as_is=True)
1066
+ continue
1067
+
1068
+ # A CONTAINER. Descend it to ANY depth: the walk stops on each branch at
1069
+ # the first directory carrying a SKILL.md, so a container of containers
1070
+ # (hermes-base's `mlops/`) resolves the way upstream's depth-agnostic
1071
+ # `iter_skill_index_files` does.
1072
+ leaves, symlinked = container_leaves(container)
1073
+ for relative in symlinked:
1074
+ # Defence in depth: `walk_pack_subtree` already refuses symlinks
1075
+ # anywhere in the payload, so a symlinked leaf normally fails
1076
+ # verification before this runs.
1077
+ print(
1078
+ f"Warning: pack {name} member {entry_name}/{relative} is a symlink; skipping",
1079
+ file=sys.stderr,
1080
+ )
1081
+ contributed = 0
1082
+ for relative in leaves:
1083
+ # NAME is the leaf basename; PATH may be any number of segments deep.
1084
+ if claim(
1085
+ relative.rsplit("/", 1)[-1],
1086
+ Path(entry_name).joinpath(*relative.split("/")),
1087
+ ):
1088
+ contributed += 1
1089
+ if contributed == 0:
1090
+ # A container whose ENTIRE subtree yields no PROJECTABLE skill —
1091
+ # either it holds none at all, or every leaf it holds was rejected
1092
+ # by the canonical-name gate. Reported, never silently dropped.
1093
+ print(
1094
+ f"Warning: pack {name} declared entry {entry_name!r} is a container "
1095
+ f"that contributes no skills",
1096
+ file=sys.stderr,
1097
+ )
1098
+ return inventory
1099
+
1100
+
1101
+ def pack_inventory(root, name, declared, flatten):
1102
+ """The projected inventory as ordered `(name, relative_path)` pairs.
1103
+
1104
+ Without flatten a member is `<root>/<name>` exactly as before; with flatten
1105
+ it is the section 3b expansion. Everything downstream — include/exclude,
1106
+ section 6 redundancy, the symlink target — consumes this one shape.
1107
+ """
1108
+ if flatten:
1109
+ return flatten_pack_inventory(root, name, declared)
1110
+ return [(item, Path(item)) for item in declared]
1111
+
1112
+
1113
+ def pack_declared_skills(root, metadata, entry, flatten=False):
1114
+ """The full declared inventory (pre-include/exclude).
1115
+
1116
+ Under flatten these are the DECLARED entries, which may be containers rather
1117
+ than skills — the section 3b expansion into projected skill names happens
1118
+ later, in `pack_inventory()`. Keeping the two apart is what leaves sealing
1119
+ untouched: the payload is defined over what is DECLARED.
1120
+ """
1121
+ name = entry["name"]
1122
+ if metadata is not None:
1123
+ pack = metadata.get("pack", {})
1124
+ if not isinstance(pack, dict):
1125
+ raise ValueError(f"Pack {name} pack.toml [pack] must be a table")
1126
+ if pack.get("name") != name:
1127
+ raise ValueError(
1128
+ f"Pack {name} pack.toml declares name {pack.get('name')!r}"
1129
+ )
1130
+ if entry.get("version") and pack.get("version") != entry["version"]:
1131
+ raise ValueError(
1132
+ f"Pack {name} pack.toml declares version {pack.get('version')!r}, "
1133
+ f"manifest pins {entry['version']!r}"
1134
+ )
1135
+ freeform = metadata.get("freeform", {})
1136
+ if not isinstance(freeform, dict):
1137
+ raise ValueError(f"Pack {name} pack.toml [freeform] must be a table")
1138
+ declared = freeform.get("skills", [])
1139
+ if not isinstance(declared, list) or not all(isinstance(item, str) for item in declared):
1140
+ raise ValueError(f"Pack {name} pack.toml [freeform].skills must be an array of strings")
1141
+ if len(set(declared)) != len(declared):
1142
+ raise ValueError(f"Pack {name} pack.toml declares duplicate skills")
1143
+ for item in declared:
1144
+ validate_skill_name(item)
1145
+ return list(declared)
1146
+
1147
+ declared = []
1148
+ for child in scan_children(root):
1149
+ if child.name.startswith(".") or child.name.startswith("_"):
1150
+ continue
1151
+ mode = child.stat(follow_symlinks=False).st_mode
1152
+ if stat.S_ISLNK(mode):
1153
+ print(
1154
+ f"Warning: pack {name} member {child.name!r} is a symlink; skipping",
1155
+ file=sys.stderr,
1156
+ )
1157
+ continue
1158
+ if not stat.S_ISDIR(mode):
1159
+ continue
1160
+ if not is_regular_file(Path(child.path) / "SKILL.md"):
1161
+ # Section 3 stops here: no SKILL.md, not a skill. Under flatten a
1162
+ # SKILL.md-less child may instead be a CONTAINER, and skipping it
1163
+ # would make the manifest's `"flatten": true` a no-op for exactly
1164
+ # the pack.toml-less packs it exists to serve. The extra condition
1165
+ # keeps ordinary directories (docs/, assets/) out of the inventory —
1166
+ # and therefore out of the sealed payload.
1167
+ if not (flatten and has_flattenable_children(Path(child.path))):
1168
+ continue
1169
+ declared.append(validate_skill_name(child.name))
1170
+ return declared
1171
+
1172
+
1173
+ def walk_pack_subtree(root, relative_root, files, directories):
1174
+ def visit(directory):
1175
+ for child in scan_children(directory):
1176
+ path = Path(child.path)
1177
+ relative = path.relative_to(root).as_posix()
1178
+ mode = child.stat(follow_symlinks=False).st_mode
1179
+ if stat.S_ISLNK(mode):
1180
+ raise ValueError(f"Pack payload may not contain symlinks: {path}")
1181
+ if stat.S_ISDIR(mode):
1182
+ directories.add(relative)
1183
+ visit(path)
1184
+ elif stat.S_ISREG(mode):
1185
+ files[relative] = hash_regular_file(path)
1186
+ else:
1187
+ raise ValueError(
1188
+ f"Pack payload may contain only regular files and directories: {path}"
1189
+ )
1190
+
1191
+ directories.add(Path(relative_root).as_posix())
1192
+ visit(root / relative_root)
1193
+
1194
+
1195
+ def pack_payload(root, metadata, declared, flatten=False):
1196
+ """payload = pack.toml + every file under each DECLARED skill directory.
1197
+
1198
+ UNCHANGED by contract section 3b: declaring a container already covers its
1199
+ leaves recursively, so a flattened pack seals and verifies byte-for-byte the
1200
+ same as before. The one concession is the SKILL.md requirement below — under
1201
+ flatten a declared entry is allowed to be a container, and demanding a
1202
+ SKILL.md at its root would reject the very layout 3b exists to project.
1203
+ """
1204
+ files = {}
1205
+ directories = set()
1206
+ if metadata is not None:
1207
+ files["pack.toml"] = hash_regular_file(root / "pack.toml")
1208
+ for name in declared:
1209
+ skill_dir = root / name
1210
+ assert_real_pack_directory(skill_dir, f"Pack skill {name}")
1211
+ if not flatten and not is_regular_file(skill_dir / "SKILL.md"):
1212
+ raise PackUnavailable(
1213
+ f"Pack skill {name} is missing a regular SKILL.md: {skill_dir}"
1214
+ )
1215
+ walk_pack_subtree(root, name, files, directories)
1216
+ return files, directories
1217
+
1218
+
1219
+ def parse_checksums(root):
1220
+ raw = read_regular_file(root / "SHA256SUMS")
1221
+ expected = {}
1222
+ for line in raw.decode("utf-8").splitlines():
1223
+ if not line:
1224
+ continue
1225
+ digest, separator, value = line.partition(" ")
1226
+ if (
1227
+ separator != " "
1228
+ or len(digest) != 64
1229
+ or any(char not in "0123456789abcdef" for char in digest)
1230
+ ):
1231
+ raise ValueError(f"Invalid SHA256SUMS entry in {root}: {line}")
1232
+ relative = safe_checksum_path(value).as_posix()
1233
+ if relative in expected:
1234
+ raise ValueError(f"Duplicate SHA256SUMS entry in {root}: {relative}")
1235
+ expected[relative] = digest
1236
+ return expected
1237
+
1238
+
1239
+ def verify_sealed_pack(root, files, directories):
1240
+ expected = parse_checksums(root)
1241
+
1242
+ missing = sorted(set(files) - set(expected))
1243
+ if missing:
1244
+ raise ValueError(
1245
+ f"Pack payload at {root} is not covered by SHA256SUMS: {missing[:5]}"
1246
+ )
1247
+ for relative, digest in files.items():
1248
+ if expected[relative] != digest:
1249
+ raise ValueError(f"Pack digest mismatch at {root}: {relative}")
1250
+
1251
+ for relative, digest in sorted(expected.items()):
1252
+ if relative in files:
1253
+ continue
1254
+ path = safe_checksum_path(relative)
1255
+ try:
1256
+ assert_no_symlink_components(root, path)
1257
+ actual = hash_regular_file(root / path)
1258
+ except (FileNotFoundError, PackUnavailable) as error:
1259
+ # `assert_no_symlink_components` reports an absent component as
1260
+ # PackUnavailable. Inside a seal it is nothing of the sort: rule 3
1261
+ # says a checksummed path may not be absent, so this is an
1262
+ # integrity failure and must never be `optional`-suppressed.
1263
+ raise ValueError(
1264
+ f"SHA256SUMS at {root} references a missing path: {relative}"
1265
+ ) from error
1266
+ if actual != digest:
1267
+ raise ValueError(f"Pack digest mismatch at {root}: {relative}")
1268
+
1269
+ covered = set()
1270
+ for relative in files:
1271
+ parts = relative.split("/")
1272
+ for index in range(1, len(parts)):
1273
+ covered.add("/".join(parts[:index]))
1274
+ unauthenticated = sorted(directory for directory in directories if directory not in covered)
1275
+ if unauthenticated:
1276
+ raise ValueError(
1277
+ f"Pack at {root} contains unauthenticated empty directories: {unauthenticated[:5]}"
1278
+ )
1279
+
1280
+
1281
+ def verify_pack(root, metadata, declared, sealed, flatten=False):
1282
+ """Structural validation always; checksum verification when sealed.
1283
+
1284
+ A seal is a COMPLETENESS claim: the pack asserts that exactly this payload,
1285
+ and every path its SHA256SUMS names, is present with these digests. So a
1286
+ sealed pack that is missing a declared skill, a SKILL.md, or a checksummed
1287
+ file has failed integrity verification -- it is not "an uninstalled pack".
1288
+ Nothing raised from here while `sealed` may therefore be a PackUnavailable,
1289
+ because that class (and only that class) is what `"optional": true`
1290
+ downgrades to a warning in resolve_pack().
1291
+ """
1292
+ try:
1293
+ files, directories = pack_payload(root, metadata, declared, flatten=flatten)
1294
+ if metadata is not None:
1295
+ payload_files = metadata.get("source", {}).get("payload_files")
1296
+ if isinstance(payload_files, int):
1297
+ actual = sum(1 for relative in files if relative != "pack.toml")
1298
+ if actual != payload_files:
1299
+ raise ValueError(
1300
+ f"Pack at {root} declares {payload_files} payload files but has {actual}"
1301
+ )
1302
+ if sealed:
1303
+ if not is_regular_file(root / "SHA256SUMS"):
1304
+ raise ValueError(f"Sealed pack at {root} has no regular SHA256SUMS")
1305
+ verify_sealed_pack(root, files, directories)
1306
+ except PackUnavailable as error:
1307
+ if not sealed:
1308
+ # Unsealed packs get structural validation only, and a missing
1309
+ # member there really is "not installed here" -- still optional.
1310
+ raise
1311
+ raise ValueError(
1312
+ f"Sealed pack at {root} failed integrity verification: {error}"
1313
+ ) from error
1314
+ return files
1315
+
1316
+
1317
+ def resolve_pack(
1318
+ entry,
1319
+ cache_dir,
1320
+ base_dir,
1321
+ default_registry,
1322
+ registry_roots,
1323
+ managed_roots,
1324
+ on_resolved=None,
1325
+ ):
1326
+ """Resolve one normalized pack entry to an ordered list of (name, path).
1327
+
1328
+ `on_resolved`, when given, is called once per pack that resolved AND
1329
+ verified, with a record describing WHERE the pack came from:
1330
+
1331
+ {"name", "root", "family_root", "declared"}
1332
+
1333
+ `root` is the exact pack root (e.g. `packs/bmad/6.10.2`); `family_root` is
1334
+ `packs/bmad` when the pack lives under a version directory, else None. The
1335
+ two are reported SEPARATELY on purpose: a sibling version under the same
1336
+ family root is NOT this pack, so callers must never treat the family root
1337
+ as the pack's own extent. `declared` is the full inventory before
1338
+ include/exclude, so a caller can tell "this pack provides that name" from
1339
+ "some other version of this pack does".
1340
+
1341
+ Under flatten (contract 3b) `declared` carries the FLATTENED names, because
1342
+ that is what the pack PROVIDES and section 6 clause (b) asks what a pack
1343
+ provides. The container names it was declared with are an implementation
1344
+ detail of the pack's on-disk layout, and no `skills[]` entry is ever named
1345
+ after one. Section 6 clause (a) is unaffected: a leaf at
1346
+ `<root>/apple/apple-notes` is still contained by `<root>`.
1347
+
1348
+ Returned paths are LEAF paths and are no longer necessarily `<root>/<name>`.
1349
+ """
1350
+ name = entry["name"]
1351
+ optional = bool(entry.get("optional", False))
1352
+ try:
1353
+ root, description = resolve_pack_root(
1354
+ entry, base_dir, cache_dir, registry_roots, default_registry
1355
+ )
1356
+
1357
+ family_root = root.parent if root.parent.name == name else None
1358
+ managed_roots.add(root)
1359
+ if family_root is not None:
1360
+ # `packs/<name>/<version>` -> the whole family is a managed root.
1361
+ managed_roots.add(family_root)
1362
+
1363
+ metadata = read_pack_metadata(root)
1364
+ flatten = pack_flatten_enabled(metadata, entry)
1365
+ declared = pack_declared_skills(root, metadata, entry, flatten=flatten)
1366
+
1367
+ sealed = bool(entry.get("sealed", False))
1368
+ policy = metadata.get("policy", {}) if isinstance(metadata, dict) else {}
1369
+ if isinstance(policy, dict) and policy.get("sealed") is True:
1370
+ # The manifest may only TIGHTEN: `sealed: false` cannot disable this.
1371
+ sealed = True
1372
+
1373
+ verify_pack(root, metadata, declared, sealed, flatten=flatten)
1374
+ # Expansion runs INSIDE the try, and strictly after verification: an
1375
+ # integrity check must never be gated on how a pack is projected, and a
1376
+ # member that vanished between the two is `optional`-suppressible here
1377
+ # exactly as it is above.
1378
+ inventory = pack_inventory(root, name, declared, flatten)
1379
+ except PackUnavailable as error:
1380
+ if optional:
1381
+ print(f"Warning: optional pack {name} skipped: {error}", file=sys.stderr)
1382
+ return []
1383
+ raise ValueError(f"Pack {name} could not be resolved: {error}") from error
1384
+
1385
+ provided = [item for item, _relative in inventory]
1386
+ if on_resolved is not None:
1387
+ on_resolved(
1388
+ {
1389
+ "name": name,
1390
+ "root": root,
1391
+ "family_root": family_root,
1392
+ "declared": list(provided),
1393
+ }
1394
+ )
1395
+
1396
+ # include/exclude apply AFTER expansion, to the FLATTENED names (contract
1397
+ # 3b): a manifest names the skills it wants, and under flatten a container
1398
+ # name is not one of them.
1399
+ members = list(inventory)
1400
+ include = entry.get("include")
1401
+ if include is not None:
1402
+ wanted = set(include)
1403
+ unknown = sorted(wanted - set(provided))
1404
+ if unknown:
1405
+ print(
1406
+ f"Warning: pack {name} include names not in inventory: {unknown}",
1407
+ file=sys.stderr,
1408
+ )
1409
+ members = [item for item in members if item[0] in wanted]
1410
+ exclude = entry.get("exclude")
1411
+ if exclude:
1412
+ unwanted = set(exclude)
1413
+ members = [item for item in members if item[0] not in unwanted]
1414
+
1415
+ print(
1416
+ f"pack {name}"
1417
+ + (f"@{entry['version']}" if entry.get("version") else "")
1418
+ + f" -> {root} "
1419
+ f"({len(members)}/{len(inventory)} skill(s), "
1420
+ f"{'sealed' if sealed else 'unsealed'}, "
1421
+ + (f"flattened from {len(declared)} declared entries, " if flatten else "")
1422
+ + f"via {description})"
1423
+ )
1424
+ return [
1425
+ (validate_skill_name(item), root / relative) for item, relative in members
1426
+ ]
1427
+
1428
+
1429
+ # --------------------------------------------------------------------------- #
1430
+ # Retired directories
1431
+ # --------------------------------------------------------------------------- #
1432
+
1433
+
1434
+ def default_managed_roots():
1435
+ roots = set()
1436
+ for candidate in (
1437
+ Path(os.path.expanduser("~/.agents/.cache")),
1438
+ Path(os.path.expanduser("~/code/skillex")),
1439
+ ):
1440
+ try:
1441
+ if candidate.is_dir():
1442
+ roots.add(candidate.resolve(strict=True))
1443
+ except OSError:
1444
+ continue
1445
+ override = os.environ.get("PJ_SKILLS_REGISTRY_ROOT", "").strip()
1446
+ if override:
1447
+ try:
1448
+ roots.add(Path(override).expanduser().resolve(strict=True))
1449
+ except OSError:
1450
+ pass
1451
+ return roots
1452
+
1453
+
1454
+ def is_inside_managed_root(target, managed_roots):
1455
+ for root in managed_roots:
1456
+ try:
1457
+ Path(target).relative_to(root)
1458
+ return True
1459
+ except ValueError:
1460
+ continue
1461
+ return False
1462
+
1463
+
1464
+ def handle_retired_dirs(cli_dirs_base, managed_roots, prune=False):
1465
+ base = cli_dirs_base.resolve(strict=True)
1466
+ candidates = []
1467
+ for cli_rel_path in RETIRED_CLI_SKILL_DIRS:
1468
+ if cli_rel_path in NEVER_PRUNE_DIRS:
1469
+ continue
1470
+ retired = base / cli_rel_path
1471
+ if not retired.exists() and not retired.is_symlink():
1472
+ continue
1473
+ assert_real_directory_chain(base, retired.parent)
1474
+ if retired.is_symlink():
1475
+ print(
1476
+ f"sync-skills: retired {retired} is a symlink; leaving it alone",
1477
+ file=sys.stderr,
1478
+ )
1479
+ continue
1480
+ if not retired.is_dir():
1481
+ continue
1482
+ real_retired = retired.resolve(strict=True)
1483
+ if real_retired != retired.parent.resolve(strict=True) / retired.name:
1484
+ raise ValueError(f"Retired skills directory escapes its parent: {retired}")
1485
+ for child in scan_children(real_retired):
1486
+ if not stat.S_ISLNK(child.stat(follow_symlinks=False).st_mode):
1487
+ continue
1488
+ target = os.path.realpath(child.path)
1489
+ if not is_inside_managed_root(target, managed_roots):
1490
+ continue
1491
+ candidates.append((Path(child.path), target))
1492
+
1493
+ if not candidates:
1494
+ return 0
1495
+
1496
+ if not prune:
1497
+ print(
1498
+ f"sync-skills: {len(candidates)} managed symlink(s) remain in retired "
1499
+ f"CLI skill dirs under {base}; re-run with --prune-retired to remove them:"
1500
+ )
1501
+ for link, target in candidates:
1502
+ print(f" would prune {link} -> {target}")
1503
+ return 0
1504
+
1505
+ pruned = 0
1506
+ for link, target in candidates:
1507
+ parent = link.parent
1508
+ assert_real_directory_chain(base, parent)
1509
+ if parent.is_symlink() or not parent.is_dir():
1510
+ raise ValueError(f"Retired skills parent changed after preflight: {parent}")
1511
+ try:
1512
+ mode = os.lstat(link).st_mode
1513
+ except FileNotFoundError:
1514
+ continue
1515
+ if not stat.S_ISLNK(mode):
1516
+ raise ValueError(f"Retired entry is no longer a symlink: {link}")
1517
+ os.unlink(link)
1518
+ pruned += 1
1519
+ print(f"pruned {link} -> {target}")
1520
+ print(f"sync-skills: pruned {pruned} retired symlink(s) under {base}")
1521
+ return pruned
1522
+
1523
+
1524
+ # --------------------------------------------------------------------------- #
1525
+ # Fanout
1526
+ # --------------------------------------------------------------------------- #
1527
+
1528
+
1529
+ def fanout_to_cli(
1530
+ cli_dirs_base,
1531
+ skills_map,
1532
+ active_cli_dirs=None,
1533
+ before_mutation=None,
1534
+ scope="project",
1535
+ ):
1536
+ """
1537
+ Creates symlinks in each of the supported CLI skill dirs relative to
1538
+ cli_dirs_base pointing to the resolved paths in skills_map.
1539
+ """
1540
+ skill_names = [validate_skill_name(name) for name in skills_map]
1541
+ if active_cli_dirs is None:
1542
+ active_cli_dirs = preflight_cli_dirs(cli_dirs_base, skill_names, scope)
1543
+ if skill_names and not active_cli_dirs:
1544
+ # A sync that resolves skills but has nowhere to put them has FAILED.
1545
+ # Reporting success here is how a topology change silently unprojects
1546
+ # every skill; make it loud instead.
1547
+ raise ValueError(
1548
+ f"No supported agent CLI skills directory exists under {cli_dirs_base}; "
1549
+ f"refusing to silently drop {len(skill_names)} skill(s): "
1550
+ f"{sorted(skill_names)[:5]}"
1551
+ )
1552
+ if before_mutation is not None:
1553
+ before_mutation()
1554
+ linked_total = 0
1555
+ for cli_dir, expected_cli in active_cli_dirs:
1556
+ revalidate_cli_dir(cli_dirs_base, cli_dir, expected_cli)
1557
+ if not cli_dir.is_symlink():
1558
+ cli_dir.mkdir(parents=True, exist_ok=True)
1559
+ revalidate_cli_dir(cli_dirs_base, cli_dir, expected_cli)
1560
+ real_cli_dir = expected_cli.resolve(strict=True)
1561
+
1562
+ for name, actual_path in skills_map.items():
1563
+ revalidate_cli_dir(cli_dirs_base, cli_dir, expected_cli)
1564
+ symlink_target = real_cli_dir / name
1565
+ if symlink_target.parent != real_cli_dir:
1566
+ raise ValueError(f"Skill destination escapes CLI directory: {symlink_target}")
1567
+
1568
+ # A project-local source may already be the exact destination in
1569
+ # the shared `.agents/skills` projection. Preserve that real
1570
+ # directory; replacing it with a self-referential symlink would
1571
+ # destroy the source.
1572
+ if (
1573
+ is_real_directory(symlink_target)
1574
+ and symlink_target.resolve(strict=True) == Path(actual_path).resolve(strict=True)
1575
+ ):
1576
+ continue
1577
+
1578
+ # If it's a symlink already pointing to the right place, skip
1579
+ if (
1580
+ symlink_target.is_symlink()
1581
+ and os.readlink(symlink_target) == str(actual_path)
1582
+ ):
1583
+ continue
1584
+
1585
+ # If it exists but is wrong, remove it
1586
+ if symlink_target.exists() or symlink_target.is_symlink():
1587
+ revalidate_cli_dir(cli_dirs_base, cli_dir, expected_cli)
1588
+ if symlink_target.is_dir() and not symlink_target.is_symlink():
1589
+ shutil.rmtree(symlink_target)
1590
+ else:
1591
+ symlink_target.unlink()
1592
+
1593
+ revalidate_cli_dir(cli_dirs_base, cli_dir, expected_cli)
1594
+ os.symlink(actual_path, symlink_target)
1595
+ linked_total += 1
1596
+ print(f"→ {symlink_target} -> {actual_path}")
1597
+
1598
+ print(
1599
+ f"sync-skills: {linked_total} new/updated symlink(s) "
1600
+ f"across CLIs in {cli_dirs_base}"
1601
+ )
1602
+
1603
+
1604
+ def manifest_layer(manifest_path):
1605
+ manifest = load_manifest(manifest_path)
1606
+ validate_manifest_skill_names(manifest)
1607
+ packs = validate_manifest_packs(manifest)
1608
+ return {
1609
+ "manifest": manifest,
1610
+ "packs": packs,
1611
+ "base_dir": manifest_path.parent,
1612
+ "registry": manifest.get("registry", DEFAULT_REGISTRY),
1613
+ }
1614
+
1615
+
1616
+ def main():
1617
+ args = parse_args()
1618
+
1619
+ global_manifest_path = Path(os.path.expanduser("~/.agents/skills.json"))
1620
+ project_manifest_path = Path(os.getcwd()) / ".agents" / "skills.json"
1621
+
1622
+ # Destination topology is a security boundary. Validate every active CLI
1623
+ # directory before cloning/updating registries, creating caches, or changing
1624
+ # any skill link so one unsafe/broken symlink produces zero mutation.
1625
+ #
1626
+ # Precedence, lowest to highest (contract section 5):
1627
+ # global packs[] -> global skills[] -> project packs[] -> project skills[]
1628
+ layers = []
1629
+ if args.scope == "global":
1630
+ preflight_base = Path(os.path.expanduser("~"))
1631
+ print(f"Loading global manifest from {global_manifest_path}")
1632
+ layers.append(manifest_layer(global_manifest_path))
1633
+ else:
1634
+ preflight_base = Path(os.getcwd())
1635
+ print(f"Loading project manifest from {project_manifest_path}")
1636
+ project_layer = manifest_layer(project_manifest_path)
1637
+ if project_layer["manifest"].get("inherit_global", False):
1638
+ print("Inheriting global skills...")
1639
+ layers.append(manifest_layer(global_manifest_path))
1640
+ layers.append(project_layer)
1641
+
1642
+ preflight_names = []
1643
+ for layer in layers:
1644
+ preflight_names.extend(
1645
+ manifest_skill_name(skill)
1646
+ for skill in layer["manifest"].get("skills", [])
1647
+ )
1648
+ preflight_cli_dirs(preflight_base, preflight_names, args.scope)
1649
+
1650
+ cache_dir = ensure_cache_dir()
1651
+
1652
+ skills_to_sync = {} # name -> actual_path
1653
+ # ONE stable memo of registry URL -> ordered checkout roots, shared by
1654
+ # `packs[]` and `skills[]`. Existing roots are never refreshed mid-run.
1655
+ registry_roots = {}
1656
+ managed_roots = default_managed_roots()
1657
+
1658
+ for layer in layers:
1659
+ # Section 6 redundancy is scoped to ONE manifest: a project `skills[]`
1660
+ # entry is weighed only against packs the project manifest declares,
1661
+ # never against the global manifest's packs. This is exactly the scope
1662
+ # provision-packs.py and `pj audit` use, so all three surfaces resolve
1663
+ # every name to the same path. Cross-layer precedence still comes from
1664
+ # the 1-4 ordering above, so a project pack does override a global
1665
+ # `skills[]` entry.
1666
+ pack_scope = PackScope()
1667
+ for entry in layer["packs"]:
1668
+ for name, path in resolve_pack(
1669
+ entry,
1670
+ cache_dir,
1671
+ layer["base_dir"],
1672
+ layer["registry"],
1673
+ registry_roots,
1674
+ managed_roots,
1675
+ on_resolved=pack_scope.record,
1676
+ ):
1677
+ # Later packs override earlier ones.
1678
+ skills_to_sync[name] = path
1679
+ for skill in layer["manifest"].get("skills", []):
1680
+ # Contract section 5 step 1: an entry a declared pack already
1681
+ # provides is REDUNDANT, not an override. Dropping it here is what
1682
+ # keeps `bmad-help` from pinning itself to a stale pack version
1683
+ # while its 74 siblings follow the declared pack.
1684
+ if pack_scope.is_redundant(skill):
1685
+ print(
1686
+ f"Skipping redundant skills[] entry {manifest_skill_name(skill)}: "
1687
+ f"provided by a declared pack"
1688
+ )
1689
+ continue
1690
+ name, path = resolve_skill_path(
1691
+ skill,
1692
+ cache_dir,
1693
+ layer["base_dir"],
1694
+ layer["registry"],
1695
+ registry_roots,
1696
+ )
1697
+ if path:
1698
+ # Contract section 5 step 2: a surviving explicit skills[] entry
1699
+ # always overrides a pack member.
1700
+ skills_to_sync[name] = path
1701
+
1702
+ managed_roots.update(
1703
+ Path(root)
1704
+ for roots in registry_roots.values()
1705
+ for root in roots
1706
+ )
1707
+
1708
+ # Re-validate the full destination topology, now including every
1709
+ # pack-derived skill name, immediately before the first mutation.
1710
+ active_cli_dirs = preflight_cli_dirs(
1711
+ preflight_base,
1712
+ [validate_skill_name(name) for name in skills_to_sync],
1713
+ args.scope,
1714
+ skill_sources=skills_to_sync,
1715
+ )
1716
+
1717
+ fanout_to_cli(
1718
+ preflight_base,
1719
+ skills_to_sync,
1720
+ active_cli_dirs=active_cli_dirs,
1721
+ scope=args.scope,
1722
+ )
1723
+
1724
+ handle_retired_dirs(preflight_base, managed_roots, prune=args.prune_retired)
1725
+
1726
+
1727
+ if __name__ == "__main__":
1728
+ main()