@delorenj/pjangler 1.2.25 → 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 (834) hide show
  1. package/README.md +12 -3
  2. package/dist/index.js +8461 -5505
  3. package/dist/mcp-server.js +7998 -5448
  4. package/package.json +8 -4
  5. package/templates/commonproject/copier.yml +6 -6
  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 +1411 -132
  12. package/templates/commonproject/template/mise.toml.jinja +10 -7
  13. package/templates/hermes-agent/copier.yml +2 -1
  14. package/templates/hermes-agent/template/.gitignore.jinja +1 -0
  15. package/templates/hermes-agent/template/.scripts/20-runtime-repo.sh +61 -4
  16. package/templates/hermes-agent/template/.scripts/70-systemd.sh +7 -0
  17. package/templates/hermes-agent/template/.scripts/lib/ticket-provider.sh +15 -7
  18. package/templates/hermes-agent/template/.scripts/providers/linear.sh +41 -1
  19. package/templates/hermes-agent/template/.scripts/providers/plane.sh +91 -21
  20. package/templates/hermes-agent/template/.scripts/providers/trello.sh +34 -1
  21. package/templates/hermes-agent/template/.scripts/reporter-watchdog.py +242 -0
  22. package/templates/hermes-agent/template/.scripts/secret-scan.py +68 -0
  23. package/templates/hermes-agent/template/.scripts/sentinel.prompt.md.jinja +3 -2
  24. package/templates/hermes-agent/template/SOUL.md.jinja +30 -8
  25. package/templates/hermes-agent/template/role.yaml.jinja +1 -0
  26. package/templates/commonproject/.augment/commands/bmad/agents/bmb-agent-builder.md +0 -14
  27. package/templates/commonproject/.augment/commands/bmad/agents/bmb-module-builder.md +0 -14
  28. package/templates/commonproject/.augment/commands/bmad/agents/bmb-workflow-builder.md +0 -14
  29. package/templates/commonproject/.augment/commands/bmad/agents/bmm-analyst.md +0 -14
  30. package/templates/commonproject/.augment/commands/bmad/agents/bmm-architect.md +0 -14
  31. package/templates/commonproject/.augment/commands/bmad/agents/bmm-dev.md +0 -14
  32. package/templates/commonproject/.augment/commands/bmad/agents/bmm-pm.md +0 -14
  33. package/templates/commonproject/.augment/commands/bmad/agents/bmm-quick-flow-solo-dev.md +0 -14
  34. package/templates/commonproject/.augment/commands/bmad/agents/bmm-sm.md +0 -14
  35. package/templates/commonproject/.augment/commands/bmad/agents/bmm-tea.md +0 -14
  36. package/templates/commonproject/.augment/commands/bmad/agents/bmm-tech-writer.md +0 -14
  37. package/templates/commonproject/.augment/commands/bmad/agents/bmm-ux-designer.md +0 -14
  38. package/templates/commonproject/.augment/commands/bmad/agents/cis-brainstorming-coach.md +0 -14
  39. package/templates/commonproject/.augment/commands/bmad/agents/cis-creative-problem-solver.md +0 -14
  40. package/templates/commonproject/.augment/commands/bmad/agents/cis-design-thinking-coach.md +0 -14
  41. package/templates/commonproject/.augment/commands/bmad/agents/cis-innovation-strategist.md +0 -14
  42. package/templates/commonproject/.augment/commands/bmad/agents/cis-presentation-master.md +0 -14
  43. package/templates/commonproject/.augment/commands/bmad/agents/cis-storyteller.md +0 -14
  44. package/templates/commonproject/.augment/commands/bmad/agents/core-bmad-master.md +0 -14
  45. package/templates/commonproject/.augment/commands/bmad/tasks/core-index-docs.md +0 -74
  46. package/templates/commonproject/.augment/commands/bmad/tasks/core-shard-doc.md +0 -118
  47. package/templates/commonproject/.augment/commands/bmad/workflows/bmb-agent.md +0 -5
  48. package/templates/commonproject/.augment/commands/bmad/workflows/bmb-module.md +0 -5
  49. package/templates/commonproject/.augment/commands/bmad/workflows/bmb-workflow.md +0 -5
  50. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-check-implementation-readiness.md +0 -5
  51. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-code-review.md +0 -13
  52. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-correct-course.md +0 -13
  53. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-architecture.md +0 -5
  54. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-epics-and-stories.md +0 -5
  55. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-excalidraw-dataflow.md +0 -13
  56. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-excalidraw-diagram.md +0 -13
  57. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-excalidraw-flowchart.md +0 -13
  58. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-excalidraw-wireframe.md +0 -13
  59. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-product-brief.md +0 -5
  60. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-story.md +0 -13
  61. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-create-ux-design.md +0 -5
  62. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-dev-story.md +0 -13
  63. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-document-project.md +0 -13
  64. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-generate-project-context.md +0 -5
  65. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-prd.md +0 -5
  66. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-quick-dev.md +0 -5
  67. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-quick-spec.md +0 -5
  68. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-research.md +0 -5
  69. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-retrospective.md +0 -13
  70. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-sprint-planning.md +0 -13
  71. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-sprint-status.md +0 -13
  72. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-atdd.md +0 -13
  73. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-automate.md +0 -13
  74. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-ci.md +0 -13
  75. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-framework.md +0 -13
  76. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-nfr.md +0 -13
  77. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-test-design.md +0 -13
  78. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-test-review.md +0 -13
  79. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-testarch-trace.md +0 -13
  80. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-workflow-init.md +0 -13
  81. package/templates/commonproject/.augment/commands/bmad/workflows/bmm-workflow-status.md +0 -13
  82. package/templates/commonproject/.augment/commands/bmad/workflows/cis-design-thinking.md +0 -13
  83. package/templates/commonproject/.augment/commands/bmad/workflows/cis-innovation-strategy.md +0 -13
  84. package/templates/commonproject/.augment/commands/bmad/workflows/cis-problem-solving.md +0 -13
  85. package/templates/commonproject/.augment/commands/bmad/workflows/cis-storytelling.md +0 -13
  86. package/templates/commonproject/.augment/commands/bmad/workflows/core-brainstorming.md +0 -5
  87. package/templates/commonproject/.augment/commands/bmad/workflows/core-party-mode.md +0 -5
  88. package/templates/commonproject/.augment/commands/bmad/workflows/custom-ticket-lifecycle.md +0 -5
  89. package/templates/commonproject/.copier-answers.yml +0 -4
  90. package/templates/commonproject/.gemini/commands/bmad-agent-bmb-agent-builder.toml +0 -12
  91. package/templates/commonproject/.gemini/commands/bmad-agent-bmb-module-builder.toml +0 -12
  92. package/templates/commonproject/.gemini/commands/bmad-agent-bmb-workflow-builder.toml +0 -12
  93. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-analyst.toml +0 -12
  94. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-architect.toml +0 -12
  95. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-dev.toml +0 -12
  96. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-pm.toml +0 -12
  97. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-quick-flow-solo-dev.toml +0 -12
  98. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-sm.toml +0 -12
  99. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-tea.toml +0 -12
  100. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-tech-writer.toml +0 -12
  101. package/templates/commonproject/.gemini/commands/bmad-agent-bmm-ux-designer.toml +0 -12
  102. package/templates/commonproject/.gemini/commands/bmad-agent-cis-brainstorming-coach.toml +0 -12
  103. package/templates/commonproject/.gemini/commands/bmad-agent-cis-creative-problem-solver.toml +0 -12
  104. package/templates/commonproject/.gemini/commands/bmad-agent-cis-design-thinking-coach.toml +0 -12
  105. package/templates/commonproject/.gemini/commands/bmad-agent-cis-innovation-strategist.toml +0 -12
  106. package/templates/commonproject/.gemini/commands/bmad-agent-cis-presentation-master.toml +0 -12
  107. package/templates/commonproject/.gemini/commands/bmad-agent-cis-storyteller.toml +0 -12
  108. package/templates/commonproject/.gemini/commands/bmad-agent-core-bmad-master.toml +0 -12
  109. package/templates/commonproject/.gemini/commands/bmad-task-core-index-docs.toml +0 -12
  110. package/templates/commonproject/.gemini/commands/bmad-task-core-review-adversarial-general.toml +0 -12
  111. package/templates/commonproject/.gemini/commands/bmad-task-core-shard-doc.toml +0 -12
  112. package/templates/commonproject/.gemini/commands/bmad-task-core-workflow.toml +0 -12
  113. package/templates/commonproject/.gemini/commands/bmad-workflow-bmb-agent.toml +0 -4
  114. package/templates/commonproject/.gemini/commands/bmad-workflow-bmb-module.toml +0 -4
  115. package/templates/commonproject/.gemini/commands/bmad-workflow-bmb-workflow.toml +0 -4
  116. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-check-implementation-readiness.toml +0 -4
  117. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-code-review.toml +0 -12
  118. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-correct-course.toml +0 -12
  119. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-architecture.toml +0 -4
  120. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-epics-and-stories.toml +0 -4
  121. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-excalidraw-dataflow.toml +0 -12
  122. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-excalidraw-diagram.toml +0 -12
  123. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-excalidraw-flowchart.toml +0 -12
  124. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-excalidraw-wireframe.toml +0 -12
  125. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-product-brief.toml +0 -4
  126. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-story.toml +0 -12
  127. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-create-ux-design.toml +0 -4
  128. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-dev-story.toml +0 -12
  129. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-document-project.toml +0 -12
  130. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-generate-project-context.toml +0 -4
  131. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-prd.toml +0 -4
  132. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-quick-dev.toml +0 -4
  133. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-quick-spec.toml +0 -4
  134. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-research.toml +0 -4
  135. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-retrospective.toml +0 -12
  136. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-sprint-planning.toml +0 -12
  137. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-sprint-status.toml +0 -12
  138. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-atdd.toml +0 -12
  139. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-automate.toml +0 -12
  140. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-ci.toml +0 -12
  141. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-framework.toml +0 -12
  142. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-nfr.toml +0 -12
  143. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-test-design.toml +0 -12
  144. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-test-review.toml +0 -12
  145. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-testarch-trace.toml +0 -12
  146. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-workflow-init.toml +0 -12
  147. package/templates/commonproject/.gemini/commands/bmad-workflow-bmm-workflow-status.toml +0 -12
  148. package/templates/commonproject/.gemini/commands/bmad-workflow-cis-design-thinking.toml +0 -12
  149. package/templates/commonproject/.gemini/commands/bmad-workflow-cis-innovation-strategy.toml +0 -12
  150. package/templates/commonproject/.gemini/commands/bmad-workflow-cis-problem-solving.toml +0 -12
  151. package/templates/commonproject/.gemini/commands/bmad-workflow-cis-storytelling.toml +0 -12
  152. package/templates/commonproject/.gemini/commands/bmad-workflow-core-brainstorming.toml +0 -4
  153. package/templates/commonproject/.gemini/commands/bmad-workflow-core-party-mode.toml +0 -4
  154. package/templates/commonproject/.gemini/commands/bmad-workflow-custom-ticket-lifecycle.toml +0 -4
  155. package/templates/commonproject/.github/agents/bmd-custom-bmb-agent-builder.agent.md +0 -17
  156. package/templates/commonproject/.github/agents/bmd-custom-bmb-module-builder.agent.md +0 -17
  157. package/templates/commonproject/.github/agents/bmd-custom-bmb-workflow-builder.agent.md +0 -17
  158. package/templates/commonproject/.github/agents/bmd-custom-bmm-analyst.agent.md +0 -17
  159. package/templates/commonproject/.github/agents/bmd-custom-bmm-architect.agent.md +0 -17
  160. package/templates/commonproject/.github/agents/bmd-custom-bmm-dev.agent.md +0 -17
  161. package/templates/commonproject/.github/agents/bmd-custom-bmm-pm.agent.md +0 -17
  162. package/templates/commonproject/.github/agents/bmd-custom-bmm-quick-flow-solo-dev.agent.md +0 -17
  163. package/templates/commonproject/.github/agents/bmd-custom-bmm-sm.agent.md +0 -17
  164. package/templates/commonproject/.github/agents/bmd-custom-bmm-tea.agent.md +0 -17
  165. package/templates/commonproject/.github/agents/bmd-custom-bmm-tech-writer.agent.md +0 -17
  166. package/templates/commonproject/.github/agents/bmd-custom-bmm-ux-designer.agent.md +0 -17
  167. package/templates/commonproject/.github/agents/bmd-custom-cis-brainstorming-coach.agent.md +0 -17
  168. package/templates/commonproject/.github/agents/bmd-custom-cis-creative-problem-solver.agent.md +0 -17
  169. package/templates/commonproject/.github/agents/bmd-custom-cis-design-thinking-coach.agent.md +0 -17
  170. package/templates/commonproject/.github/agents/bmd-custom-cis-innovation-strategist.agent.md +0 -17
  171. package/templates/commonproject/.github/agents/bmd-custom-cis-presentation-master.agent.md +0 -17
  172. package/templates/commonproject/.github/agents/bmd-custom-cis-storyteller.agent.md +0 -17
  173. package/templates/commonproject/.github/agents/bmd-custom-core-bmad-master.agent.md +0 -17
  174. package/templates/commonproject/.mcp.json +0 -12
  175. package/templates/commonproject/.mise/scripts/claude +0 -13
  176. package/templates/commonproject/.mise/scripts/create-plane-project.sh +0 -149
  177. package/templates/commonproject/.mise/scripts/init-project.sh +0 -314
  178. package/templates/commonproject/.mise/scripts/link-agentfiles.sh +0 -9
  179. package/templates/commonproject/.opencode/agent/bmad-agent-bmb-agent-builder.md +0 -14
  180. package/templates/commonproject/.opencode/agent/bmad-agent-bmb-module-builder.md +0 -14
  181. package/templates/commonproject/.opencode/agent/bmad-agent-bmb-workflow-builder.md +0 -14
  182. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-analyst.md +0 -14
  183. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-architect.md +0 -14
  184. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-dev.md +0 -14
  185. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-pm.md +0 -14
  186. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-quick-flow-solo-dev.md +0 -14
  187. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-sm.md +0 -14
  188. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-tea.md +0 -14
  189. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-tech-writer.md +0 -14
  190. package/templates/commonproject/.opencode/agent/bmad-agent-bmm-ux-designer.md +0 -14
  191. package/templates/commonproject/.opencode/agent/bmad-agent-cis-brainstorming-coach.md +0 -14
  192. package/templates/commonproject/.opencode/agent/bmad-agent-cis-creative-problem-solver.md +0 -14
  193. package/templates/commonproject/.opencode/agent/bmad-agent-cis-design-thinking-coach.md +0 -14
  194. package/templates/commonproject/.opencode/agent/bmad-agent-cis-innovation-strategist.md +0 -14
  195. package/templates/commonproject/.opencode/agent/bmad-agent-cis-presentation-master.md +0 -14
  196. package/templates/commonproject/.opencode/agent/bmad-agent-cis-storyteller.md +0 -14
  197. package/templates/commonproject/.opencode/agent/bmad-agent-core-bmad-master.md +0 -14
  198. package/templates/commonproject/.opencode/command/bmad-bmb-agent.md +0 -5
  199. package/templates/commonproject/.opencode/command/bmad-bmb-module.md +0 -5
  200. package/templates/commonproject/.opencode/command/bmad-bmb-workflow.md +0 -5
  201. package/templates/commonproject/.opencode/command/bmad-bmm-check-implementation-readiness.md +0 -5
  202. package/templates/commonproject/.opencode/command/bmad-bmm-code-review.md +0 -13
  203. package/templates/commonproject/.opencode/command/bmad-bmm-correct-course.md +0 -13
  204. package/templates/commonproject/.opencode/command/bmad-bmm-create-architecture.md +0 -5
  205. package/templates/commonproject/.opencode/command/bmad-bmm-create-epics-and-stories.md +0 -5
  206. package/templates/commonproject/.opencode/command/bmad-bmm-create-excalidraw-dataflow.md +0 -13
  207. package/templates/commonproject/.opencode/command/bmad-bmm-create-excalidraw-diagram.md +0 -13
  208. package/templates/commonproject/.opencode/command/bmad-bmm-create-excalidraw-flowchart.md +0 -13
  209. package/templates/commonproject/.opencode/command/bmad-bmm-create-excalidraw-wireframe.md +0 -13
  210. package/templates/commonproject/.opencode/command/bmad-bmm-create-product-brief.md +0 -5
  211. package/templates/commonproject/.opencode/command/bmad-bmm-create-story.md +0 -13
  212. package/templates/commonproject/.opencode/command/bmad-bmm-create-ux-design.md +0 -5
  213. package/templates/commonproject/.opencode/command/bmad-bmm-dev-story.md +0 -13
  214. package/templates/commonproject/.opencode/command/bmad-bmm-document-project.md +0 -13
  215. package/templates/commonproject/.opencode/command/bmad-bmm-generate-project-context.md +0 -5
  216. package/templates/commonproject/.opencode/command/bmad-bmm-prd.md +0 -5
  217. package/templates/commonproject/.opencode/command/bmad-bmm-quick-dev.md +0 -5
  218. package/templates/commonproject/.opencode/command/bmad-bmm-quick-spec.md +0 -5
  219. package/templates/commonproject/.opencode/command/bmad-bmm-research.md +0 -5
  220. package/templates/commonproject/.opencode/command/bmad-bmm-retrospective.md +0 -13
  221. package/templates/commonproject/.opencode/command/bmad-bmm-sprint-planning.md +0 -13
  222. package/templates/commonproject/.opencode/command/bmad-bmm-sprint-status.md +0 -13
  223. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-atdd.md +0 -13
  224. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-automate.md +0 -13
  225. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-ci.md +0 -13
  226. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-framework.md +0 -13
  227. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-nfr.md +0 -13
  228. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-test-design.md +0 -13
  229. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-test-review.md +0 -13
  230. package/templates/commonproject/.opencode/command/bmad-bmm-testarch-trace.md +0 -13
  231. package/templates/commonproject/.opencode/command/bmad-bmm-workflow-init.md +0 -13
  232. package/templates/commonproject/.opencode/command/bmad-bmm-workflow-status.md +0 -13
  233. package/templates/commonproject/.opencode/command/bmad-cis-design-thinking.md +0 -13
  234. package/templates/commonproject/.opencode/command/bmad-cis-innovation-strategy.md +0 -13
  235. package/templates/commonproject/.opencode/command/bmad-cis-problem-solving.md +0 -13
  236. package/templates/commonproject/.opencode/command/bmad-cis-storytelling.md +0 -13
  237. package/templates/commonproject/.opencode/command/bmad-core-brainstorming.md +0 -5
  238. package/templates/commonproject/.opencode/command/bmad-core-party-mode.md +0 -5
  239. package/templates/commonproject/.opencode/command/bmad-custom-ticket-lifecycle.md +0 -5
  240. package/templates/commonproject/.opencode/command/bmad-task-core-index-docs.md +0 -9
  241. package/templates/commonproject/.opencode/command/bmad-task-core-shard-doc.md +0 -9
  242. package/templates/commonproject/.plane.json +0 -6
  243. package/templates/commonproject/.scripts/test-template.sh +0 -63
  244. package/templates/commonproject/AGENTS.md +0 -86
  245. package/templates/commonproject/README.md +0 -172
  246. package/templates/commonproject/_bmad/_config/agent-manifest.csv +0 -20
  247. package/templates/commonproject/_bmad/_config/agents/bmb-agent-builder.customize.yaml +0 -41
  248. package/templates/commonproject/_bmad/_config/agents/bmb-module-builder.customize.yaml +0 -41
  249. package/templates/commonproject/_bmad/_config/agents/bmb-workflow-builder.customize.yaml +0 -41
  250. package/templates/commonproject/_bmad/_config/agents/bmm-analyst.customize.yaml +0 -41
  251. package/templates/commonproject/_bmad/_config/agents/bmm-architect.customize.yaml +0 -41
  252. package/templates/commonproject/_bmad/_config/agents/bmm-dev.customize.yaml +0 -41
  253. package/templates/commonproject/_bmad/_config/agents/bmm-pm.customize.yaml +0 -41
  254. package/templates/commonproject/_bmad/_config/agents/bmm-quick-flow-solo-dev.customize.yaml +0 -41
  255. package/templates/commonproject/_bmad/_config/agents/bmm-sm.customize.yaml +0 -41
  256. package/templates/commonproject/_bmad/_config/agents/bmm-tea.customize.yaml +0 -41
  257. package/templates/commonproject/_bmad/_config/agents/bmm-tech-writer.customize.yaml +0 -41
  258. package/templates/commonproject/_bmad/_config/agents/bmm-ux-designer.customize.yaml +0 -41
  259. package/templates/commonproject/_bmad/_config/agents/cis-brainstorming-coach.customize.yaml +0 -41
  260. package/templates/commonproject/_bmad/_config/agents/cis-creative-problem-solver.customize.yaml +0 -41
  261. package/templates/commonproject/_bmad/_config/agents/cis-design-thinking-coach.customize.yaml +0 -41
  262. package/templates/commonproject/_bmad/_config/agents/cis-innovation-strategist.customize.yaml +0 -41
  263. package/templates/commonproject/_bmad/_config/agents/cis-presentation-master.customize.yaml +0 -41
  264. package/templates/commonproject/_bmad/_config/agents/cis-storyteller.customize.yaml +0 -41
  265. package/templates/commonproject/_bmad/_config/agents/core-bmad-master.customize.yaml +0 -41
  266. package/templates/commonproject/_bmad/_config/custom/cache-manifest.yaml +0 -4
  267. package/templates/commonproject/_bmad/_config/custom/custom/module.yaml +0 -8
  268. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/data/ac-sufficiency-rubric.md +0 -33
  269. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/data/audit-comment-template.md +0 -54
  270. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/data/event-schemas.md +0 -58
  271. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-c/step-01-init.md +0 -173
  272. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-c/step-02-triage.md +0 -159
  273. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-c/step-03-refine.md +0 -149
  274. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-c/step-04-implement.md +0 -147
  275. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-c/step-05-review.md +0 -146
  276. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-c/step-06-qa.md +0 -199
  277. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-c/step-07-complete.md +0 -141
  278. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-e/step-01-assess.md +0 -102
  279. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-e/step-02-apply.md +0 -85
  280. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/steps-v/step-01-validate.md +0 -154
  281. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/workflow-plan-ticket-lifecycle.md +0 -346
  282. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/workflow.md +0 -84
  283. package/templates/commonproject/_bmad/_config/custom/custom/workflows/ticket-lifecycle/workflow.yaml +0 -39
  284. package/templates/commonproject/_bmad/_config/files-manifest.csv +0 -483
  285. package/templates/commonproject/_bmad/_config/ides/claude-code.yaml +0 -6
  286. package/templates/commonproject/_bmad/_config/ides/codex.yaml +0 -5
  287. package/templates/commonproject/_bmad/_config/manifest.yaml +0 -18
  288. package/templates/commonproject/_bmad/_config/task-manifest.csv +0 -5
  289. package/templates/commonproject/_bmad/_config/tool-manifest.csv +0 -1
  290. package/templates/commonproject/_bmad/_config/workflow-manifest.csv +0 -43
  291. package/templates/commonproject/_bmad/_memory/config.yaml +0 -11
  292. package/templates/commonproject/_bmad/_memory/storyteller-sidecar/stories-told.md +0 -7
  293. package/templates/commonproject/_bmad/_memory/storyteller-sidecar/story-preferences.md +0 -7
  294. package/templates/commonproject/_bmad/bmb/README.md +0 -25
  295. package/templates/commonproject/_bmad/bmb/agents/agent-builder.md +0 -64
  296. package/templates/commonproject/_bmad/bmb/agents/module-builder.md +0 -65
  297. package/templates/commonproject/_bmad/bmb/agents/workflow-builder.md +0 -66
  298. package/templates/commonproject/_bmad/bmb/config.yaml +0 -12
  299. package/templates/commonproject/_bmad/bmb/workflows/agent/data/agent-compilation.md +0 -273
  300. package/templates/commonproject/_bmad/bmb/workflows/agent/data/agent-menu-patterns.md +0 -233
  301. package/templates/commonproject/_bmad/bmb/workflows/agent/data/agent-metadata.md +0 -208
  302. package/templates/commonproject/_bmad/bmb/workflows/agent/data/brainstorm-context.md +0 -146
  303. package/templates/commonproject/_bmad/bmb/workflows/agent/data/communication-presets.csv +0 -61
  304. package/templates/commonproject/_bmad/bmb/workflows/agent/data/critical-actions.md +0 -120
  305. package/templates/commonproject/_bmad/bmb/workflows/agent/data/expert-agent-architecture.md +0 -236
  306. package/templates/commonproject/_bmad/bmb/workflows/agent/data/expert-agent-validation.md +0 -174
  307. package/templates/commonproject/_bmad/bmb/workflows/agent/data/module-agent-validation.md +0 -126
  308. package/templates/commonproject/_bmad/bmb/workflows/agent/data/persona-properties.md +0 -266
  309. package/templates/commonproject/_bmad/bmb/workflows/agent/data/principles-crafting.md +0 -292
  310. package/templates/commonproject/_bmad/bmb/workflows/agent/data/reference/module-examples/architect.md +0 -68
  311. package/templates/commonproject/_bmad/bmb/workflows/agent/data/simple-agent-architecture.md +0 -204
  312. package/templates/commonproject/_bmad/bmb/workflows/agent/data/simple-agent-validation.md +0 -133
  313. package/templates/commonproject/_bmad/bmb/workflows/agent/data/understanding-agent-types.md +0 -222
  314. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-01-brainstorm.md +0 -128
  315. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-02-discovery.md +0 -170
  316. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-03-type-metadata.md +0 -296
  317. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-04-persona.md +0 -212
  318. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-05-commands-menu.md +0 -178
  319. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-06-activation.md +0 -279
  320. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-07a-build-simple.md +0 -187
  321. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-07b-build-expert.md +0 -201
  322. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-07c-build-module.md +0 -258
  323. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-c/step-08-celebrate.md +0 -249
  324. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-01-load-existing.md +0 -221
  325. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-02-discover-edits.md +0 -193
  326. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-03-placeholder.md +0 -1
  327. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-04-type-metadata.md +0 -124
  328. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-05-persona.md +0 -134
  329. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-06-commands-menu.md +0 -122
  330. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-07-activation.md +0 -125
  331. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-08a-edit-simple.md +0 -137
  332. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-08b-edit-expert.md +0 -119
  333. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-08c-edit-module.md +0 -123
  334. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-e/e-09-celebrate.md +0 -155
  335. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-v/v-01-load-review.md +0 -136
  336. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-v/v-02a-validate-metadata.md +0 -116
  337. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-v/v-02b-validate-persona.md +0 -124
  338. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-v/v-02c-validate-menu.md +0 -145
  339. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-v/v-02d-validate-structure.md +0 -136
  340. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-v/v-02e-validate-sidecar.md +0 -136
  341. package/templates/commonproject/_bmad/bmb/workflows/agent/steps-v/v-03-summary.md +0 -104
  342. package/templates/commonproject/_bmad/bmb/workflows/agent/templates/agent-plan.template.md +0 -5
  343. package/templates/commonproject/_bmad/bmb/workflows/agent/templates/expert-agent-template/expert-agent.template.md +0 -77
  344. package/templates/commonproject/_bmad/bmb/workflows/agent/templates/simple-agent.template.md +0 -72
  345. package/templates/commonproject/_bmad/bmb/workflows/agent/workflow.md +0 -123
  346. package/templates/commonproject/_bmad/bmb/workflows/module/data/agent-architecture.md +0 -179
  347. package/templates/commonproject/_bmad/bmb/workflows/module/data/agent-spec-template.md +0 -79
  348. package/templates/commonproject/_bmad/bmb/workflows/module/data/module-installer-standards.md +0 -348
  349. package/templates/commonproject/_bmad/bmb/workflows/module/data/module-standards.md +0 -280
  350. package/templates/commonproject/_bmad/bmb/workflows/module/data/module-yaml-conventions.md +0 -392
  351. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-01-welcome.md +0 -147
  352. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-02-spark.md +0 -140
  353. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-03-module-type.md +0 -148
  354. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-04-vision.md +0 -82
  355. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-05-identity.md +0 -96
  356. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-06-users.md +0 -85
  357. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-07-value.md +0 -75
  358. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-08-agents.md +0 -96
  359. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-09-workflows.md +0 -82
  360. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-10-tools.md +0 -90
  361. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-11-scenarios.md +0 -83
  362. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-12-creative.md +0 -94
  363. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-13-review.md +0 -104
  364. package/templates/commonproject/_bmad/bmb/workflows/module/steps-b/step-14-finalize.md +0 -117
  365. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-01-load-brief.md +0 -178
  366. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-01b-continue.md +0 -83
  367. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-02-structure.md +0 -109
  368. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-03-config.md +0 -118
  369. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-04-installer.md +0 -160
  370. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-05-agents.md +0 -167
  371. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-06-workflows.md +0 -183
  372. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-07-docs.md +0 -402
  373. package/templates/commonproject/_bmad/bmb/workflows/module/steps-c/step-08-complete.md +0 -123
  374. package/templates/commonproject/_bmad/bmb/workflows/module/steps-e/step-01-load-target.md +0 -81
  375. package/templates/commonproject/_bmad/bmb/workflows/module/steps-e/step-02-select-edit.md +0 -77
  376. package/templates/commonproject/_bmad/bmb/workflows/module/steps-e/step-03-apply-edit.md +0 -77
  377. package/templates/commonproject/_bmad/bmb/workflows/module/steps-e/step-04-review.md +0 -80
  378. package/templates/commonproject/_bmad/bmb/workflows/module/steps-e/step-05-confirm.md +0 -75
  379. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-01-load-target.md +0 -96
  380. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-02-file-structure.md +0 -94
  381. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-03-module-yaml.md +0 -99
  382. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-04-agent-specs.md +0 -152
  383. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-05-workflow-specs.md +0 -152
  384. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-06-documentation.md +0 -143
  385. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-07-installation.md +0 -113
  386. package/templates/commonproject/_bmad/bmb/workflows/module/steps-v/step-08-report.md +0 -197
  387. package/templates/commonproject/_bmad/bmb/workflows/module/templates/brief-template.md +0 -154
  388. package/templates/commonproject/_bmad/bmb/workflows/module/templates/workflow-spec-template.md +0 -96
  389. package/templates/commonproject/_bmad/bmb/workflows/module/workflow.md +0 -100
  390. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/architecture.md +0 -152
  391. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/common-workflow-tools.csv +0 -19
  392. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/csv-data-file-standards.md +0 -81
  393. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/frontmatter-standards.md +0 -225
  394. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/input-discovery-standards.md +0 -269
  395. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/intent-vs-prescriptive-spectrum.md +0 -50
  396. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/menu-handling-standards.md +0 -167
  397. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/output-format-standards.md +0 -188
  398. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/step-file-rules.md +0 -235
  399. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/step-type-patterns.md +0 -311
  400. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/subprocess-optimization-patterns.md +0 -386
  401. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/trimodal-workflow-structure.md +0 -209
  402. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/workflow-chaining-standards.md +0 -271
  403. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/workflow-examples.md +0 -276
  404. package/templates/commonproject/_bmad/bmb/workflows/workflow/data/workflow-type-criteria.md +0 -172
  405. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-00-conversion.md +0 -262
  406. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-01-discovery.md +0 -194
  407. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-01b-continuation.md +0 -3
  408. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-02-classification.md +0 -269
  409. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-03-requirements.md +0 -282
  410. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-04-tools.md +0 -281
  411. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-05-plan-review.md +0 -242
  412. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-06-design.md +0 -329
  413. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-07-foundation.md +0 -238
  414. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-08-build-step-01.md +0 -377
  415. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-09-build-next-step.md +0 -350
  416. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-10-confirmation.md +0 -320
  417. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-c/step-11-completion.md +0 -191
  418. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-e/step-e-01-assess-workflow.md +0 -237
  419. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-e/step-e-02-discover-edits.md +0 -248
  420. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-e/step-e-03-fix-validation.md +0 -252
  421. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-e/step-e-04-direct-edit.md +0 -275
  422. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-e/step-e-05-apply-edit.md +0 -154
  423. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-e/step-e-06-validate-after.md +0 -190
  424. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-e/step-e-07-complete.md +0 -206
  425. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-01-validate-max-mode.md +0 -109
  426. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-01-validate.md +0 -221
  427. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-01b-structure.md +0 -152
  428. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-02-frontmatter-validation.md +0 -199
  429. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-02b-path-violations.md +0 -265
  430. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-03-menu-validation.md +0 -164
  431. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-04-step-type-validation.md +0 -211
  432. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-05-output-format-validation.md +0 -200
  433. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-06-validation-design-check.md +0 -195
  434. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-07-instruction-style-check.md +0 -209
  435. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-08-collaborative-experience-check.md +0 -199
  436. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-08b-subprocess-optimization.md +0 -179
  437. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-09-cohesive-review.md +0 -186
  438. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-10-report-complete.md +0 -154
  439. package/templates/commonproject/_bmad/bmb/workflows/workflow/steps-v/step-11-plan-validation.md +0 -237
  440. package/templates/commonproject/_bmad/bmb/workflows/workflow/templates/minimal-output-template.md +0 -11
  441. package/templates/commonproject/_bmad/bmb/workflows/workflow/templates/step-01-init-continuable-template.md +0 -241
  442. package/templates/commonproject/_bmad/bmb/workflows/workflow/templates/step-1b-template.md +0 -223
  443. package/templates/commonproject/_bmad/bmb/workflows/workflow/templates/step-template.md +0 -290
  444. package/templates/commonproject/_bmad/bmb/workflows/workflow/templates/workflow-template.md +0 -102
  445. package/templates/commonproject/_bmad/bmb/workflows/workflow/workflow.md +0 -109
  446. package/templates/commonproject/_bmad/bmm/agents/analyst.md +0 -82
  447. package/templates/commonproject/_bmad/bmm/agents/architect.md +0 -74
  448. package/templates/commonproject/_bmad/bmm/agents/dev.md +0 -76
  449. package/templates/commonproject/_bmad/bmm/agents/pm.md +0 -78
  450. package/templates/commonproject/_bmad/bmm/agents/quick-flow-solo-dev.md +0 -74
  451. package/templates/commonproject/_bmad/bmm/agents/sm.md +0 -77
  452. package/templates/commonproject/_bmad/bmm/agents/tea.md +0 -77
  453. package/templates/commonproject/_bmad/bmm/agents/tech-writer.md +0 -78
  454. package/templates/commonproject/_bmad/bmm/agents/ux-designer.md +0 -74
  455. package/templates/commonproject/_bmad/bmm/config.yaml +0 -18
  456. package/templates/commonproject/_bmad/bmm/data/README.md +0 -29
  457. package/templates/commonproject/_bmad/bmm/data/documentation-standards.md +0 -262
  458. package/templates/commonproject/_bmad/bmm/data/project-context-template.md +0 -40
  459. package/templates/commonproject/_bmad/bmm/teams/default-party.csv +0 -21
  460. package/templates/commonproject/_bmad/bmm/teams/team-fullstack.yaml +0 -12
  461. package/templates/commonproject/_bmad/bmm/testarch/knowledge/api-request.md +0 -442
  462. package/templates/commonproject/_bmad/bmm/testarch/knowledge/api-testing-patterns.md +0 -843
  463. package/templates/commonproject/_bmad/bmm/testarch/knowledge/auth-session.md +0 -552
  464. package/templates/commonproject/_bmad/bmm/testarch/knowledge/burn-in.md +0 -273
  465. package/templates/commonproject/_bmad/bmm/testarch/knowledge/ci-burn-in.md +0 -675
  466. package/templates/commonproject/_bmad/bmm/testarch/knowledge/component-tdd.md +0 -486
  467. package/templates/commonproject/_bmad/bmm/testarch/knowledge/contract-testing.md +0 -957
  468. package/templates/commonproject/_bmad/bmm/testarch/knowledge/data-factories.md +0 -500
  469. package/templates/commonproject/_bmad/bmm/testarch/knowledge/email-auth.md +0 -721
  470. package/templates/commonproject/_bmad/bmm/testarch/knowledge/error-handling.md +0 -725
  471. package/templates/commonproject/_bmad/bmm/testarch/knowledge/feature-flags.md +0 -750
  472. package/templates/commonproject/_bmad/bmm/testarch/knowledge/file-utils.md +0 -463
  473. package/templates/commonproject/_bmad/bmm/testarch/knowledge/fixture-architecture.md +0 -401
  474. package/templates/commonproject/_bmad/bmm/testarch/knowledge/fixtures-composition.md +0 -382
  475. package/templates/commonproject/_bmad/bmm/testarch/knowledge/intercept-network-call.md +0 -430
  476. package/templates/commonproject/_bmad/bmm/testarch/knowledge/log.md +0 -429
  477. package/templates/commonproject/_bmad/bmm/testarch/knowledge/network-error-monitor.md +0 -405
  478. package/templates/commonproject/_bmad/bmm/testarch/knowledge/network-first.md +0 -486
  479. package/templates/commonproject/_bmad/bmm/testarch/knowledge/network-recorder.md +0 -527
  480. package/templates/commonproject/_bmad/bmm/testarch/knowledge/nfr-criteria.md +0 -670
  481. package/templates/commonproject/_bmad/bmm/testarch/knowledge/overview.md +0 -286
  482. package/templates/commonproject/_bmad/bmm/testarch/knowledge/playwright-config.md +0 -730
  483. package/templates/commonproject/_bmad/bmm/testarch/knowledge/probability-impact.md +0 -601
  484. package/templates/commonproject/_bmad/bmm/testarch/knowledge/recurse.md +0 -421
  485. package/templates/commonproject/_bmad/bmm/testarch/knowledge/risk-governance.md +0 -615
  486. package/templates/commonproject/_bmad/bmm/testarch/knowledge/selective-testing.md +0 -732
  487. package/templates/commonproject/_bmad/bmm/testarch/knowledge/selector-resilience.md +0 -527
  488. package/templates/commonproject/_bmad/bmm/testarch/knowledge/test-healing-patterns.md +0 -644
  489. package/templates/commonproject/_bmad/bmm/testarch/knowledge/test-levels-framework.md +0 -473
  490. package/templates/commonproject/_bmad/bmm/testarch/knowledge/test-priorities-matrix.md +0 -373
  491. package/templates/commonproject/_bmad/bmm/testarch/knowledge/test-quality.md +0 -664
  492. package/templates/commonproject/_bmad/bmm/testarch/knowledge/timing-debugging.md +0 -372
  493. package/templates/commonproject/_bmad/bmm/testarch/knowledge/visual-debugging.md +0 -524
  494. package/templates/commonproject/_bmad/bmm/testarch/tea-index.csv +0 -34
  495. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/product-brief.template.md +0 -10
  496. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-01-init.md +0 -177
  497. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-01b-continue.md +0 -161
  498. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-02-vision.md +0 -199
  499. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-03-users.md +0 -202
  500. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-04-metrics.md +0 -205
  501. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-05-scope.md +0 -219
  502. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-06-complete.md +0 -194
  503. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/create-product-brief/workflow.md +0 -58
  504. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-01-init.md +0 -137
  505. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-02-domain-analysis.md +0 -229
  506. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-03-competitive-landscape.md +0 -238
  507. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-04-regulatory-focus.md +0 -206
  508. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-05-technical-trends.md +0 -234
  509. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-06-research-synthesis.md +0 -443
  510. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/market-steps/step-01-init.md +0 -182
  511. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/market-steps/step-02-customer-behavior.md +0 -237
  512. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/market-steps/step-02-customer-insights.md +0 -200
  513. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/market-steps/step-03-customer-pain-points.md +0 -249
  514. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/market-steps/step-04-customer-decisions.md +0 -259
  515. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/market-steps/step-05-competitive-analysis.md +0 -177
  516. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/market-steps/step-06-research-completion.md +0 -475
  517. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/research.template.md +0 -29
  518. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-01-init.md +0 -137
  519. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-02-technical-overview.md +0 -239
  520. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-03-integration-patterns.md +0 -248
  521. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-04-architectural-patterns.md +0 -202
  522. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-05-implementation-research.md +0 -239
  523. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-06-research-synthesis.md +0 -486
  524. package/templates/commonproject/_bmad/bmm/workflows/1-analysis/research/workflow.md +0 -173
  525. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-01-init.md +0 -135
  526. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-01b-continue.md +0 -127
  527. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-02-discovery.md +0 -190
  528. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-03-core-experience.md +0 -216
  529. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-04-emotional-response.md +0 -219
  530. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-05-inspiration.md +0 -234
  531. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-06-design-system.md +0 -252
  532. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-07-defining-experience.md +0 -254
  533. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-08-visual-foundation.md +0 -224
  534. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-09-design-directions.md +0 -224
  535. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-10-user-journeys.md +0 -241
  536. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-11-component-strategy.md +0 -248
  537. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-12-ux-patterns.md +0 -237
  538. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-13-responsive-accessibility.md +0 -264
  539. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-14-complete.md +0 -228
  540. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/ux-design-template.md +0 -13
  541. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/workflow.md +0 -43
  542. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/data/domain-complexity.csv +0 -13
  543. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/data/prd-purpose.md +0 -197
  544. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/data/project-types.csv +0 -11
  545. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-01-init.md +0 -191
  546. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-01b-continue.md +0 -153
  547. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-02-discovery.md +0 -224
  548. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-03-success.md +0 -226
  549. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-04-journeys.md +0 -213
  550. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-05-domain.md +0 -207
  551. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-06-innovation.md +0 -226
  552. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-07-project-type.md +0 -237
  553. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-08-scoping.md +0 -228
  554. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-09-functional.md +0 -231
  555. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-10-nonfunctional.md +0 -242
  556. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-11-polish.md +0 -217
  557. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-12-complete.md +0 -180
  558. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-e/step-e-01-discovery.md +0 -247
  559. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-e/step-e-01b-legacy-conversion.md +0 -208
  560. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-e/step-e-02-review.md +0 -249
  561. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-e/step-e-03-edit.md +0 -253
  562. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-e/step-e-04-complete.md +0 -168
  563. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-01-discovery.md +0 -218
  564. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-02-format-detection.md +0 -191
  565. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-02b-parity-check.md +0 -209
  566. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-03-density-validation.md +0 -174
  567. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-04-brief-coverage-validation.md +0 -214
  568. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-05-measurability-validation.md +0 -228
  569. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-06-traceability-validation.md +0 -217
  570. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-07-implementation-leakage-validation.md +0 -205
  571. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-08-domain-compliance-validation.md +0 -243
  572. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-09-project-type-validation.md +0 -263
  573. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-10-smart-validation.md +0 -209
  574. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-11-holistic-quality-validation.md +0 -264
  575. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-12-completeness-validation.md +0 -242
  576. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-13-report-complete.md +0 -232
  577. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/templates/prd-template.md +0 -10
  578. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/validation-report-prd-workflow.md +0 -433
  579. package/templates/commonproject/_bmad/bmm/workflows/2-plan-workflows/prd/workflow.md +0 -150
  580. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-01-document-discovery.md +0 -190
  581. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-02-prd-analysis.md +0 -178
  582. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-03-epic-coverage-validation.md +0 -179
  583. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-04-ux-alignment.md +0 -139
  584. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-05-epic-quality-review.md +0 -252
  585. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-06-final-assessment.md +0 -133
  586. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/templates/readiness-report-template.md +0 -4
  587. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/workflow.md +0 -55
  588. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/architecture-decision-template.md +0 -12
  589. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/data/domain-complexity.csv +0 -11
  590. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/data/project-types.csv +0 -7
  591. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-01-init.md +0 -153
  592. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-01b-continue.md +0 -164
  593. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-02-context.md +0 -224
  594. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-03-starter.md +0 -331
  595. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-04-decisions.md +0 -318
  596. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-05-patterns.md +0 -359
  597. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-06-structure.md +0 -379
  598. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-07-validation.md +0 -359
  599. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-08-complete.md +0 -352
  600. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-architecture/workflow.md +0 -50
  601. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-01-validate-prerequisites.md +0 -259
  602. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-02-design-epics.md +0 -233
  603. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-03-create-stories.md +0 -272
  604. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-04-final-validation.md +0 -145
  605. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/templates/epics-template.md +0 -57
  606. package/templates/commonproject/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/workflow.md +0 -59
  607. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/code-review/checklist.md +0 -23
  608. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/code-review/instructions.xml +0 -227
  609. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/code-review/workflow.yaml +0 -50
  610. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/correct-course/checklist.md +0 -279
  611. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/correct-course/instructions.md +0 -206
  612. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml +0 -58
  613. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/create-story/checklist.md +0 -358
  614. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/create-story/instructions.xml +0 -345
  615. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/create-story/template.md +0 -49
  616. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml +0 -59
  617. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/dev-story/checklist.md +0 -80
  618. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/dev-story/instructions.xml +0 -410
  619. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml +0 -25
  620. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/retrospective/instructions.md +0 -1443
  621. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/retrospective/workflow.yaml +0 -57
  622. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/sprint-planning/checklist.md +0 -33
  623. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/sprint-planning/instructions.md +0 -225
  624. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/sprint-planning/sprint-status-template.yaml +0 -55
  625. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.yaml +0 -52
  626. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/sprint-status/instructions.md +0 -229
  627. package/templates/commonproject/_bmad/bmm/workflows/4-implementation/sprint-status/workflow.yaml +0 -35
  628. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-01-mode-detection.md +0 -156
  629. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-02-context-gathering.md +0 -120
  630. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-03-execute.md +0 -113
  631. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-04-self-check.md +0 -113
  632. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-05-adversarial-review.md +0 -106
  633. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-06-resolve-findings.md +0 -140
  634. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md +0 -52
  635. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-01-understand.md +0 -189
  636. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-02-investigate.md +0 -144
  637. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-03-generate.md +0 -128
  638. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-04-review.md +0 -173
  639. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/tech-spec-template.md +0 -74
  640. package/templates/commonproject/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md +0 -79
  641. package/templates/commonproject/_bmad/bmm/workflows/document-project/checklist.md +0 -245
  642. package/templates/commonproject/_bmad/bmm/workflows/document-project/documentation-requirements.csv +0 -12
  643. package/templates/commonproject/_bmad/bmm/workflows/document-project/instructions.md +0 -221
  644. package/templates/commonproject/_bmad/bmm/workflows/document-project/templates/deep-dive-template.md +0 -345
  645. package/templates/commonproject/_bmad/bmm/workflows/document-project/templates/index-template.md +0 -169
  646. package/templates/commonproject/_bmad/bmm/workflows/document-project/templates/project-overview-template.md +0 -103
  647. package/templates/commonproject/_bmad/bmm/workflows/document-project/templates/project-scan-report-schema.json +0 -160
  648. package/templates/commonproject/_bmad/bmm/workflows/document-project/templates/source-tree-template.md +0 -135
  649. package/templates/commonproject/_bmad/bmm/workflows/document-project/workflow.yaml +0 -28
  650. package/templates/commonproject/_bmad/bmm/workflows/document-project/workflows/deep-dive-instructions.md +0 -298
  651. package/templates/commonproject/_bmad/bmm/workflows/document-project/workflows/deep-dive.yaml +0 -31
  652. package/templates/commonproject/_bmad/bmm/workflows/document-project/workflows/full-scan-instructions.md +0 -1106
  653. package/templates/commonproject/_bmad/bmm/workflows/document-project/workflows/full-scan.yaml +0 -31
  654. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/_shared/excalidraw-library.json +0 -90
  655. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/_shared/excalidraw-templates.yaml +0 -127
  656. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-dataflow/checklist.md +0 -39
  657. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-dataflow/instructions.md +0 -130
  658. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-dataflow/workflow.yaml +0 -26
  659. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-diagram/checklist.md +0 -43
  660. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-diagram/instructions.md +0 -141
  661. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-diagram/workflow.yaml +0 -26
  662. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-flowchart/checklist.md +0 -49
  663. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-flowchart/instructions.md +0 -241
  664. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-flowchart/workflow.yaml +0 -26
  665. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-wireframe/checklist.md +0 -38
  666. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-wireframe/instructions.md +0 -133
  667. package/templates/commonproject/_bmad/bmm/workflows/excalidraw-diagrams/create-wireframe/workflow.yaml +0 -26
  668. package/templates/commonproject/_bmad/bmm/workflows/generate-project-context/project-context-template.md +0 -21
  669. package/templates/commonproject/_bmad/bmm/workflows/generate-project-context/steps/step-01-discover.md +0 -184
  670. package/templates/commonproject/_bmad/bmm/workflows/generate-project-context/steps/step-02-generate.md +0 -318
  671. package/templates/commonproject/_bmad/bmm/workflows/generate-project-context/steps/step-03-complete.md +0 -278
  672. package/templates/commonproject/_bmad/bmm/workflows/generate-project-context/workflow.md +0 -49
  673. package/templates/commonproject/_bmad/bmm/workflows/testarch/atdd/atdd-checklist-template.md +0 -364
  674. package/templates/commonproject/_bmad/bmm/workflows/testarch/atdd/checklist.md +0 -374
  675. package/templates/commonproject/_bmad/bmm/workflows/testarch/atdd/instructions.md +0 -806
  676. package/templates/commonproject/_bmad/bmm/workflows/testarch/atdd/workflow.yaml +0 -45
  677. package/templates/commonproject/_bmad/bmm/workflows/testarch/automate/checklist.md +0 -582
  678. package/templates/commonproject/_bmad/bmm/workflows/testarch/automate/instructions.md +0 -1324
  679. package/templates/commonproject/_bmad/bmm/workflows/testarch/automate/workflow.yaml +0 -52
  680. package/templates/commonproject/_bmad/bmm/workflows/testarch/ci/checklist.md +0 -248
  681. package/templates/commonproject/_bmad/bmm/workflows/testarch/ci/github-actions-template.yaml +0 -198
  682. package/templates/commonproject/_bmad/bmm/workflows/testarch/ci/gitlab-ci-template.yaml +0 -149
  683. package/templates/commonproject/_bmad/bmm/workflows/testarch/ci/instructions.md +0 -536
  684. package/templates/commonproject/_bmad/bmm/workflows/testarch/ci/workflow.yaml +0 -45
  685. package/templates/commonproject/_bmad/bmm/workflows/testarch/framework/checklist.md +0 -321
  686. package/templates/commonproject/_bmad/bmm/workflows/testarch/framework/instructions.md +0 -481
  687. package/templates/commonproject/_bmad/bmm/workflows/testarch/framework/workflow.yaml +0 -47
  688. package/templates/commonproject/_bmad/bmm/workflows/testarch/nfr-assess/checklist.md +0 -407
  689. package/templates/commonproject/_bmad/bmm/workflows/testarch/nfr-assess/instructions.md +0 -722
  690. package/templates/commonproject/_bmad/bmm/workflows/testarch/nfr-assess/nfr-report-template.md +0 -445
  691. package/templates/commonproject/_bmad/bmm/workflows/testarch/nfr-assess/workflow.yaml +0 -47
  692. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-design/checklist.md +0 -235
  693. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-design/instructions.md +0 -788
  694. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-design/test-design-template.md +0 -294
  695. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-design/workflow.yaml +0 -54
  696. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-review/checklist.md +0 -472
  697. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-review/instructions.md +0 -628
  698. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-review/test-review-template.md +0 -390
  699. package/templates/commonproject/_bmad/bmm/workflows/testarch/test-review/workflow.yaml +0 -46
  700. package/templates/commonproject/_bmad/bmm/workflows/testarch/trace/checklist.md +0 -655
  701. package/templates/commonproject/_bmad/bmm/workflows/testarch/trace/instructions.md +0 -1047
  702. package/templates/commonproject/_bmad/bmm/workflows/testarch/trace/trace-template.md +0 -675
  703. package/templates/commonproject/_bmad/bmm/workflows/testarch/trace/workflow.yaml +0 -55
  704. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/init/instructions.md +0 -346
  705. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/init/workflow.yaml +0 -29
  706. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/instructions.md +0 -395
  707. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/paths/enterprise-brownfield.yaml +0 -103
  708. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/paths/enterprise-greenfield.yaml +0 -100
  709. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/paths/method-brownfield.yaml +0 -103
  710. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/paths/method-greenfield.yaml +0 -100
  711. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/project-levels.yaml +0 -59
  712. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/workflow-status-template.yaml +0 -24
  713. package/templates/commonproject/_bmad/bmm/workflows/workflow-status/workflow.yaml +0 -30
  714. package/templates/commonproject/_bmad/cis/agents/brainstorming-coach.md +0 -66
  715. package/templates/commonproject/_bmad/cis/agents/creative-problem-solver.md +0 -66
  716. package/templates/commonproject/_bmad/cis/agents/design-thinking-coach.md +0 -66
  717. package/templates/commonproject/_bmad/cis/agents/innovation-strategist.md +0 -66
  718. package/templates/commonproject/_bmad/cis/agents/presentation-master.md +0 -72
  719. package/templates/commonproject/_bmad/cis/agents/storyteller/storyteller.md +0 -63
  720. package/templates/commonproject/_bmad/cis/config.yaml +0 -11
  721. package/templates/commonproject/_bmad/cis/teams/creative-squad.yaml +0 -7
  722. package/templates/commonproject/_bmad/cis/teams/default-party.csv +0 -12
  723. package/templates/commonproject/_bmad/cis/workflows/README.md +0 -139
  724. package/templates/commonproject/_bmad/cis/workflows/design-thinking/README.md +0 -56
  725. package/templates/commonproject/_bmad/cis/workflows/design-thinking/design-methods.csv +0 -31
  726. package/templates/commonproject/_bmad/cis/workflows/design-thinking/instructions.md +0 -202
  727. package/templates/commonproject/_bmad/cis/workflows/design-thinking/template.md +0 -111
  728. package/templates/commonproject/_bmad/cis/workflows/design-thinking/workflow.yaml +0 -27
  729. package/templates/commonproject/_bmad/cis/workflows/innovation-strategy/README.md +0 -56
  730. package/templates/commonproject/_bmad/cis/workflows/innovation-strategy/innovation-frameworks.csv +0 -31
  731. package/templates/commonproject/_bmad/cis/workflows/innovation-strategy/instructions.md +0 -276
  732. package/templates/commonproject/_bmad/cis/workflows/innovation-strategy/template.md +0 -189
  733. package/templates/commonproject/_bmad/cis/workflows/innovation-strategy/workflow.yaml +0 -27
  734. package/templates/commonproject/_bmad/cis/workflows/problem-solving/README.md +0 -56
  735. package/templates/commonproject/_bmad/cis/workflows/problem-solving/instructions.md +0 -252
  736. package/templates/commonproject/_bmad/cis/workflows/problem-solving/solving-methods.csv +0 -31
  737. package/templates/commonproject/_bmad/cis/workflows/problem-solving/template.md +0 -165
  738. package/templates/commonproject/_bmad/cis/workflows/problem-solving/workflow.yaml +0 -27
  739. package/templates/commonproject/_bmad/cis/workflows/storytelling/README.md +0 -58
  740. package/templates/commonproject/_bmad/cis/workflows/storytelling/instructions.md +0 -293
  741. package/templates/commonproject/_bmad/cis/workflows/storytelling/story-types.csv +0 -26
  742. package/templates/commonproject/_bmad/cis/workflows/storytelling/template.md +0 -113
  743. package/templates/commonproject/_bmad/cis/workflows/storytelling/workflow.yaml +0 -27
  744. package/templates/commonproject/_bmad/core/agents/bmad-master.md +0 -63
  745. package/templates/commonproject/_bmad/core/config.yaml +0 -9
  746. package/templates/commonproject/_bmad/core/resources/excalidraw/README.md +0 -160
  747. package/templates/commonproject/_bmad/core/resources/excalidraw/excalidraw-helpers.md +0 -127
  748. package/templates/commonproject/_bmad/core/resources/excalidraw/library-loader.md +0 -50
  749. package/templates/commonproject/_bmad/core/resources/excalidraw/validate-json-instructions.md +0 -79
  750. package/templates/commonproject/_bmad/core/tasks/index-docs.xml +0 -65
  751. package/templates/commonproject/_bmad/core/tasks/review-adversarial-general.xml +0 -41
  752. package/templates/commonproject/_bmad/core/tasks/shard-doc.xml +0 -109
  753. package/templates/commonproject/_bmad/core/tasks/workflow.xml +0 -235
  754. package/templates/commonproject/_bmad/core/workflows/advanced-elicitation/methods.csv +0 -51
  755. package/templates/commonproject/_bmad/core/workflows/advanced-elicitation/workflow.xml +0 -117
  756. package/templates/commonproject/_bmad/core/workflows/brainstorming/brain-methods.csv +0 -62
  757. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-01-session-setup.md +0 -197
  758. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-01b-continue.md +0 -122
  759. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-02a-user-selected.md +0 -225
  760. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-02b-ai-recommended.md +0 -237
  761. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-02c-random-selection.md +0 -209
  762. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-02d-progressive-flow.md +0 -264
  763. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-03-technique-execution.md +0 -399
  764. package/templates/commonproject/_bmad/core/workflows/brainstorming/steps/step-04-idea-organization.md +0 -303
  765. package/templates/commonproject/_bmad/core/workflows/brainstorming/template.md +0 -15
  766. package/templates/commonproject/_bmad/core/workflows/brainstorming/workflow.md +0 -58
  767. package/templates/commonproject/_bmad/core/workflows/party-mode/steps/step-01-agent-loading.md +0 -139
  768. package/templates/commonproject/_bmad/core/workflows/party-mode/steps/step-02-discussion-orchestration.md +0 -204
  769. package/templates/commonproject/_bmad/core/workflows/party-mode/steps/step-03-graceful-exit.md +0 -159
  770. package/templates/commonproject/_bmad/core/workflows/party-mode/workflow.md +0 -206
  771. package/templates/commonproject/_bmad/custom/config.yaml +0 -11
  772. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/data/ac-sufficiency-rubric.md +0 -33
  773. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/data/audit-comment-template.md +0 -54
  774. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/data/event-schemas.md +0 -58
  775. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-c/step-01-init.md +0 -173
  776. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-c/step-02-triage.md +0 -159
  777. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-c/step-03-refine.md +0 -149
  778. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-c/step-04-implement.md +0 -147
  779. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-c/step-05-review.md +0 -146
  780. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-c/step-06-qa.md +0 -199
  781. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-c/step-07-complete.md +0 -141
  782. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-e/step-01-assess.md +0 -102
  783. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-e/step-02-apply.md +0 -85
  784. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/steps-v/step-01-validate.md +0 -154
  785. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/workflow-plan-ticket-lifecycle.md +0 -346
  786. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/workflow.md +0 -84
  787. package/templates/commonproject/_bmad/custom/workflows/ticket-lifecycle/workflow.yaml +0 -39
  788. package/templates/commonproject/mise.toml +0 -38
  789. package/templates/commonproject/template/.mise/scripts/provision-bmad-skills.py +0 -480
  790. package/templates/commonproject/tests/test_provision_bmad_skills.py +0 -203
  791. package/templates/commonproject/tests/test_sync_skills_topology.py +0 -120
  792. package/templates/hermes-agent/README.md +0 -192
  793. package/templates/hermes-agent/config.example.toml +0 -1
  794. package/templates/hermes-agent/docs/architecture.md +0 -135
  795. package/templates/hermes-agent/docs/fleet-control-plane/README.md +0 -35
  796. package/templates/hermes-agent/docs/fleet-control-plane/architecture.md +0 -258
  797. package/templates/hermes-agent/docs/fleet-control-plane/epics-and-stories.md +0 -280
  798. package/templates/hermes-agent/docs/fleet-control-plane/implementation-readiness-report-2026-06-27.md +0 -118
  799. package/templates/hermes-agent/docs/fleet-control-plane/prd.md +0 -140
  800. package/templates/hermes-agent/docs/operations.md +0 -335
  801. package/templates/hermes-agent/docs/runbooks/runtime-checkpoint-repair.md +0 -31
  802. package/templates/hermes-agent/docs/sentinel/README.md +0 -119
  803. package/templates/hermes-agent/docs/sentinel/architecture.md +0 -202
  804. package/templates/hermes-agent/docs/sentinel/development.md +0 -274
  805. package/templates/hermes-agent/docs/sentinel/providers.md +0 -203
  806. package/templates/hermes-agent/docs/sentinel.md +0 -18
  807. package/templates/hermes-agent/install-local.sh +0 -253
  808. package/templates/hermes-agent/runtime-scaffold/.gitattributes +0 -10
  809. package/templates/hermes-agent/runtime-scaffold/README.md +0 -55
  810. package/templates/hermes-agent/runtime-scaffold/decisions/.gitkeep +0 -2
  811. package/templates/hermes-agent/runtime-scaffold/logs/.gitkeep +0 -1
  812. package/templates/hermes-agent/runtime-scaffold/memories/MEMORY.md +0 -47
  813. package/templates/hermes-agent/runtime-scaffold/memories/USER.md +0 -51
  814. package/templates/hermes-agent/scripts/backfill-fleet-sot.sh +0 -270
  815. package/templates/hermes-agent/scripts/degit-runtime.sh +0 -192
  816. package/templates/hermes-agent/scripts/fleet-prune-debris.sh +0 -128
  817. package/templates/hermes-agent/scripts/fleet-sync.sh +0 -526
  818. package/templates/hermes-agent/scripts/hermes-runtime-templatize.py +0 -321
  819. package/templates/hermes-agent/scripts/migrate-profile-scoped-chat-secrets.py +0 -136
  820. package/templates/hermes-agent/scripts/migrate-unify.sh +0 -252
  821. package/templates/hermes-agent/scripts/momo-unify-agent.py +0 -224
  822. package/templates/hermes-agent/scripts/repair-runtime-checkpoint.sh +0 -10
  823. package/templates/hermes-agent/scripts/retrofit-70-envfile.sh +0 -129
  824. package/templates/hermes-agent/scripts/unify-pm.sh +0 -148
  825. package/templates/hermes-agent/tests/test_bloodbank_consumer_contract.py +0 -437
  826. package/templates/hermes-agent/tests/test_fleet_upgrade_contract.py +0 -176
  827. package/templates/hermes-agent/tests/test_launcher_chat_secret_isolation.py +0 -85
  828. package/templates/hermes-agent/tests/test_local_runtime_provisioning.py +0 -130
  829. package/templates/hermes-agent/tests/test_operator_docs_local_runtime_contract.py +0 -132
  830. package/templates/hermes-agent/tests/test_profile_env_detach_contract.py +0 -14
  831. package/templates/hermes-agent/tests/test_profile_scoped_chat_secrets.py +0 -89
  832. package/templates/hermes-agent/tests/test_repository_privacy_contract.py +0 -32
  833. package/templates/hermes-agent/tests/test_slack_provisioning.py +0 -344
  834. package/templates/hermes-agent/tests/test_telegram_provisioning.py +0 -475
@@ -1,31 +1,86 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
3
  sync-skills.py — manifest-driven skill fanout.
4
- Replaces the old symlink-based skillex monolithic 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.
5
8
  """
6
9
 
7
10
  import argparse
11
+ import hashlib
8
12
  import json
9
13
  import os
10
14
  import re
11
15
  import shutil
16
+ import stat
12
17
  import subprocess
13
18
  import sys
19
+ import tomllib
14
20
  from pathlib import Path
15
21
  from urllib.parse import unquote, urlparse
16
22
 
17
- # The list of agent CLI skill directories (relative to home or project root)
18
- CLI_SKILL_DIRS = [
19
- ".gemini/skills",
20
- ".codex/skills",
21
- ".kimi/skills",
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 = [
22
51
  ".augment/skills",
23
- ".config/opencode/skills",
24
52
  ".hermes/skills",
25
- ".claude/skills",
26
53
  ".openclaw/skills",
54
+ ".kimi/skills",
55
+ ".crush/skills",
56
+ ".cursor/skills",
27
57
  ]
28
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
+
29
84
 
30
85
  def parse_args():
31
86
  parser = argparse.ArgumentParser(
@@ -37,6 +92,14 @@ def parse_args():
37
92
  required=True,
38
93
  help="Whether to sync global skills or project-local skills.",
39
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
+ )
40
103
  return parser.parse_args()
41
104
 
42
105
 
@@ -74,6 +137,16 @@ def validate_manifest_skill_names(manifest):
74
137
  manifest_skill_name(skill)
75
138
 
76
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
+
77
150
  def assert_real_directory_chain(root, target):
78
151
  root = root.resolve(strict=True)
79
152
  target = target.absolute()
@@ -92,10 +165,58 @@ def assert_real_directory_chain(root, target):
92
165
  raise ValueError(f"Destination parent is not a directory: {current}")
93
166
 
94
167
 
95
- def preflight_cli_dirs(cli_dirs_base, skill_names):
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]
96
200
  base = cli_dirs_base.resolve(strict=True)
97
201
  active = []
98
- for cli_rel_path in CLI_SKILL_DIRS:
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):
99
220
  cli_dir = base / cli_rel_path
100
221
  parent = cli_dir.parent
101
222
  if not parent.exists() and not parent.is_symlink():
@@ -105,16 +226,10 @@ def preflight_cli_dirs(cli_dirs_base, skill_names):
105
226
  raise ValueError(f"Unsafe CLI destination parent: {parent}")
106
227
  if cli_dir.is_symlink():
107
228
  # Generated projects intentionally expose the single managed skill
108
- # projection to Claude as `.claude/skills -> ../.agents/skills`.
109
- # Accept only that exact lexical alias. Resolving an arbitrary
110
- # directory symlink here would let cleanup below traverse outside
111
- # the project (or through a broken target) before failing.
112
- raw_target = os.readlink(cli_dir)
113
- canonical_alias = (
114
- cli_rel_path == ".claude/skills"
115
- and raw_target == "../.agents/skills"
116
- )
117
- managed_skills = base / ".agents" / "skills"
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
118
233
  if not canonical_alias:
119
234
  raise ValueError(f"Refusing symlinked CLI skills directory: {cli_dir}")
120
235
  assert_real_directory_chain(base, managed_skills)
@@ -124,16 +239,42 @@ def preflight_cli_dirs(cli_dirs_base, skill_names):
124
239
  or not managed_skills.is_dir()
125
240
  ):
126
241
  raise ValueError(
127
- f"Canonical Claude skills alias target is not a real directory: {managed_skills}"
242
+ f"Managed skills alias target is not a real directory: {managed_skills}"
128
243
  )
129
244
  resolved_cli = cli_dir.resolve(strict=True)
130
245
  if resolved_cli != managed_skills.resolve(strict=True):
131
246
  raise ValueError(
132
- f"Canonical Claude skills alias escapes managed project skills: {cli_dir}"
247
+ f"Managed skills alias escapes managed project skills: {cli_dir}"
133
248
  )
134
- # The alias already exposes the managed projection. Do not fan out
135
- # into `.agents/skills` a second time: that directory is owned by
136
- # the pinned provisioner and may also contain real custom skills.
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)
137
278
  continue
138
279
  else:
139
280
  if cli_dir.exists() and not cli_dir.is_dir():
@@ -142,11 +283,7 @@ def preflight_cli_dirs(cli_dirs_base, skill_names):
142
283
  expected_cli = real_parent / cli_dir.name
143
284
  if cli_dir.exists() and cli_dir.resolve(strict=True) != expected_cli:
144
285
  raise ValueError(f"CLI skills directory escapes its parent: {cli_dir}")
145
- for name in skill_names:
146
- destination = expected_cli / name
147
- if destination.parent != expected_cli or len(destination.relative_to(expected_cli).parts) != 1:
148
- raise ValueError(f"Skill destination escapes CLI directory: {destination}")
149
- active.append((cli_dir, expected_cli))
286
+ add_target(cli_dir, expected_cli)
150
287
  return active
151
288
 
152
289
 
@@ -172,12 +309,33 @@ def ensure_cache_dir():
172
309
  return cache_dir
173
310
 
174
311
 
175
- def sync_registry(registry_url):
176
- # Sanitize registry_url to create a folder name
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
+ """
177
329
  safe_name = re.sub(r"[^a-zA-Z0-9]", "_", registry_url)
178
- cache_dir = (
179
- Path(os.path.expanduser("~/.agents/.cache/registries")) / safe_name
180
- )
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)
181
339
 
182
340
  if cache_dir.exists():
183
341
  try:
@@ -230,7 +388,7 @@ def sync_git_skill(name, source, version, cache_dir):
230
388
 
231
389
 
232
390
  def resolve_skill_path(
233
- skill, cache_dir, base_dir, default_registry, registry_cache
391
+ skill, cache_dir, base_dir, default_registry, registry_roots
234
392
  ):
235
393
  if isinstance(skill, str):
236
394
  path = skill if "/" in skill else f"all-skills/{skill}"
@@ -241,16 +399,20 @@ def resolve_skill_path(
241
399
 
242
400
  if "registry_path" in skill:
243
401
  registry_url = skill.get("registry", default_registry)
244
- if registry_url not in registry_cache:
245
- registry_cache[registry_url] = sync_registry(registry_url)
246
- full_path = registry_cache[registry_url] / skill["registry_path"]
247
- if not full_path.exists():
248
- print(
249
- f"Warning: Registry skill {name} not found at {full_path}",
250
- file=sys.stderr,
251
- )
252
- return name, None
253
- return name, full_path
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
254
416
 
255
417
  source = skill.get("source", "")
256
418
  if source.startswith("git@") or source.startswith("https://"):
@@ -280,16 +442,1113 @@ def resolve_skill_path(
280
442
  return name, None
281
443
 
282
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
+
283
1529
  def fanout_to_cli(
284
- cli_dirs_base, skills_map, active_cli_dirs=None, before_mutation=None
1530
+ cli_dirs_base,
1531
+ skills_map,
1532
+ active_cli_dirs=None,
1533
+ before_mutation=None,
1534
+ scope="project",
285
1535
  ):
286
1536
  """
287
- Creates symlinks in each of the CLI_SKILL_DIRS relative to cli_dirs_base
288
- pointing to the resolved paths in skills_map.
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.
289
1539
  """
290
1540
  skill_names = [validate_skill_name(name) for name in skills_map]
291
1541
  if active_cli_dirs is None:
292
- active_cli_dirs = preflight_cli_dirs(cli_dirs_base, skill_names)
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
+ )
293
1552
  if before_mutation is not None:
294
1553
  before_mutation()
295
1554
  linked_total = 0
@@ -306,6 +1565,16 @@ def fanout_to_cli(
306
1565
  if symlink_target.parent != real_cli_dir:
307
1566
  raise ValueError(f"Skill destination escapes CLI directory: {symlink_target}")
308
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
+
309
1578
  # If it's a symlink already pointing to the right place, skip
310
1579
  if (
311
1580
  symlink_target.is_symlink()
@@ -332,6 +1601,18 @@ def fanout_to_cli(
332
1601
  )
333
1602
 
334
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
+
335
1616
  def main():
336
1617
  args = parse_args()
337
1618
 
@@ -341,108 +1622,106 @@ def main():
341
1622
  # Destination topology is a security boundary. Validate every active CLI
342
1623
  # directory before cloning/updating registries, creating caches, or changing
343
1624
  # any skill link so one unsafe/broken symlink produces zero mutation.
344
- preflight_names = []
345
- preflight_base = Path(os.path.expanduser("~"))
1625
+ #
1626
+ # Precedence, lowest to highest (contract section 5):
1627
+ # global packs[] -> global skills[] -> project packs[] -> project skills[]
1628
+ layers = []
346
1629
  if args.scope == "global":
347
- preflight_manifest = load_manifest(global_manifest_path)
348
- validate_manifest_skill_names(preflight_manifest)
349
- preflight_names.extend(
350
- manifest_skill_name(skill)
351
- for skill in preflight_manifest.get("skills", [])
352
- )
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))
353
1633
  else:
354
1634
  preflight_base = Path(os.getcwd())
355
- preflight_manifest = load_manifest(project_manifest_path)
356
- validate_manifest_skill_names(preflight_manifest)
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:
357
1644
  preflight_names.extend(
358
1645
  manifest_skill_name(skill)
359
- for skill in preflight_manifest.get("skills", [])
1646
+ for skill in layer["manifest"].get("skills", [])
360
1647
  )
361
- if preflight_manifest.get("inherit_global", False):
362
- inherited = load_manifest(global_manifest_path)
363
- validate_manifest_skill_names(inherited)
364
- preflight_names.extend(
365
- manifest_skill_name(skill)
366
- for skill in inherited.get("skills", [])
367
- )
368
- active_cli_dirs = preflight_cli_dirs(preflight_base, preflight_names)
1648
+ preflight_cli_dirs(preflight_base, preflight_names, args.scope)
1649
+
369
1650
  cache_dir = ensure_cache_dir()
370
1651
 
371
1652
  skills_to_sync = {} # name -> actual_path
372
- registry_cache = {}
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()
373
1657
 
374
- if args.scope == "global":
375
- print(f"Loading global manifest from {global_manifest_path}")
376
- manifest = load_manifest(global_manifest_path)
377
- validate_manifest_skill_names(manifest)
378
- default_registry = manifest.get(
379
- "registry", "https://github.com/delorenj/skillex.git"
380
- )
381
- base_dir = global_manifest_path.parent
382
- for skill in manifest.get("skills", []):
383
- name, path = resolve_skill_path(
384
- skill,
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,
385
1670
  cache_dir,
386
- base_dir,
387
- default_registry,
388
- registry_cache,
389
- )
390
- if path:
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.
391
1678
  skills_to_sync[name] = path
392
-
393
- # Fanout globally (home dir)
394
- fanout_to_cli(
395
- Path(os.path.expanduser("~")),
396
- skills_to_sync,
397
- active_cli_dirs=active_cli_dirs,
398
- )
399
-
400
- elif args.scope == "project":
401
- print(f"Loading project manifest from {project_manifest_path}")
402
- manifest = load_manifest(project_manifest_path)
403
- validate_manifest_skill_names(manifest)
404
- default_registry = manifest.get(
405
- "registry", "https://github.com/delorenj/skillex.git"
406
- )
407
-
408
- # Check if we should inherit global skills
409
- if manifest.get("inherit_global", False):
410
- print("Inheriting global skills...")
411
- global_manifest = load_manifest(global_manifest_path)
412
- validate_manifest_skill_names(global_manifest)
413
- global_registry = global_manifest.get(
414
- "registry", "https://github.com/delorenj/skillex.git"
415
- )
416
- for skill in global_manifest.get("skills", []):
417
- name, path = resolve_skill_path(
418
- skill,
419
- cache_dir,
420
- global_manifest_path.parent,
421
- global_registry,
422
- registry_cache,
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"
423
1688
  )
424
- if path:
425
- skills_to_sync[name] = path
426
-
427
- base_dir = project_manifest_path.parent
428
- for skill in manifest.get("skills", []):
1689
+ continue
429
1690
  name, path = resolve_skill_path(
430
1691
  skill,
431
1692
  cache_dir,
432
- base_dir,
433
- default_registry,
434
- registry_cache,
1693
+ layer["base_dir"],
1694
+ layer["registry"],
1695
+ registry_roots,
435
1696
  )
436
1697
  if path:
437
- # Overrides global skill of the same name
1698
+ # Contract section 5 step 2: a surviving explicit skills[] entry
1699
+ # always overrides a pack member.
438
1700
  skills_to_sync[name] = path
439
1701
 
440
- # Fanout locally (project dir)
441
- fanout_to_cli(
442
- Path(os.getcwd()),
443
- skills_to_sync,
444
- active_cli_dirs=active_cli_dirs,
445
- )
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)
446
1725
 
447
1726
 
448
1727
  if __name__ == "__main__":