@agents-inc/cli 0.32.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 (497) hide show
  1. package/CHANGELOG.md +462 -0
  2. package/LICENSE +21 -0
  3. package/README.md +179 -0
  4. package/config/skills-matrix.yaml +926 -0
  5. package/config/stacks.yaml +2186 -0
  6. package/dist/chunk-3ZOIOVKT.js +365 -0
  7. package/dist/chunk-3ZOIOVKT.js.map +1 -0
  8. package/dist/chunk-4RAY5AOI.js +78 -0
  9. package/dist/chunk-4RAY5AOI.js.map +1 -0
  10. package/dist/chunk-5PIKNCZX.js +234 -0
  11. package/dist/chunk-5PIKNCZX.js.map +1 -0
  12. package/dist/chunk-66UDJBF6.js +96 -0
  13. package/dist/chunk-66UDJBF6.js.map +1 -0
  14. package/dist/chunk-7SOPVGDV.js +24 -0
  15. package/dist/chunk-7SOPVGDV.js.map +1 -0
  16. package/dist/chunk-A27LOC4Z.js +95 -0
  17. package/dist/chunk-A27LOC4Z.js.map +1 -0
  18. package/dist/chunk-B2UBHA66.js +301 -0
  19. package/dist/chunk-B2UBHA66.js.map +1 -0
  20. package/dist/chunk-BZN2Z5P7.js +882 -0
  21. package/dist/chunk-BZN2Z5P7.js.map +1 -0
  22. package/dist/chunk-BZQBJP34.js +186 -0
  23. package/dist/chunk-BZQBJP34.js.map +1 -0
  24. package/dist/chunk-DC5AK3LW.js +105 -0
  25. package/dist/chunk-DC5AK3LW.js.map +1 -0
  26. package/dist/chunk-DHET7RCE.js +50 -0
  27. package/dist/chunk-DHET7RCE.js.map +1 -0
  28. package/dist/chunk-EMJ2ZKS7.js +346 -0
  29. package/dist/chunk-EMJ2ZKS7.js.map +1 -0
  30. package/dist/chunk-FJQRVFMB.js +48 -0
  31. package/dist/chunk-FJQRVFMB.js.map +1 -0
  32. package/dist/chunk-FZGYSLJL.js +85 -0
  33. package/dist/chunk-FZGYSLJL.js.map +1 -0
  34. package/dist/chunk-H566H3MQ.js +87 -0
  35. package/dist/chunk-H566H3MQ.js.map +1 -0
  36. package/dist/chunk-IYG2LAIM.js +90 -0
  37. package/dist/chunk-IYG2LAIM.js.map +1 -0
  38. package/dist/chunk-IZZ4IIEG.js +29 -0
  39. package/dist/chunk-IZZ4IIEG.js.map +1 -0
  40. package/dist/chunk-JMVWYAHT.js +63 -0
  41. package/dist/chunk-JMVWYAHT.js.map +1 -0
  42. package/dist/chunk-LAPCUV4D.js +191 -0
  43. package/dist/chunk-LAPCUV4D.js.map +1 -0
  44. package/dist/chunk-LGUI3PMO.js +109 -0
  45. package/dist/chunk-LGUI3PMO.js.map +1 -0
  46. package/dist/chunk-MM7NK5N2.js +4542 -0
  47. package/dist/chunk-MM7NK5N2.js.map +1 -0
  48. package/dist/chunk-N6S7ZRIL.js +31 -0
  49. package/dist/chunk-N6S7ZRIL.js.map +1 -0
  50. package/dist/chunk-O4D67NN7.js +24 -0
  51. package/dist/chunk-O4D67NN7.js.map +1 -0
  52. package/dist/chunk-ODUOU55D.js +56 -0
  53. package/dist/chunk-ODUOU55D.js.map +1 -0
  54. package/dist/chunk-OGJIZ6QH.js +497 -0
  55. package/dist/chunk-OGJIZ6QH.js.map +1 -0
  56. package/dist/chunk-OMV7TLWD.js +340 -0
  57. package/dist/chunk-OMV7TLWD.js.map +1 -0
  58. package/dist/chunk-PBEHPQLK.js +146 -0
  59. package/dist/chunk-PBEHPQLK.js.map +1 -0
  60. package/dist/chunk-QPTOIZAT.js +32 -0
  61. package/dist/chunk-QPTOIZAT.js.map +1 -0
  62. package/dist/chunk-R3XFQKPG.js +111 -0
  63. package/dist/chunk-R3XFQKPG.js.map +1 -0
  64. package/dist/chunk-R74PZWQS.js +69 -0
  65. package/dist/chunk-R74PZWQS.js.map +1 -0
  66. package/dist/chunk-SO22IQPY.js +45 -0
  67. package/dist/chunk-SO22IQPY.js.map +1 -0
  68. package/dist/chunk-T4EXUIBY.js +19 -0
  69. package/dist/chunk-T4EXUIBY.js.map +1 -0
  70. package/dist/chunk-U3IGFMCY.js +31 -0
  71. package/dist/chunk-U3IGFMCY.js.map +1 -0
  72. package/dist/chunk-UICL22RT.js +318 -0
  73. package/dist/chunk-UICL22RT.js.map +1 -0
  74. package/dist/chunk-UX2H2K2G.js +183 -0
  75. package/dist/chunk-UX2H2K2G.js.map +1 -0
  76. package/dist/chunk-W2ZSCZ2U.js +93 -0
  77. package/dist/chunk-W2ZSCZ2U.js.map +1 -0
  78. package/dist/chunk-WEUVWHMA.js +189 -0
  79. package/dist/chunk-WEUVWHMA.js.map +1 -0
  80. package/dist/chunk-XY3XDVMI.js +15599 -0
  81. package/dist/chunk-XY3XDVMI.js.map +1 -0
  82. package/dist/chunk-YND42IXK.js +233 -0
  83. package/dist/chunk-YND42IXK.js.map +1 -0
  84. package/dist/chunk-YZTWZVGX.js +41 -0
  85. package/dist/chunk-YZTWZVGX.js.map +1 -0
  86. package/dist/chunk-Z4TWOP3H.js +81 -0
  87. package/dist/chunk-Z4TWOP3H.js.map +1 -0
  88. package/dist/cli/defaults/agent-mappings.yaml +271 -0
  89. package/dist/commands/build/marketplace.js +252 -0
  90. package/dist/commands/build/marketplace.js.map +1 -0
  91. package/dist/commands/build/plugins.js +114 -0
  92. package/dist/commands/build/plugins.js.map +1 -0
  93. package/dist/commands/build/stack.js +153 -0
  94. package/dist/commands/build/stack.js.map +1 -0
  95. package/dist/commands/compile.js +354 -0
  96. package/dist/commands/compile.js.map +1 -0
  97. package/dist/commands/config/get.js +61 -0
  98. package/dist/commands/config/get.js.map +1 -0
  99. package/dist/commands/config/index.js +23 -0
  100. package/dist/commands/config/index.js.map +1 -0
  101. package/dist/commands/config/path.js +34 -0
  102. package/dist/commands/config/path.js.map +1 -0
  103. package/dist/commands/config/set-project.js +61 -0
  104. package/dist/commands/config/set-project.js.map +1 -0
  105. package/dist/commands/config/show.js +14 -0
  106. package/dist/commands/config/show.js.map +1 -0
  107. package/dist/commands/config/unset-project.js +57 -0
  108. package/dist/commands/config/unset-project.js.map +1 -0
  109. package/dist/commands/diff.js +742 -0
  110. package/dist/commands/diff.js.map +1 -0
  111. package/dist/commands/doctor.js +370 -0
  112. package/dist/commands/doctor.js.map +1 -0
  113. package/dist/commands/edit.js +301 -0
  114. package/dist/commands/edit.js.map +1 -0
  115. package/dist/commands/eject.js +262 -0
  116. package/dist/commands/eject.js.map +1 -0
  117. package/dist/commands/import/skill.js +361 -0
  118. package/dist/commands/import/skill.js.map +1 -0
  119. package/dist/commands/info.js +217 -0
  120. package/dist/commands/info.js.map +1 -0
  121. package/dist/commands/init.js +443 -0
  122. package/dist/commands/init.js.map +1 -0
  123. package/dist/commands/list.js +49 -0
  124. package/dist/commands/list.js.map +1 -0
  125. package/dist/commands/new/agent.js +224 -0
  126. package/dist/commands/new/agent.js.map +1 -0
  127. package/dist/commands/new/skill.js +199 -0
  128. package/dist/commands/new/skill.js.map +1 -0
  129. package/dist/commands/outdated.js +176 -0
  130. package/dist/commands/outdated.js.map +1 -0
  131. package/dist/commands/search.js +288 -0
  132. package/dist/commands/search.js.map +1 -0
  133. package/dist/commands/uninstall.js +302 -0
  134. package/dist/commands/uninstall.js.map +1 -0
  135. package/dist/commands/update.js +304 -0
  136. package/dist/commands/update.js.map +1 -0
  137. package/dist/commands/validate.js +389 -0
  138. package/dist/commands/validate.js.map +1 -0
  139. package/dist/commands/version/bump.js +79 -0
  140. package/dist/commands/version/bump.js.map +1 -0
  141. package/dist/commands/version/index.js +54 -0
  142. package/dist/commands/version/index.js.map +1 -0
  143. package/dist/commands/version/set.js +86 -0
  144. package/dist/commands/version/set.js.map +1 -0
  145. package/dist/commands/version/show.js +54 -0
  146. package/dist/commands/version/show.js.map +1 -0
  147. package/dist/components/common/confirm.js +9 -0
  148. package/dist/components/common/confirm.js.map +1 -0
  149. package/dist/components/common/confirm.test.js +203 -0
  150. package/dist/components/common/confirm.test.js.map +1 -0
  151. package/dist/components/common/message.js +20 -0
  152. package/dist/components/common/message.js.map +1 -0
  153. package/dist/components/common/spinner.js +14 -0
  154. package/dist/components/common/spinner.js.map +1 -0
  155. package/dist/components/skill-search/skill-search.js +12 -0
  156. package/dist/components/skill-search/skill-search.js.map +1 -0
  157. package/dist/components/wizard/category-grid.js +11 -0
  158. package/dist/components/wizard/category-grid.js.map +1 -0
  159. package/dist/components/wizard/category-grid.test.js +997 -0
  160. package/dist/components/wizard/category-grid.test.js.map +1 -0
  161. package/dist/components/wizard/domain-selection.js +14 -0
  162. package/dist/components/wizard/domain-selection.js.map +1 -0
  163. package/dist/components/wizard/help-modal.js +10 -0
  164. package/dist/components/wizard/help-modal.js.map +1 -0
  165. package/dist/components/wizard/menu-item.js +10 -0
  166. package/dist/components/wizard/menu-item.js.map +1 -0
  167. package/dist/components/wizard/search-modal.js +11 -0
  168. package/dist/components/wizard/search-modal.js.map +1 -0
  169. package/dist/components/wizard/search-modal.test.js +218 -0
  170. package/dist/components/wizard/search-modal.test.js.map +1 -0
  171. package/dist/components/wizard/section-progress.js +10 -0
  172. package/dist/components/wizard/section-progress.js.map +1 -0
  173. package/dist/components/wizard/section-progress.test.js +192 -0
  174. package/dist/components/wizard/section-progress.test.js.map +1 -0
  175. package/dist/components/wizard/source-grid.js +14 -0
  176. package/dist/components/wizard/source-grid.js.map +1 -0
  177. package/dist/components/wizard/source-grid.test.js +504 -0
  178. package/dist/components/wizard/source-grid.test.js.map +1 -0
  179. package/dist/components/wizard/stack-selection.js +17 -0
  180. package/dist/components/wizard/stack-selection.js.map +1 -0
  181. package/dist/components/wizard/step-build.js +17 -0
  182. package/dist/components/wizard/step-build.js.map +1 -0
  183. package/dist/components/wizard/step-build.test.js +600 -0
  184. package/dist/components/wizard/step-build.test.js.map +1 -0
  185. package/dist/components/wizard/step-confirm.js +12 -0
  186. package/dist/components/wizard/step-confirm.js.map +1 -0
  187. package/dist/components/wizard/step-confirm.test.js +366 -0
  188. package/dist/components/wizard/step-confirm.test.js.map +1 -0
  189. package/dist/components/wizard/step-refine.js +10 -0
  190. package/dist/components/wizard/step-refine.js.map +1 -0
  191. package/dist/components/wizard/step-refine.test.js +237 -0
  192. package/dist/components/wizard/step-refine.test.js.map +1 -0
  193. package/dist/components/wizard/step-settings.js +17 -0
  194. package/dist/components/wizard/step-settings.js.map +1 -0
  195. package/dist/components/wizard/step-settings.test.js +243 -0
  196. package/dist/components/wizard/step-settings.test.js.map +1 -0
  197. package/dist/components/wizard/step-sources.js +20 -0
  198. package/dist/components/wizard/step-sources.js.map +1 -0
  199. package/dist/components/wizard/step-sources.test.js +294 -0
  200. package/dist/components/wizard/step-sources.test.js.map +1 -0
  201. package/dist/components/wizard/step-stack.js +19 -0
  202. package/dist/components/wizard/step-stack.js.map +1 -0
  203. package/dist/components/wizard/step-stack.test.js +357 -0
  204. package/dist/components/wizard/step-stack.test.js.map +1 -0
  205. package/dist/components/wizard/view-title.js +10 -0
  206. package/dist/components/wizard/view-title.js.map +1 -0
  207. package/dist/components/wizard/wizard-layout.js +16 -0
  208. package/dist/components/wizard/wizard-layout.js.map +1 -0
  209. package/dist/components/wizard/wizard-tabs.js +14 -0
  210. package/dist/components/wizard/wizard-tabs.js.map +1 -0
  211. package/dist/components/wizard/wizard-tabs.test.js +294 -0
  212. package/dist/components/wizard/wizard-tabs.test.js.map +1 -0
  213. package/dist/components/wizard/wizard.js +35 -0
  214. package/dist/components/wizard/wizard.js.map +1 -0
  215. package/dist/config/skills-matrix.yaml +926 -0
  216. package/dist/config/stacks.yaml +2186 -0
  217. package/dist/hooks/init.js +40 -0
  218. package/dist/hooks/init.js.map +1 -0
  219. package/dist/index.js +10 -0
  220. package/dist/index.js.map +1 -0
  221. package/dist/magic-string.es-RGXYGAW3.js +1316 -0
  222. package/dist/magic-string.es-RGXYGAW3.js.map +1 -0
  223. package/dist/source-manager-SBPPLOQQ.js +16 -0
  224. package/dist/source-manager-SBPPLOQQ.js.map +1 -0
  225. package/dist/src/agents/_templates/agent.liquid +140 -0
  226. package/dist/src/agents/developer/api-developer/agent.yaml +12 -0
  227. package/dist/src/agents/developer/api-developer/critical-reminders.md +23 -0
  228. package/dist/src/agents/developer/api-developer/critical-requirements.md +11 -0
  229. package/dist/src/agents/developer/api-developer/examples.md +72 -0
  230. package/dist/src/agents/developer/api-developer/intro.md +22 -0
  231. package/dist/src/agents/developer/api-developer/output-format.md +359 -0
  232. package/dist/src/agents/developer/api-developer/workflow.md +471 -0
  233. package/dist/src/agents/developer/cli-developer/agent.yaml +12 -0
  234. package/dist/src/agents/developer/cli-developer/critical-reminders.md +28 -0
  235. package/dist/src/agents/developer/cli-developer/critical-requirements.md +15 -0
  236. package/dist/src/agents/developer/cli-developer/examples.md +68 -0
  237. package/dist/src/agents/developer/cli-developer/intro.md +23 -0
  238. package/dist/src/agents/developer/cli-developer/output-format.md +216 -0
  239. package/dist/src/agents/developer/cli-developer/workflow.md +509 -0
  240. package/dist/src/agents/developer/web-architecture/agent.yaml +12 -0
  241. package/dist/src/agents/developer/web-architecture/critical-reminders.md +27 -0
  242. package/dist/src/agents/developer/web-architecture/critical-requirements.md +35 -0
  243. package/dist/src/agents/developer/web-architecture/examples.md +187 -0
  244. package/dist/src/agents/developer/web-architecture/intro.md +35 -0
  245. package/dist/src/agents/developer/web-architecture/output-format.md +261 -0
  246. package/dist/src/agents/developer/web-architecture/workflow.md +599 -0
  247. package/dist/src/agents/developer/web-developer/agent.yaml +12 -0
  248. package/dist/src/agents/developer/web-developer/critical-reminders.md +17 -0
  249. package/dist/src/agents/developer/web-developer/critical-requirements.md +15 -0
  250. package/dist/src/agents/developer/web-developer/examples.md +109 -0
  251. package/dist/src/agents/developer/web-developer/intro.md +5 -0
  252. package/dist/src/agents/developer/web-developer/output-format.md +213 -0
  253. package/dist/src/agents/developer/web-developer/workflow.md +459 -0
  254. package/dist/src/agents/meta/agent-summoner/agent.yaml +12 -0
  255. package/dist/src/agents/meta/agent-summoner/critical-reminders.md +31 -0
  256. package/dist/src/agents/meta/agent-summoner/critical-requirements.md +27 -0
  257. package/dist/src/agents/meta/agent-summoner/examples.md +176 -0
  258. package/dist/src/agents/meta/agent-summoner/intro.md +9 -0
  259. package/dist/src/agents/meta/agent-summoner/output-format.md +115 -0
  260. package/dist/src/agents/meta/agent-summoner/workflow.md +1540 -0
  261. package/dist/src/agents/meta/documentor/agent.yaml +11 -0
  262. package/dist/src/agents/meta/documentor/critical-reminders.md +23 -0
  263. package/dist/src/agents/meta/documentor/critical-requirements.md +13 -0
  264. package/dist/src/agents/meta/documentor/examples.md +147 -0
  265. package/dist/src/agents/meta/documentor/intro.md +11 -0
  266. package/dist/src/agents/meta/documentor/output-format.md +237 -0
  267. package/dist/src/agents/meta/documentor/workflow.md +1271 -0
  268. package/dist/src/agents/meta/skill-summoner/agent.yaml +13 -0
  269. package/dist/src/agents/meta/skill-summoner/critical-reminders.md +73 -0
  270. package/dist/src/agents/meta/skill-summoner/critical-requirements.md +62 -0
  271. package/dist/src/agents/meta/skill-summoner/examples.md +116 -0
  272. package/dist/src/agents/meta/skill-summoner/intro.md +5 -0
  273. package/dist/src/agents/meta/skill-summoner/output-format.md +279 -0
  274. package/dist/src/agents/meta/skill-summoner/workflow.md +1485 -0
  275. package/dist/src/agents/migration/cli-migrator/agent.yaml +12 -0
  276. package/dist/src/agents/migration/cli-migrator/anti-patterns.md +158 -0
  277. package/dist/src/agents/migration/cli-migrator/conversion-mappings.md +63 -0
  278. package/dist/src/agents/migration/cli-migrator/critical-reminders.md +17 -0
  279. package/dist/src/agents/migration/cli-migrator/critical-requirements.md +13 -0
  280. package/dist/src/agents/migration/cli-migrator/intro.md +15 -0
  281. package/dist/src/agents/migration/cli-migrator/output-format.md +164 -0
  282. package/dist/src/agents/migration/cli-migrator/workflow.md +230 -0
  283. package/dist/src/agents/pattern/pattern-scout/agent.yaml +10 -0
  284. package/dist/src/agents/pattern/pattern-scout/critical-reminders.md +58 -0
  285. package/dist/src/agents/pattern/pattern-scout/critical-requirements.md +17 -0
  286. package/dist/src/agents/pattern/pattern-scout/examples.md +93 -0
  287. package/dist/src/agents/pattern/pattern-scout/intro.md +3 -0
  288. package/dist/src/agents/pattern/pattern-scout/output-format.md +196 -0
  289. package/dist/src/agents/pattern/pattern-scout/workflow.md +1901 -0
  290. package/dist/src/agents/pattern/web-pattern-critique/agent.yaml +12 -0
  291. package/dist/src/agents/pattern/web-pattern-critique/critical-reminders.md +13 -0
  292. package/dist/src/agents/pattern/web-pattern-critique/critical-requirements.md +11 -0
  293. package/dist/src/agents/pattern/web-pattern-critique/examples.md +56 -0
  294. package/dist/src/agents/pattern/web-pattern-critique/intro.md +5 -0
  295. package/dist/src/agents/pattern/web-pattern-critique/output-format.md +257 -0
  296. package/dist/src/agents/pattern/web-pattern-critique/workflow.md +674 -0
  297. package/dist/src/agents/planning/web-pm/agent.yaml +12 -0
  298. package/dist/src/agents/planning/web-pm/critical-reminders.md +21 -0
  299. package/dist/src/agents/planning/web-pm/critical-requirements.md +17 -0
  300. package/dist/src/agents/planning/web-pm/examples.md +85 -0
  301. package/dist/src/agents/planning/web-pm/intro.md +3 -0
  302. package/dist/src/agents/planning/web-pm/output-format.md +228 -0
  303. package/dist/src/agents/planning/web-pm/workflow.md +393 -0
  304. package/dist/src/agents/researcher/api-researcher/agent.yaml +10 -0
  305. package/dist/src/agents/researcher/api-researcher/critical-reminders.md +27 -0
  306. package/dist/src/agents/researcher/api-researcher/critical-requirements.md +13 -0
  307. package/dist/src/agents/researcher/api-researcher/examples.md +116 -0
  308. package/dist/src/agents/researcher/api-researcher/intro.md +32 -0
  309. package/dist/src/agents/researcher/api-researcher/output-format.md +135 -0
  310. package/dist/src/agents/researcher/api-researcher/workflow.md +261 -0
  311. package/dist/src/agents/researcher/web-researcher/agent.yaml +10 -0
  312. package/dist/src/agents/researcher/web-researcher/critical-reminders.md +23 -0
  313. package/dist/src/agents/researcher/web-researcher/critical-requirements.md +11 -0
  314. package/dist/src/agents/researcher/web-researcher/examples.md +126 -0
  315. package/dist/src/agents/researcher/web-researcher/intro.md +31 -0
  316. package/dist/src/agents/researcher/web-researcher/output-format.md +112 -0
  317. package/dist/src/agents/researcher/web-researcher/workflow.md +322 -0
  318. package/dist/src/agents/reviewer/api-reviewer/agent.yaml +12 -0
  319. package/dist/src/agents/reviewer/api-reviewer/critical-reminders.md +16 -0
  320. package/dist/src/agents/reviewer/api-reviewer/critical-requirements.md +13 -0
  321. package/dist/src/agents/reviewer/api-reviewer/examples.md +54 -0
  322. package/dist/src/agents/reviewer/api-reviewer/intro.md +22 -0
  323. package/dist/src/agents/reviewer/api-reviewer/output-format.md +288 -0
  324. package/dist/src/agents/reviewer/api-reviewer/workflow.md +369 -0
  325. package/dist/src/agents/reviewer/cli-reviewer/agent.yaml +12 -0
  326. package/dist/src/agents/reviewer/cli-reviewer/critical-reminders.md +17 -0
  327. package/dist/src/agents/reviewer/cli-reviewer/critical-requirements.md +13 -0
  328. package/dist/src/agents/reviewer/cli-reviewer/examples.md +83 -0
  329. package/dist/src/agents/reviewer/cli-reviewer/intro.md +21 -0
  330. package/dist/src/agents/reviewer/cli-reviewer/output-format.md +330 -0
  331. package/dist/src/agents/reviewer/cli-reviewer/workflow.md +294 -0
  332. package/dist/src/agents/reviewer/web-reviewer/agent.yaml +12 -0
  333. package/dist/src/agents/reviewer/web-reviewer/critical-reminders.md +17 -0
  334. package/dist/src/agents/reviewer/web-reviewer/critical-requirements.md +11 -0
  335. package/dist/src/agents/reviewer/web-reviewer/examples.md +79 -0
  336. package/dist/src/agents/reviewer/web-reviewer/intro.md +20 -0
  337. package/dist/src/agents/reviewer/web-reviewer/output-format.md +253 -0
  338. package/dist/src/agents/reviewer/web-reviewer/workflow.md +228 -0
  339. package/dist/src/agents/tester/cli-tester/agent.yaml +12 -0
  340. package/dist/src/agents/tester/cli-tester/critical-reminders.md +19 -0
  341. package/dist/src/agents/tester/cli-tester/critical-requirements.md +17 -0
  342. package/dist/src/agents/tester/cli-tester/examples.md +80 -0
  343. package/dist/src/agents/tester/cli-tester/intro.md +19 -0
  344. package/dist/src/agents/tester/cli-tester/output-format.md +232 -0
  345. package/dist/src/agents/tester/cli-tester/workflow.md +304 -0
  346. package/dist/src/agents/tester/web-tester/agent.yaml +12 -0
  347. package/dist/src/agents/tester/web-tester/critical-reminders.md +15 -0
  348. package/dist/src/agents/tester/web-tester/critical-requirements.md +11 -0
  349. package/dist/src/agents/tester/web-tester/examples.md +68 -0
  350. package/dist/src/agents/tester/web-tester/intro.md +18 -0
  351. package/dist/src/agents/tester/web-tester/output-format.md +252 -0
  352. package/dist/src/agents/tester/web-tester/workflow.md +507 -0
  353. package/dist/stores/wizard-store.js +13 -0
  354. package/dist/stores/wizard-store.js.map +1 -0
  355. package/dist/stores/wizard-store.test.js +689 -0
  356. package/dist/stores/wizard-store.test.js.map +1 -0
  357. package/package.json +134 -0
  358. package/src/agents/_templates/agent.liquid +140 -0
  359. package/src/agents/developer/api-developer/agent.yaml +12 -0
  360. package/src/agents/developer/api-developer/critical-reminders.md +23 -0
  361. package/src/agents/developer/api-developer/critical-requirements.md +11 -0
  362. package/src/agents/developer/api-developer/examples.md +72 -0
  363. package/src/agents/developer/api-developer/intro.md +22 -0
  364. package/src/agents/developer/api-developer/output-format.md +359 -0
  365. package/src/agents/developer/api-developer/workflow.md +471 -0
  366. package/src/agents/developer/cli-developer/agent.yaml +12 -0
  367. package/src/agents/developer/cli-developer/critical-reminders.md +28 -0
  368. package/src/agents/developer/cli-developer/critical-requirements.md +15 -0
  369. package/src/agents/developer/cli-developer/examples.md +68 -0
  370. package/src/agents/developer/cli-developer/intro.md +23 -0
  371. package/src/agents/developer/cli-developer/output-format.md +216 -0
  372. package/src/agents/developer/cli-developer/workflow.md +509 -0
  373. package/src/agents/developer/web-architecture/agent.yaml +12 -0
  374. package/src/agents/developer/web-architecture/critical-reminders.md +27 -0
  375. package/src/agents/developer/web-architecture/critical-requirements.md +35 -0
  376. package/src/agents/developer/web-architecture/examples.md +187 -0
  377. package/src/agents/developer/web-architecture/intro.md +35 -0
  378. package/src/agents/developer/web-architecture/output-format.md +261 -0
  379. package/src/agents/developer/web-architecture/workflow.md +599 -0
  380. package/src/agents/developer/web-developer/agent.yaml +12 -0
  381. package/src/agents/developer/web-developer/critical-reminders.md +17 -0
  382. package/src/agents/developer/web-developer/critical-requirements.md +15 -0
  383. package/src/agents/developer/web-developer/examples.md +109 -0
  384. package/src/agents/developer/web-developer/intro.md +5 -0
  385. package/src/agents/developer/web-developer/output-format.md +213 -0
  386. package/src/agents/developer/web-developer/workflow.md +459 -0
  387. package/src/agents/meta/agent-summoner/agent.yaml +12 -0
  388. package/src/agents/meta/agent-summoner/critical-reminders.md +31 -0
  389. package/src/agents/meta/agent-summoner/critical-requirements.md +27 -0
  390. package/src/agents/meta/agent-summoner/examples.md +176 -0
  391. package/src/agents/meta/agent-summoner/intro.md +9 -0
  392. package/src/agents/meta/agent-summoner/output-format.md +115 -0
  393. package/src/agents/meta/agent-summoner/workflow.md +1540 -0
  394. package/src/agents/meta/documentor/agent.yaml +11 -0
  395. package/src/agents/meta/documentor/critical-reminders.md +23 -0
  396. package/src/agents/meta/documentor/critical-requirements.md +13 -0
  397. package/src/agents/meta/documentor/examples.md +147 -0
  398. package/src/agents/meta/documentor/intro.md +11 -0
  399. package/src/agents/meta/documentor/output-format.md +237 -0
  400. package/src/agents/meta/documentor/workflow.md +1271 -0
  401. package/src/agents/meta/skill-summoner/agent.yaml +13 -0
  402. package/src/agents/meta/skill-summoner/critical-reminders.md +73 -0
  403. package/src/agents/meta/skill-summoner/critical-requirements.md +62 -0
  404. package/src/agents/meta/skill-summoner/examples.md +116 -0
  405. package/src/agents/meta/skill-summoner/intro.md +5 -0
  406. package/src/agents/meta/skill-summoner/output-format.md +279 -0
  407. package/src/agents/meta/skill-summoner/workflow.md +1485 -0
  408. package/src/agents/migration/cli-migrator/agent.yaml +12 -0
  409. package/src/agents/migration/cli-migrator/anti-patterns.md +158 -0
  410. package/src/agents/migration/cli-migrator/conversion-mappings.md +63 -0
  411. package/src/agents/migration/cli-migrator/critical-reminders.md +17 -0
  412. package/src/agents/migration/cli-migrator/critical-requirements.md +13 -0
  413. package/src/agents/migration/cli-migrator/intro.md +15 -0
  414. package/src/agents/migration/cli-migrator/output-format.md +164 -0
  415. package/src/agents/migration/cli-migrator/workflow.md +230 -0
  416. package/src/agents/pattern/pattern-scout/agent.yaml +10 -0
  417. package/src/agents/pattern/pattern-scout/critical-reminders.md +58 -0
  418. package/src/agents/pattern/pattern-scout/critical-requirements.md +17 -0
  419. package/src/agents/pattern/pattern-scout/examples.md +93 -0
  420. package/src/agents/pattern/pattern-scout/intro.md +3 -0
  421. package/src/agents/pattern/pattern-scout/output-format.md +196 -0
  422. package/src/agents/pattern/pattern-scout/workflow.md +1901 -0
  423. package/src/agents/pattern/web-pattern-critique/agent.yaml +12 -0
  424. package/src/agents/pattern/web-pattern-critique/critical-reminders.md +13 -0
  425. package/src/agents/pattern/web-pattern-critique/critical-requirements.md +11 -0
  426. package/src/agents/pattern/web-pattern-critique/examples.md +56 -0
  427. package/src/agents/pattern/web-pattern-critique/intro.md +5 -0
  428. package/src/agents/pattern/web-pattern-critique/output-format.md +257 -0
  429. package/src/agents/pattern/web-pattern-critique/workflow.md +674 -0
  430. package/src/agents/planning/web-pm/agent.yaml +12 -0
  431. package/src/agents/planning/web-pm/critical-reminders.md +21 -0
  432. package/src/agents/planning/web-pm/critical-requirements.md +17 -0
  433. package/src/agents/planning/web-pm/examples.md +85 -0
  434. package/src/agents/planning/web-pm/intro.md +3 -0
  435. package/src/agents/planning/web-pm/output-format.md +228 -0
  436. package/src/agents/planning/web-pm/workflow.md +393 -0
  437. package/src/agents/researcher/api-researcher/agent.yaml +10 -0
  438. package/src/agents/researcher/api-researcher/critical-reminders.md +27 -0
  439. package/src/agents/researcher/api-researcher/critical-requirements.md +13 -0
  440. package/src/agents/researcher/api-researcher/examples.md +116 -0
  441. package/src/agents/researcher/api-researcher/intro.md +32 -0
  442. package/src/agents/researcher/api-researcher/output-format.md +135 -0
  443. package/src/agents/researcher/api-researcher/workflow.md +261 -0
  444. package/src/agents/researcher/web-researcher/agent.yaml +10 -0
  445. package/src/agents/researcher/web-researcher/critical-reminders.md +23 -0
  446. package/src/agents/researcher/web-researcher/critical-requirements.md +11 -0
  447. package/src/agents/researcher/web-researcher/examples.md +126 -0
  448. package/src/agents/researcher/web-researcher/intro.md +31 -0
  449. package/src/agents/researcher/web-researcher/output-format.md +112 -0
  450. package/src/agents/researcher/web-researcher/workflow.md +322 -0
  451. package/src/agents/reviewer/api-reviewer/agent.yaml +12 -0
  452. package/src/agents/reviewer/api-reviewer/critical-reminders.md +16 -0
  453. package/src/agents/reviewer/api-reviewer/critical-requirements.md +13 -0
  454. package/src/agents/reviewer/api-reviewer/examples.md +54 -0
  455. package/src/agents/reviewer/api-reviewer/intro.md +22 -0
  456. package/src/agents/reviewer/api-reviewer/output-format.md +288 -0
  457. package/src/agents/reviewer/api-reviewer/workflow.md +369 -0
  458. package/src/agents/reviewer/cli-reviewer/agent.yaml +12 -0
  459. package/src/agents/reviewer/cli-reviewer/critical-reminders.md +17 -0
  460. package/src/agents/reviewer/cli-reviewer/critical-requirements.md +13 -0
  461. package/src/agents/reviewer/cli-reviewer/examples.md +83 -0
  462. package/src/agents/reviewer/cli-reviewer/intro.md +21 -0
  463. package/src/agents/reviewer/cli-reviewer/output-format.md +330 -0
  464. package/src/agents/reviewer/cli-reviewer/workflow.md +294 -0
  465. package/src/agents/reviewer/web-reviewer/agent.yaml +12 -0
  466. package/src/agents/reviewer/web-reviewer/critical-reminders.md +17 -0
  467. package/src/agents/reviewer/web-reviewer/critical-requirements.md +11 -0
  468. package/src/agents/reviewer/web-reviewer/examples.md +79 -0
  469. package/src/agents/reviewer/web-reviewer/intro.md +20 -0
  470. package/src/agents/reviewer/web-reviewer/output-format.md +253 -0
  471. package/src/agents/reviewer/web-reviewer/workflow.md +228 -0
  472. package/src/agents/tester/cli-tester/agent.yaml +12 -0
  473. package/src/agents/tester/cli-tester/critical-reminders.md +19 -0
  474. package/src/agents/tester/cli-tester/critical-requirements.md +17 -0
  475. package/src/agents/tester/cli-tester/examples.md +80 -0
  476. package/src/agents/tester/cli-tester/intro.md +19 -0
  477. package/src/agents/tester/cli-tester/output-format.md +232 -0
  478. package/src/agents/tester/cli-tester/workflow.md +304 -0
  479. package/src/agents/tester/web-tester/agent.yaml +12 -0
  480. package/src/agents/tester/web-tester/critical-reminders.md +15 -0
  481. package/src/agents/tester/web-tester/critical-requirements.md +11 -0
  482. package/src/agents/tester/web-tester/examples.md +68 -0
  483. package/src/agents/tester/web-tester/intro.md +18 -0
  484. package/src/agents/tester/web-tester/output-format.md +252 -0
  485. package/src/agents/tester/web-tester/workflow.md +507 -0
  486. package/src/schemas/agent-frontmatter.schema.json +84 -0
  487. package/src/schemas/agent.schema.json +93 -0
  488. package/src/schemas/hooks.schema.json +47 -0
  489. package/src/schemas/marketplace.schema.json +119 -0
  490. package/src/schemas/metadata.schema.json +113 -0
  491. package/src/schemas/plugin.schema.json +130 -0
  492. package/src/schemas/project-config.schema.json +125 -0
  493. package/src/schemas/project-source-config.schema.json +81 -0
  494. package/src/schemas/skill-frontmatter.schema.json +42 -0
  495. package/src/schemas/skills-matrix.schema.json +467 -0
  496. package/src/schemas/stack.schema.json +191 -0
  497. package/src/schemas/stacks.schema.json +111 -0
@@ -0,0 +1,361 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ INFO_MESSAGES,
4
+ STATUS_MESSAGES
5
+ } from "../../chunk-R74PZWQS.js";
6
+ import {
7
+ BaseCommand,
8
+ EXIT_CODES
9
+ } from "../../chunk-ODUOU55D.js";
10
+ import {
11
+ IMPORT_DEFAULTS,
12
+ computeFileHash,
13
+ fetchFromSource,
14
+ getCurrentDate
15
+ } from "../../chunk-MM7NK5N2.js";
16
+ import "../../chunk-T4EXUIBY.js";
17
+ import {
18
+ copy,
19
+ directoryExists,
20
+ ensureDir,
21
+ fileExists,
22
+ getErrorMessage,
23
+ importedSkillMetadataSchema,
24
+ listDirectories,
25
+ readFile,
26
+ writeFile
27
+ } from "../../chunk-BZN2Z5P7.js";
28
+ import {
29
+ DEFAULT_SKILLS_SUBDIR,
30
+ GITHUB_SOURCE,
31
+ LOCAL_SKILLS_PATH,
32
+ STANDARD_FILES,
33
+ YAML_FORMATTING
34
+ } from "../../chunk-LAPCUV4D.js";
35
+ import {
36
+ init_esm_shims
37
+ } from "../../chunk-DHET7RCE.js";
38
+
39
+ // src/cli/commands/import/skill.ts
40
+ init_esm_shims();
41
+ import { Args, Flags } from "@oclif/core";
42
+ import path from "path";
43
+ import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
44
+ var SKILL_MD_FILE = STANDARD_FILES.SKILL_MD;
45
+ var METADATA_YAML_FILE = STANDARD_FILES.METADATA_YAML;
46
+ var METADATA_JSON_FILE = STANDARD_FILES.METADATA_JSON;
47
+ function parseGitHubSource(source) {
48
+ if (source.startsWith(GITHUB_SOURCE.HTTPS_PREFIX)) {
49
+ const path2 = source.replace(GITHUB_SOURCE.HTTPS_PREFIX, "");
50
+ return {
51
+ gigetSource: `${GITHUB_SOURCE.GITHUB_PREFIX}${path2}`,
52
+ displaySource: source
53
+ };
54
+ }
55
+ if (source.startsWith(GITHUB_SOURCE.GITHUB_PREFIX) || source.startsWith(GITHUB_SOURCE.GH_PREFIX)) {
56
+ const normalized = source.startsWith(GITHUB_SOURCE.GH_PREFIX) ? GITHUB_SOURCE.GITHUB_PREFIX + source.slice(GITHUB_SOURCE.GH_PREFIX.length) : source;
57
+ return {
58
+ gigetSource: normalized,
59
+ displaySource: `${GITHUB_SOURCE.HTTPS_PREFIX}${normalized.replace(GITHUB_SOURCE.GITHUB_PREFIX, "")}`
60
+ };
61
+ }
62
+ if (source.includes("/") && !source.includes(":")) {
63
+ return {
64
+ gigetSource: `${GITHUB_SOURCE.GITHUB_PREFIX}${source}`,
65
+ displaySource: `${GITHUB_SOURCE.HTTPS_PREFIX}${source}`
66
+ };
67
+ }
68
+ return {
69
+ gigetSource: source,
70
+ displaySource: source
71
+ };
72
+ }
73
+ async function discoverValidSkills(skillsDir, skillDirs) {
74
+ const validSkills = [];
75
+ for (const skillDir of skillDirs) {
76
+ const skillMdPath = path.join(skillsDir, skillDir, SKILL_MD_FILE);
77
+ if (await fileExists(skillMdPath)) {
78
+ validSkills.push(skillDir);
79
+ }
80
+ }
81
+ return validSkills.sort();
82
+ }
83
+ var ImportSkill = class _ImportSkill extends BaseCommand {
84
+ static summary = "Import a skill from a third-party GitHub repository";
85
+ static description = "Download and import skills from external GitHub repositories into your local .claude/skills/ directory. Supports importing specific skills or listing available skills.";
86
+ static examples = [
87
+ {
88
+ description: "List available skills from a repository",
89
+ command: "<%= config.bin %> import skill github:vercel-labs/agent-skills --list"
90
+ },
91
+ {
92
+ description: "Import a specific skill",
93
+ command: "<%= config.bin %> import skill github:vercel-labs/agent-skills --skill react-best-practices"
94
+ },
95
+ {
96
+ description: "Import all skills from a repository",
97
+ command: "<%= config.bin %> import skill github:vercel-labs/agent-skills --all"
98
+ },
99
+ {
100
+ description: "Import with custom skills directory",
101
+ command: "<%= config.bin %> import skill github:owner/repo --skill my-skill --subdir custom-skills"
102
+ }
103
+ ];
104
+ static args = {
105
+ source: Args.string({
106
+ description: "GitHub repository source (github:owner/repo, https://github.com/owner/repo, or owner/repo)",
107
+ required: true
108
+ })
109
+ };
110
+ static flags = {
111
+ ...BaseCommand.baseFlags,
112
+ skill: Flags.string({
113
+ char: "n",
114
+ description: "Name of the specific skill to import",
115
+ required: false
116
+ }),
117
+ all: Flags.boolean({
118
+ char: "a",
119
+ description: "Import all skills from the repository",
120
+ default: false
121
+ }),
122
+ list: Flags.boolean({
123
+ char: "l",
124
+ description: "List available skills without importing",
125
+ default: false
126
+ }),
127
+ subdir: Flags.string({
128
+ description: "Subdirectory containing skills (default: skills)",
129
+ default: DEFAULT_SKILLS_SUBDIR
130
+ }),
131
+ force: Flags.boolean({
132
+ char: "f",
133
+ description: "Overwrite existing skills",
134
+ default: false
135
+ }),
136
+ refresh: Flags.boolean({
137
+ description: "Force refresh from remote (ignore cache)",
138
+ default: false
139
+ })
140
+ };
141
+ async run() {
142
+ const { args, flags } = await this.parse(_ImportSkill);
143
+ const projectDir = process.cwd();
144
+ this.log("");
145
+ this.log("Import Third-Party Skill");
146
+ this.log("");
147
+ if (!flags.list && !flags.skill && !flags.all) {
148
+ this.error("Please specify --skill <name>, --all, or --list to list available skills", {
149
+ exit: EXIT_CODES.INVALID_ARGS
150
+ });
151
+ }
152
+ if (flags.skill && flags.all) {
153
+ this.error("Cannot use --skill and --all together", {
154
+ exit: EXIT_CODES.INVALID_ARGS
155
+ });
156
+ }
157
+ const { gigetSource, displaySource } = parseGitHubSource(args.source);
158
+ this.log(`Source: ${displaySource}`);
159
+ this.log(STATUS_MESSAGES.FETCHING_REPOSITORY);
160
+ let repoPath;
161
+ try {
162
+ const result = await fetchFromSource(gigetSource, {
163
+ forceRefresh: flags.refresh
164
+ });
165
+ repoPath = result.path;
166
+ this.log(result.fromCache ? "Using cached source" : "Downloaded fresh copy");
167
+ } catch (error) {
168
+ this.error(error instanceof Error ? error.message : `Failed to fetch: ${args.source}`, {
169
+ exit: EXIT_CODES.NETWORK_ERROR
170
+ });
171
+ }
172
+ const subdir = flags.subdir;
173
+ if (/\0/.test(subdir)) {
174
+ this.error("--subdir contains null bytes", {
175
+ exit: EXIT_CODES.INVALID_ARGS
176
+ });
177
+ }
178
+ if (path.isAbsolute(subdir)) {
179
+ this.error(`--subdir must be a relative path, got: ${subdir}`, {
180
+ exit: EXIT_CODES.INVALID_ARGS
181
+ });
182
+ }
183
+ const skillsDir = path.resolve(path.join(repoPath, subdir));
184
+ const resolvedRepoPath = path.resolve(repoPath);
185
+ if (!skillsDir.startsWith(resolvedRepoPath + path.sep) && skillsDir !== resolvedRepoPath) {
186
+ this.error(`--subdir path escapes repository boundary: ${subdir}`, {
187
+ exit: EXIT_CODES.INVALID_ARGS
188
+ });
189
+ }
190
+ if (!await directoryExists(skillsDir)) {
191
+ this.error(
192
+ `Skills directory not found: ${flags.subdir}
193
+ The repository doesn't have a '${flags.subdir}' directory.
194
+ Use --subdir to specify a different location.`,
195
+ { exit: EXIT_CODES.INVALID_ARGS }
196
+ );
197
+ }
198
+ const skillDirs = await listDirectories(skillsDir);
199
+ const availableSkills = await discoverValidSkills(skillsDir, skillDirs);
200
+ if (availableSkills.length === 0) {
201
+ this.error(`No valid skills found in ${flags.subdir}/
202
+ Skills must have a SKILL.md file.`, {
203
+ exit: EXIT_CODES.ERROR
204
+ });
205
+ }
206
+ if (flags.list) {
207
+ this.log("");
208
+ this.log(`Available skills (${availableSkills.length}):`);
209
+ this.log("");
210
+ for (const skill of availableSkills) {
211
+ this.log(` - ${skill}`);
212
+ }
213
+ this.log("");
214
+ this.log("Use --skill <name> to import a specific skill, or --all to import all.");
215
+ return;
216
+ }
217
+ let skillsToImport = [];
218
+ if (flags.all) {
219
+ skillsToImport = availableSkills;
220
+ } else if (flags.skill) {
221
+ if (!availableSkills.includes(flags.skill)) {
222
+ this.error(
223
+ `Skill '${flags.skill}' not found in repository.
224
+ Available skills: ${availableSkills.join(", ")}
225
+ Use --list to see all available skills.`,
226
+ { exit: EXIT_CODES.INVALID_ARGS }
227
+ );
228
+ }
229
+ skillsToImport = [flags.skill];
230
+ }
231
+ const destDir = path.join(projectDir, LOCAL_SKILLS_PATH);
232
+ if (flags["dry-run"]) {
233
+ this.log("");
234
+ this.log("[DRY RUN] Would import the following skills:");
235
+ for (const skill of skillsToImport) {
236
+ const destPath = path.join(destDir, skill);
237
+ const exists = await directoryExists(destPath);
238
+ this.log(` - ${skill} -> ${destPath}${exists ? " (exists)" : ""}`);
239
+ }
240
+ return;
241
+ }
242
+ this.log("");
243
+ this.log(`Importing ${skillsToImport.length} skill(s)...`);
244
+ let imported = 0;
245
+ let skipped = 0;
246
+ for (const skillName of skillsToImport) {
247
+ const sourcePath = path.join(skillsDir, skillName);
248
+ const destPath = path.join(destDir, skillName);
249
+ if (await directoryExists(destPath)) {
250
+ if (!flags.force) {
251
+ this.warn(`Skipping '${skillName}': already exists. Use --force to overwrite.`);
252
+ skipped++;
253
+ continue;
254
+ }
255
+ }
256
+ try {
257
+ await this.importSkill(sourcePath, destPath, skillName, displaySource);
258
+ this.logSuccess(`Imported: ${skillName}`);
259
+ imported++;
260
+ } catch (error) {
261
+ this.warn(`Failed to import '${skillName}': ${getErrorMessage(error)}`);
262
+ skipped++;
263
+ }
264
+ }
265
+ this.log("");
266
+ this.logSuccess(`Import complete: ${imported} imported, ${skipped} skipped`);
267
+ this.log(`Skills location: ${destDir}`);
268
+ this.log("");
269
+ this.log(INFO_MESSAGES.RUN_COMPILE);
270
+ this.log("");
271
+ }
272
+ async importSkill(sourcePath, destPath, skillName, source) {
273
+ const skillMdPath = path.join(sourcePath, SKILL_MD_FILE);
274
+ if (!await fileExists(skillMdPath)) {
275
+ throw new Error(
276
+ `Missing required SKILL.md file at ${skillMdPath}
277
+ Every skill must have a SKILL.md file containing the skill's prompt content.
278
+ Create one with:
279
+ echo "# ${skillName}" > ${path.join(sourcePath, SKILL_MD_FILE)}`
280
+ );
281
+ }
282
+ const contentHash = await computeFileHash(skillMdPath);
283
+ await ensureDir(path.dirname(destPath));
284
+ await copy(sourcePath, destPath);
285
+ await this.injectForkedFromMetadata(destPath, skillName, source, contentHash);
286
+ }
287
+ async injectForkedFromMetadata(destPath, skillName, source, contentHash) {
288
+ const metadataYamlPath = path.join(destPath, METADATA_YAML_FILE);
289
+ const metadataJsonPath = path.join(destPath, METADATA_JSON_FILE);
290
+ const forkedFrom = {
291
+ source,
292
+ skill_name: skillName,
293
+ content_hash: contentHash,
294
+ date: getCurrentDate()
295
+ };
296
+ if (await fileExists(metadataYamlPath)) {
297
+ const rawContent = await readFile(metadataYamlPath);
298
+ const lines = rawContent.split("\n");
299
+ let yamlContent2 = rawContent;
300
+ let schemaComment = "";
301
+ if (lines[0]?.startsWith("# yaml-language-server:")) {
302
+ schemaComment = `${lines[0]}
303
+ `;
304
+ yamlContent2 = lines.slice(1).join("\n");
305
+ }
306
+ const raw = parseYaml(yamlContent2);
307
+ const parseResult = importedSkillMetadataSchema.safeParse(raw);
308
+ if (!parseResult.success) {
309
+ this.warn(
310
+ `Malformed metadata.yaml at ${metadataYamlPath} \u2014 existing fields may be lost
311
+ Validation errors: ${parseResult.error.issues.map((i) => i.message).join(", ")}
312
+ Expected fields: cli_name (string), cli_description (string), category (string)
313
+ Validate your YAML syntax at https://yamllint.com`
314
+ );
315
+ }
316
+ const metadata = parseResult.success ? parseResult.data : { forked_from: void 0 };
317
+ metadata.forked_from = forkedFrom;
318
+ const newYamlContent = stringifyYaml(metadata, {
319
+ lineWidth: YAML_FORMATTING.LINE_WIDTH_NONE
320
+ });
321
+ await writeFile(metadataYamlPath, schemaComment + newYamlContent);
322
+ return;
323
+ }
324
+ if (await fileExists(metadataJsonPath)) {
325
+ const rawContent = await readFile(metadataJsonPath);
326
+ let jsonParsed;
327
+ try {
328
+ jsonParsed = JSON.parse(rawContent);
329
+ } catch {
330
+ this.warn(
331
+ `Malformed JSON in ${metadataJsonPath} \u2014 skipping metadata injection
332
+ Common issues: trailing commas, unquoted keys, single quotes instead of double quotes
333
+ Validate your JSON at https://jsonlint.com`
334
+ );
335
+ return;
336
+ }
337
+ const jsonResult = importedSkillMetadataSchema.safeParse(jsonParsed);
338
+ const metadata = jsonResult.success ? jsonResult.data : { forked_from: void 0 };
339
+ metadata.forked_from = forkedFrom;
340
+ const yamlContent2 = stringifyYaml(metadata, { lineWidth: YAML_FORMATTING.LINE_WIDTH_NONE });
341
+ await writeFile(metadataYamlPath, yamlContent2);
342
+ return;
343
+ }
344
+ const minimalMetadata = {
345
+ cli_name: skillName.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" "),
346
+ cli_description: "Imported from third-party repository",
347
+ category: IMPORT_DEFAULTS.CATEGORY,
348
+ category_exclusive: false,
349
+ author: IMPORT_DEFAULTS.AUTHOR,
350
+ forked_from: forkedFrom
351
+ };
352
+ const yamlContent = stringifyYaml(minimalMetadata, {
353
+ lineWidth: YAML_FORMATTING.LINE_WIDTH_NONE
354
+ });
355
+ await writeFile(metadataYamlPath, yamlContent);
356
+ }
357
+ };
358
+ export {
359
+ ImportSkill as default
360
+ };
361
+ //# sourceMappingURL=skill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/cli/commands/import/skill.ts"],"sourcesContent":["import { Args, Flags } from \"@oclif/core\";\nimport path from \"path\";\nimport { parse as parseYaml, stringify as stringifyYaml } from \"yaml\";\nimport { BaseCommand } from \"../../base-command.js\";\nimport { getErrorMessage } from \"../../utils/errors.js\";\nimport { EXIT_CODES } from \"../../lib/exit-codes.js\";\nimport { fetchFromSource } from \"../../lib/loading/index.js\";\nimport { importedSkillMetadataSchema } from \"../../lib/schemas.js\";\nimport { getCurrentDate, computeFileHash } from \"../../lib/versioning.js\";\nimport {\n copy,\n directoryExists,\n fileExists,\n listDirectories,\n readFile,\n writeFile,\n ensureDir,\n} from \"../../utils/fs.js\";\nimport {\n DEFAULT_SKILLS_SUBDIR,\n GITHUB_SOURCE,\n LOCAL_SKILLS_PATH,\n STANDARD_FILES,\n YAML_FORMATTING,\n} from \"../../consts.js\";\nimport { IMPORT_DEFAULTS } from \"../../lib/metadata-keys.js\";\nimport { STATUS_MESSAGES, INFO_MESSAGES } from \"../../utils/messages.js\";\n\n/**\n * Metadata for tracking third-party imports. Different from ForkedFromMetadata\n * in skill-metadata.ts which tracks internal fork lineage (uses skill_id\n * instead of source/skill_name).\n */\ntype ImportedForkedFromMetadata = {\n source: string;\n skill_name: string;\n content_hash: string;\n date: string;\n};\n\ntype SkillMetadata = {\n forked_from?: ImportedForkedFromMetadata;\n [key: string]: unknown;\n};\n\nconst SKILL_MD_FILE = STANDARD_FILES.SKILL_MD;\nconst METADATA_YAML_FILE = STANDARD_FILES.METADATA_YAML;\nconst METADATA_JSON_FILE = STANDARD_FILES.METADATA_JSON;\n\nfunction parseGitHubSource(source: string): {\n gigetSource: string;\n displaySource: string;\n} {\n if (source.startsWith(GITHUB_SOURCE.HTTPS_PREFIX)) {\n const path = source.replace(GITHUB_SOURCE.HTTPS_PREFIX, \"\");\n return {\n gigetSource: `${GITHUB_SOURCE.GITHUB_PREFIX}${path}`,\n displaySource: source,\n };\n }\n\n if (\n source.startsWith(GITHUB_SOURCE.GITHUB_PREFIX) ||\n source.startsWith(GITHUB_SOURCE.GH_PREFIX)\n ) {\n const normalized = source.startsWith(GITHUB_SOURCE.GH_PREFIX)\n ? GITHUB_SOURCE.GITHUB_PREFIX + source.slice(GITHUB_SOURCE.GH_PREFIX.length)\n : source;\n return {\n gigetSource: normalized,\n displaySource: `${GITHUB_SOURCE.HTTPS_PREFIX}${normalized.replace(GITHUB_SOURCE.GITHUB_PREFIX, \"\")}`,\n };\n }\n\n if (source.includes(\"/\") && !source.includes(\":\")) {\n return {\n gigetSource: `${GITHUB_SOURCE.GITHUB_PREFIX}${source}`,\n displaySource: `${GITHUB_SOURCE.HTTPS_PREFIX}${source}`,\n };\n }\n\n return {\n gigetSource: source,\n displaySource: source,\n };\n}\n\nasync function discoverValidSkills(skillsDir: string, skillDirs: string[]): Promise<string[]> {\n const validSkills: string[] = [];\n\n for (const skillDir of skillDirs) {\n const skillMdPath = path.join(skillsDir, skillDir, SKILL_MD_FILE);\n if (await fileExists(skillMdPath)) {\n validSkills.push(skillDir);\n }\n }\n\n return validSkills.sort();\n}\n\nexport default class ImportSkill extends BaseCommand {\n static summary = \"Import a skill from a third-party GitHub repository\";\n static description =\n \"Download and import skills from external GitHub repositories into your local \" +\n \".claude/skills/ directory. Supports importing specific skills or listing available skills.\";\n\n static examples = [\n {\n description: \"List available skills from a repository\",\n command: \"<%= config.bin %> import skill github:vercel-labs/agent-skills --list\",\n },\n {\n description: \"Import a specific skill\",\n command:\n \"<%= config.bin %> import skill github:vercel-labs/agent-skills --skill react-best-practices\",\n },\n {\n description: \"Import all skills from a repository\",\n command: \"<%= config.bin %> import skill github:vercel-labs/agent-skills --all\",\n },\n {\n description: \"Import with custom skills directory\",\n command:\n \"<%= config.bin %> import skill github:owner/repo --skill my-skill --subdir custom-skills\",\n },\n ];\n\n static args = {\n source: Args.string({\n description:\n \"GitHub repository source (github:owner/repo, https://github.com/owner/repo, or owner/repo)\",\n required: true,\n }),\n };\n\n static flags = {\n ...BaseCommand.baseFlags,\n skill: Flags.string({\n char: \"n\",\n description: \"Name of the specific skill to import\",\n required: false,\n }),\n all: Flags.boolean({\n char: \"a\",\n description: \"Import all skills from the repository\",\n default: false,\n }),\n list: Flags.boolean({\n char: \"l\",\n description: \"List available skills without importing\",\n default: false,\n }),\n subdir: Flags.string({\n description: \"Subdirectory containing skills (default: skills)\",\n default: DEFAULT_SKILLS_SUBDIR,\n }),\n force: Flags.boolean({\n char: \"f\",\n description: \"Overwrite existing skills\",\n default: false,\n }),\n refresh: Flags.boolean({\n description: \"Force refresh from remote (ignore cache)\",\n default: false,\n }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(ImportSkill);\n const projectDir = process.cwd();\n\n this.log(\"\");\n this.log(\"Import Third-Party Skill\");\n this.log(\"\");\n\n if (!flags.list && !flags.skill && !flags.all) {\n this.error(\"Please specify --skill <name>, --all, or --list to list available skills\", {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n\n if (flags.skill && flags.all) {\n this.error(\"Cannot use --skill and --all together\", {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n\n const { gigetSource, displaySource } = parseGitHubSource(args.source);\n this.log(`Source: ${displaySource}`);\n\n this.log(STATUS_MESSAGES.FETCHING_REPOSITORY);\n\n let repoPath: string;\n try {\n const result = await fetchFromSource(gigetSource, {\n forceRefresh: flags.refresh,\n });\n repoPath = result.path;\n this.log(result.fromCache ? \"Using cached source\" : \"Downloaded fresh copy\");\n } catch (error) {\n this.error(error instanceof Error ? error.message : `Failed to fetch: ${args.source}`, {\n exit: EXIT_CODES.NETWORK_ERROR,\n });\n }\n\n // Validate --subdir to prevent path traversal outside repository boundary\n const subdir = flags.subdir;\n if (/\\0/.test(subdir)) {\n this.error(\"--subdir contains null bytes\", {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n if (path.isAbsolute(subdir)) {\n this.error(`--subdir must be a relative path, got: ${subdir}`, {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n const skillsDir = path.resolve(path.join(repoPath, subdir));\n const resolvedRepoPath = path.resolve(repoPath);\n if (!skillsDir.startsWith(resolvedRepoPath + path.sep) && skillsDir !== resolvedRepoPath) {\n this.error(`--subdir path escapes repository boundary: ${subdir}`, {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n\n if (!(await directoryExists(skillsDir))) {\n this.error(\n `Skills directory not found: ${flags.subdir}\\n` +\n `The repository doesn't have a '${flags.subdir}' directory.\\n` +\n `Use --subdir to specify a different location.`,\n { exit: EXIT_CODES.INVALID_ARGS },\n );\n }\n\n const skillDirs = await listDirectories(skillsDir);\n const availableSkills = await discoverValidSkills(skillsDir, skillDirs);\n\n if (availableSkills.length === 0) {\n this.error(`No valid skills found in ${flags.subdir}/\\nSkills must have a SKILL.md file.`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n if (flags.list) {\n this.log(\"\");\n this.log(`Available skills (${availableSkills.length}):`);\n this.log(\"\");\n for (const skill of availableSkills) {\n this.log(` - ${skill}`);\n }\n this.log(\"\");\n this.log(\"Use --skill <name> to import a specific skill, or --all to import all.\");\n return;\n }\n\n let skillsToImport: string[] = [];\n\n if (flags.all) {\n skillsToImport = availableSkills;\n } else if (flags.skill) {\n if (!availableSkills.includes(flags.skill)) {\n this.error(\n `Skill '${flags.skill}' not found in repository.\\n` +\n `Available skills: ${availableSkills.join(\", \")}\\n` +\n `Use --list to see all available skills.`,\n { exit: EXIT_CODES.INVALID_ARGS },\n );\n }\n skillsToImport = [flags.skill];\n }\n\n const destDir = path.join(projectDir, LOCAL_SKILLS_PATH);\n\n if (flags[\"dry-run\"]) {\n this.log(\"\");\n this.log(\"[DRY RUN] Would import the following skills:\");\n for (const skill of skillsToImport) {\n const destPath = path.join(destDir, skill);\n const exists = await directoryExists(destPath);\n this.log(` - ${skill} -> ${destPath}${exists ? \" (exists)\" : \"\"}`);\n }\n return;\n }\n\n this.log(\"\");\n this.log(`Importing ${skillsToImport.length} skill(s)...`);\n\n let imported = 0;\n let skipped = 0;\n\n for (const skillName of skillsToImport) {\n const sourcePath = path.join(skillsDir, skillName);\n const destPath = path.join(destDir, skillName);\n\n if (await directoryExists(destPath)) {\n if (!flags.force) {\n this.warn(`Skipping '${skillName}': already exists. Use --force to overwrite.`);\n skipped++;\n continue;\n }\n }\n\n try {\n await this.importSkill(sourcePath, destPath, skillName, displaySource);\n this.logSuccess(`Imported: ${skillName}`);\n imported++;\n } catch (error) {\n this.warn(`Failed to import '${skillName}': ${getErrorMessage(error)}`);\n skipped++;\n }\n }\n\n this.log(\"\");\n this.logSuccess(`Import complete: ${imported} imported, ${skipped} skipped`);\n this.log(`Skills location: ${destDir}`);\n this.log(\"\");\n this.log(INFO_MESSAGES.RUN_COMPILE);\n this.log(\"\");\n }\n\n private async importSkill(\n sourcePath: string,\n destPath: string,\n skillName: string,\n source: string,\n ): Promise<void> {\n const skillMdPath = path.join(sourcePath, SKILL_MD_FILE);\n if (!(await fileExists(skillMdPath))) {\n throw new Error(\n `Missing required SKILL.md file at ${skillMdPath}\\n` +\n `Every skill must have a SKILL.md file containing the skill's prompt content.\\n` +\n `Create one with:\\n` +\n ` echo \"# ${skillName}\" > ${path.join(sourcePath, SKILL_MD_FILE)}`,\n );\n }\n\n const contentHash = await computeFileHash(skillMdPath);\n\n await ensureDir(path.dirname(destPath));\n await copy(sourcePath, destPath);\n\n await this.injectForkedFromMetadata(destPath, skillName, source, contentHash);\n }\n\n private async injectForkedFromMetadata(\n destPath: string,\n skillName: string,\n source: string,\n contentHash: string,\n ): Promise<void> {\n const metadataYamlPath = path.join(destPath, METADATA_YAML_FILE);\n const metadataJsonPath = path.join(destPath, METADATA_JSON_FILE);\n\n const forkedFrom: ImportedForkedFromMetadata = {\n source,\n skill_name: skillName,\n content_hash: contentHash,\n date: getCurrentDate(),\n };\n\n if (await fileExists(metadataYamlPath)) {\n const rawContent = await readFile(metadataYamlPath);\n const lines = rawContent.split(\"\\n\");\n let yamlContent = rawContent;\n let schemaComment = \"\";\n\n if (lines[0]?.startsWith(\"# yaml-language-server:\")) {\n schemaComment = `${lines[0]}\\n`;\n yamlContent = lines.slice(1).join(\"\\n\");\n }\n\n const raw = parseYaml(yamlContent);\n const parseResult = importedSkillMetadataSchema.safeParse(raw);\n if (!parseResult.success) {\n this.warn(\n `Malformed metadata.yaml at ${metadataYamlPath} — existing fields may be lost\\n` +\n ` Validation errors: ${parseResult.error.issues.map((i) => i.message).join(\", \")}\\n` +\n ` Expected fields: cli_name (string), cli_description (string), category (string)\\n` +\n ` Validate your YAML syntax at https://yamllint.com`,\n );\n }\n const metadata = parseResult.success\n ? (parseResult.data as SkillMetadata)\n : { forked_from: undefined };\n metadata.forked_from = forkedFrom;\n\n const newYamlContent = stringifyYaml(metadata, {\n lineWidth: YAML_FORMATTING.LINE_WIDTH_NONE,\n });\n await writeFile(metadataYamlPath, schemaComment + newYamlContent);\n return;\n }\n\n if (await fileExists(metadataJsonPath)) {\n const rawContent = await readFile(metadataJsonPath);\n let jsonParsed: unknown;\n try {\n jsonParsed = JSON.parse(rawContent);\n } catch {\n this.warn(\n `Malformed JSON in ${metadataJsonPath} — skipping metadata injection\\n` +\n ` Common issues: trailing commas, unquoted keys, single quotes instead of double quotes\\n` +\n ` Validate your JSON at https://jsonlint.com`,\n );\n return;\n }\n const jsonResult = importedSkillMetadataSchema.safeParse(jsonParsed);\n const metadata = jsonResult.success\n ? (jsonResult.data as SkillMetadata)\n : { forked_from: undefined };\n metadata.forked_from = forkedFrom;\n\n const yamlContent = stringifyYaml(metadata, { lineWidth: YAML_FORMATTING.LINE_WIDTH_NONE });\n await writeFile(metadataYamlPath, yamlContent);\n return;\n }\n\n const minimalMetadata: SkillMetadata = {\n cli_name: skillName\n .split(\"-\")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \"),\n cli_description: \"Imported from third-party repository\",\n category: IMPORT_DEFAULTS.CATEGORY,\n category_exclusive: false,\n author: IMPORT_DEFAULTS.AUTHOR,\n forked_from: forkedFrom,\n };\n\n const yamlContent = stringifyYaml(minimalMetadata, {\n lineWidth: YAML_FORMATTING.LINE_WIDTH_NONE,\n });\n await writeFile(metadataYamlPath, yamlContent);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,MAAM,aAAa;AAC5B,OAAO,UAAU;AACjB,SAAS,SAAS,WAAW,aAAa,qBAAqB;AA2C/D,IAAM,gBAAgB,eAAe;AACrC,IAAM,qBAAqB,eAAe;AAC1C,IAAM,qBAAqB,eAAe;AAE1C,SAAS,kBAAkB,QAGzB;AACA,MAAI,OAAO,WAAW,cAAc,YAAY,GAAG;AACjD,UAAMA,QAAO,OAAO,QAAQ,cAAc,cAAc,EAAE;AAC1D,WAAO;AAAA,MACL,aAAa,GAAG,cAAc,aAAa,GAAGA,KAAI;AAAA,MAClD,eAAe;AAAA,IACjB;AAAA,EACF;AAEA,MACE,OAAO,WAAW,cAAc,aAAa,KAC7C,OAAO,WAAW,cAAc,SAAS,GACzC;AACA,UAAM,aAAa,OAAO,WAAW,cAAc,SAAS,IACxD,cAAc,gBAAgB,OAAO,MAAM,cAAc,UAAU,MAAM,IACzE;AACJ,WAAO;AAAA,MACL,aAAa;AAAA,MACb,eAAe,GAAG,cAAc,YAAY,GAAG,WAAW,QAAQ,cAAc,eAAe,EAAE,CAAC;AAAA,IACpG;AAAA,EACF;AAEA,MAAI,OAAO,SAAS,GAAG,KAAK,CAAC,OAAO,SAAS,GAAG,GAAG;AACjD,WAAO;AAAA,MACL,aAAa,GAAG,cAAc,aAAa,GAAG,MAAM;AAAA,MACpD,eAAe,GAAG,cAAc,YAAY,GAAG,MAAM;AAAA,IACvD;AAAA,EACF;AAEA,SAAO;AAAA,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{
6
+ BaseCommand,
7
+ EXIT_CODES
8
+ } from "../chunk-ODUOU55D.js";
9
+ import {
10
+ discoverLocalSkills,
11
+ loadSkillsMatrixFromSource
12
+ } from "../chunk-MM7NK5N2.js";
13
+ import "../chunk-T4EXUIBY.js";
14
+ import {
15
+ fileExists,
16
+ readFile
17
+ } from "../chunk-BZN2Z5P7.js";
18
+ import {
19
+ STANDARD_FILES
20
+ } from "../chunk-LAPCUV4D.js";
21
+ import {
22
+ init_esm_shims
23
+ } from "../chunk-DHET7RCE.js";
24
+
25
+ // src/cli/commands/info.ts
26
+ init_esm_shims();
27
+ import { Args, Flags } from "@oclif/core";
28
+ import path from "path";
29
+ var CONTENT_PREVIEW_LINES = 10;
30
+ var MAX_LINE_LENGTH = 80;
31
+ var MAX_SUGGESTIONS = 5;
32
+ function stripFrontmatter(content) {
33
+ const lines = content.split("\n");
34
+ let inFrontmatter = false;
35
+ let frontmatterEndIndex = 0;
36
+ for (let i = 0; i < lines.length; i++) {
37
+ const line = lines[i].trim();
38
+ if (line === "---") {
39
+ if (!inFrontmatter) {
40
+ inFrontmatter = true;
41
+ } else {
42
+ frontmatterEndIndex = i + 1;
43
+ break;
44
+ }
45
+ }
46
+ }
47
+ return lines.slice(frontmatterEndIndex).join("\n");
48
+ }
49
+ function getPreviewLines(content, maxLines) {
50
+ const body = stripFrontmatter(content);
51
+ const lines = body.split("\n");
52
+ const result = [];
53
+ for (const line of lines) {
54
+ if (result.length >= maxLines) break;
55
+ if (line.trim() || result.length > 0) {
56
+ const truncated = line.length > MAX_LINE_LENGTH ? `${line.slice(0, MAX_LINE_LENGTH - 3)}...` : line;
57
+ result.push(truncated);
58
+ }
59
+ }
60
+ return result;
61
+ }
62
+ function formatRelations(relations) {
63
+ if (relations.length === 0) {
64
+ return "(none)";
65
+ }
66
+ return relations.map((r) => r.skillId).join(", ");
67
+ }
68
+ function formatRequirements(requirements) {
69
+ if (requirements.length === 0) {
70
+ return "(none)";
71
+ }
72
+ return requirements.map((req) => {
73
+ const prefix = req.needsAny ? "any of: " : "";
74
+ return prefix + req.skillIds.join(", ");
75
+ }).join("; ");
76
+ }
77
+ function formatTags(tags) {
78
+ if (tags.length === 0) {
79
+ return "(none)";
80
+ }
81
+ return tags.join(", ");
82
+ }
83
+ function findSuggestions(skills, query, maxSuggestions) {
84
+ const lowerQuery = query.toLowerCase();
85
+ const matches = [];
86
+ for (const skill of Object.values(skills)) {
87
+ if (!skill) continue;
88
+ if (matches.length >= maxSuggestions) break;
89
+ if (skill.id.toLowerCase().includes(lowerQuery) || skill.displayName?.toLowerCase().includes(lowerQuery)) {
90
+ matches.push(skill.id);
91
+ }
92
+ }
93
+ return matches;
94
+ }
95
+ function formatSkillInfo(skill, isInstalled) {
96
+ const lines = [];
97
+ lines.push(`Skill: ${skill.id}`);
98
+ if (skill.displayName) {
99
+ lines.push(`Alias: ${skill.displayName}`);
100
+ }
101
+ lines.push(`Author: ${skill.author}`);
102
+ lines.push(`Category: ${skill.category}`);
103
+ lines.push("");
104
+ lines.push("Description:");
105
+ lines.push(` ${skill.description}`);
106
+ lines.push("");
107
+ lines.push(`Tags: ${formatTags(skill.tags)}`);
108
+ lines.push("");
109
+ lines.push(`Requires: ${formatRequirements(skill.requires)}`);
110
+ lines.push(`Conflicts with: ${formatRelations(skill.conflictsWith)}`);
111
+ lines.push(`Recommends: ${formatRelations(skill.recommends)}`);
112
+ if (skill.usageGuidance) {
113
+ lines.push("");
114
+ lines.push("Usage Guidance:");
115
+ lines.push(` ${skill.usageGuidance}`);
116
+ }
117
+ lines.push("");
118
+ lines.push(`Local Status: ${isInstalled ? "Installed" : "Not installed"}`);
119
+ return lines.join("\n");
120
+ }
121
+ var Info = class _Info extends BaseCommand {
122
+ static summary = "Show detailed information about a skill";
123
+ static description = "Display comprehensive information about a skill including metadata, relationships, and content preview";
124
+ static examples = [
125
+ {
126
+ description: "Show info for a skill by ID",
127
+ command: "<%= config.bin %> <%= command.id %> web-framework-react"
128
+ },
129
+ {
130
+ description: "Show info without content preview",
131
+ command: "<%= config.bin %> <%= command.id %> web-framework-react --no-preview"
132
+ },
133
+ {
134
+ description: "Show info from a custom source",
135
+ command: "<%= config.bin %> <%= command.id %> my-skill --source github:org/marketplace"
136
+ }
137
+ ];
138
+ static args = {
139
+ skill: Args.string({
140
+ description: "Skill ID or alias to look up",
141
+ required: true
142
+ })
143
+ };
144
+ static flags = {
145
+ ...BaseCommand.baseFlags,
146
+ preview: Flags.boolean({
147
+ description: "Show content preview from SKILL.md",
148
+ default: true,
149
+ allowNo: true
150
+ })
151
+ };
152
+ async run() {
153
+ const { args, flags } = await this.parse(_Info);
154
+ try {
155
+ this.log(STATUS_MESSAGES.LOADING_SKILLS);
156
+ const { matrix, sourcePath, isLocal } = await loadSkillsMatrixFromSource({
157
+ sourceFlag: flags.source
158
+ });
159
+ this.log(`Loaded from ${isLocal ? "local" : "remote"}: ${sourcePath}`);
160
+ let skill = matrix.skills[args.skill];
161
+ if (!skill) {
162
+ const fullId = matrix.displayNameToId[args.skill];
163
+ if (fullId) {
164
+ skill = matrix.skills[fullId];
165
+ }
166
+ }
167
+ if (!skill) {
168
+ const suggestions = findSuggestions(matrix.skills, args.skill, MAX_SUGGESTIONS);
169
+ this.log("");
170
+ this.error(`Skill "${args.skill}" not found.`, { exit: false });
171
+ if (suggestions.length > 0) {
172
+ this.log("");
173
+ this.log("Did you mean one of these?");
174
+ for (const suggestion of suggestions) {
175
+ this.log(` - ${suggestion}`);
176
+ }
177
+ }
178
+ this.log("");
179
+ this.logInfo("Use 'cc search <query>' to find available skills.");
180
+ this.log("");
181
+ this.exit(EXIT_CODES.ERROR);
182
+ }
183
+ const localSkillsResult = await discoverLocalSkills(process.cwd());
184
+ const localSkillIds = localSkillsResult?.skills.map((s) => s.id) || [];
185
+ const isInstalled = localSkillIds.includes(skill.id);
186
+ this.log("");
187
+ this.log(formatSkillInfo(skill, isInstalled));
188
+ if (flags.preview) {
189
+ let skillMdPath;
190
+ if (skill.local && skill.localPath) {
191
+ skillMdPath = path.join(process.cwd(), skill.localPath, STANDARD_FILES.SKILL_MD);
192
+ } else {
193
+ const sourceDir = isLocal ? sourcePath : path.dirname(sourcePath);
194
+ skillMdPath = path.join(sourceDir, skill.path, STANDARD_FILES.SKILL_MD);
195
+ }
196
+ if (await fileExists(skillMdPath)) {
197
+ const content = await readFile(skillMdPath);
198
+ const previewLines = getPreviewLines(content, CONTENT_PREVIEW_LINES);
199
+ if (previewLines.length > 0) {
200
+ this.log("");
201
+ this.log(`--- Content Preview (first ${CONTENT_PREVIEW_LINES} lines) ---`);
202
+ for (const line of previewLines) {
203
+ this.log(line);
204
+ }
205
+ }
206
+ }
207
+ }
208
+ this.log("");
209
+ } catch (error) {
210
+ this.handleError(error);
211
+ }
212
+ }
213
+ };
214
+ export {
215
+ Info as default
216
+ };
217
+ //# sourceMappingURL=info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/cli/commands/info.ts"],"sourcesContent":["import { Args, Flags } from \"@oclif/core\";\nimport path from \"path\";\nimport { BaseCommand } from \"../base-command.js\";\nimport { loadSkillsMatrixFromSource } from \"../lib/loading/index.js\";\nimport { discoverLocalSkills } from \"../lib/skills/index.js\";\nimport { fileExists, readFile } from \"../utils/fs.js\";\nimport { STANDARD_FILES } from \"../consts.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { STATUS_MESSAGES } from \"../utils/messages.js\";\nimport type {\n ResolvedSkill,\n SkillDisplayName,\n SkillId,\n SkillRelation,\n SkillRequirement,\n} from \"../types/index.js\";\n\nconst CONTENT_PREVIEW_LINES = 10;\nconst MAX_LINE_LENGTH = 80;\nconst MAX_SUGGESTIONS = 5;\n\nfunction stripFrontmatter(content: string): string {\n const lines = content.split(\"\\n\");\n let inFrontmatter = false;\n let frontmatterEndIndex = 0;\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i].trim();\n if (line === \"---\") {\n if (!inFrontmatter) {\n inFrontmatter = true;\n } else {\n frontmatterEndIndex = i + 1;\n break;\n }\n }\n }\n\n return lines.slice(frontmatterEndIndex).join(\"\\n\");\n}\n\nfunction getPreviewLines(content: string, maxLines: number): string[] {\n const body = stripFrontmatter(content);\n const lines = body.split(\"\\n\");\n const result: string[] = [];\n\n for (const line of lines) {\n if (result.length >= maxLines) break;\n if (line.trim() || result.length > 0) {\n const truncated =\n line.length > MAX_LINE_LENGTH ? `${line.slice(0, MAX_LINE_LENGTH - 3)}...` : line;\n result.push(truncated);\n }\n }\n\n return result;\n}\n\nfunction formatRelations(relations: SkillRelation[]): string {\n if (relations.length === 0) {\n return \"(none)\";\n }\n return relations.map((r) => r.skillId).join(\", \");\n}\n\nfunction formatRequirements(requirements: SkillRequirement[]): string {\n if (requirements.length === 0) {\n return \"(none)\";\n }\n return requirements\n .map((req) => {\n const prefix = req.needsAny ? \"any of: \" : \"\";\n return prefix + req.skillIds.join(\", \");\n })\n .join(\"; \");\n}\n\nfunction formatTags(tags: string[]): string {\n if (tags.length === 0) {\n return \"(none)\";\n }\n return tags.join(\", \");\n}\n\nfunction findSuggestions(\n skills: Partial<Record<SkillId, ResolvedSkill>>,\n query: string,\n maxSuggestions: number,\n): string[] {\n const lowerQuery = query.toLowerCase();\n const matches: string[] = [];\n\n for (const skill of Object.values(skills)) {\n if (!skill) continue;\n if (matches.length >= maxSuggestions) break;\n if (\n skill.id.toLowerCase().includes(lowerQuery) ||\n skill.displayName?.toLowerCase().includes(lowerQuery)\n ) {\n matches.push(skill.id);\n }\n }\n\n return matches;\n}\n\nfunction formatSkillInfo(skill: ResolvedSkill, isInstalled: boolean): string {\n const lines: string[] = [];\n\n lines.push(`Skill: ${skill.id}`);\n if (skill.displayName) {\n lines.push(`Alias: ${skill.displayName}`);\n }\n lines.push(`Author: ${skill.author}`);\n lines.push(`Category: ${skill.category}`);\n lines.push(\"\");\n lines.push(\"Description:\");\n lines.push(` ${skill.description}`);\n lines.push(\"\");\n lines.push(`Tags: ${formatTags(skill.tags)}`);\n lines.push(\"\");\n lines.push(`Requires: ${formatRequirements(skill.requires)}`);\n lines.push(`Conflicts with: ${formatRelations(skill.conflictsWith)}`);\n lines.push(`Recommends: ${formatRelations(skill.recommends)}`);\n\n if (skill.usageGuidance) {\n lines.push(\"\");\n lines.push(\"Usage Guidance:\");\n lines.push(` ${skill.usageGuidance}`);\n }\n\n lines.push(\"\");\n lines.push(`Local Status: ${isInstalled ? \"Installed\" : \"Not installed\"}`);\n\n return lines.join(\"\\n\");\n}\n\nexport default class Info extends BaseCommand {\n static summary = \"Show detailed information about a skill\";\n static description =\n \"Display comprehensive information about a skill including metadata, relationships, and content preview\";\n\n static examples = [\n {\n description: \"Show info for a skill by ID\",\n command: \"<%= config.bin %> <%= command.id %> web-framework-react\",\n },\n {\n description: \"Show info without content preview\",\n command: \"<%= config.bin %> <%= command.id %> web-framework-react --no-preview\",\n },\n {\n description: \"Show info from a custom source\",\n command: \"<%= config.bin %> <%= command.id %> my-skill --source github:org/marketplace\",\n },\n ];\n\n static args = {\n skill: Args.string({\n description: \"Skill ID or alias to look up\",\n required: true,\n }),\n };\n\n static flags = {\n ...BaseCommand.baseFlags,\n preview: Flags.boolean({\n description: \"Show content preview from SKILL.md\",\n default: true,\n allowNo: true,\n }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(Info);\n\n try {\n this.log(STATUS_MESSAGES.LOADING_SKILLS);\n\n const { matrix, sourcePath, isLocal } = await loadSkillsMatrixFromSource({\n sourceFlag: flags.source,\n });\n\n this.log(`Loaded from ${isLocal ? \"local\" : \"remote\"}: ${sourcePath}`);\n\n // CLI arg is an untyped string — cast at data boundary\n let skill: ResolvedSkill | undefined = matrix.skills[args.skill as SkillId];\n\n if (!skill) {\n // Try alias lookup — CLI arg is an untyped string\n const fullId = matrix.displayNameToId[args.skill as SkillDisplayName];\n if (fullId) {\n skill = matrix.skills[fullId];\n }\n }\n\n if (!skill) {\n const suggestions = findSuggestions(matrix.skills, args.skill, MAX_SUGGESTIONS);\n\n this.log(\"\");\n this.error(`Skill \"${args.skill}\" not found.`, { exit: false });\n\n if (suggestions.length > 0) {\n this.log(\"\");\n this.log(\"Did you mean one of these?\");\n for (const suggestion of suggestions) {\n this.log(` - ${suggestion}`);\n }\n }\n\n this.log(\"\");\n this.logInfo(\"Use 'cc search <query>' to find available skills.\");\n this.log(\"\");\n this.exit(EXIT_CODES.ERROR);\n }\n\n const localSkillsResult = await discoverLocalSkills(process.cwd());\n const localSkillIds = localSkillsResult?.skills.map((s) => s.id) || [];\n const isInstalled = localSkillIds.includes(skill.id);\n\n this.log(\"\");\n this.log(formatSkillInfo(skill, isInstalled));\n\n if (flags.preview) {\n let skillMdPath: string;\n\n if (skill.local && skill.localPath) {\n skillMdPath = path.join(process.cwd(), skill.localPath, STANDARD_FILES.SKILL_MD);\n } else {\n const sourceDir = isLocal ? sourcePath : path.dirname(sourcePath);\n skillMdPath = path.join(sourceDir, skill.path, STANDARD_FILES.SKILL_MD);\n }\n\n if (await fileExists(skillMdPath)) {\n const content = await readFile(skillMdPath);\n const previewLines = getPreviewLines(content, CONTENT_PREVIEW_LINES);\n\n if (previewLines.length > 0) {\n this.log(\"\");\n this.log(`--- Content Preview (first ${CONTENT_PREVIEW_LINES} lines) ---`);\n for (const line of previewLines) {\n this.log(line);\n }\n }\n }\n }\n\n this.log(\"\");\n } catch (error) {\n this.handleError(error);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,MAAM,aAAa;AAC5B,OAAO,UAAU;AAgBjB,IAAM,wBAAwB;AAC9B,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AAExB,SAAS,iBAAiB,SAAyB;AACjD,QAAM,QAAQ,QAAQ,MAAM,IAAI;AAChC,MAAI,gBAAgB;AACpB,MAAI,sBAAsB;AAE1B,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,UAAM,OAAO,MAAM,CAAC,EAAE,KAAK;AAC3B,QAAI,SAAS,OAAO;AAClB,UAA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