@claude-collective/cli 0.21.0 → 0.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/CHANGELOG.md +174 -0
  2. package/README.md +41 -27
  3. package/config/skills-matrix.yaml +38 -37
  4. package/config/stacks.yaml +8 -14
  5. package/dist/{chunk-ZNIDWLL5.js → chunk-3X5D7RM5.js} +4 -3
  6. package/dist/chunk-3X5D7RM5.js.map +1 -0
  7. package/dist/chunk-4S4FCAA2.js +100 -0
  8. package/dist/chunk-4S4FCAA2.js.map +1 -0
  9. package/dist/chunk-4WGN6SUE.js +197 -0
  10. package/dist/chunk-4WGN6SUE.js.map +1 -0
  11. package/dist/{chunk-DHET7RCE.js → chunk-AWKZ5BDL.js} +9 -2
  12. package/dist/{chunk-DHET7RCE.js.map → chunk-AWKZ5BDL.js.map} +1 -1
  13. package/dist/{chunk-6Q3Y7KVB.js → chunk-DBRUQQUF.js} +8 -2
  14. package/dist/chunk-DBRUQQUF.js.map +1 -0
  15. package/dist/{chunk-OQYYMQJR.js → chunk-ETCVEV3S.js} +8 -11
  16. package/dist/chunk-ETCVEV3S.js.map +1 -0
  17. package/dist/{chunk-ZSVMS677.js → chunk-F4RD5FYM.js} +2 -2
  18. package/dist/chunk-F4RD5FYM.js.map +1 -0
  19. package/dist/{chunk-5KXUDHAB.js → chunk-GGFOD5PK.js} +6 -9
  20. package/dist/chunk-GGFOD5PK.js.map +1 -0
  21. package/dist/{chunk-UMORK7OK.js → chunk-H7SSBSPR.js} +2 -2
  22. package/dist/chunk-H7SSBSPR.js.map +1 -0
  23. package/dist/chunk-HWD32NP7.js +19 -0
  24. package/dist/chunk-HWD32NP7.js.map +1 -0
  25. package/dist/{chunk-HGCBZUH5.js → chunk-IAYAE6MG.js} +9 -10
  26. package/dist/chunk-IAYAE6MG.js.map +1 -0
  27. package/dist/{chunk-RTE64SJA.js → chunk-IXBCRT3F.js} +2 -2
  28. package/dist/chunk-IXBCRT3F.js.map +1 -0
  29. package/dist/{chunk-WFEFICFM.js → chunk-KWYO3M5Q.js} +5 -5
  30. package/dist/chunk-KWYO3M5Q.js.map +1 -0
  31. package/dist/{chunk-HEOHU5EZ.js → chunk-MCTSHLAF.js} +22 -11
  32. package/dist/chunk-MCTSHLAF.js.map +1 -0
  33. package/dist/chunk-MH66WDFV.js +251 -0
  34. package/dist/chunk-MH66WDFV.js.map +1 -0
  35. package/dist/{chunk-2LSGX6R4.js → chunk-MTPM7BX5.js} +83 -25
  36. package/dist/chunk-MTPM7BX5.js.map +1 -0
  37. package/dist/chunk-NQJ47R4N.js +1092 -0
  38. package/dist/chunk-NQJ47R4N.js.map +1 -0
  39. package/dist/chunk-NRC7XYCI.js +211 -0
  40. package/dist/chunk-NRC7XYCI.js.map +1 -0
  41. package/dist/{chunk-FJFEKPXF.js → chunk-O6ZTD7ZI.js} +14 -3
  42. package/dist/chunk-O6ZTD7ZI.js.map +1 -0
  43. package/dist/chunk-OBXAY23Y.js +56 -0
  44. package/dist/chunk-OBXAY23Y.js.map +1 -0
  45. package/dist/{chunk-XY3XDVMI.js → chunk-QR2EBWL2.js} +3 -3
  46. package/dist/{chunk-66UDJBF6.js → chunk-REJGRCVQ.js} +2 -2
  47. package/dist/{chunk-CBLPAMZO.js → chunk-TMED5DQ2.js} +68 -42
  48. package/dist/chunk-TMED5DQ2.js.map +1 -0
  49. package/dist/{chunk-Q3J43SF3.js → chunk-U7HFKR74.js} +2 -2
  50. package/dist/chunk-U7HFKR74.js.map +1 -0
  51. package/dist/{chunk-3EHUF54X.js → chunk-UEMRJI2K.js} +17 -4
  52. package/dist/chunk-UEMRJI2K.js.map +1 -0
  53. package/dist/{chunk-Z2CWURZ6.js → chunk-UNN7523L.js} +2 -2
  54. package/dist/chunk-V2ZIH7HV.js +29 -0
  55. package/dist/chunk-V2ZIH7HV.js.map +1 -0
  56. package/dist/{chunk-ZEI3ZUDU.js → chunk-VVYNZZUX.js} +7 -15
  57. package/dist/chunk-VVYNZZUX.js.map +1 -0
  58. package/dist/chunk-WXS4S3MA.js +220 -0
  59. package/dist/chunk-WXS4S3MA.js.map +1 -0
  60. package/dist/{chunk-A46TPNBJ.js → chunk-XENOESJZ.js} +7 -16
  61. package/dist/chunk-XENOESJZ.js.map +1 -0
  62. package/dist/chunk-YDBSSAJ6.js +4207 -0
  63. package/dist/chunk-YDBSSAJ6.js.map +1 -0
  64. package/dist/chunk-ZDREFYD2.js +696 -0
  65. package/dist/chunk-ZDREFYD2.js.map +1 -0
  66. package/dist/chunk-ZW2PELOH.js +197 -0
  67. package/dist/chunk-ZW2PELOH.js.map +1 -0
  68. package/dist/cli/defaults/agent-mappings.yaml +0 -1
  69. package/dist/commands/build/marketplace.js +15 -13
  70. package/dist/commands/build/marketplace.js.map +1 -1
  71. package/dist/commands/build/plugins.js +13 -229
  72. package/dist/commands/build/plugins.js.map +1 -1
  73. package/dist/commands/build/stack.js +11 -18
  74. package/dist/commands/build/stack.js.map +1 -1
  75. package/dist/commands/compile.js +36 -58
  76. package/dist/commands/compile.js.map +1 -1
  77. package/dist/commands/config/get.js +8 -8
  78. package/dist/commands/config/get.js.map +1 -1
  79. package/dist/commands/config/index.js +7 -7
  80. package/dist/commands/config/index.js.map +1 -1
  81. package/dist/commands/config/path.js +6 -6
  82. package/dist/commands/config/path.js.map +1 -1
  83. package/dist/commands/config/set-project.js +8 -8
  84. package/dist/commands/config/set-project.js.map +1 -1
  85. package/dist/commands/config/show.js +7 -7
  86. package/dist/commands/config/unset-project.js +8 -8
  87. package/dist/commands/config/unset-project.js.map +1 -1
  88. package/dist/commands/diff.js +10 -16
  89. package/dist/commands/diff.js.map +1 -1
  90. package/dist/commands/doctor.js +18 -51
  91. package/dist/commands/doctor.js.map +1 -1
  92. package/dist/commands/edit.js +87 -57
  93. package/dist/commands/edit.js.map +1 -1
  94. package/dist/commands/eject.js +17 -49
  95. package/dist/commands/eject.js.map +1 -1
  96. package/dist/commands/import/skill.js +26 -26
  97. package/dist/commands/import/skill.js.map +1 -1
  98. package/dist/commands/info.js +15 -17
  99. package/dist/commands/info.js.map +1 -1
  100. package/dist/commands/init.js +45 -722
  101. package/dist/commands/init.js.map +1 -1
  102. package/dist/commands/list.js +8 -87
  103. package/dist/commands/list.js.map +1 -1
  104. package/dist/commands/new/agent.js +8 -12
  105. package/dist/commands/new/agent.js.map +1 -1
  106. package/dist/commands/new/skill.js +6 -6
  107. package/dist/commands/new/skill.js.map +1 -1
  108. package/dist/commands/outdated.js +15 -19
  109. package/dist/commands/outdated.js.map +1 -1
  110. package/dist/commands/search.js +21 -34
  111. package/dist/commands/search.js.map +1 -1
  112. package/dist/commands/uninstall.js +15 -14
  113. package/dist/commands/uninstall.js.map +1 -1
  114. package/dist/commands/update.js +13 -24
  115. package/dist/commands/update.js.map +1 -1
  116. package/dist/commands/validate.js +44 -487
  117. package/dist/commands/validate.js.map +1 -1
  118. package/dist/commands/version/bump.js +11 -11
  119. package/dist/commands/version/bump.js.map +1 -1
  120. package/dist/commands/version/index.js +9 -10
  121. package/dist/commands/version/index.js.map +1 -1
  122. package/dist/commands/version/set.js +10 -8
  123. package/dist/commands/version/set.js.map +1 -1
  124. package/dist/commands/version/show.js +9 -10
  125. package/dist/commands/version/show.js.map +1 -1
  126. package/dist/components/common/confirm.js +2 -2
  127. package/dist/components/common/confirm.test.js +203 -0
  128. package/dist/components/common/confirm.test.js.map +1 -0
  129. package/dist/components/common/message.js +1 -1
  130. package/dist/components/common/spinner.js +1 -1
  131. package/dist/components/common/spinner.js.map +1 -1
  132. package/dist/components/skill-search/skill-search.js +3 -3
  133. package/dist/components/wizard/category-grid.js +2 -2
  134. package/dist/components/wizard/category-grid.test.js +132 -78
  135. package/dist/components/wizard/category-grid.test.js.map +1 -1
  136. package/dist/components/wizard/menu-item.js +2 -2
  137. package/dist/components/wizard/search-modal.js +9 -0
  138. package/dist/components/wizard/search-modal.js.map +1 -0
  139. package/dist/components/wizard/search-modal.test.js +216 -0
  140. package/dist/components/wizard/search-modal.test.js.map +1 -0
  141. package/dist/components/wizard/section-progress.js +2 -2
  142. package/dist/components/wizard/section-progress.test.js +4 -4
  143. package/dist/components/wizard/section-progress.test.js.map +1 -1
  144. package/dist/components/wizard/source-grid.js +10 -0
  145. package/dist/components/wizard/source-grid.js.map +1 -0
  146. package/dist/components/wizard/source-grid.test.js +500 -0
  147. package/dist/components/wizard/source-grid.test.js.map +1 -0
  148. package/dist/components/wizard/step-approach.js +7 -6
  149. package/dist/components/wizard/step-approach.test.js +115 -0
  150. package/dist/components/wizard/step-approach.test.js.map +1 -0
  151. package/dist/components/wizard/step-build.js +9 -4
  152. package/dist/components/wizard/step-build.test.js +103 -122
  153. package/dist/components/wizard/step-build.test.js.map +1 -1
  154. package/dist/components/wizard/step-confirm.js +3 -2
  155. package/dist/components/wizard/step-confirm.test.js +364 -0
  156. package/dist/components/wizard/step-confirm.test.js.map +1 -0
  157. package/dist/components/wizard/step-refine.js +2 -2
  158. package/dist/components/wizard/step-refine.test.js +19 -13
  159. package/dist/components/wizard/step-refine.test.js.map +1 -1
  160. package/dist/components/wizard/step-settings.js +14 -0
  161. package/dist/components/wizard/step-settings.js.map +1 -0
  162. package/dist/components/wizard/step-settings.test.js +240 -0
  163. package/dist/components/wizard/step-settings.test.js.map +1 -0
  164. package/dist/components/wizard/step-sources.js +17 -0
  165. package/dist/components/wizard/step-sources.js.map +1 -0
  166. package/dist/components/wizard/step-sources.test.js +290 -0
  167. package/dist/components/wizard/step-sources.test.js.map +1 -0
  168. package/dist/components/wizard/step-stack.js +7 -6
  169. package/dist/components/wizard/step-stack.test.js +344 -0
  170. package/dist/components/wizard/step-stack.test.js.map +1 -0
  171. package/dist/components/wizard/view-title.js +2 -2
  172. package/dist/components/wizard/wizard-layout.js +6 -5
  173. package/dist/components/wizard/wizard-tabs.js +2 -2
  174. package/dist/components/wizard/wizard-tabs.test.js +292 -0
  175. package/dist/components/wizard/wizard-tabs.test.js.map +1 -0
  176. package/dist/components/wizard/wizard.js +22 -14
  177. package/dist/config/skills-matrix.yaml +38 -37
  178. package/dist/config/stacks.yaml +8 -14
  179. package/dist/hooks/init.js +5 -5
  180. package/dist/hooks/init.js.map +1 -1
  181. package/dist/index.js +1 -1
  182. package/dist/index.js.map +1 -1
  183. package/dist/{magic-string.es-RGXYGAW3.js → magic-string.es-PAH2SOTR.js} +2 -2
  184. package/dist/source-manager-DSYZEVGZ.js +16 -0
  185. package/dist/source-manager-DSYZEVGZ.js.map +1 -0
  186. package/dist/src/agents/developer/api-developer/agent.yaml +1 -1
  187. package/dist/src/agents/developer/cli-developer/agent.yaml +1 -1
  188. package/dist/src/agents/developer/web-architecture/agent.yaml +1 -1
  189. package/dist/src/agents/developer/web-developer/agent.yaml +1 -1
  190. package/dist/src/agents/meta/agent-summoner/agent.yaml +1 -1
  191. package/dist/src/agents/meta/documentor/agent.yaml +1 -1
  192. package/dist/src/agents/meta/skill-summoner/agent.yaml +1 -1
  193. package/dist/src/agents/migration/cli-migrator/agent.yaml +1 -1
  194. package/dist/src/agents/pattern/pattern-scout/agent.yaml +1 -1
  195. package/dist/src/agents/pattern/web-pattern-critique/agent.yaml +1 -1
  196. package/dist/src/agents/planning/web-pm/agent.yaml +1 -1
  197. package/dist/src/agents/researcher/api-researcher/agent.yaml +1 -1
  198. package/dist/src/agents/researcher/web-researcher/agent.yaml +1 -1
  199. package/dist/src/agents/reviewer/api-reviewer/agent.yaml +1 -1
  200. package/dist/src/agents/reviewer/cli-reviewer/agent.yaml +1 -1
  201. package/dist/src/agents/reviewer/web-reviewer/agent.yaml +1 -1
  202. package/dist/src/agents/tester/cli-tester/agent.yaml +1 -1
  203. package/dist/src/agents/tester/web-tester/agent.yaml +1 -1
  204. package/dist/stores/wizard-store.js +4 -3
  205. package/dist/stores/wizard-store.test.js +51 -82
  206. package/dist/stores/wizard-store.test.js.map +1 -1
  207. package/package.json +5 -3
  208. package/src/agents/developer/api-developer/agent.yaml +1 -1
  209. package/src/agents/developer/cli-developer/agent.yaml +1 -1
  210. package/src/agents/developer/web-architecture/agent.yaml +1 -1
  211. package/src/agents/developer/web-developer/agent.yaml +1 -1
  212. package/src/agents/meta/agent-summoner/agent.yaml +1 -1
  213. package/src/agents/meta/documentor/agent.yaml +1 -1
  214. package/src/agents/meta/skill-summoner/agent.yaml +1 -1
  215. package/src/agents/migration/cli-migrator/agent.yaml +1 -1
  216. package/src/agents/pattern/pattern-scout/agent.yaml +1 -1
  217. package/src/agents/pattern/web-pattern-critique/agent.yaml +1 -1
  218. package/src/agents/planning/web-pm/agent.yaml +1 -1
  219. package/src/agents/researcher/api-researcher/agent.yaml +1 -1
  220. package/src/agents/researcher/web-researcher/agent.yaml +1 -1
  221. package/src/agents/reviewer/api-reviewer/agent.yaml +1 -1
  222. package/src/agents/reviewer/cli-reviewer/agent.yaml +1 -1
  223. package/src/agents/reviewer/web-reviewer/agent.yaml +1 -1
  224. package/src/agents/tester/cli-tester/agent.yaml +1 -1
  225. package/src/agents/tester/web-tester/agent.yaml +1 -1
  226. package/dist/chunk-2LSGX6R4.js.map +0 -1
  227. package/dist/chunk-2OKUEELH.js +0 -32
  228. package/dist/chunk-2OKUEELH.js.map +0 -1
  229. package/dist/chunk-374JNMR6.js +0 -212
  230. package/dist/chunk-374JNMR6.js.map +0 -1
  231. package/dist/chunk-3EHUF54X.js.map +0 -1
  232. package/dist/chunk-3XR4PALU.js +0 -529
  233. package/dist/chunk-3XR4PALU.js.map +0 -1
  234. package/dist/chunk-5K2ZLUO5.js +0 -57
  235. package/dist/chunk-5K2ZLUO5.js.map +0 -1
  236. package/dist/chunk-5KXUDHAB.js.map +0 -1
  237. package/dist/chunk-6Q3Y7KVB.js.map +0 -1
  238. package/dist/chunk-7SLV7CMF.js +0 -615
  239. package/dist/chunk-7SLV7CMF.js.map +0 -1
  240. package/dist/chunk-A46TPNBJ.js.map +0 -1
  241. package/dist/chunk-AL74GBW4.js +0 -69
  242. package/dist/chunk-AL74GBW4.js.map +0 -1
  243. package/dist/chunk-BQX23RBV.js +0 -191
  244. package/dist/chunk-BQX23RBV.js.map +0 -1
  245. package/dist/chunk-CA4LH4LI.js +0 -132
  246. package/dist/chunk-CA4LH4LI.js.map +0 -1
  247. package/dist/chunk-CBLPAMZO.js.map +0 -1
  248. package/dist/chunk-CKPQHGXR.js +0 -417
  249. package/dist/chunk-CKPQHGXR.js.map +0 -1
  250. package/dist/chunk-CXOFOJCN.js +0 -80
  251. package/dist/chunk-CXOFOJCN.js.map +0 -1
  252. package/dist/chunk-EHGD7HIE.js +0 -104
  253. package/dist/chunk-EHGD7HIE.js.map +0 -1
  254. package/dist/chunk-EHS3TWWP.js +0 -95
  255. package/dist/chunk-EHS3TWWP.js.map +0 -1
  256. package/dist/chunk-FJFEKPXF.js.map +0 -1
  257. package/dist/chunk-HEOHU5EZ.js.map +0 -1
  258. package/dist/chunk-HGCBZUH5.js.map +0 -1
  259. package/dist/chunk-HPGFY5ZN.js +0 -114
  260. package/dist/chunk-HPGFY5ZN.js.map +0 -1
  261. package/dist/chunk-INJ2EFRW.js +0 -127
  262. package/dist/chunk-INJ2EFRW.js.map +0 -1
  263. package/dist/chunk-IOBFMF6X.js +0 -61
  264. package/dist/chunk-IOBFMF6X.js.map +0 -1
  265. package/dist/chunk-KH3HA7J7.js +0 -116
  266. package/dist/chunk-KH3HA7J7.js.map +0 -1
  267. package/dist/chunk-N6JNE326.js +0 -261
  268. package/dist/chunk-N6JNE326.js.map +0 -1
  269. package/dist/chunk-NAGU7TVZ.js +0 -36
  270. package/dist/chunk-NAGU7TVZ.js.map +0 -1
  271. package/dist/chunk-OQYYMQJR.js.map +0 -1
  272. package/dist/chunk-PLZOUVDD.js +0 -419
  273. package/dist/chunk-PLZOUVDD.js.map +0 -1
  274. package/dist/chunk-Q3J43SF3.js.map +0 -1
  275. package/dist/chunk-RTE64SJA.js.map +0 -1
  276. package/dist/chunk-T25OEQFI.js +0 -26
  277. package/dist/chunk-T25OEQFI.js.map +0 -1
  278. package/dist/chunk-UMORK7OK.js.map +0 -1
  279. package/dist/chunk-VFHWU7JU.js +0 -287
  280. package/dist/chunk-VFHWU7JU.js.map +0 -1
  281. package/dist/chunk-VS4GVTZE.js +0 -91
  282. package/dist/chunk-VS4GVTZE.js.map +0 -1
  283. package/dist/chunk-WFEFICFM.js.map +0 -1
  284. package/dist/chunk-WG6KIAPK.js +0 -54
  285. package/dist/chunk-WG6KIAPK.js.map +0 -1
  286. package/dist/chunk-ZEI3ZUDU.js.map +0 -1
  287. package/dist/chunk-ZNIDWLL5.js.map +0 -1
  288. package/dist/chunk-ZSVMS677.js.map +0 -1
  289. /package/dist/{chunk-XY3XDVMI.js.map → chunk-QR2EBWL2.js.map} +0 -0
  290. /package/dist/{chunk-66UDJBF6.js.map → chunk-REJGRCVQ.js.map} +0 -0
  291. /package/dist/{chunk-Z2CWURZ6.js.map → chunk-UNN7523L.js.map} +0 -0
  292. /package/dist/{magic-string.es-RGXYGAW3.js.map → magic-string.es-PAH2SOTR.js.map} +0 -0
@@ -1,244 +1,28 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- generateSkillPluginManifest,
4
- getPluginManifestPath,
5
- writePluginManifest
6
- } from "../../chunk-VS4GVTZE.js";
7
- import {
8
- hashSkillFolder
9
- } from "../../chunk-IOBFMF6X.js";
10
- import {
11
- parseFrontmatter
12
- } from "../../chunk-BQX23RBV.js";
13
2
  import {
14
3
  BaseCommand,
15
4
  EXIT_CODES
16
- } from "../../chunk-EHS3TWWP.js";
5
+ } from "../../chunk-OBXAY23Y.js";
17
6
  import {
18
- setVerbose,
19
- verbose
20
- } from "../../chunk-T25OEQFI.js";
7
+ compileAllSkillPlugins,
8
+ compileSkillPlugin,
9
+ printCompilationSummary
10
+ } from "../../chunk-YDBSSAJ6.js";
21
11
  import {
22
- copy,
23
- ensureDir,
24
- fileExists,
25
- glob,
26
- readFile,
27
- writeFile
28
- } from "../../chunk-AL74GBW4.js";
12
+ setVerbose
13
+ } from "../../chunk-ZDREFYD2.js";
14
+ import "../../chunk-HWD32NP7.js";
29
15
  import {
30
- DEFAULT_VERSION,
31
16
  DIRS
32
- } from "../../chunk-FJFEKPXF.js";
17
+ } from "../../chunk-O6ZTD7ZI.js";
33
18
  import {
34
19
  init_esm_shims
35
- } from "../../chunk-DHET7RCE.js";
20
+ } from "../../chunk-AWKZ5BDL.js";
36
21
 
37
22
  // src/cli/commands/build/plugins.ts
38
23
  init_esm_shims();
39
24
  import { Flags } from "@oclif/core";
40
- import path2 from "path";
41
-
42
- // src/cli/lib/skill-plugin-compiler.ts
43
- init_esm_shims();
44
25
  import path from "path";
45
- import { parse as parseYaml } from "yaml";
46
- var SKILL_FILES = ["SKILL.md", "reference.md"];
47
- var SKILL_DIRS = ["examples", "scripts"];
48
- function sanitizeSkillName(name) {
49
- return name.replace(/\+/g, "-");
50
- }
51
- function parseMajorVersion(version) {
52
- const match = version.match(/^(\d+)\./);
53
- return match ? parseInt(match[1], 10) : 1;
54
- }
55
- function bumpMajorVersion(version) {
56
- const major = parseMajorVersion(version);
57
- return `${major + 1}.0.0`;
58
- }
59
- var CONTENT_HASH_FILE = ".content-hash";
60
- async function readExistingManifest(pluginDir) {
61
- const manifestPath = getPluginManifestPath(pluginDir);
62
- if (!await fileExists(manifestPath)) {
63
- return null;
64
- }
65
- try {
66
- const content = await readFile(manifestPath);
67
- const manifest = JSON.parse(content);
68
- const hashFilePath = manifestPath.replace("plugin.json", CONTENT_HASH_FILE);
69
- let contentHash;
70
- if (await fileExists(hashFilePath)) {
71
- contentHash = (await readFile(hashFilePath)).trim();
72
- }
73
- return {
74
- version: manifest.version ?? DEFAULT_VERSION,
75
- contentHash
76
- };
77
- } catch {
78
- return null;
79
- }
80
- }
81
- async function determineVersion(skillPath, pluginDir) {
82
- const newHash = await hashSkillFolder(skillPath);
83
- const existing = await readExistingManifest(pluginDir);
84
- if (!existing) {
85
- return {
86
- version: DEFAULT_VERSION,
87
- contentHash: newHash
88
- };
89
- }
90
- if (existing.contentHash !== newHash) {
91
- return {
92
- version: bumpMajorVersion(existing.version),
93
- contentHash: newHash
94
- };
95
- }
96
- return {
97
- version: existing.version,
98
- contentHash: newHash
99
- };
100
- }
101
- async function readSkillMetadata(skillPath) {
102
- const metadataPath = path.join(skillPath, "metadata.yaml");
103
- if (!await fileExists(metadataPath)) {
104
- return null;
105
- }
106
- try {
107
- const content = await readFile(metadataPath);
108
- const lines = content.split("\n");
109
- const yamlContent = lines[0]?.startsWith("# yaml-language-server:") ? lines.slice(1).join("\n") : content;
110
- return parseYaml(yamlContent);
111
- } catch {
112
- return null;
113
- }
114
- }
115
- function generateReadme(skillName, frontmatter, metadata) {
116
- const lines = [];
117
- lines.push(`# ${skillName}`);
118
- lines.push("");
119
- lines.push(frontmatter.description);
120
- lines.push("");
121
- if (metadata?.tags && metadata.tags.length > 0) {
122
- lines.push("## Tags");
123
- lines.push("");
124
- lines.push(metadata.tags.map((t) => `\`${t}\``).join(" "));
125
- lines.push("");
126
- }
127
- lines.push("## Installation");
128
- lines.push("");
129
- lines.push("Add this plugin to your Claude Code configuration:");
130
- lines.push("");
131
- lines.push("```json");
132
- lines.push(`{`);
133
- lines.push(` "plugins": ["skill-${skillName}"]`);
134
- lines.push(`}`);
135
- lines.push("```");
136
- lines.push("");
137
- lines.push("## Usage");
138
- lines.push("");
139
- lines.push(`This skill is automatically available when installed.`);
140
- if (metadata?.requires && metadata.requires.length > 0) {
141
- lines.push("");
142
- lines.push("**Requires:** " + metadata.requires.join(", "));
143
- }
144
- lines.push("");
145
- lines.push("---");
146
- lines.push("");
147
- lines.push("*Generated by Claude Collective skill-plugin-compiler*");
148
- lines.push("");
149
- return lines.join("\n");
150
- }
151
- async function compileSkillPlugin(options) {
152
- const { skillPath, outputDir, skillName: overrideName } = options;
153
- const dirBasename = path.basename(skillPath);
154
- const skillMdPath = path.join(skillPath, "SKILL.md");
155
- if (!await fileExists(skillMdPath)) {
156
- throw new Error(
157
- `Skill '${dirBasename}' is missing required SKILL.md file. Expected at: ${skillMdPath}`
158
- );
159
- }
160
- const skillMdContent = await readFile(skillMdPath);
161
- const frontmatter = parseFrontmatter(skillMdContent);
162
- if (!frontmatter) {
163
- throw new Error(
164
- `Skill '${dirBasename}' has invalid or missing YAML frontmatter in SKILL.md. Required fields: 'name' and 'description'. File: ${skillMdPath}`
165
- );
166
- }
167
- const skillName = overrideName ?? sanitizeSkillName(frontmatter.name);
168
- verbose(`Compiling skill plugin: ${skillName} from ${skillPath}`);
169
- const metadata = await readSkillMetadata(skillPath);
170
- const pluginDir = path.join(outputDir, `skill-${skillName}`);
171
- const skillsDir = path.join(pluginDir, "skills", skillName);
172
- await ensureDir(pluginDir);
173
- await ensureDir(skillsDir);
174
- const { version, contentHash } = await determineVersion(skillPath, pluginDir);
175
- const manifest = generateSkillPluginManifest({
176
- skillName,
177
- description: frontmatter.description,
178
- author: metadata?.author,
179
- version,
180
- keywords: metadata?.tags
181
- });
182
- await writePluginManifest(pluginDir, manifest);
183
- const hashFilePath = getPluginManifestPath(pluginDir).replace("plugin.json", CONTENT_HASH_FILE);
184
- await writeFile(hashFilePath, contentHash);
185
- verbose(` Wrote plugin.json for ${skillName} (v${version})`);
186
- await writeFile(path.join(skillsDir, "SKILL.md"), skillMdContent);
187
- verbose(` Copied SKILL.md`);
188
- for (const fileName of SKILL_FILES) {
189
- if (fileName === "SKILL.md") continue;
190
- const sourcePath = path.join(skillPath, fileName);
191
- if (await fileExists(sourcePath)) {
192
- const content = await readFile(sourcePath);
193
- await writeFile(path.join(skillsDir, fileName), content);
194
- verbose(` Copied ${fileName}`);
195
- }
196
- }
197
- for (const dirName of SKILL_DIRS) {
198
- const sourceDir = path.join(skillPath, dirName);
199
- if (await fileExists(sourceDir)) {
200
- await copy(sourceDir, path.join(skillsDir, dirName));
201
- verbose(` Copied ${dirName}/`);
202
- }
203
- }
204
- const readme = generateReadme(skillName, frontmatter, metadata);
205
- await writeFile(path.join(pluginDir, "README.md"), readme);
206
- verbose(` Generated README.md`);
207
- return {
208
- pluginPath: pluginDir,
209
- manifest,
210
- skillName
211
- };
212
- }
213
- async function compileAllSkillPlugins(skillsDir, outputDir) {
214
- const results = [];
215
- const skillMdFiles = await glob("**/SKILL.md", skillsDir);
216
- for (const skillMdFile of skillMdFiles) {
217
- const skillPath = path.join(skillsDir, path.dirname(skillMdFile));
218
- try {
219
- const result = await compileSkillPlugin({
220
- skillPath,
221
- outputDir
222
- });
223
- results.push(result);
224
- console.log(` [OK] skill-${result.skillName}`);
225
- } catch (error) {
226
- const errorMessage = error instanceof Error ? error.message : String(error);
227
- const dirBasename = path.basename(skillPath);
228
- console.warn(` [WARN] Failed to compile skill from ${dirBasename}: ${errorMessage}`);
229
- }
230
- }
231
- return results;
232
- }
233
- function printCompilationSummary(results) {
234
- console.log(`
235
- Compiled ${results.length} skill plugins:`);
236
- for (const result of results) {
237
- console.log(` - skill-${result.skillName} (v${result.manifest.version})`);
238
- }
239
- }
240
-
241
- // src/cli/commands/build/plugins.ts
242
26
  var DEFAULT_OUTPUT_DIR = "dist/plugins";
243
27
  var BuildPlugins = class _BuildPlugins extends BaseCommand {
244
28
  static summary = "Build skills into standalone plugins (requires skills repo)";
@@ -274,8 +58,8 @@ var BuildPlugins = class _BuildPlugins extends BaseCommand {
274
58
  const { flags } = await this.parse(_BuildPlugins);
275
59
  setVerbose(flags.verbose);
276
60
  const projectRoot = process.cwd();
277
- const skillsDir = path2.resolve(projectRoot, flags["skills-dir"]);
278
- const outputDir = path2.resolve(projectRoot, flags["output-dir"]);
61
+ const skillsDir = path.resolve(projectRoot, flags["skills-dir"]);
62
+ const outputDir = path.resolve(projectRoot, flags["output-dir"]);
279
63
  this.log("");
280
64
  this.log("Compiling skill plugins");
281
65
  this.log(` Skills directory: ${skillsDir}`);
@@ -283,7 +67,7 @@ var BuildPlugins = class _BuildPlugins extends BaseCommand {
283
67
  this.log("");
284
68
  try {
285
69
  if (flags.skill) {
286
- const skillPath = path2.resolve(skillsDir, flags.skill);
70
+ const skillPath = path.resolve(skillsDir, flags.skill);
287
71
  this.log(`Compiling skill at ${skillPath}...`);
288
72
  const result = await compileSkillPlugin({
289
73
  skillPath,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/commands/build/plugins.ts","../../../src/cli/lib/skill-plugin-compiler.ts"],"sourcesContent":["import { Flags } from \"@oclif/core\";\nimport path from \"path\";\nimport { BaseCommand } from \"../../base-command\";\nimport { setVerbose } from \"../../utils/logger\";\nimport { DIRS } from \"../../consts\";\nimport {\n compileAllSkillPlugins,\n compileSkillPlugin,\n printCompilationSummary,\n} from \"../../lib/skill-plugin-compiler\";\nimport { EXIT_CODES } from \"../../lib/exit-codes\";\n\nconst DEFAULT_OUTPUT_DIR = \"dist/plugins\";\n\nexport default class BuildPlugins extends BaseCommand {\n static summary = \"Build skills into standalone plugins (requires skills repo)\";\n\n static description =\n \"Build skills into standalone plugins. By default, compiles all skills. Use --skill to compile a specific skill only.\";\n\n static examples = [\n \"<%= config.bin %> <%= command.id %>\",\n \"<%= config.bin %> <%= command.id %> --skill cli-commander\",\n \"<%= config.bin %> <%= command.id %> --skills-dir ./src/skills --output-dir ./plugins\",\n \"<%= config.bin %> <%= command.id %> --verbose\",\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n \"skills-dir\": Flags.string({\n char: \"s\",\n description: \"Skills source directory\",\n default: DIRS.skills,\n }),\n \"output-dir\": Flags.string({\n char: \"o\",\n description: \"Output directory\",\n default: DEFAULT_OUTPUT_DIR,\n }),\n skill: Flags.string({\n description: \"Compile only a specific skill (path to skill directory)\",\n }),\n verbose: Flags.boolean({\n char: \"v\",\n description: \"Enable verbose logging\",\n default: false,\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(BuildPlugins);\n\n setVerbose(flags.verbose);\n\n const projectRoot = process.cwd();\n const skillsDir = path.resolve(projectRoot, flags[\"skills-dir\"]);\n const outputDir = path.resolve(projectRoot, flags[\"output-dir\"]);\n\n this.log(\"\");\n this.log(\"Compiling skill plugins\");\n this.log(` Skills directory: ${skillsDir}`);\n this.log(` Output directory: ${outputDir}`);\n this.log(\"\");\n\n try {\n if (flags.skill) {\n const skillPath = path.resolve(skillsDir, flags.skill);\n this.log(`Compiling skill at ${skillPath}...`);\n\n const result = await compileSkillPlugin({\n skillPath,\n outputDir,\n });\n\n this.log(`Compiled skill-${result.skillName}`);\n this.log(` Plugin path: ${result.pluginPath}`);\n } else {\n this.log(\"Finding and compiling all skills...\");\n\n const results = await compileAllSkillPlugins(skillsDir, outputDir);\n\n this.log(`Compiled ${results.length} skill plugins`);\n printCompilationSummary(results);\n }\n\n this.log(\"\");\n this.logSuccess(\"Plugin compilation complete!\");\n } catch (error) {\n this.log(\"Compilation failed\");\n this.error(error instanceof Error ? error.message : String(error), {\n exit: EXIT_CODES.ERROR,\n });\n }\n }\n}\n","import path from \"path\";\nimport { parse as parseYaml } from \"yaml\";\nimport { readFile, writeFile, ensureDir, glob, fileExists, copy } from \"../utils/fs\";\nimport { verbose } from \"../utils/logger\";\nimport {\n generateSkillPluginManifest,\n writePluginManifest,\n getPluginManifestPath,\n} from \"./plugin-manifest\";\nimport { parseFrontmatter } from \"./loader\";\nimport { hashSkillFolder } from \"./versioning\";\nimport { DEFAULT_VERSION } from \"../consts\";\nimport type { PluginManifest, SkillFrontmatter, SkillMetadataConfig } from \"../../types\";\n\nexport interface SkillPluginOptions {\n skillPath: string;\n outputDir: string;\n skillName?: string;\n}\n\nexport interface CompiledSkillPlugin {\n pluginPath: string;\n manifest: PluginManifest;\n skillName: string;\n}\n\nconst SKILL_FILES = [\"SKILL.md\", \"reference.md\"] as const;\n\nconst SKILL_DIRS = [\"examples\", \"scripts\"] as const;\n\nfunction sanitizeSkillName(name: string): string {\n return name.replace(/\\+/g, \"-\");\n}\n\nfunction parseMajorVersion(version: string): number {\n const match = version.match(/^(\\d+)\\./);\n return match ? parseInt(match[1], 10) : 1;\n}\n\nfunction bumpMajorVersion(version: string): string {\n const major = parseMajorVersion(version);\n return `${major + 1}.0.0`;\n}\n\nconst CONTENT_HASH_FILE = \".content-hash\";\n\nasync function readExistingManifest(\n pluginDir: string,\n): Promise<{ version: string; contentHash: string | undefined } | null> {\n const manifestPath = getPluginManifestPath(pluginDir);\n\n if (!(await fileExists(manifestPath))) {\n return null;\n }\n\n try {\n const content = await readFile(manifestPath);\n const manifest = JSON.parse(content) as PluginManifest;\n\n const hashFilePath = manifestPath.replace(\"plugin.json\", CONTENT_HASH_FILE);\n let contentHash: string | undefined;\n if (await fileExists(hashFilePath)) {\n contentHash = (await readFile(hashFilePath)).trim();\n }\n\n return {\n version: manifest.version ?? DEFAULT_VERSION,\n contentHash,\n };\n } catch {\n return null;\n }\n}\n\nasync function determineVersion(\n skillPath: string,\n pluginDir: string,\n): Promise<{ version: string; contentHash: string }> {\n const newHash = await hashSkillFolder(skillPath);\n\n const existing = await readExistingManifest(pluginDir);\n\n if (!existing) {\n return {\n version: DEFAULT_VERSION,\n contentHash: newHash,\n };\n }\n\n if (existing.contentHash !== newHash) {\n return {\n version: bumpMajorVersion(existing.version),\n contentHash: newHash,\n };\n }\n\n return {\n version: existing.version,\n contentHash: newHash,\n };\n}\n\nasync function readSkillMetadata(skillPath: string): Promise<SkillMetadataConfig | null> {\n const metadataPath = path.join(skillPath, \"metadata.yaml\");\n\n if (!(await fileExists(metadataPath))) {\n return null;\n }\n\n try {\n const content = await readFile(metadataPath);\n const lines = content.split(\"\\n\");\n const yamlContent = lines[0]?.startsWith(\"# yaml-language-server:\")\n ? lines.slice(1).join(\"\\n\")\n : content;\n\n return parseYaml(yamlContent) as SkillMetadataConfig;\n } catch {\n return null;\n }\n}\n\nfunction generateReadme(\n skillName: string,\n frontmatter: SkillFrontmatter,\n metadata: SkillMetadataConfig | null,\n): string {\n const lines: string[] = [];\n\n lines.push(`# ${skillName}`);\n lines.push(\"\");\n lines.push(frontmatter.description);\n lines.push(\"\");\n\n if (metadata?.tags && metadata.tags.length > 0) {\n lines.push(\"## Tags\");\n lines.push(\"\");\n lines.push(metadata.tags.map((t) => `\\`${t}\\``).join(\" \"));\n lines.push(\"\");\n }\n\n lines.push(\"## Installation\");\n lines.push(\"\");\n lines.push(\"Add this plugin to your Claude Code configuration:\");\n lines.push(\"\");\n lines.push(\"```json\");\n lines.push(`{`);\n lines.push(` \"plugins\": [\"skill-${skillName}\"]`);\n lines.push(`}`);\n lines.push(\"```\");\n lines.push(\"\");\n\n lines.push(\"## Usage\");\n lines.push(\"\");\n lines.push(`This skill is automatically available when installed.`);\n if (metadata?.requires && metadata.requires.length > 0) {\n lines.push(\"\");\n lines.push(\"**Requires:** \" + metadata.requires.join(\", \"));\n }\n lines.push(\"\");\n\n lines.push(\"---\");\n lines.push(\"\");\n lines.push(\"*Generated by Claude Collective skill-plugin-compiler*\");\n lines.push(\"\");\n\n return lines.join(\"\\n\");\n}\n\nexport async function compileSkillPlugin(\n options: SkillPluginOptions,\n): Promise<CompiledSkillPlugin> {\n const { skillPath, outputDir, skillName: overrideName } = options;\n\n // Use directory basename for initial error messages before frontmatter is parsed\n const dirBasename = path.basename(skillPath);\n\n const skillMdPath = path.join(skillPath, \"SKILL.md\");\n if (!(await fileExists(skillMdPath))) {\n throw new Error(\n `Skill '${dirBasename}' is missing required SKILL.md file. Expected at: ${skillMdPath}`,\n );\n }\n\n const skillMdContent = await readFile(skillMdPath);\n const frontmatter = parseFrontmatter(skillMdContent);\n\n if (!frontmatter) {\n throw new Error(\n `Skill '${dirBasename}' has invalid or missing YAML frontmatter in SKILL.md. ` +\n `Required fields: 'name' and 'description'. File: ${skillMdPath}`,\n );\n }\n\n // Use frontmatter.name as the canonical skill name (source of truth)\n // Override name takes precedence if explicitly provided\n const skillName = overrideName ?? sanitizeSkillName(frontmatter.name);\n\n verbose(`Compiling skill plugin: ${skillName} from ${skillPath}`);\n\n const metadata = await readSkillMetadata(skillPath);\n\n const pluginDir = path.join(outputDir, `skill-${skillName}`);\n const skillsDir = path.join(pluginDir, \"skills\", skillName);\n\n await ensureDir(pluginDir);\n await ensureDir(skillsDir);\n\n const { version, contentHash } = await determineVersion(skillPath, pluginDir);\n\n const manifest = generateSkillPluginManifest({\n skillName,\n description: frontmatter.description,\n author: metadata?.author,\n version,\n keywords: metadata?.tags,\n });\n\n await writePluginManifest(pluginDir, manifest);\n\n const hashFilePath = getPluginManifestPath(pluginDir).replace(\"plugin.json\", CONTENT_HASH_FILE);\n await writeFile(hashFilePath, contentHash);\n\n verbose(` Wrote plugin.json for ${skillName} (v${version})`);\n\n await writeFile(path.join(skillsDir, \"SKILL.md\"), skillMdContent);\n verbose(` Copied SKILL.md`);\n\n for (const fileName of SKILL_FILES) {\n if (fileName === \"SKILL.md\") continue;\n\n const sourcePath = path.join(skillPath, fileName);\n if (await fileExists(sourcePath)) {\n const content = await readFile(sourcePath);\n await writeFile(path.join(skillsDir, fileName), content);\n verbose(` Copied ${fileName}`);\n }\n }\n\n for (const dirName of SKILL_DIRS) {\n const sourceDir = path.join(skillPath, dirName);\n if (await fileExists(sourceDir)) {\n await copy(sourceDir, path.join(skillsDir, dirName));\n verbose(` Copied ${dirName}/`);\n }\n }\n\n const readme = generateReadme(skillName, frontmatter, metadata);\n await writeFile(path.join(pluginDir, \"README.md\"), readme);\n verbose(` Generated README.md`);\n\n return {\n pluginPath: pluginDir,\n manifest,\n skillName,\n };\n}\n\nexport async function compileAllSkillPlugins(\n skillsDir: string,\n outputDir: string,\n): Promise<CompiledSkillPlugin[]> {\n const results: CompiledSkillPlugin[] = [];\n\n const skillMdFiles = await glob(\"**/SKILL.md\", skillsDir);\n\n for (const skillMdFile of skillMdFiles) {\n const skillPath = path.join(skillsDir, path.dirname(skillMdFile));\n\n try {\n // compileSkillPlugin uses frontmatter.name as the canonical skill name\n const result = await compileSkillPlugin({\n skillPath,\n outputDir,\n });\n results.push(result);\n console.log(` [OK] skill-${result.skillName}`);\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n const dirBasename = path.basename(skillPath);\n console.warn(` [WARN] Failed to compile skill from ${dirBasename}: ${errorMessage}`);\n }\n }\n\n return results;\n}\n\nexport function printCompilationSummary(results: CompiledSkillPlugin[]): void {\n console.log(`\\nCompiled ${results.length} skill plugins:`);\n for (const result of results) {\n console.log(` - skill-${result.skillName} (v${result.manifest.version})`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,aAAa;AACtB,OAAOA,WAAU;;;ACDjB;AAAA,OAAO,UAAU;AACjB,SAAS,SAAS,iBAAiB;AAyBnC,IAAM,cAAc,CAAC,YAAY,cAAc;AAE/C,IAAM,aAAa,CAAC,YAAY,SAAS;AAEzC,SAAS,kBAAkB,MAAsB;AAC/C,SAAO,KAAK,QAAQ,OAAO,GAAG;AAChC;AAEA,SAAS,kBAAkB,SAAyB;AAClD,QAAM,QAAQ,QAAQ,MAAM,UAAU;AACtC,SAAO,QAAQ,SAAS,MAAM,CAAC,GAAG,EAAE,IAAI;AAC1C;AAEA,SAAS,iBAAiB,SAAyB;AACjD,QAAM,QAAQ,kBAAkB,OAAO;AACvC,SAAO,GAAG,QAAQ,CAAC;AACrB;AAEA,IAAM,oBAAoB;AAE1B,eAAe,qBACb,WACsE;AACtE,QAAM,eAAe,sBAAsB,SAAS;AAEpD,MAAI,CAAE,MAAM,WAAW,YAAY,GAAI;AACrC,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,UAAU,MAAM,SAAS,YAAY;AAC3C,UAAM,WAAW,KAAK,MAAM,OAAO;AAEnC,UAAM,eAAe,aAAa,QAAQ,eAAe,iBAAiB;AAC1E,QAAI;AACJ,QAAI,MAAM,WAAW,YAAY,GAAG;AAClC,qBAAe,MAAM,SAAS,YAAY,GAAG,KAAK;AAAA,IACpD;AAEA,WAAO;AAAA,MACL,SAAS,SAAS,WAAW;AAAA,MAC7B;AAAA,IACF;AAAA,EACF,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAe,iBACb,WACA,WACmD;AACnD,QAAM,UAAU,MAAM,gBAAgB,SAAS;AAE/C,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SAAS;AAAA,IACX,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,MAAqB;AACzB,UAAM,EAAE,MAAM,IAAI,MAAM,KAAK,MAAM,aAAY;AAE/C,eAAW,MAAM,OAAO;AAExB,UAAM,cAAc,QAAQ,IAAI;AAChC,UAAM,YAAYC,MAAK,QAAQ,aAAa,MAAM,YAAY,CAAC;AAC/D,UAAM,YAAYA,MAAK,QAAQ,aAAa,MAAM,YAAY,CAAC;AAE/D,SAAK,IAAI,EAAE;AACX,SAAK,IAAI,yBAAyB;AAClC,SAAK,IAAI,uBAAuB,SAAS,EAAE;AAC3C,SAAK,IAAI,uBAAuB,SAAS,EAAE;AAC3C,SAAK,IAAI,EAAE;AAEX,QAAI;AACF,UAAI,MAAM,OAAO;AACf,cAAM,YAAYA,MAAK,QAAQ,WAAW,MAAM,KAAK;AACrD,aAAK,IAAI,sBAAsB,SAAS,KAAK;AAE7C,cAAM,SAAS,MAAM,mBAAmB;AAAA,UACtC;AAAA,UACA;AAAA,QACF,CAAC;AAED,aAAK,IAAI,kBAAkB,OAAO,SAAS,EAAE;AAC7C,aAAK,IAAI,kBAAkB,OAAO,UAAU,EAAE;AAAA,MAChD,OAAO;AACL,aAAK,IAAI,qCAAqC;AAE9C,cAAM,UAAU,MAAM,uBAAuB,WAAW,SAAS;AAEjE,aAAK,IAAI,YAAY,QAAQ,MAAM,gBAAgB;AACnD,gCAAwB,OAAO;AAAA,MACjC;AAEA,WAAK,IAAI,EAAE;AACX,WAAK,WAAW,8BAA8B;AAAA,IAChD,SAAS,OAAO;AACd,WAAK,IAAI,oBAAoB;AAC7B,WAAK,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG;AAAA,QACjE,MAAM,WAAW;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":["path","path"]}
1
+ {"version":3,"sources":["../../../src/cli/commands/build/plugins.ts"],"sourcesContent":["import { Flags } from \"@oclif/core\";\nimport path from \"path\";\nimport { BaseCommand } from \"../../base-command\";\nimport { setVerbose } from \"../../utils/logger\";\nimport { DIRS } from \"../../consts\";\nimport {\n compileAllSkillPlugins,\n compileSkillPlugin,\n printCompilationSummary,\n} from \"../../lib/skills\";\nimport { EXIT_CODES } from \"../../lib/exit-codes\";\n\nconst DEFAULT_OUTPUT_DIR = \"dist/plugins\";\n\nexport default class BuildPlugins extends BaseCommand {\n static summary = \"Build skills into standalone plugins (requires skills repo)\";\n\n static description =\n \"Build skills into standalone plugins. By default, compiles all skills. Use --skill to compile a specific skill only.\";\n\n static examples = [\n \"<%= config.bin %> <%= command.id %>\",\n \"<%= config.bin %> <%= command.id %> --skill cli-commander\",\n \"<%= config.bin %> <%= command.id %> --skills-dir ./src/skills --output-dir ./plugins\",\n \"<%= config.bin %> <%= command.id %> --verbose\",\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n \"skills-dir\": Flags.string({\n char: \"s\",\n description: \"Skills source directory\",\n default: DIRS.skills,\n }),\n \"output-dir\": Flags.string({\n char: \"o\",\n description: \"Output directory\",\n default: DEFAULT_OUTPUT_DIR,\n }),\n skill: Flags.string({\n description: \"Compile only a specific skill (path to skill directory)\",\n }),\n verbose: Flags.boolean({\n char: \"v\",\n description: \"Enable verbose logging\",\n default: false,\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(BuildPlugins);\n\n setVerbose(flags.verbose);\n\n const projectRoot = process.cwd();\n const skillsDir = path.resolve(projectRoot, flags[\"skills-dir\"]);\n const outputDir = path.resolve(projectRoot, flags[\"output-dir\"]);\n\n this.log(\"\");\n this.log(\"Compiling skill plugins\");\n this.log(` Skills directory: ${skillsDir}`);\n this.log(` Output directory: ${outputDir}`);\n this.log(\"\");\n\n try {\n if (flags.skill) {\n const skillPath = path.resolve(skillsDir, flags.skill);\n this.log(`Compiling skill at ${skillPath}...`);\n\n const result = await compileSkillPlugin({\n skillPath,\n outputDir,\n });\n\n this.log(`Compiled skill-${result.skillName}`);\n this.log(` Plugin path: ${result.pluginPath}`);\n } else {\n this.log(\"Finding and compiling all skills...\");\n\n const results = await compileAllSkillPlugins(skillsDir, outputDir);\n\n this.log(`Compiled ${results.length} skill plugins`);\n printCompilationSummary(results);\n }\n\n this.log(\"\");\n this.logSuccess(\"Plugin compilation complete!\");\n } catch (error) {\n this.log(\"Compilation failed\");\n this.error(error instanceof Error ? error.message : String(error), {\n exit: EXIT_CODES.ERROR,\n });\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,aAAa;AACtB,OAAO,UAAU;AAWjB,IAAM,qBAAqB;AAE3B,IAAqB,eAArB,MAAqB,sBAAqB,YAAY;AAAA,EACpD,OAAO,UAAU;AAAA,EAEjB,OAAO,cACL;AAAA,EAEF,OAAO,WAAW;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EAEA,OAAO,QAAQ;AAAA,IACb,GAAG,YAAY;AAAA,IACf,cAAc,MAAM,OAAO;AAAA,MACzB,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS,KAAK;AAAA,IAChB,CAAC;AAAA,IACD,cAAc,MAAM,OAAO;AAAA,MACzB,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS;AAAA,IACX,CAAC;AAAA,IACD,OAAO,MAAM,OAAO;AAAA,MAClB,aAAa;AAAA,IACf,CAAC;AAAA,IACD,SAAS,MAAM,QAAQ;AAAA,MACrB,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS;AAAA,IACX,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,MAAqB;AACzB,UAAM,EAAE,MAAM,IAAI,MAAM,KAAK,MAAM,aAAY;AAE/C,eAAW,MAAM,OAAO;AAExB,UAAM,cAAc,QAAQ,IAAI;AAChC,UAAM,YAAY,KAAK,QAAQ,aAAa,MAAM,YAAY,CAAC;AAC/D,UAAM,YAAY,KAAK,QAAQ,aAAa,MAAM,YAAY,CAAC;AAE/D,SAAK,IAAI,EAAE;AACX,SAAK,IAAI,yBAAyB;AAClC,SAAK,IAAI,uBAAuB,SAAS,EAAE;AAC3C,SAAK,IAAI,uBAAuB,SAAS,EAAE;AAC3C,SAAK,IAAI,EAAE;AAEX,QAAI;AACF,UAAI,MAAM,OAAO;AACf,cAAM,YAAY,KAAK,QAAQ,WAAW,MAAM,KAAK;AACrD,aAAK,IAAI,sBAAsB,SAAS,KAAK;AAE7C,cAAM,SAAS,MAAM,mBAAmB;AAAA,UACtC;AAAA,UACA;AAAA,QACF,CAAC;AAED,aAAK,IAAI,kBAAkB,OAAO,SAAS,EAAE;AAC7C,aAAK,IAAI,kBAAkB,OAAO,UAAU,EAAE;AAAA,MAChD,OAAO;AACL,aAAK,IAAI,qCAAqC;AAE9C,cAAM,UAAU,MAAM,uBAAuB,WAAW,SAAS;AAEjE,aAAK,IAAI,YAAY,QAAQ,MAAM,gBAAgB;AACnD,gCAAwB,OAAO;AAAA,MACjC;AAEA,WAAK,IAAI,EAAE;AACX,WAAK,WAAW,8BAA8B;AAAA,IAChD,SAAS,OAAO;AACd,WAAK,IAAI,oBAAoB;AAC7B,WAAK,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG;AAAA,QACjE,MAAM,WAAW;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":[]}
@@ -1,33 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  getAgentDefinitions
4
- } from "../../chunk-CXOFOJCN.js";
5
- import {
6
- compileStackPlugin,
7
- printStackCompilationSummary
8
- } from "../../chunk-7SLV7CMF.js";
9
- import "../../chunk-VS4GVTZE.js";
10
- import "../../chunk-IOBFMF6X.js";
11
- import {
12
- loadStacks
13
- } from "../../chunk-CKPQHGXR.js";
14
- import "../../chunk-CA4LH4LI.js";
15
- import "../../chunk-BQX23RBV.js";
4
+ } from "../../chunk-NRC7XYCI.js";
16
5
  import {
17
6
  BaseCommand,
18
7
  EXIT_CODES
19
- } from "../../chunk-EHS3TWWP.js";
20
- import "../../chunk-374JNMR6.js";
8
+ } from "../../chunk-OBXAY23Y.js";
9
+ import {
10
+ compileStackPlugin,
11
+ loadStacks,
12
+ printStackCompilationSummary
13
+ } from "../../chunk-YDBSSAJ6.js";
21
14
  import {
22
15
  setVerbose
23
- } from "../../chunk-T25OEQFI.js";
24
- import "../../chunk-AL74GBW4.js";
16
+ } from "../../chunk-ZDREFYD2.js";
17
+ import "../../chunk-HWD32NP7.js";
25
18
  import {
26
19
  PROJECT_ROOT
27
- } from "../../chunk-FJFEKPXF.js";
20
+ } from "../../chunk-O6ZTD7ZI.js";
28
21
  import {
29
22
  init_esm_shims
30
- } from "../../chunk-DHET7RCE.js";
23
+ } from "../../chunk-AWKZ5BDL.js";
31
24
 
32
25
  // src/cli/commands/build/stack.tsx
33
26
  init_esm_shims();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/commands/build/stack.tsx"],"sourcesContent":["import React from \"react\";\nimport { Flags } from \"@oclif/core\";\nimport { render, Box, Text } from \"ink\";\nimport { Select } from \"@inkjs/ui\";\nimport path from \"path\";\nimport { BaseCommand } from \"../../base-command\";\nimport { setVerbose } from \"../../utils/logger\";\nimport { PROJECT_ROOT } from \"../../consts\";\nimport { compileStackPlugin, printStackCompilationSummary } from \"../../lib/stack-plugin-compiler\";\nimport { getAgentDefinitions } from \"../../lib/agent-fetcher\";\nimport { EXIT_CODES } from \"../../lib/exit-codes\";\nimport { loadStacks } from \"../../lib/stacks-loader\";\n\nconst DEFAULT_OUTPUT_DIR = \"dist/stacks\";\n\ninterface StackSelectorProps {\n availableStacks: string[];\n onSelect: (stackId: string) => void;\n}\n\nconst StackSelector: React.FC<StackSelectorProps> = ({ availableStacks, onSelect }) => {\n return (\n <Box flexDirection=\"column\">\n <Text>Select a stack to compile:</Text>\n <Select\n options={availableStacks.map((name) => ({\n value: name,\n label: name,\n }))}\n onChange={(value) => {\n onSelect(value);\n }}\n />\n </Box>\n );\n};\n\nexport default class BuildStack extends BaseCommand {\n static summary = \"Build a stack into a standalone plugin\";\n\n static description =\n \"Build a stack into a standalone plugin (requires skills repo). If no stack is specified, you will be prompted to select one.\";\n\n static examples = [\n \"<%= config.bin %> <%= command.id %>\",\n \"<%= config.bin %> <%= command.id %> --stack frontend-stack\",\n \"<%= config.bin %> <%= command.id %> --stack frontend-stack --output-dir ./plugins\",\n \"<%= config.bin %> <%= command.id %> --agent-source /path/to/agents --refresh\",\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n stack: Flags.string({\n description: \"Stack ID to compile (directory name in src/stacks/)\",\n }),\n \"output-dir\": Flags.string({\n char: \"o\",\n description: \"Output directory\",\n default: DEFAULT_OUTPUT_DIR,\n }),\n \"agent-source\": Flags.string({\n description: \"Agent partials source (default: local CLI)\",\n }),\n refresh: Flags.boolean({\n description: \"Force refresh remote agent source\",\n default: false,\n }),\n verbose: Flags.boolean({\n char: \"v\",\n description: \"Enable verbose logging\",\n default: false,\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(BuildStack);\n\n setVerbose(flags.verbose);\n\n const projectRoot = process.cwd();\n const outputDir = path.resolve(projectRoot, flags[\"output-dir\"]);\n\n let stackId = flags.stack;\n\n // If no stack specified, prompt for selection\n if (!stackId) {\n const stacks = await loadStacks(projectRoot);\n const availableStacks = stacks.map((s) => s.id).sort();\n\n if (availableStacks.length === 0) {\n this.error(`No stacks found in config/stacks.yaml`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n // Render interactive selector\n stackId = await new Promise<string>((resolve, reject) => {\n const { waitUntilExit } = render(\n <StackSelector\n availableStacks={availableStacks}\n onSelect={(selected) => {\n resolve(selected);\n }}\n />,\n );\n\n waitUntilExit().catch(reject);\n }).catch(() => {\n this.log(\"Cancelled\");\n this.exit(EXIT_CODES.CANCELLED);\n });\n }\n\n this.log(\"\");\n this.log(`Compiling stack plugin: ${stackId}`);\n this.log(` Output directory: ${outputDir}`);\n this.log(\"\");\n\n // Load agent partials\n let agentSourcePath: string;\n try {\n this.log(flags[\"agent-source\"] ? \"Fetching agent partials...\" : \"Loading agent partials...\");\n const agentDefs = await getAgentDefinitions(flags[\"agent-source\"], {\n forceRefresh: flags.refresh,\n });\n agentSourcePath = agentDefs.sourcePath;\n this.log(\n flags[\"agent-source\"]\n ? `Agent partials fetched from: ${flags[\"agent-source\"]}`\n : `Agent partials loaded from: ${PROJECT_ROOT}`,\n );\n } catch (error) {\n this.log(\"Failed to load agent partials\");\n this.error(error instanceof Error ? error.message : String(error), {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n // Compile the stack\n try {\n this.log(`Compiling stack \"${stackId}\"...`);\n\n const result = await compileStackPlugin({\n stackId,\n outputDir,\n projectRoot,\n agentSourcePath,\n });\n\n this.log(`Compiled stack plugin: ${result.stackName}`);\n\n printStackCompilationSummary(result);\n\n this.log(\"\");\n this.logSuccess(\"Stack plugin compilation complete!\");\n } catch (error) {\n this.log(\"Compilation failed\");\n this.error(error instanceof Error ? error.message : String(error), {\n exit: EXIT_CODES.ERROR,\n });\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA,SAAS,aAAa;AACtB,SAAS,QAAQ,KAAK,YAAY;AAClC,SAAS,cAAc;AACvB,OAAO,UAAU;AAkBb,SACE,KADF;AATJ,IAAM,qBAAqB;AAO3B,IAAM,gBAA8C,CAAC,EAAE,iBAAiB,SAAS,MAAM;AACrF,SACE,qBAAC,OAAI,eAAc,UACjB;AAAA,wBAAC,QAAK,wCAA0B;AAAA,IAChC;AAAA,MAAC;AAAA;AAAA,QACC,SAAS,gBAAgB,IAAI,CAAC,UAAU;AAAA,UACtC,OAAO;AAAA,UACP,OAAO;AAAA,QACT,EAAE;AAAA,QACF,UAAU,CAAC,UAAU;AACnB,mBAAS,KAAK;AAAA,QAChB;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,IAAqB,aAArB,MAAqB,oBAAmB,YAAY;AAAA,EAClD,OAAO,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stack.tsx"],"sourcesContent":["import React from \"react\";\nimport { Flags } from \"@oclif/core\";\nimport { render, Box, Text } from \"ink\";\nimport { Select } from \"@inkjs/ui\";\nimport path from \"path\";\nimport { BaseCommand } from \"../../base-command\";\nimport { setVerbose } from \"../../utils/logger\";\nimport { PROJECT_ROOT } from \"../../consts\";\nimport { compileStackPlugin, printStackCompilationSummary, loadStacks } from \"../../lib/stacks\";\nimport { getAgentDefinitions } from \"../../lib/agents\";\nimport { EXIT_CODES } from \"../../lib/exit-codes\";\n\nconst DEFAULT_OUTPUT_DIR = \"dist/stacks\";\n\ntype StackSelectorProps = {\n availableStacks: string[];\n onSelect: (stackId: string) => void;\n};\n\nconst StackSelector: React.FC<StackSelectorProps> = ({ availableStacks, onSelect }) => {\n return (\n <Box flexDirection=\"column\">\n <Text>Select a stack to compile:</Text>\n <Select\n options={availableStacks.map((name) => ({\n value: name,\n label: name,\n }))}\n onChange={(value) => {\n onSelect(value);\n }}\n />\n </Box>\n );\n};\n\nexport default class BuildStack extends BaseCommand {\n static summary = \"Build a stack into a standalone plugin\";\n\n static description =\n \"Build a stack into a standalone plugin (requires skills repo). If no stack is specified, you will be prompted to select one.\";\n\n static examples = [\n \"<%= config.bin %> <%= command.id %>\",\n \"<%= config.bin %> <%= command.id %> --stack frontend-stack\",\n \"<%= config.bin %> <%= command.id %> --stack frontend-stack --output-dir ./plugins\",\n \"<%= config.bin %> <%= command.id %> --agent-source /path/to/agents --refresh\",\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n stack: Flags.string({\n description: \"Stack ID to compile (directory name in src/stacks/)\",\n }),\n \"output-dir\": Flags.string({\n char: \"o\",\n description: \"Output directory\",\n default: DEFAULT_OUTPUT_DIR,\n }),\n \"agent-source\": Flags.string({\n description: \"Agent partials source (default: local CLI)\",\n }),\n refresh: Flags.boolean({\n description: \"Force refresh remote agent source\",\n default: false,\n }),\n verbose: Flags.boolean({\n char: \"v\",\n description: \"Enable verbose logging\",\n default: false,\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(BuildStack);\n\n setVerbose(flags.verbose);\n\n const projectRoot = process.cwd();\n const outputDir = path.resolve(projectRoot, flags[\"output-dir\"]);\n\n let stackId = flags.stack;\n\n if (!stackId) {\n const stacks = await loadStacks(projectRoot);\n const availableStacks = stacks.map((s) => s.id).sort();\n\n if (availableStacks.length === 0) {\n this.error(`No stacks found in config/stacks.yaml`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n stackId = await new Promise<string>((resolve, reject) => {\n const { waitUntilExit } = render(\n <StackSelector\n availableStacks={availableStacks}\n onSelect={(selected) => {\n resolve(selected);\n }}\n />,\n );\n\n waitUntilExit().catch(reject);\n }).catch(() => {\n this.log(\"Cancelled\");\n this.exit(EXIT_CODES.CANCELLED);\n });\n }\n\n this.log(\"\");\n this.log(`Compiling stack plugin: ${stackId}`);\n this.log(` Output directory: ${outputDir}`);\n this.log(\"\");\n\n let agentSourcePath: string;\n try {\n this.log(flags[\"agent-source\"] ? \"Fetching agent partials...\" : \"Loading agent partials...\");\n const agentDefs = await getAgentDefinitions(flags[\"agent-source\"], {\n forceRefresh: flags.refresh,\n });\n agentSourcePath = agentDefs.sourcePath;\n this.log(\n flags[\"agent-source\"]\n ? `Agent partials fetched from: ${flags[\"agent-source\"]}`\n : `Agent partials loaded from: ${PROJECT_ROOT}`,\n );\n } catch (error) {\n this.log(\"Failed to load agent partials\");\n this.error(error instanceof Error ? error.message : String(error), {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n try {\n this.log(`Compiling stack \"${stackId}\"...`);\n\n const result = await compileStackPlugin({\n stackId,\n outputDir,\n projectRoot,\n agentSourcePath,\n });\n\n this.log(`Compiled stack plugin: ${result.stackName}`);\n\n printStackCompilationSummary(result);\n\n this.log(\"\");\n this.logSuccess(\"Stack plugin compilation complete!\");\n } catch (error) {\n this.log(\"Compilation failed\");\n this.error(error instanceof Error ? error.message : String(error), {\n exit: EXIT_CODES.ERROR,\n });\n }\n }\n}\n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M,UAAU,OAAO,KAAK,GAAG;AAAA,QACjE,MAAM,WAAW;AAAA,MACnB,CAAC;AAAA,IACH;AAEA,QAAI;AACF,WAAK,IAAI,oBAAoB,OAAO,MAAM;AAE1C,YAAM,SAAS,MAAM,mBAAmB;AAAA,QACtC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAED,WAAK,IAAI,0BAA0B,OAAO,SAAS,EAAE;AAErD,mCAA6B,MAAM;AAEnC,WAAK,IAAI,EAAE;AACX,WAAK,WAAW,oCAAoC;AAAA,IACtD,SAAS,OAAO;AACd,WAAK,IAAI,oBAAoB;AAC7B,WAAK,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG;AAAA,QACjE,MAAM,WAAW;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":[]}
@@ -1,53 +1,41 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- getAgentDefinitions
4
- } from "../chunk-CXOFOJCN.js";
5
- import {
6
- detectInstallation
7
- } from "../chunk-5K2ZLUO5.js";
8
- import {
3
+ getAgentDefinitions,
9
4
  recompileAgents
10
- } from "../chunk-N6JNE326.js";
11
- import "../chunk-7SLV7CMF.js";
12
- import "../chunk-VS4GVTZE.js";
13
- import {
14
- getCollectivePluginDir,
15
- getPluginAgentsDir,
16
- getPluginManifestPath,
17
- getProjectPluginsDir
18
- } from "../chunk-HPGFY5ZN.js";
19
- import "../chunk-VFHWU7JU.js";
20
- import "../chunk-IOBFMF6X.js";
21
- import "../chunk-CKPQHGXR.js";
22
- import "../chunk-CA4LH4LI.js";
23
- import {
24
- loadPluginSkills
25
- } from "../chunk-BQX23RBV.js";
5
+ } from "../chunk-NRC7XYCI.js";
26
6
  import {
27
7
  BaseCommand,
28
8
  EXIT_CODES
29
- } from "../chunk-EHS3TWWP.js";
9
+ } from "../chunk-OBXAY23Y.js";
30
10
  import {
11
+ detectInstallation,
12
+ getCollectivePluginDir,
13
+ getPluginAgentsDir,
14
+ getPluginManifestPath,
15
+ getProjectPluginsDir,
16
+ loadPluginSkills,
17
+ parseFrontmatter,
31
18
  resolveSource
32
- } from "../chunk-374JNMR6.js";
33
- import {
34
- setVerbose,
35
- verbose
36
- } from "../chunk-T25OEQFI.js";
19
+ } from "../chunk-YDBSSAJ6.js";
37
20
  import {
38
21
  directoryExists,
39
22
  ensureDir,
40
23
  fileExists,
41
24
  glob,
42
25
  listDirectories,
43
- readFile
44
- } from "../chunk-AL74GBW4.js";
26
+ pluginManifestSchema,
27
+ projectConfigLoaderSchema,
28
+ readFile,
29
+ setVerbose,
30
+ verbose
31
+ } from "../chunk-ZDREFYD2.js";
32
+ import "../chunk-HWD32NP7.js";
45
33
  import {
46
34
  LOCAL_SKILLS_PATH
47
- } from "../chunk-FJFEKPXF.js";
35
+ } from "../chunk-O6ZTD7ZI.js";
48
36
  import {
49
37
  init_esm_shims
50
- } from "../chunk-DHET7RCE.js";
38
+ } from "../chunk-AWKZ5BDL.js";
51
39
 
52
40
  // src/cli/commands/compile.ts
53
41
  init_esm_shims();
@@ -66,29 +54,13 @@ async function loadSkillsFromDir(skillsDir, pathPrefix = "") {
66
54
  const relativePath = path.relative(skillsDir, skillDir);
67
55
  try {
68
56
  const content = await readFile(skillPath);
69
- let metadata = {};
70
- if (content.startsWith("---")) {
71
- const endIndex = content.indexOf("---", 3);
72
- if (endIndex > 0) {
73
- const yamlContent = content.slice(3, endIndex).trim();
74
- const lines = yamlContent.split("\n");
75
- for (const line of lines) {
76
- const colonIndex = line.indexOf(":");
77
- if (colonIndex > 0) {
78
- const key = line.slice(0, colonIndex).trim();
79
- const value = line.slice(colonIndex + 1).trim();
80
- metadata[key] = value.replace(/^["']|["']$/g, "");
81
- }
82
- }
83
- }
84
- }
85
- const skillName = metadata.name || path.basename(skillDir);
57
+ const frontmatter = parseFrontmatter(content, skillPath);
58
+ const skillName = frontmatter?.name || path.basename(skillDir);
86
59
  const canonicalId = skillName;
87
60
  const skill = {
61
+ id: canonicalId,
88
62
  path: pathPrefix ? `${pathPrefix}/${relativePath}/` : `${relativePath}/`,
89
- name: skillName,
90
- description: metadata.description || "",
91
- canonicalId
63
+ description: frontmatter?.description || ""
92
64
  };
93
65
  skills[canonicalId] = skill;
94
66
  verbose(` Loaded skill: ${canonicalId}`);
@@ -139,7 +111,7 @@ async function readPluginManifest(pluginDir) {
139
111
  }
140
112
  try {
141
113
  const content = await readFile(manifestPath);
142
- return JSON.parse(content);
114
+ return pluginManifestSchema.parse(JSON.parse(content));
143
115
  } catch {
144
116
  return null;
145
117
  }
@@ -222,11 +194,17 @@ var Compile = class _Compile extends BaseCommand {
222
194
  if (hasConfig) {
223
195
  try {
224
196
  const configContent = await readFile(configPath);
225
- const config = parseYaml(configContent);
226
- const agentCount = config.agents?.length ?? 0;
227
- const configSkillCount = config.skills?.length ?? 0;
228
- this.log(`Using config.yaml (${agentCount} agents, ${configSkillCount} skills)`);
229
- verbose(` Config: ${configPath}`);
197
+ const parsed = parseYaml(configContent);
198
+ const configResult = projectConfigLoaderSchema.safeParse(parsed);
199
+ if (configResult.success) {
200
+ const config = configResult.data;
201
+ const agentCount = config.agents?.length ?? 0;
202
+ const stackSkillCount = config.stack ? new Set(Object.values(config.stack).flatMap((a) => Object.values(a))).size : 0;
203
+ this.log(`Using config.yaml (${agentCount} agents, ${stackSkillCount} skills)`);
204
+ verbose(` Config: ${configPath}`);
205
+ } else {
206
+ this.warn("config.yaml found but has invalid structure - using defaults");
207
+ }
230
208
  } catch {
231
209
  this.warn("config.yaml found but could not be parsed - using defaults");
232
210
  }