incitaciones 0.1.0

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 (318) hide show
  1. package/LICENSE +395 -0
  2. package/README.md +410 -0
  3. package/content/distilled/abstraction-miner.md +32 -0
  4. package/content/distilled/adversarial-stakeholder-evaluation.md +121 -0
  5. package/content/distilled/anti-slop-prose.md +46 -0
  6. package/content/distilled/bias-audit.md +39 -0
  7. package/content/distilled/code-review/SKILL.md +53 -0
  8. package/content/distilled/code-review/references/criteria.md +50 -0
  9. package/content/distilled/code-review/references/templates.md +75 -0
  10. package/content/distilled/code-review/references/variants.md +32 -0
  11. package/content/distilled/commit/SKILL.md +41 -0
  12. package/content/distilled/commit/references/criteria.md +21 -0
  13. package/content/distilled/commit/references/templates.md +46 -0
  14. package/content/distilled/composability-diagnostician.md +67 -0
  15. package/content/distilled/context-guardian.md +20 -0
  16. package/content/distilled/create-handoff/SKILL.md +16 -0
  17. package/content/distilled/create-handoff/references/handoff-template.md +65 -0
  18. package/content/distilled/create-handoff/references/naming.md +7 -0
  19. package/content/distilled/create-issues/SKILL.md +72 -0
  20. package/content/distilled/create-issues/references/criteria.md +44 -0
  21. package/content/distilled/create-issues/references/templates.md +75 -0
  22. package/content/distilled/create-plan/SKILL.md +19 -0
  23. package/content/distilled/create-plan/references/plan-template.md +87 -0
  24. package/content/distilled/create-plan/references/scenarios.md +19 -0
  25. package/content/distilled/debug/SKILL.md +42 -0
  26. package/content/distilled/debug/references/criteria.md +27 -0
  27. package/content/distilled/debug/references/templates.md +39 -0
  28. package/content/distilled/describe-pr/SKILL.md +17 -0
  29. package/content/distilled/describe-pr/references/pr-template.md +62 -0
  30. package/content/distilled/design-practice.md +213 -0
  31. package/content/distilled/design-review/SKILL.md +29 -0
  32. package/content/distilled/design-review/references/combined-review.md +27 -0
  33. package/content/distilled/design-review/references/decision-matrix.md +122 -0
  34. package/content/distilled/design-review/references/problem-statement.md +141 -0
  35. package/content/distilled/design-review/references/report-template.md +36 -0
  36. package/content/distilled/design-review/references/scope-document.md +51 -0
  37. package/content/distilled/distill-prompt/SKILL.md +41 -0
  38. package/content/distilled/distill-prompt/references/criteria.md +26 -0
  39. package/content/distilled/distill-prompt/references/templates.md +30 -0
  40. package/content/distilled/doc-link-verifier/SKILL.md +212 -0
  41. package/content/distilled/doc-link-verifier/scripts/check_links.py +453 -0
  42. package/content/distilled/doc-link-verifier/scripts/extract_links.py +521 -0
  43. package/content/distilled/edge-case-discovery.md +123 -0
  44. package/content/distilled/error-handling-diagnostician.md +90 -0
  45. package/content/distilled/extract-prompt.md +220 -0
  46. package/content/distilled/formal-verification-evaluator.md +158 -0
  47. package/content/distilled/grill-me.md +24 -0
  48. package/content/distilled/guided-review.md +68 -0
  49. package/content/distilled/implement-documentation.md +68 -0
  50. package/content/distilled/implement-plan/SKILL.md +23 -0
  51. package/content/distilled/implement-plan/references/common-situations.md +36 -0
  52. package/content/distilled/implement-plan/references/verification-template.md +18 -0
  53. package/content/distilled/invalid-states-diagnostician.md +63 -0
  54. package/content/distilled/issue-review/SKILL.md +37 -0
  55. package/content/distilled/issue-review/references/convergence.md +19 -0
  56. package/content/distilled/issue-review/references/final-report.md +60 -0
  57. package/content/distilled/issue-review/references/pass-1-clarity.md +28 -0
  58. package/content/distilled/issue-review/references/pass-2-scope.md +22 -0
  59. package/content/distilled/issue-review/references/pass-3-dependencies.md +23 -0
  60. package/content/distilled/issue-review/references/pass-4-alignment.md +17 -0
  61. package/content/distilled/issue-review/references/pass-5-executability.md +17 -0
  62. package/content/distilled/issue-review/references/setup.md +25 -0
  63. package/content/distilled/iterate-plan/SKILL.md +24 -0
  64. package/content/distilled/iterate-plan/references/change-template.md +15 -0
  65. package/content/distilled/iterate-plan/references/common-scenarios.md +14 -0
  66. package/content/distilled/julia-performance-diagnostician.md +71 -0
  67. package/content/distilled/modularity-diagnostician.md +68 -0
  68. package/content/distilled/multi-agent-review.md +196 -0
  69. package/content/distilled/mutability-diagnostician.md +63 -0
  70. package/content/distilled/narrative-article.md +60 -0
  71. package/content/distilled/optionality-review.md +190 -0
  72. package/content/distilled/parallel-review/SKILL.md +49 -0
  73. package/content/distilled/parallel-review/references/criteria.md +34 -0
  74. package/content/distilled/parallel-review/references/templates.md +59 -0
  75. package/content/distilled/plan-review/SKILL.md +42 -0
  76. package/content/distilled/plan-review/references/criteria.md +51 -0
  77. package/content/distilled/plan-review/references/templates.md +67 -0
  78. package/content/distilled/pre-mortem.md +10 -0
  79. package/content/distilled/project-status-report.md +124 -0
  80. package/content/distilled/pwa-accessibility-review.md +81 -0
  81. package/content/distilled/rca-diagnostician/SKILL.md +30 -0
  82. package/content/distilled/rca-diagnostician/references/action-hierarchy.md +77 -0
  83. package/content/distilled/rca-diagnostician/references/bias-countermeasures.md +64 -0
  84. package/content/distilled/rca-diagnostician/references/evidence-timeline.md +49 -0
  85. package/content/distilled/rca-diagnostician/references/hypothesis-methods.md +53 -0
  86. package/content/distilled/rca-diagnostician/references/problem-definition.md +34 -0
  87. package/content/distilled/rca-diagnostician/references/report-template.md +75 -0
  88. package/content/distilled/rca-diagnostician/references/rigor-checklist.md +66 -0
  89. package/content/distilled/red-team-review.md +133 -0
  90. package/content/distilled/research-codebase/SKILL.md +22 -0
  91. package/content/distilled/research-codebase/references/report-template.md +75 -0
  92. package/content/distilled/research-codebase/references/search-patterns.md +27 -0
  93. package/content/distilled/research-documentation.md +79 -0
  94. package/content/distilled/research-review/SKILL.md +42 -0
  95. package/content/distilled/research-review/references/criteria.md +51 -0
  96. package/content/distilled/research-review/references/templates.md +73 -0
  97. package/content/distilled/resonant-refactor.md +45 -0
  98. package/content/distilled/resume-handoff/SKILL.md +19 -0
  99. package/content/distilled/resume-handoff/references/analysis-template.md +40 -0
  100. package/content/distilled/resume-handoff/references/locating.md +12 -0
  101. package/content/distilled/review-documentation.md +44 -0
  102. package/content/distilled/rigidity-diagnostician.md +70 -0
  103. package/content/distilled/rule-of-5-universal/SKILL.md +26 -0
  104. package/content/distilled/rule-of-5-universal/references/criteria.md +34 -0
  105. package/content/distilled/rule-of-5-universal/references/examples.md +69 -0
  106. package/content/distilled/rule-of-5-universal/references/templates.md +136 -0
  107. package/content/distilled/specification-evaluation-diagnostician.md +106 -0
  108. package/content/distilled/specification-review/SKILL.md +43 -0
  109. package/content/distilled/specification-review/references/criteria.md +51 -0
  110. package/content/distilled/specification-review/references/templates.md +67 -0
  111. package/content/distilled/systematic-housekeeping.md +27 -0
  112. package/content/distilled/tdd/SKILL.md +38 -0
  113. package/content/distilled/tdd/references/criteria.md +26 -0
  114. package/content/distilled/tdd/references/templates.md +53 -0
  115. package/content/distilled/test-abstraction-miner.md +43 -0
  116. package/content/distilled/test-friction.md +51 -0
  117. package/content/distilled/testability-implementability-evaluator.md +144 -0
  118. package/content/distilled/ui-align.md +32 -0
  119. package/content/distilled/ux-dx-evaluation-diagnostician/SKILL.md +21 -0
  120. package/content/distilled/ux-dx-evaluation-diagnostician/references/layer-1-product.md +20 -0
  121. package/content/distilled/ux-dx-evaluation-diagnostician/references/layer-2-engineering.md +20 -0
  122. package/content/distilled/ux-dx-evaluation-diagnostician/references/layer-3-interface.md +23 -0
  123. package/content/distilled/ux-dx-evaluation-diagnostician/references/layer-4-ecosystem.md +20 -0
  124. package/content/distilled/ux-dx-evaluation-diagnostician/references/layer-5-documentation.md +19 -0
  125. package/content/distilled/ux-dx-evaluation-diagnostician/references/report-template.md +36 -0
  126. package/content/distilled/verification-diagnostician.md +90 -0
  127. package/content/distilled/verify-prompt/SKILL.md +32 -0
  128. package/content/distilled/verify-prompt/references/criteria.md +21 -0
  129. package/content/manifest.json +3220 -0
  130. package/package.json +50 -0
  131. package/pi-package/README.md +9 -0
  132. package/pi-package/prompts/abstraction-miner.md +10 -0
  133. package/pi-package/prompts/adversarial-stakeholder-evaluation.md +10 -0
  134. package/pi-package/prompts/anti-slop-prose.md +10 -0
  135. package/pi-package/prompts/bias-audit.md +10 -0
  136. package/pi-package/prompts/code-review.md +10 -0
  137. package/pi-package/prompts/commit.md +10 -0
  138. package/pi-package/prompts/composability-diagnostician.md +10 -0
  139. package/pi-package/prompts/context-guardian.md +10 -0
  140. package/pi-package/prompts/create-handoff.md +10 -0
  141. package/pi-package/prompts/create-issues.md +10 -0
  142. package/pi-package/prompts/create-plan.md +10 -0
  143. package/pi-package/prompts/debug.md +10 -0
  144. package/pi-package/prompts/describe-pr.md +10 -0
  145. package/pi-package/prompts/design-practice.md +10 -0
  146. package/pi-package/prompts/design-review.md +10 -0
  147. package/pi-package/prompts/distill-prompt.md +10 -0
  148. package/pi-package/prompts/doc-link-verifier.md +10 -0
  149. package/pi-package/prompts/edge-case-discovery.md +10 -0
  150. package/pi-package/prompts/error-handling-diagnostician.md +10 -0
  151. package/pi-package/prompts/extract-prompt.md +10 -0
  152. package/pi-package/prompts/formal-verification-evaluator.md +10 -0
  153. package/pi-package/prompts/grill-me.md +10 -0
  154. package/pi-package/prompts/guided-review.md +10 -0
  155. package/pi-package/prompts/implement-documentation.md +10 -0
  156. package/pi-package/prompts/implement-plan.md +10 -0
  157. package/pi-package/prompts/invalid-states-diagnostician.md +10 -0
  158. package/pi-package/prompts/issue-review.md +10 -0
  159. package/pi-package/prompts/iterate-plan.md +10 -0
  160. package/pi-package/prompts/julia-performance-diagnostician.md +10 -0
  161. package/pi-package/prompts/modularity-diagnostician.md +10 -0
  162. package/pi-package/prompts/multi-agent-review.md +10 -0
  163. package/pi-package/prompts/mutability-diagnostician.md +10 -0
  164. package/pi-package/prompts/narrative-article.md +10 -0
  165. package/pi-package/prompts/optionality-review.md +10 -0
  166. package/pi-package/prompts/parallel-review.md +10 -0
  167. package/pi-package/prompts/plan-review.md +10 -0
  168. package/pi-package/prompts/pre-mortem.md +10 -0
  169. package/pi-package/prompts/project-status-report.md +10 -0
  170. package/pi-package/prompts/pwa-accessibility-review.md +10 -0
  171. package/pi-package/prompts/rca-diagnostician.md +10 -0
  172. package/pi-package/prompts/red-team-review.md +10 -0
  173. package/pi-package/prompts/research-codebase.md +10 -0
  174. package/pi-package/prompts/research-documentation.md +10 -0
  175. package/pi-package/prompts/research-review.md +10 -0
  176. package/pi-package/prompts/resonant-refactor.md +10 -0
  177. package/pi-package/prompts/resume-handoff.md +10 -0
  178. package/pi-package/prompts/review-documentation.md +10 -0
  179. package/pi-package/prompts/rigidity-diagnostician.md +10 -0
  180. package/pi-package/prompts/rule-of-5-universal.md +10 -0
  181. package/pi-package/prompts/specification-evaluation-diagnostician.md +10 -0
  182. package/pi-package/prompts/specification-review.md +10 -0
  183. package/pi-package/prompts/systematic-housekeeping.md +10 -0
  184. package/pi-package/prompts/tdd.md +10 -0
  185. package/pi-package/prompts/test-abstraction-miner.md +10 -0
  186. package/pi-package/prompts/test-friction.md +10 -0
  187. package/pi-package/prompts/testability-implementability-evaluator.md +10 -0
  188. package/pi-package/prompts/ui-align.md +10 -0
  189. package/pi-package/prompts/ux-dx-evaluation-diagnostician.md +10 -0
  190. package/pi-package/prompts/verification-diagnostician.md +10 -0
  191. package/pi-package/prompts/verify-prompt.md +10 -0
  192. package/pi-package/skills/abstraction-miner/SKILL.md +38 -0
  193. package/pi-package/skills/adversarial-stakeholder-evaluation/SKILL.md +127 -0
  194. package/pi-package/skills/anti-slop-prose/SKILL.md +52 -0
  195. package/pi-package/skills/bias-audit/SKILL.md +45 -0
  196. package/pi-package/skills/code-review/SKILL.md +59 -0
  197. package/pi-package/skills/code-review/references/criteria.md +50 -0
  198. package/pi-package/skills/code-review/references/templates.md +75 -0
  199. package/pi-package/skills/code-review/references/variants.md +32 -0
  200. package/pi-package/skills/commit/SKILL.md +47 -0
  201. package/pi-package/skills/commit/references/criteria.md +21 -0
  202. package/pi-package/skills/commit/references/templates.md +46 -0
  203. package/pi-package/skills/composability-diagnostician/SKILL.md +73 -0
  204. package/pi-package/skills/context-guardian/SKILL.md +26 -0
  205. package/pi-package/skills/create-handoff/SKILL.md +22 -0
  206. package/pi-package/skills/create-handoff/references/handoff-template.md +65 -0
  207. package/pi-package/skills/create-handoff/references/naming.md +7 -0
  208. package/pi-package/skills/create-issues/SKILL.md +78 -0
  209. package/pi-package/skills/create-issues/references/criteria.md +44 -0
  210. package/pi-package/skills/create-issues/references/templates.md +75 -0
  211. package/pi-package/skills/create-plan/SKILL.md +25 -0
  212. package/pi-package/skills/create-plan/references/plan-template.md +87 -0
  213. package/pi-package/skills/create-plan/references/scenarios.md +19 -0
  214. package/pi-package/skills/debug/SKILL.md +48 -0
  215. package/pi-package/skills/debug/references/criteria.md +27 -0
  216. package/pi-package/skills/debug/references/templates.md +39 -0
  217. package/pi-package/skills/describe-pr/SKILL.md +23 -0
  218. package/pi-package/skills/describe-pr/references/pr-template.md +62 -0
  219. package/pi-package/skills/design-practice/SKILL.md +219 -0
  220. package/pi-package/skills/design-review/SKILL.md +35 -0
  221. package/pi-package/skills/design-review/references/combined-review.md +27 -0
  222. package/pi-package/skills/design-review/references/decision-matrix.md +122 -0
  223. package/pi-package/skills/design-review/references/problem-statement.md +141 -0
  224. package/pi-package/skills/design-review/references/report-template.md +36 -0
  225. package/pi-package/skills/design-review/references/scope-document.md +51 -0
  226. package/pi-package/skills/distill-prompt/SKILL.md +47 -0
  227. package/pi-package/skills/distill-prompt/references/criteria.md +26 -0
  228. package/pi-package/skills/distill-prompt/references/templates.md +30 -0
  229. package/pi-package/skills/doc-link-verifier/SKILL.md +218 -0
  230. package/pi-package/skills/doc-link-verifier/scripts/check_links.py +453 -0
  231. package/pi-package/skills/doc-link-verifier/scripts/extract_links.py +521 -0
  232. package/pi-package/skills/edge-case-discovery/SKILL.md +129 -0
  233. package/pi-package/skills/error-handling-diagnostician/SKILL.md +96 -0
  234. package/pi-package/skills/extract-prompt/SKILL.md +226 -0
  235. package/pi-package/skills/formal-verification-evaluator/SKILL.md +164 -0
  236. package/pi-package/skills/grill-me/SKILL.md +30 -0
  237. package/pi-package/skills/guided-review/SKILL.md +74 -0
  238. package/pi-package/skills/implement-documentation/SKILL.md +74 -0
  239. package/pi-package/skills/implement-plan/SKILL.md +29 -0
  240. package/pi-package/skills/implement-plan/references/common-situations.md +36 -0
  241. package/pi-package/skills/implement-plan/references/verification-template.md +18 -0
  242. package/pi-package/skills/invalid-states-diagnostician/SKILL.md +69 -0
  243. package/pi-package/skills/issue-review/SKILL.md +43 -0
  244. package/pi-package/skills/issue-review/references/convergence.md +19 -0
  245. package/pi-package/skills/issue-review/references/final-report.md +60 -0
  246. package/pi-package/skills/issue-review/references/pass-1-clarity.md +28 -0
  247. package/pi-package/skills/issue-review/references/pass-2-scope.md +22 -0
  248. package/pi-package/skills/issue-review/references/pass-3-dependencies.md +23 -0
  249. package/pi-package/skills/issue-review/references/pass-4-alignment.md +17 -0
  250. package/pi-package/skills/issue-review/references/pass-5-executability.md +17 -0
  251. package/pi-package/skills/issue-review/references/setup.md +25 -0
  252. package/pi-package/skills/iterate-plan/SKILL.md +30 -0
  253. package/pi-package/skills/iterate-plan/references/change-template.md +15 -0
  254. package/pi-package/skills/iterate-plan/references/common-scenarios.md +14 -0
  255. package/pi-package/skills/julia-performance-diagnostician/SKILL.md +77 -0
  256. package/pi-package/skills/modularity-diagnostician/SKILL.md +74 -0
  257. package/pi-package/skills/multi-agent-review/SKILL.md +202 -0
  258. package/pi-package/skills/mutability-diagnostician/SKILL.md +69 -0
  259. package/pi-package/skills/narrative-article/SKILL.md +66 -0
  260. package/pi-package/skills/optionality-review/SKILL.md +196 -0
  261. package/pi-package/skills/parallel-review/SKILL.md +55 -0
  262. package/pi-package/skills/parallel-review/references/criteria.md +34 -0
  263. package/pi-package/skills/parallel-review/references/templates.md +59 -0
  264. package/pi-package/skills/plan-review/SKILL.md +48 -0
  265. package/pi-package/skills/plan-review/references/criteria.md +51 -0
  266. package/pi-package/skills/plan-review/references/templates.md +67 -0
  267. package/pi-package/skills/pre-mortem/SKILL.md +16 -0
  268. package/pi-package/skills/project-status-report/SKILL.md +130 -0
  269. package/pi-package/skills/pwa-accessibility-review/SKILL.md +87 -0
  270. package/pi-package/skills/rca-diagnostician/SKILL.md +36 -0
  271. package/pi-package/skills/rca-diagnostician/references/action-hierarchy.md +77 -0
  272. package/pi-package/skills/rca-diagnostician/references/bias-countermeasures.md +64 -0
  273. package/pi-package/skills/rca-diagnostician/references/evidence-timeline.md +49 -0
  274. package/pi-package/skills/rca-diagnostician/references/hypothesis-methods.md +53 -0
  275. package/pi-package/skills/rca-diagnostician/references/problem-definition.md +34 -0
  276. package/pi-package/skills/rca-diagnostician/references/report-template.md +75 -0
  277. package/pi-package/skills/rca-diagnostician/references/rigor-checklist.md +66 -0
  278. package/pi-package/skills/red-team-review/SKILL.md +139 -0
  279. package/pi-package/skills/research-codebase/SKILL.md +28 -0
  280. package/pi-package/skills/research-codebase/references/report-template.md +75 -0
  281. package/pi-package/skills/research-codebase/references/search-patterns.md +27 -0
  282. package/pi-package/skills/research-documentation/SKILL.md +85 -0
  283. package/pi-package/skills/research-review/SKILL.md +48 -0
  284. package/pi-package/skills/research-review/references/criteria.md +51 -0
  285. package/pi-package/skills/research-review/references/templates.md +73 -0
  286. package/pi-package/skills/resonant-refactor/SKILL.md +51 -0
  287. package/pi-package/skills/resume-handoff/SKILL.md +25 -0
  288. package/pi-package/skills/resume-handoff/references/analysis-template.md +40 -0
  289. package/pi-package/skills/resume-handoff/references/locating.md +12 -0
  290. package/pi-package/skills/review-documentation/SKILL.md +50 -0
  291. package/pi-package/skills/rigidity-diagnostician/SKILL.md +76 -0
  292. package/pi-package/skills/rule-of-5-universal/SKILL.md +32 -0
  293. package/pi-package/skills/rule-of-5-universal/references/criteria.md +34 -0
  294. package/pi-package/skills/rule-of-5-universal/references/examples.md +69 -0
  295. package/pi-package/skills/rule-of-5-universal/references/templates.md +136 -0
  296. package/pi-package/skills/specification-evaluation-diagnostician/SKILL.md +112 -0
  297. package/pi-package/skills/specification-review/SKILL.md +49 -0
  298. package/pi-package/skills/specification-review/references/criteria.md +51 -0
  299. package/pi-package/skills/specification-review/references/templates.md +67 -0
  300. package/pi-package/skills/systematic-housekeeping/SKILL.md +33 -0
  301. package/pi-package/skills/tdd/SKILL.md +44 -0
  302. package/pi-package/skills/tdd/references/criteria.md +26 -0
  303. package/pi-package/skills/tdd/references/templates.md +53 -0
  304. package/pi-package/skills/test-abstraction-miner/SKILL.md +49 -0
  305. package/pi-package/skills/test-friction/SKILL.md +57 -0
  306. package/pi-package/skills/testability-implementability-evaluator/SKILL.md +150 -0
  307. package/pi-package/skills/ui-align/SKILL.md +38 -0
  308. package/pi-package/skills/ux-dx-evaluation-diagnostician/SKILL.md +27 -0
  309. package/pi-package/skills/ux-dx-evaluation-diagnostician/references/layer-1-product.md +20 -0
  310. package/pi-package/skills/ux-dx-evaluation-diagnostician/references/layer-2-engineering.md +20 -0
  311. package/pi-package/skills/ux-dx-evaluation-diagnostician/references/layer-3-interface.md +23 -0
  312. package/pi-package/skills/ux-dx-evaluation-diagnostician/references/layer-4-ecosystem.md +20 -0
  313. package/pi-package/skills/ux-dx-evaluation-diagnostician/references/layer-5-documentation.md +19 -0
  314. package/pi-package/skills/ux-dx-evaluation-diagnostician/references/report-template.md +36 -0
  315. package/pi-package/skills/verification-diagnostician/SKILL.md +96 -0
  316. package/pi-package/skills/verify-prompt/SKILL.md +38 -0
  317. package/pi-package/skills/verify-prompt/references/criteria.md +21 -0
  318. package/scripts/cli.mjs +453 -0
@@ -0,0 +1,453 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * incitaciones CLI — Install LLM agent skills across tools.
4
+ *
5
+ * Usage:
6
+ * npx incitaciones Install all skills (default)
7
+ * npx incitaciones install Install all skills
8
+ * npx incitaciones install --bundle essentials
9
+ * npx incitaciones install --tool claude
10
+ * npx incitaciones list List available skills
11
+ * npx incitaciones info <name> Show skill details
12
+ * npx incitaciones --help Show this message
13
+ */
14
+
15
+ import fs from "node:fs";
16
+ import path from "node:path";
17
+ import { fileURLToPath } from "node:url";
18
+ import { createRequire } from "node:module";
19
+
20
+ const __filename = fileURLToPath(import.meta.url);
21
+ const __dirname = path.dirname(__filename);
22
+ const PACKAGE_ROOT = path.resolve(__dirname, "..");
23
+
24
+ // ── Paths ─────────────────────────────────────────────
25
+ const MANIFEST_PATH = path.join(PACKAGE_ROOT, "content", "manifest.json");
26
+ const DISTILLED_DIR = path.join(PACKAGE_ROOT, "content", "distilled");
27
+
28
+ // ── Helpers ────────────────────────────────────────────
29
+ function readJSON(p) {
30
+ return JSON.parse(fs.readFileSync(p, "utf8"));
31
+ }
32
+
33
+ function escapeYaml(s) {
34
+ return String(s).replace(/\\/g, "\\\\").replace(/"/g, '\\"');
35
+ }
36
+
37
+ function now() {
38
+ return new Date().toISOString().replace("Z", "000Z");
39
+ }
40
+
41
+ function shortDate() {
42
+ return new Date().toISOString().slice(0, 10);
43
+ }
44
+
45
+ // ── Manifest ───────────────────────────────────────────
46
+ function getManifest() {
47
+ try {
48
+ return readJSON(MANIFEST_PATH);
49
+ } catch {
50
+ console.error("❌ manifest.json not found at", MANIFEST_PATH);
51
+ process.exit(1);
52
+ }
53
+ }
54
+
55
+ function getPrompts(manifest, bundle) {
56
+ if (!bundle || bundle === "all") return manifest.prompts;
57
+ const names = manifest.bundles?.[bundle]?.prompts;
58
+ if (!names) {
59
+ console.error(`❌ Unknown bundle: "${bundle}"`);
60
+ const keys = Object.keys(manifest.bundles || {}).filter((k) => k !== "all");
61
+ console.error(` Available bundles: ${keys.join(", ")}`);
62
+ process.exit(1);
63
+ }
64
+ return manifest.prompts.filter((p) => names.includes(p.name));
65
+ }
66
+
67
+ // ── Resolve distilled path ─────────────────────────────
68
+ function resolveDistilled(prompt) {
69
+ const rel = prompt.distilled;
70
+ const abs = path.resolve(PACKAGE_ROOT, rel);
71
+ return fs.existsSync(abs) ? abs : null;
72
+ }
73
+
74
+ // ── Generate frontmatter ───────────────────────────────
75
+ function generateFrontmatter(prompt) {
76
+ const desc = escapeYaml(prompt.description || `Incitaciones prompt: ${prompt.name}`);
77
+ return [
78
+ "---",
79
+ `name: ${prompt.name}`,
80
+ `description: "${desc}"`,
81
+ 'installed-from: incitaciones',
82
+ `installed-version: "${getVersion()}"`,
83
+ `installed-at: "${now()}"`,
84
+ "---",
85
+ "",
86
+ ].join("\n");
87
+ }
88
+
89
+ function getVersion() {
90
+ try {
91
+ const pkg = readJSON(path.join(PACKAGE_ROOT, "package.json"));
92
+ return `npm:${pkg.version}`;
93
+ } catch {
94
+ return shortDate();
95
+ }
96
+ }
97
+
98
+ // ── Install a single skill ─────────────────────────────
99
+ function installSkill(prompt, dstRoot) {
100
+ const src = resolveDistilled(prompt);
101
+ if (!src) {
102
+ console.error(` ⚠ ${prompt.name} (distilled not found)`);
103
+ return false;
104
+ }
105
+
106
+ const dstDir = path.join(dstRoot, prompt.name);
107
+ fs.rmSync(dstDir, { recursive: true, force: true });
108
+ fs.mkdirSync(dstDir, { recursive: true });
109
+
110
+ // Write SKILL.md with frontmatter
111
+ const content = generateFrontmatter(prompt) + fs.readFileSync(src, "utf8");
112
+ fs.writeFileSync(path.join(dstDir, "SKILL.md"), content, "utf8");
113
+
114
+ // Copy references/ directory if it's a multi-file skill
115
+ const srcDir = path.dirname(src);
116
+ if (src.endsWith("SKILL.md")) {
117
+ for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) {
118
+ if (entry.name === "SKILL.md") continue;
119
+ const s = path.join(srcDir, entry.name);
120
+ const d = path.join(dstDir, entry.name);
121
+ if (entry.isDirectory()) {
122
+ fs.cpSync(s, d, { recursive: true });
123
+ } else {
124
+ fs.copyFileSync(s, d);
125
+ }
126
+ }
127
+ }
128
+
129
+ const multi = src.endsWith("SKILL.md") ? " (multi-file)" : "";
130
+ console.log(` + ${prompt.name}${multi}`);
131
+ return true;
132
+ }
133
+
134
+ // ── Install prompt templates for pi ────────────────────
135
+ function installPromptTemplates(prompts, dstDir) {
136
+ fs.mkdirSync(dstDir, { recursive: true });
137
+ for (const p of prompts) {
138
+ const desc = escapeYaml(p.description || `Incitaciones prompt: ${p.name}`);
139
+ const tmpl = [
140
+ "---",
141
+ `description: "Shortcut for the ${p.name} skill. ${desc}"`,
142
+ "---",
143
+ "<!-- installed-from: incitaciones -->",
144
+ "",
145
+ `Use the installed \`${p.name}\` skill for this task.`,
146
+ "",
147
+ `If the skill is not automatically loaded, invoke \`/skill:${p.name}\` and follow it.`,
148
+ "",
149
+ "User context: $@",
150
+ "",
151
+ ].join("\n");
152
+ fs.writeFileSync(path.join(dstDir, `${p.name}.md`), tmpl, "utf8");
153
+ }
154
+ }
155
+
156
+ // ── Tool detection ─────────────────────────────────────
157
+ const TOOL_CONFIGS = [
158
+ {
159
+ id: "pi",
160
+ detect: (base) => fs.existsSync(path.join(base, ".pi")) || fs.existsSync(path.join(home(), ".pi", "agent")),
161
+ install: (prompts, base) => {
162
+ const isLocal = fs.existsSync(path.join(base, ".pi"));
163
+ const piDir = isLocal
164
+ ? path.join(base, ".pi")
165
+ : path.join(home(), ".pi", "agent");
166
+ const promptsDir = path.join(piDir, "prompts");
167
+ installPromptTemplates(prompts, promptsDir);
168
+ console.log(` ${isLocal ? "+" : "~"} pi (reads .agents/skills/ + prompt templates)`);
169
+ },
170
+ },
171
+ {
172
+ id: "amp",
173
+ dir: () => path.join(home(), ".config", "amp"),
174
+ detect: (base) => fs.existsSync(path.join(home(), ".config", "amp")),
175
+ install: (prompts, base) => {
176
+ const ampDir = path.join(home(), ".config", "amp");
177
+ const skillsDir = path.join(ampDir, "skills");
178
+ const link = fs.readlinkSync(skillsDir, { encoding: "utf8" }).trim();
179
+ if (fs.existsSync(skillsDir) && fs.lstatSync(skillsDir)?.isSymbolicLink?.()) {
180
+ console.log(` + amp (symlinked)`);
181
+ return;
182
+ }
183
+ installSkillsTo(prompts, skillsDir);
184
+ console.log(` + amp (skills)`);
185
+ },
186
+ },
187
+ {
188
+ id: "claude",
189
+ dir: (base) => path.join(base, ".claude"),
190
+ detect: (base) => fs.existsSync(path.join(base, ".claude")),
191
+ install: (prompts, base) => {
192
+ const skillsDir = path.join(base, ".claude", "skills");
193
+ const isSymlink = fs.existsSync(skillsDir) && fs.lstatSync(skillsDir)?.isSymbolicLink?.();
194
+ if (isSymlink) {
195
+ console.log(" + claude (symlinked)");
196
+ return;
197
+ }
198
+ installSkillsTo(prompts, skillsDir);
199
+ console.log(" + claude (skills)");
200
+ },
201
+ },
202
+ {
203
+ id: "gemini",
204
+ dir: (base) => path.join(base, ".gemini"),
205
+ detect: (base) => fs.existsSync(path.join(base, ".gemini")),
206
+ install: (prompts, base) => {
207
+ const cmdsDir = path.join(base, ".gemini", "commands", "incitaciones");
208
+ fs.mkdirSync(cmdsDir, { recursive: true });
209
+ for (const p of prompts) {
210
+ const src = resolveDistilled(p);
211
+ if (!src) continue;
212
+ const desc = escapeYaml(p.description || `Incitaciones prompt: ${p.name}`);
213
+ const content = fs.readFileSync(src, "utf8");
214
+ const escaped = content.replace(/\\/g, "\\\\").replace(/"""/g, '\\"""');
215
+ const toml = [
216
+ `description = "${desc}"`,
217
+ 'prompt = """',
218
+ escaped,
219
+ '"""',
220
+ "",
221
+ ].join("\n");
222
+ fs.writeFileSync(path.join(cmdsDir, `${p.name}.toml`), toml, "utf8");
223
+ }
224
+ const skillsDir = path.join(base, ".gemini", "skills");
225
+ const isSymlink = fs.existsSync(skillsDir) && fs.lstatSync(skillsDir)?.isSymbolicLink?.();
226
+ if (!isSymlink) {
227
+ installSkillsTo(prompts, skillsDir);
228
+ console.log(" + gemini (commands + skills)");
229
+ } else {
230
+ console.log(" + gemini (commands + skills symlinked)");
231
+ }
232
+ },
233
+ },
234
+ ];
235
+
236
+ function home() {
237
+ return process.env.HOME || process.env.USERPROFILE || "/home";
238
+ }
239
+
240
+ // ── Install skills to a directory ──────────────────────
241
+ function installSkillsTo(prompts, dir) {
242
+ for (const p of prompts) {
243
+ installSkill(p, dir);
244
+ }
245
+ }
246
+
247
+ // ── Core install logic ─────────────────────────────────
248
+ function doInstall(prompts, options) {
249
+ const scope = options.global ? "global" : "local";
250
+ const base = options.dir || (scope === "local" ? process.cwd() : home());
251
+ const dstRoot = options.dir
252
+ ? path.resolve(options.dir)
253
+ : path.join(base, ".agents", "skills");
254
+
255
+ console.log(`Installing incitaciones skills (${scope})...\n`);
256
+
257
+ let installed = 0;
258
+ for (const prompt of prompts) {
259
+ if (installSkill(prompt, dstRoot)) installed++;
260
+ }
261
+ console.log(`\nInstalled: ${installed} skills to ${dstRoot}/\n`);
262
+
263
+ // Tool integrations
264
+ if (!options.tool) {
265
+ console.log("Setting up tool integrations...");
266
+ let found = 0;
267
+ for (const tool of TOOL_CONFIGS) {
268
+ if (tool.detect(base)) {
269
+ try {
270
+ tool.install(prompts, base);
271
+ found++;
272
+ } catch (e) {
273
+ console.error(` ⚠ ${tool.id}: ${e.message}`);
274
+ }
275
+ }
276
+ }
277
+ if (!found) {
278
+ console.log(" (no tool directories detected — skills installed to .agents/skills/)");
279
+ }
280
+ } else {
281
+ // Install for specific tool only
282
+ const tool = TOOL_CONFIGS.find((t) => t.id === options.tool);
283
+ if (!tool) {
284
+ console.error(`❌ Unknown tool: "${options.tool}"`);
285
+ const ids = TOOL_CONFIGS.map((t) => t.id).join(", ");
286
+ console.error(` Supported: ${ids}`);
287
+ process.exit(1);
288
+ }
289
+ const base = options.global ? home() : process.cwd();
290
+ if (!tool.detect(base)) {
291
+ console.error(`❌ Tool "${options.tool}" not detected at ${base}`);
292
+ process.exit(1);
293
+ }
294
+ tool.install(prompts, base);
295
+ }
296
+ }
297
+
298
+ // ── Commands ───────────────────────────────────────────
299
+ function doList(prompts) {
300
+ console.log("Available incitaciones skills:\n");
301
+ for (const p of prompts) {
302
+ console.log(` ${p.name} — ${p.description || "(no description)"}`);
303
+ }
304
+
305
+ try {
306
+ const manifest = getManifest();
307
+ const bundles = manifest.bundles || {};
308
+ const bundleKeys = Object.keys(bundles).filter((k) => k !== "all");
309
+ if (bundleKeys.length > 0) {
310
+ console.log("\nBundles:");
311
+ for (const key of bundleKeys) {
312
+ const desc = bundles[key].description || "";
313
+ const count = bundles[key].prompts.length;
314
+ console.log(` ${key} (${count} prompts) — ${desc}`);
315
+ }
316
+ }
317
+ } catch {}
318
+
319
+ console.log(`\nTotal: ${prompts.length} skills`);
320
+ }
321
+
322
+ function doInfo(name, prompts) {
323
+ const prompt = prompts.find((p) => p.name === name);
324
+ if (!prompt) {
325
+ console.error(`❌ Skill not found: "${name}"`);
326
+ const names = prompts.map((p) => p.name).sort();
327
+ console.error(` Available: ${names.join(", ")}`);
328
+ process.exit(1);
329
+ }
330
+
331
+ const src = resolveDistilled(prompt);
332
+ console.log(`\n ${prompt.name}`);
333
+ console.log(` ${"=".repeat(prompt.name.length)}`);
334
+ console.log(` Description: ${prompt.description || "(none)"}`);
335
+ console.log(` Type: ${prompt.type || "prompt"}`);
336
+ console.log(` Status: ${prompt.status || "unknown"}`);
337
+ console.log(` Tags: ${(prompt.tags || []).join(", ") || "(none)"}`);
338
+ console.log(` Source: ${prompt.source || "(none)"}`);
339
+ console.log(` Distilled: ${prompt.distilled}`);
340
+ if (src) {
341
+ const lines = fs.readFileSync(src, "utf8").split("\n").length;
342
+ const isMulti = src.endsWith("SKILL.md");
343
+ console.log(` Lines: ${lines}${isMulti ? " + references" : ""}`);
344
+ }
345
+ console.log("");
346
+
347
+ // Show related prompts
348
+ const related = prompt.related || [];
349
+ if (related.length > 0) {
350
+ console.log(" Related:");
351
+ for (const r of related) {
352
+ console.log(` - ${r}`);
353
+ }
354
+ console.log("");
355
+ }
356
+ }
357
+
358
+ // ── Main ───────────────────────────────────────────────
359
+ function usage() {
360
+ console.log(`Usage:
361
+ npx incitaciones [command] [options]
362
+
363
+ Commands:
364
+ install Install skills (default command)
365
+ list List available skills
366
+ info Show details for a skill
367
+ help Show this message
368
+
369
+ Options (install):
370
+ --bundle <name> Install only a specific bundle (default: all)
371
+ --tool <id> Install for a specific tool only (detected automatically otherwise)
372
+ --dir <path> Install to a custom directory
373
+ --global Install globally (~/.agents/skills/)
374
+ --local Install to current project (.agents/skills/) (default when in git repo)
375
+
376
+ Examples:
377
+ npx incitaciones # Install all skills
378
+ npx incitaciones install --bundle essentials
379
+ npx incitaciones install --tool claude
380
+ npx incitaciones list
381
+ npx incitaciones info commit
382
+ `);
383
+ }
384
+
385
+ function parseArgs(argv) {
386
+ const args = { command: "install", bundle: "all", global: false, local: false, tool: null, dir: null };
387
+ let i = 2;
388
+
389
+ while (i < argv.length) {
390
+ const arg = argv[i];
391
+ if (arg === "--help" || arg === "-h") {
392
+ args.command = "help";
393
+ i++;
394
+ } else if (arg === "list") {
395
+ args.command = "list";
396
+ i++;
397
+ } else if (arg === "install") {
398
+ args.command = "install";
399
+ i++;
400
+ } else if (arg === "info") {
401
+ args.command = "info";
402
+ args.name = argv[i + 1];
403
+ i += 2;
404
+ } else if (arg === "help") {
405
+ args.command = "help";
406
+ i++;
407
+ } else if (arg === "--bundle") {
408
+ args.bundle = argv[i + 1];
409
+ i += 2;
410
+ } else if (arg === "--tool") {
411
+ args.tool = argv[i + 1];
412
+ i += 2;
413
+ } else if (arg === "--dir") {
414
+ args.dir = argv[i + 1];
415
+ i += 2;
416
+ } else if (arg === "--global") {
417
+ args.global = true;
418
+ i++;
419
+ } else if (arg === "--local") {
420
+ args.local = true;
421
+ i++;
422
+ } else {
423
+ console.error(`Unknown option: ${arg}`);
424
+ usage();
425
+ process.exit(1);
426
+ }
427
+ }
428
+ return args;
429
+ }
430
+
431
+ function main() {
432
+ const args = parseArgs(process.argv);
433
+ const manifest = getManifest();
434
+ const prompts = getPrompts(manifest, args.bundle);
435
+
436
+ switch (args.command) {
437
+ case "help":
438
+ usage();
439
+ break;
440
+ case "list":
441
+ doList(prompts);
442
+ break;
443
+ case "info":
444
+ doInfo(args.name, prompts);
445
+ break;
446
+ case "install":
447
+ default:
448
+ doInstall(prompts, args);
449
+ break;
450
+ }
451
+ }
452
+
453
+ main();