@mohammadhprp/system-prompt 0.10.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 (347) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +35 -0
  3. package/bin/system-prompt.js +8 -0
  4. package/framework/README.md +163 -0
  5. package/framework/agents/README.md +49 -0
  6. package/framework/agents/backend-architect.md +146 -0
  7. package/framework/agents/researcher.md +79 -0
  8. package/framework/agents/reviewer.md +183 -0
  9. package/framework/agents/security-auditor.md +131 -0
  10. package/framework/commands/README.md +43 -0
  11. package/framework/commands/changelog.md +44 -0
  12. package/framework/commands/commit.md +31 -0
  13. package/framework/commands/learn.md +24 -0
  14. package/framework/commands/mr.md +46 -0
  15. package/framework/commands/pr.md +39 -0
  16. package/framework/commands/release.md +34 -0
  17. package/framework/commands/review.md +24 -0
  18. package/framework/commands/summarize-changes.md +49 -0
  19. package/framework/mcps/README.md +78 -0
  20. package/framework/mcps/excalidraw/README.md +37 -0
  21. package/framework/mcps/excalidraw/capabilities.md +54 -0
  22. package/framework/mcps/excalidraw/configs/opencode.json +8 -0
  23. package/framework/mcps/excalidraw/install.md +92 -0
  24. package/framework/mcps/excalidraw/troubleshooting.md +67 -0
  25. package/framework/mcps/figma-mcp-go/README.md +51 -0
  26. package/framework/mcps/figma-mcp-go/capabilities.md +190 -0
  27. package/framework/mcps/figma-mcp-go/configs/opencode.json +9 -0
  28. package/framework/mcps/figma-mcp-go/install.md +74 -0
  29. package/framework/mcps/figma-mcp-go/troubleshooting.md +99 -0
  30. package/framework/mcps/github-mcp/README.md +51 -0
  31. package/framework/mcps/github-mcp/capabilities.md +83 -0
  32. package/framework/mcps/github-mcp/configs/.env.example +1 -0
  33. package/framework/mcps/github-mcp/configs/opencode.json +13 -0
  34. package/framework/mcps/github-mcp/install.md +60 -0
  35. package/framework/mcps/github-mcp/troubleshooting.md +79 -0
  36. package/framework/mcps/gitlab-mcp/README.md +54 -0
  37. package/framework/mcps/gitlab-mcp/capabilities.md +216 -0
  38. package/framework/mcps/gitlab-mcp/configs/.env.example +2 -0
  39. package/framework/mcps/gitlab-mcp/configs/opencode.json +13 -0
  40. package/framework/mcps/gitlab-mcp/install.md +99 -0
  41. package/framework/mcps/gitlab-mcp/troubleshooting.md +116 -0
  42. package/framework/mcps/jira-mcp/README.md +53 -0
  43. package/framework/mcps/jira-mcp/capabilities.md +79 -0
  44. package/framework/mcps/jira-mcp/configs/.env.example +2 -0
  45. package/framework/mcps/jira-mcp/configs/opencode.json +13 -0
  46. package/framework/mcps/jira-mcp/install.md +94 -0
  47. package/framework/mcps/jira-mcp/troubleshooting.md +113 -0
  48. package/framework/mcps/laravel-boost/README.md +53 -0
  49. package/framework/mcps/laravel-boost/capabilities.md +92 -0
  50. package/framework/mcps/laravel-boost/configs/opencode.json +9 -0
  51. package/framework/mcps/laravel-boost/install.md +106 -0
  52. package/framework/mcps/laravel-boost/troubleshooting.md +119 -0
  53. package/framework/mcps/notion-mcp/README.md +58 -0
  54. package/framework/mcps/notion-mcp/capabilities.md +118 -0
  55. package/framework/mcps/notion-mcp/configs/opencode.json +9 -0
  56. package/framework/mcps/notion-mcp/install.md +70 -0
  57. package/framework/mcps/notion-mcp/troubleshooting.md +95 -0
  58. package/framework/mcps/playwright-mcp/README.md +50 -0
  59. package/framework/mcps/playwright-mcp/capabilities.md +149 -0
  60. package/framework/mcps/playwright-mcp/configs/opencode.json +9 -0
  61. package/framework/mcps/playwright-mcp/install.md +136 -0
  62. package/framework/mcps/playwright-mcp/troubleshooting.md +154 -0
  63. package/framework/mcps/supabase-mcp/README.md +66 -0
  64. package/framework/mcps/supabase-mcp/capabilities.md +127 -0
  65. package/framework/mcps/supabase-mcp/configs/opencode.json +9 -0
  66. package/framework/mcps/supabase-mcp/install.md +85 -0
  67. package/framework/mcps/supabase-mcp/troubleshooting.md +113 -0
  68. package/framework/memory/README.md +17 -0
  69. package/framework/memory/codebase-insights.md +6 -0
  70. package/framework/memory/user-preferences.md +5 -0
  71. package/framework/modes/README.md +52 -0
  72. package/framework/modes/audit.md +88 -0
  73. package/framework/plugins/README.md +65 -0
  74. package/framework/plugins/opencode-goal-plugin/README.md +45 -0
  75. package/framework/plugins/opencode-goal-plugin/capabilities.md +127 -0
  76. package/framework/plugins/opencode-goal-plugin/install.md +71 -0
  77. package/framework/plugins/opencode-goal-plugin/troubleshooting.md +112 -0
  78. package/framework/plugins/ponytail/README.md +44 -0
  79. package/framework/plugins/ponytail/capabilities.md +112 -0
  80. package/framework/plugins/ponytail/install.md +77 -0
  81. package/framework/plugins/ponytail/troubleshooting.md +116 -0
  82. package/framework/references/standards/api.md +44 -0
  83. package/framework/references/standards/architecture.md +43 -0
  84. package/framework/references/standards/database.md +43 -0
  85. package/framework/references/standards/debugging.md +44 -0
  86. package/framework/references/standards/documentation.md +43 -0
  87. package/framework/references/standards/logging.md +43 -0
  88. package/framework/references/standards/naming.md +43 -0
  89. package/framework/references/standards/observability.md +43 -0
  90. package/framework/references/standards/performance.md +43 -0
  91. package/framework/references/standards/pull-requests.md +43 -0
  92. package/framework/references/standards/security.md +43 -0
  93. package/framework/references/standards/testing.md +43 -0
  94. package/framework/references/templates/adr.md +28 -0
  95. package/framework/references/templates/api-spec.md +56 -0
  96. package/framework/references/templates/design-document.md +39 -0
  97. package/framework/references/templates/incident-report.md +38 -0
  98. package/framework/references/templates/postmortem.md +41 -0
  99. package/framework/references/templates/pull-request.md +34 -0
  100. package/framework/references/templates/runbook.md +48 -0
  101. package/framework/references/templates/task.md +27 -0
  102. package/framework/skills/README.md +68 -0
  103. package/framework/skills/agent-browser/SKILL.md +51 -0
  104. package/framework/skills/backend-best-practices/SKILL.md +136 -0
  105. package/framework/skills/backend-best-practices/examples.md +31 -0
  106. package/framework/skills/backend-best-practices/references/api-design.md +79 -0
  107. package/framework/skills/backend-best-practices/references/architecture-review.md +77 -0
  108. package/framework/skills/backend-best-practices/references/database-design.md +78 -0
  109. package/framework/skills/backend-best-practices/references/debugging.md +76 -0
  110. package/framework/skills/backend-best-practices/references/observability.md +78 -0
  111. package/framework/skills/backend-best-practices/references/performance.md +78 -0
  112. package/framework/skills/backend-best-practices/references/refactoring.md +77 -0
  113. package/framework/skills/backend-best-practices/references/security.md +80 -0
  114. package/framework/skills/backend-best-practices/references/testing.md +77 -0
  115. package/framework/skills/backend-engineer/SKILL.md +76 -0
  116. package/framework/skills/backend-engineer/examples.md +31 -0
  117. package/framework/skills/brainstorming/SKILL.md +159 -0
  118. package/framework/skills/brainstorming/examples.md +49 -0
  119. package/framework/skills/brainstorming/scripts/frame-template.html +213 -0
  120. package/framework/skills/brainstorming/scripts/helper.js +167 -0
  121. package/framework/skills/brainstorming/scripts/server.cjs +723 -0
  122. package/framework/skills/brainstorming/scripts/start-server.sh +209 -0
  123. package/framework/skills/brainstorming/scripts/stop-server.sh +120 -0
  124. package/framework/skills/brainstorming/visual-companion.md +291 -0
  125. package/framework/skills/brand-guidelines/LICENSE.txt +202 -0
  126. package/framework/skills/brand-guidelines/SKILL.md +73 -0
  127. package/framework/skills/code-review/SKILL.md +72 -0
  128. package/framework/skills/code-review/examples.md +31 -0
  129. package/framework/skills/design/SKILL.md +399 -0
  130. package/framework/skills/design/examples.md +34 -0
  131. package/framework/skills/diagram-design/SKILL.md +485 -0
  132. package/framework/skills/diagram-design/assets/example-architecture-dark.html +180 -0
  133. package/framework/skills/diagram-design/assets/example-architecture-full.html +192 -0
  134. package/framework/skills/diagram-design/assets/example-architecture.html +181 -0
  135. package/framework/skills/diagram-design/assets/example-bar-dark.html +127 -0
  136. package/framework/skills/diagram-design/assets/example-bar-full.html +103 -0
  137. package/framework/skills/diagram-design/assets/example-bar.html +127 -0
  138. package/framework/skills/diagram-design/assets/example-data-flow-dark.html +143 -0
  139. package/framework/skills/diagram-design/assets/example-data-flow-full.html +185 -0
  140. package/framework/skills/diagram-design/assets/example-data-flow.html +143 -0
  141. package/framework/skills/diagram-design/assets/example-datalake-dark.html +241 -0
  142. package/framework/skills/diagram-design/assets/example-datalake-full.html +246 -0
  143. package/framework/skills/diagram-design/assets/example-datalake.html +267 -0
  144. package/framework/skills/diagram-design/assets/example-dp-integration-dark.html +78 -0
  145. package/framework/skills/diagram-design/assets/example-dp-integration-full.html +88 -0
  146. package/framework/skills/diagram-design/assets/example-dp-integration.html +78 -0
  147. package/framework/skills/diagram-design/assets/example-dp-security-matrix-dark.html +31 -0
  148. package/framework/skills/diagram-design/assets/example-dp-security-matrix-full.html +32 -0
  149. package/framework/skills/diagram-design/assets/example-dp-security-matrix.html +88 -0
  150. package/framework/skills/diagram-design/assets/example-er-dark.html +200 -0
  151. package/framework/skills/diagram-design/assets/example-er-full.html +203 -0
  152. package/framework/skills/diagram-design/assets/example-er.html +200 -0
  153. package/framework/skills/diagram-design/assets/example-flowchart-dark.html +154 -0
  154. package/framework/skills/diagram-design/assets/example-flowchart-full.html +157 -0
  155. package/framework/skills/diagram-design/assets/example-flowchart.html +154 -0
  156. package/framework/skills/diagram-design/assets/example-gantt-dark.html +135 -0
  157. package/framework/skills/diagram-design/assets/example-gantt-full.html +125 -0
  158. package/framework/skills/diagram-design/assets/example-gantt.html +135 -0
  159. package/framework/skills/diagram-design/assets/example-high-level-dark.html +249 -0
  160. package/framework/skills/diagram-design/assets/example-high-level-full.html +245 -0
  161. package/framework/skills/diagram-design/assets/example-high-level-vertical-dark.html +272 -0
  162. package/framework/skills/diagram-design/assets/example-high-level-vertical-full.html +250 -0
  163. package/framework/skills/diagram-design/assets/example-high-level-vertical.html +323 -0
  164. package/framework/skills/diagram-design/assets/example-high-level.html +299 -0
  165. package/framework/skills/diagram-design/assets/example-it-state-dark.html +90 -0
  166. package/framework/skills/diagram-design/assets/example-it-state-full.html +69 -0
  167. package/framework/skills/diagram-design/assets/example-it-state.html +128 -0
  168. package/framework/skills/diagram-design/assets/example-layers-dark.html +121 -0
  169. package/framework/skills/diagram-design/assets/example-layers-full.html +124 -0
  170. package/framework/skills/diagram-design/assets/example-layers.html +121 -0
  171. package/framework/skills/diagram-design/assets/example-line-dark.html +109 -0
  172. package/framework/skills/diagram-design/assets/example-line-full.html +103 -0
  173. package/framework/skills/diagram-design/assets/example-line.html +109 -0
  174. package/framework/skills/diagram-design/assets/example-loop-dark.html +100 -0
  175. package/framework/skills/diagram-design/assets/example-loop-full.html +137 -0
  176. package/framework/skills/diagram-design/assets/example-loop-terminal.html +347 -0
  177. package/framework/skills/diagram-design/assets/example-loop.html +100 -0
  178. package/framework/skills/diagram-design/assets/example-medallion-dark.html +159 -0
  179. package/framework/skills/diagram-design/assets/example-medallion-full.html +201 -0
  180. package/framework/skills/diagram-design/assets/example-medallion.html +159 -0
  181. package/framework/skills/diagram-design/assets/example-nested-dark.html +130 -0
  182. package/framework/skills/diagram-design/assets/example-nested-full.html +133 -0
  183. package/framework/skills/diagram-design/assets/example-nested.html +134 -0
  184. package/framework/skills/diagram-design/assets/example-org-chart-dark.html +45 -0
  185. package/framework/skills/diagram-design/assets/example-org-chart-full.html +45 -0
  186. package/framework/skills/diagram-design/assets/example-org-chart.html +45 -0
  187. package/framework/skills/diagram-design/assets/example-process-dark.html +62 -0
  188. package/framework/skills/diagram-design/assets/example-process-full.html +72 -0
  189. package/framework/skills/diagram-design/assets/example-process.html +62 -0
  190. package/framework/skills/diagram-design/assets/example-pyramid-dark.html +117 -0
  191. package/framework/skills/diagram-design/assets/example-pyramid-full.html +120 -0
  192. package/framework/skills/diagram-design/assets/example-pyramid.html +117 -0
  193. package/framework/skills/diagram-design/assets/example-quadrant-consultant.html +164 -0
  194. package/framework/skills/diagram-design/assets/example-quadrant-dark.html +133 -0
  195. package/framework/skills/diagram-design/assets/example-quadrant-full.html +136 -0
  196. package/framework/skills/diagram-design/assets/example-quadrant.html +133 -0
  197. package/framework/skills/diagram-design/assets/example-radar-dark.html +137 -0
  198. package/framework/skills/diagram-design/assets/example-radar-full.html +133 -0
  199. package/framework/skills/diagram-design/assets/example-radar.html +137 -0
  200. package/framework/skills/diagram-design/assets/example-scatter-dark.html +139 -0
  201. package/framework/skills/diagram-design/assets/example-scatter-full.html +114 -0
  202. package/framework/skills/diagram-design/assets/example-scatter.html +139 -0
  203. package/framework/skills/diagram-design/assets/example-sequence-dark.html +220 -0
  204. package/framework/skills/diagram-design/assets/example-sequence-full.html +386 -0
  205. package/framework/skills/diagram-design/assets/example-sequence.html +220 -0
  206. package/framework/skills/diagram-design/assets/example-state-dark.html +145 -0
  207. package/framework/skills/diagram-design/assets/example-state-full.html +148 -0
  208. package/framework/skills/diagram-design/assets/example-state.html +145 -0
  209. package/framework/skills/diagram-design/assets/example-swimlane-dark.html +170 -0
  210. package/framework/skills/diagram-design/assets/example-swimlane-full.html +173 -0
  211. package/framework/skills/diagram-design/assets/example-swimlane.html +170 -0
  212. package/framework/skills/diagram-design/assets/example-timeline-dark.html +133 -0
  213. package/framework/skills/diagram-design/assets/example-timeline-full.html +136 -0
  214. package/framework/skills/diagram-design/assets/example-timeline.html +133 -0
  215. package/framework/skills/diagram-design/assets/example-tree-dark.html +171 -0
  216. package/framework/skills/diagram-design/assets/example-tree-full.html +174 -0
  217. package/framework/skills/diagram-design/assets/example-tree.html +171 -0
  218. package/framework/skills/diagram-design/assets/example-venn-dark.html +130 -0
  219. package/framework/skills/diagram-design/assets/example-venn-full.html +133 -0
  220. package/framework/skills/diagram-design/assets/example-venn.html +108 -0
  221. package/framework/skills/diagram-design/assets/icons.html +230 -0
  222. package/framework/skills/diagram-design/assets/index.html +333 -0
  223. package/framework/skills/diagram-design/assets/template-dark.html +82 -0
  224. package/framework/skills/diagram-design/assets/template-full.html +410 -0
  225. package/framework/skills/diagram-design/assets/template-terminal.html +170 -0
  226. package/framework/skills/diagram-design/assets/template.html +83 -0
  227. package/framework/skills/diagram-design/references/export.md +107 -0
  228. package/framework/skills/diagram-design/references/onboarding.md +268 -0
  229. package/framework/skills/diagram-design/references/primitive-annotation.md +36 -0
  230. package/framework/skills/diagram-design/references/primitive-icons.md +821 -0
  231. package/framework/skills/diagram-design/references/primitive-sketchy.md +43 -0
  232. package/framework/skills/diagram-design/references/primitive-terminal.md +76 -0
  233. package/framework/skills/diagram-design/references/style-guide.md +139 -0
  234. package/framework/skills/diagram-design/references/type-architecture.md +78 -0
  235. package/framework/skills/diagram-design/references/type-bar.md +48 -0
  236. package/framework/skills/diagram-design/references/type-data-flow.md +374 -0
  237. package/framework/skills/diagram-design/references/type-dp-integration.md +410 -0
  238. package/framework/skills/diagram-design/references/type-dp-security-matrix.md +379 -0
  239. package/framework/skills/diagram-design/references/type-er.md +23 -0
  240. package/framework/skills/diagram-design/references/type-flowchart.md +23 -0
  241. package/framework/skills/diagram-design/references/type-gantt.md +45 -0
  242. package/framework/skills/diagram-design/references/type-high-level.md +458 -0
  243. package/framework/skills/diagram-design/references/type-it-state.md +470 -0
  244. package/framework/skills/diagram-design/references/type-layers.md +26 -0
  245. package/framework/skills/diagram-design/references/type-line.md +44 -0
  246. package/framework/skills/diagram-design/references/type-loop.md +223 -0
  247. package/framework/skills/diagram-design/references/type-medallion.md +356 -0
  248. package/framework/skills/diagram-design/references/type-nested.md +22 -0
  249. package/framework/skills/diagram-design/references/type-org-chart.md +44 -0
  250. package/framework/skills/diagram-design/references/type-process.md +495 -0
  251. package/framework/skills/diagram-design/references/type-pyramid.md +33 -0
  252. package/framework/skills/diagram-design/references/type-quadrant.md +81 -0
  253. package/framework/skills/diagram-design/references/type-radar.md +80 -0
  254. package/framework/skills/diagram-design/references/type-scatter.md +39 -0
  255. package/framework/skills/diagram-design/references/type-sequence.md +35 -0
  256. package/framework/skills/diagram-design/references/type-state.md +21 -0
  257. package/framework/skills/diagram-design/references/type-swimlane.md +20 -0
  258. package/framework/skills/diagram-design/references/type-timeline.md +20 -0
  259. package/framework/skills/diagram-design/references/type-tree.md +24 -0
  260. package/framework/skills/diagram-design/references/type-venn.md +26 -0
  261. package/framework/skills/documentation/SKILL.md +74 -0
  262. package/framework/skills/documentation/examples.md +31 -0
  263. package/framework/skills/find-skills/SKILL.md +141 -0
  264. package/framework/skills/find-skills/examples.md +35 -0
  265. package/framework/skills/gitlab-mcp/SKILL.md +83 -0
  266. package/framework/skills/gitlab-mcp/examples.md +31 -0
  267. package/framework/skills/gitlab-mcp/references/code-review.md +110 -0
  268. package/framework/skills/gitlab-mcp/references/issues.md +141 -0
  269. package/framework/skills/gitlab-mcp/references/merge-requests.md +120 -0
  270. package/framework/skills/gitlab-mcp/references/pipelines.md +67 -0
  271. package/framework/skills/gitlab-mcp/references/search.md +17 -0
  272. package/framework/skills/gitlab-mcp/references/webhooks.md +32 -0
  273. package/framework/skills/gitlab-mcp/references/work-items.md +50 -0
  274. package/framework/skills/jira-mcp/SKILL.md +57 -0
  275. package/framework/skills/jira-mcp/examples.md +31 -0
  276. package/framework/skills/jira-mcp/references/comments.md +27 -0
  277. package/framework/skills/jira-mcp/references/issues.md +97 -0
  278. package/framework/skills/jira-mcp/references/projects.md +39 -0
  279. package/framework/skills/laravel-best-practices/SKILL.md +229 -0
  280. package/framework/skills/laravel-best-practices/examples.md +31 -0
  281. package/framework/skills/laravel-best-practices/references/advanced-queries.md +106 -0
  282. package/framework/skills/laravel-best-practices/references/architecture.md +202 -0
  283. package/framework/skills/laravel-best-practices/references/blade-views.md +36 -0
  284. package/framework/skills/laravel-best-practices/references/caching.md +70 -0
  285. package/framework/skills/laravel-best-practices/references/collections.md +44 -0
  286. package/framework/skills/laravel-best-practices/references/config.md +73 -0
  287. package/framework/skills/laravel-best-practices/references/db-performance.md +192 -0
  288. package/framework/skills/laravel-best-practices/references/eloquent.md +148 -0
  289. package/framework/skills/laravel-best-practices/references/error-handling.md +72 -0
  290. package/framework/skills/laravel-best-practices/references/events-notifications.md +52 -0
  291. package/framework/skills/laravel-best-practices/references/http-client.md +160 -0
  292. package/framework/skills/laravel-best-practices/references/mail.md +27 -0
  293. package/framework/skills/laravel-best-practices/references/migrations.md +121 -0
  294. package/framework/skills/laravel-best-practices/references/passport.md +197 -0
  295. package/framework/skills/laravel-best-practices/references/pennant.md +61 -0
  296. package/framework/skills/laravel-best-practices/references/pest-testing.md +166 -0
  297. package/framework/skills/laravel-best-practices/references/pulse.md +196 -0
  298. package/framework/skills/laravel-best-practices/references/queue-jobs.md +144 -0
  299. package/framework/skills/laravel-best-practices/references/routing.md +99 -0
  300. package/framework/skills/laravel-best-practices/references/scheduling.md +39 -0
  301. package/framework/skills/laravel-best-practices/references/scout.md +176 -0
  302. package/framework/skills/laravel-best-practices/references/security.md +198 -0
  303. package/framework/skills/laravel-best-practices/references/spatie-laravel-backup.md +222 -0
  304. package/framework/skills/laravel-best-practices/references/spatie-laravel-permission.md +272 -0
  305. package/framework/skills/laravel-best-practices/references/spatie-medialibrary.md +672 -0
  306. package/framework/skills/laravel-best-practices/references/style.md +125 -0
  307. package/framework/skills/laravel-best-practices/references/tailwindcss.md +112 -0
  308. package/framework/skills/laravel-best-practices/references/testing.md +43 -0
  309. package/framework/skills/laravel-best-practices/references/validation.md +75 -0
  310. package/framework/skills/lavish/SKILL.md +67 -0
  311. package/framework/skills/lavish/examples.md +31 -0
  312. package/framework/skills/notion-mcp/SKILL.md +57 -0
  313. package/framework/skills/notion-mcp/examples.md +31 -0
  314. package/framework/skills/notion-mcp/references/comments.md +112 -0
  315. package/framework/skills/notion-mcp/references/databases.md +193 -0
  316. package/framework/skills/notion-mcp/references/pages.md +235 -0
  317. package/framework/skills/skill-creator/LICENSE.txt +202 -0
  318. package/framework/skills/skill-creator/SKILL.md +485 -0
  319. package/framework/skills/skill-creator/agents/analyzer.md +274 -0
  320. package/framework/skills/skill-creator/agents/comparator.md +202 -0
  321. package/framework/skills/skill-creator/agents/grader.md +223 -0
  322. package/framework/skills/skill-creator/assets/eval_review.html +146 -0
  323. package/framework/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  324. package/framework/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  325. package/framework/skills/skill-creator/examples.md +31 -0
  326. package/framework/skills/skill-creator/references/schemas.md +430 -0
  327. package/framework/skills/skill-creator/scripts/__init__.py +0 -0
  328. package/framework/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  329. package/framework/skills/skill-creator/scripts/generate_report.py +326 -0
  330. package/framework/skills/skill-creator/scripts/improve_description.py +247 -0
  331. package/framework/skills/skill-creator/scripts/package_skill.py +136 -0
  332. package/framework/skills/skill-creator/scripts/quick_validate.py +103 -0
  333. package/framework/skills/skill-creator/scripts/run_eval.py +310 -0
  334. package/framework/skills/skill-creator/scripts/run_loop.py +328 -0
  335. package/framework/skills/skill-creator/scripts/utils.py +47 -0
  336. package/framework/styles/README.md +35 -0
  337. package/framework/styles/linear/DESIGN.md +478 -0
  338. package/framework/styles/linear/README.md +36 -0
  339. package/framework/styles/linear/assets/preview.jpg +0 -0
  340. package/framework/styles/raycast/DESIGN.md +495 -0
  341. package/framework/styles/raycast/README.md +35 -0
  342. package/framework/styles/raycast/assets/preview.jpg +0 -0
  343. package/package.json +33 -0
  344. package/src/agent-configs.js +96 -0
  345. package/src/catalog.js +145 -0
  346. package/src/cli.js +254 -0
  347. package/src/installer.js +303 -0
package/src/catalog.js ADDED
@@ -0,0 +1,145 @@
1
+ export const categories = {
2
+ skills: {
3
+ title: 'Skills',
4
+ description: 'Task-specific procedures for AI coding agents',
5
+ sourceDir: 'framework/skills',
6
+ items: [
7
+ { id: 'agent-browser', name: 'Agent Browser', description: 'Automate browser and Electron workflows for navigation, testing, screenshots, and data extraction' },
8
+ { id: 'backend-best-practices', name: 'Backend Best Practices', description: 'Consolidated backend engineering practices across API, data, security, testing, and operations' },
9
+ { id: 'backend-engineer', name: 'Backend Engineer', description: 'Analyze backend requirements, risks, and implementation plans' },
10
+ { id: 'brainstorming', name: 'Brainstorming', description: 'Turn ideas into fully formed designs through dialogue' },
11
+ { id: 'brand-guidelines', name: 'Brand Guidelines', description: 'Apply official brand colors and typography' },
12
+ { id: 'code-review', name: 'Code Review', description: 'Review backend changes for correctness and maintainability' },
13
+ { id: 'design', name: 'Design Like Damien', description: 'Premium UI design philosophy and Lovable prompting' },
14
+ { id: 'diagram-design', name: 'Diagram Design', description: 'Create technical and product diagrams as standalone HTML with inline SVG' },
15
+ { id: 'documentation', name: 'Documentation', description: 'Create ADRs, design docs, runbooks, and API docs' },
16
+ { id: 'find-skills', name: 'Find Skills', description: 'Discover, evaluate, and install agent skills for specialized tasks' },
17
+ { id: 'gitlab-mcp', name: 'GitLab MCP', description: 'Work with GitLab via MCP for MRs, issues, pipelines' },
18
+ { id: 'jira-mcp', name: 'Jira MCP', description: 'Work with Jira MCP for issue management and JQL search' },
19
+ { id: 'laravel-best-practices', name: 'Laravel Best Practices', description: 'Laravel patterns for Eloquent, validation, testing' },
20
+ { id: 'lavish', name: 'Lavish', description: 'Turn complex responses into rich HTML artifacts' },
21
+ { id: 'notion-mcp', name: 'Notion MCP', description: 'Work with Notion MCP for pages, databases, search' },
22
+ { id: 'skill-creator', name: 'Skill Creator', description: 'Create and evaluate new agent skills' }
23
+ ],
24
+ },
25
+
26
+ agents: {
27
+ title: 'Subagents',
28
+ description: 'Specialized subagents for security, architecture, review, and research',
29
+ sourceDir: 'framework/agents',
30
+ items: [
31
+ { id: 'backend-architect', name: 'Backend Architect', description: 'Design scalable, secure backend systems' },
32
+ { id: 'researcher', name: 'Researcher', description: 'Fetch and analyze web content from URLs' },
33
+ { id: 'reviewer', name: 'Reviewer', description: 'Review code for correctness and best practices' },
34
+ { id: 'security-auditor', name: 'Security Auditor', description: 'Conduct security audits for REST APIs' },
35
+ ],
36
+ },
37
+
38
+ commands: {
39
+ title: 'Slash Commands',
40
+ description: 'Slash command workflows for repeatable tasks',
41
+ sourceDir: 'framework/commands',
42
+ items: [
43
+ { id: 'changelog', name: 'Changelog', description: 'Create, add, or update CHANGELOG.md entries' },
44
+ { id: 'commit', name: 'Commit', description: 'Create atomic git commits with conventional messages' },
45
+ { id: 'learn', name: 'Learn', description: 'Distill a reusable skill from any source' },
46
+ { id: 'pr', name: 'PR', description: 'Create a GitHub PR for the current branch' },
47
+ { id: 'mr', name: 'MR', description: 'Create a GitLab MR for the current branch' },
48
+ { id: 'release', name: 'Release', description: 'Tag releases, update changelog, and bump versions' },
49
+ { id: 'review', name: 'Review', description: 'Perform comprehensive code quality review' },
50
+ { id: 'summarize-changes', name: 'Summarize Changes', description: 'Summarize uncommitted changes and flag risks' },
51
+ ],
52
+ },
53
+
54
+ mcps: {
55
+ title: 'MCPs',
56
+ description: 'Model Context Protocol servers for AI coding agents',
57
+ sourceDir: 'framework/mcps',
58
+ items: [
59
+ { id: 'excalidraw', name: 'Excalidraw MCP', description: 'Stream hand-drawn diagrams with interactive editing' },
60
+ { id: 'figma-mcp-go', name: 'Figma MCP Go', description: 'Read/write access to Figma designs via plugin bridge' },
61
+ { id: 'gitlab-mcp', name: 'GitLab MCP', description: 'Comprehensive GitLab integration' },
62
+ { id: 'github-mcp', name: 'GitHub MCP', description: 'Browse repos, manage issues/PRs, monitor Actions' },
63
+ { id: 'jira-mcp', name: 'Jira MCP', description: 'Interact with self-hosted Jira instances' },
64
+ { id: 'laravel-boost', name: 'Laravel Boost MCP', description: 'Laravel application context and ecosystem docs' },
65
+ { id: 'notion-mcp', name: 'Notion MCP', description: 'Search, read, and write Notion content' },
66
+ { id: 'playwright-mcp', name: 'Playwright MCP', description: 'Cross-browser automation with accessibility snapshots' },
67
+ { id: 'supabase-mcp', name: 'Supabase MCP', description: 'Manage Supabase projects, SQL, Edge Functions, Auth, Storage, and Realtime' },
68
+ ],
69
+ },
70
+
71
+ plugins: {
72
+ title: 'Plugins',
73
+ description: 'OpenCode plugins that extend the core agent',
74
+ sourceDir: 'framework/plugins',
75
+ items: [
76
+ { id: 'opencode-goal-plugin', name: 'OpenCode Goal Plugin', description: 'Goal-driven long-running tasks with persistence' },
77
+ { id: 'ponytail', name: 'Ponytail', description: 'Lazy senior dev mode — YAGNI-first, reuse-first ladder that reduces code bloat and cost' },
78
+ ],
79
+ },
80
+
81
+ styles: {
82
+ title: 'Styles',
83
+ description: 'Design system references from Refero Styles',
84
+ sourceDir: 'framework/styles',
85
+ items: [
86
+ { id: 'linear', name: 'Linear', description: 'Midnight precision instrument design system' },
87
+ { id: 'raycast', name: 'Raycast', description: 'Midnight command center design system' },
88
+ ],
89
+ },
90
+
91
+ modes: {
92
+ title: 'Modes',
93
+ description: 'Behavior, tool, and prompt presets for different use cases',
94
+ sourceDir: 'framework/modes',
95
+ items: [
96
+ { id: 'audit', name: 'Audit', description: 'Read-only high-scrutiny review mode for evaluating artifacts' },
97
+ ],
98
+ },
99
+
100
+ memory: {
101
+ title: 'Memory',
102
+ description: 'Persistent agent memory files for cross-session context',
103
+ sourceDir: 'framework/memory',
104
+ items: [
105
+ { id: 'codebase-insights', name: 'Codebase Insights', description: 'Non-obvious facts, gotchas, past decisions, and architecture quirks' },
106
+ { id: 'user-preferences', name: 'User Preferences', description: 'Coding style, naming conventions, and architectural preferences' },
107
+ ],
108
+ },
109
+
110
+ standards: {
111
+ title: 'Standards',
112
+ description: 'Canonical engineering standards',
113
+ sourceDir: 'framework/references/standards',
114
+ items: [
115
+ { id: 'api', name: 'API Design', description: 'REST API design standards' },
116
+ { id: 'architecture', name: 'Architecture', description: 'System architecture standards' },
117
+ { id: 'database', name: 'Database', description: 'Database design standards' },
118
+ { id: 'debugging', name: 'Debugging', description: 'Debugging methodology' },
119
+ { id: 'documentation', name: 'Documentation', description: 'Documentation standards' },
120
+ { id: 'logging', name: 'Logging', description: 'Logging standards' },
121
+ { id: 'naming', name: 'Naming', description: 'Naming conventions' },
122
+ { id: 'observability', name: 'Observability', description: 'Observability standards' },
123
+ { id: 'performance', name: 'Performance', description: 'Performance standards' },
124
+ { id: 'pull-requests', name: 'Pull Requests', description: 'Pull request standards' },
125
+ { id: 'security', name: 'Security', description: 'Security standards' },
126
+ { id: 'testing', name: 'Testing', description: 'Testing standards' },
127
+ ],
128
+ },
129
+
130
+ templates: {
131
+ title: 'Templates',
132
+ description: 'Fillable workflow documents',
133
+ sourceDir: 'framework/references/templates',
134
+ items: [
135
+ { id: 'adr', name: 'ADR', description: 'Architecture Decision Record' },
136
+ { id: 'api-spec', name: 'API Spec', description: 'API specification document' },
137
+ { id: 'design-document', name: 'Design Document', description: 'Design document template' },
138
+ { id: 'incident-report', name: 'Incident Report', description: 'Incident report template' },
139
+ { id: 'postmortem', name: 'Postmortem', description: 'Postmortem template' },
140
+ { id: 'pull-request', name: 'Pull Request', description: 'Pull request template' },
141
+ { id: 'runbook', name: 'Runbook', description: 'Runbook template' },
142
+ { id: 'task', name: 'Task', description: 'Task template' },
143
+ ],
144
+ },
145
+ };
package/src/cli.js ADDED
@@ -0,0 +1,254 @@
1
+ import { intro, outro, confirm, multiselect, spinner, isCancel } from '@clack/prompts';
2
+ import { resolve } from 'node:path';
3
+
4
+ import { categories } from './catalog.js';
5
+ import { getPackageVersion, install, loadLockFile } from './installer.js';
6
+
7
+ function buildSummary(selections) {
8
+ const lines = [];
9
+ for (const [cat, ids] of Object.entries(selections)) {
10
+ if (!ids?.length) continue;
11
+ const catConfig = categories[cat];
12
+ const label = catConfig?.title || cat;
13
+ const names = ids.map(id => {
14
+ const item = catConfig?.items.find(i => i.id === id);
15
+ return item ? item.name : id;
16
+ });
17
+ lines.push(` ${label}: ${names.join(', ')}`);
18
+ }
19
+ return lines.join('\n');
20
+ }
21
+
22
+ function computeDiff(oldLock, selections) {
23
+ const oldSels = oldLock.selections;
24
+ const added = {};
25
+ const removed = {};
26
+ const kept = {};
27
+
28
+ const allCats = [...new Set([...Object.keys(oldSels), ...Object.keys(selections)])];
29
+
30
+ for (const cat of allCats) {
31
+ const catConfig = categories[cat] || null;
32
+ const oldIds = new Set(oldSels[cat] || []);
33
+ const newIds = new Set(selections[cat] || []);
34
+
35
+ const addedIds = [...newIds].filter(id => !oldIds.has(id));
36
+ const removedIds = [...oldIds].filter(id => !newIds.has(id));
37
+ const keptIds = [...newIds].filter(id => oldIds.has(id));
38
+
39
+ if (addedIds.length) added[cat] = { config: catConfig, ids: addedIds };
40
+ if (removedIds.length) removed[cat] = { config: catConfig, ids: removedIds };
41
+ if (keptIds.length) kept[cat] = { config: catConfig, ids: keptIds };
42
+ }
43
+
44
+ return { added, removed, kept };
45
+ }
46
+
47
+ function formatDiff(diff) {
48
+ const { added, removed, kept } = diff;
49
+ const lines = [];
50
+
51
+ if (Object.keys(added).length) {
52
+ lines.push(' + Added:');
53
+ for (const [cat, data] of Object.entries(added)) {
54
+ const names = data.ids.map(id => {
55
+ const item = data.config?.items?.find(i => i.id === id);
56
+ return item?.name || id;
57
+ });
58
+ lines.push(` ${data.config?.title || cat}: ${names.join(', ')}`);
59
+ }
60
+ }
61
+
62
+ if (Object.keys(removed).length) {
63
+ if (lines.length) lines.push('');
64
+ lines.push(' - Removed:');
65
+ for (const [cat, data] of Object.entries(removed)) {
66
+ const names = data.ids.map(id => {
67
+ const item = data.config?.items?.find(i => i.id === id);
68
+ return item?.name || id;
69
+ });
70
+ lines.push(` ${data.config?.title || cat}: ${names.join(', ')}`);
71
+ }
72
+ }
73
+
74
+ if (Object.keys(kept).length) {
75
+ if (lines.length) lines.push('');
76
+ lines.push(' ~ Unchanged:');
77
+ for (const [cat, data] of Object.entries(kept)) {
78
+ const names = data.ids.map(id => {
79
+ const item = data.config?.items?.find(i => i.id === id);
80
+ return item?.name || id;
81
+ });
82
+ lines.push(` ${data.config?.title || cat}: ${names.join(', ')}`);
83
+ }
84
+ }
85
+
86
+ return lines.join('\n');
87
+ }
88
+
89
+ export async function main() {
90
+ const version = await getPackageVersion();
91
+ intro(`System prompt (v${version})`);
92
+
93
+ const agentType = 'opencode';
94
+ const targetDir = '.opencode';
95
+
96
+ const categoryOptions = Object.entries(categories).map(([key, cat]) => {
97
+ const visible = cat.items.filter(i => !i.removed);
98
+ return {
99
+ value: key,
100
+ label: cat.title,
101
+ hint: `${visible.length} ${key === 'mcps' ? 'MCPs' : cat.title.toLowerCase()}`,
102
+ };
103
+ });
104
+
105
+ const selectedCategories = await multiselect({
106
+ message: 'What would you like to install?',
107
+ options: categoryOptions,
108
+ required: false,
109
+ });
110
+ if (isCancel(selectedCategories)) {
111
+ outro('Cancelled.');
112
+ process.exit(0);
113
+ }
114
+
115
+ if (!selectedCategories?.length) {
116
+ const includeAgentsMd = await confirm({
117
+ message: 'Generate AGENTS.md?',
118
+ initialValue: true,
119
+ });
120
+ if (isCancel(includeAgentsMd)) {
121
+ outro('Cancelled.');
122
+ process.exit(0);
123
+ }
124
+
125
+ const s = spinner();
126
+ s.start('Writing files...');
127
+ await install({
128
+ targetDir,
129
+ agentType,
130
+ selections: {},
131
+ includeAgentsMd,
132
+ });
133
+ s.stop('Done.');
134
+ const installed = [];
135
+ if (includeAgentsMd) installed.push('AGENTS.md');
136
+ outro(`${installed.join(' and ')} written. Open them in your project to get started.`);
137
+ process.exit(0);
138
+ }
139
+
140
+ const selections = {};
141
+
142
+ const includeAgentsMd = await confirm({
143
+ message: 'Generate AGENTS.md?',
144
+ initialValue: true,
145
+ });
146
+ if (isCancel(includeAgentsMd)) {
147
+ outro('Cancelled.');
148
+ process.exit(0);
149
+ }
150
+
151
+ for (const cat of selectedCategories) {
152
+ const catConfig = categories[cat];
153
+ const allIds = catConfig.items.map(i => i.id);
154
+
155
+ const visibleItems = catConfig.items.filter(i => !i.removed);
156
+
157
+ const all = await confirm({
158
+ message: `Install all ${catConfig.title.toLowerCase()}?`,
159
+ initialValue: visibleItems.length <= 12,
160
+ });
161
+ if (isCancel(all)) {
162
+ outro('Cancelled.');
163
+ process.exit(0);
164
+ }
165
+
166
+ if (all) {
167
+ selections[cat] = visibleItems.map(i => i.id);
168
+ } else {
169
+ const picked = await multiselect({
170
+ message: `Which ${catConfig.title.toLowerCase()} do you want?`,
171
+ options: visibleItems.map(item => ({
172
+ value: item.id,
173
+ label: item.deprecated ? `${item.name} (deprecated)` : item.name,
174
+ hint: item.deprecated ? '⚠ Deprecated — consider alternatives' : item.description,
175
+ })),
176
+ required: true,
177
+ });
178
+ if (isCancel(picked)) {
179
+ outro('Cancelled.');
180
+ process.exit(0);
181
+ }
182
+ selections[cat] = picked;
183
+ }
184
+ }
185
+
186
+ const absTarget = resolve(process.cwd(), targetDir);
187
+ const oldLock = await loadLockFile(absTarget);
188
+
189
+ if (oldLock) {
190
+ const diff = computeDiff(oldLock, selections);
191
+ const diffText = formatDiff(diff);
192
+
193
+ console.log('\n📦 Changes from previous installation:\n');
194
+ if (diffText) {
195
+ console.log(diffText);
196
+ console.log();
197
+ } else {
198
+ console.log(' No changes — same selections as before.\n');
199
+ }
200
+
201
+ const genFiles = [];
202
+ if (includeAgentsMd) genFiles.push('AGENTS.md');
203
+ genFiles.push('opencode.json', 'tui.json', '.gitignore');
204
+ if (selections.mcps?.length) genFiles.push('.env');
205
+ if (selections.memory?.length) genFiles.push('memory/');
206
+
207
+ if (genFiles.length) {
208
+ console.log(' Generated files:');
209
+ for (const f of genFiles) {
210
+ console.log(` 📄 ${f}`);
211
+ }
212
+ console.log();
213
+ }
214
+ } else {
215
+ console.log('\n📦 Summary of what will be installed:\n');
216
+ if (includeAgentsMd) console.log(' 📄 AGENTS.md');
217
+ console.log(' 📄 opencode.json');
218
+ console.log(' 📄 tui.json');
219
+ console.log(' 📄 .gitignore');
220
+ console.log(buildSummary(selections));
221
+ console.log();
222
+ }
223
+
224
+ const confirmed = await confirm({
225
+ message: 'Proceed with installation?',
226
+ initialValue: true,
227
+ });
228
+ if (isCancel(confirmed) || !confirmed) {
229
+ outro('Installation cancelled.');
230
+ process.exit(0);
231
+ }
232
+
233
+ const s = spinner();
234
+ s.start(oldLock ? 'Updating files...' : 'Installing files...');
235
+
236
+ const finalTarget = await install({
237
+ targetDir,
238
+ agentType,
239
+ selections,
240
+ includeAgentsMd,
241
+ oldSelections: oldLock?.selections,
242
+ });
243
+
244
+ s.stop('Installation complete!');
245
+
246
+ const fileCount = Object.values(selections).reduce((sum, arr) => sum + (arr?.length || 0), 0);
247
+ const verb = oldLock ? 'Updated' : 'Installed';
248
+ outro(`${verb} ${fileCount} components to ${finalTarget}
249
+
250
+ Next steps:
251
+ ${agentType === 'opencode' ? '- Open your project in OpenCode — it will read opencode.json and AGENTS.md automatically' : '- Point your AI coding agent to AGENTS.md as the entry point'}
252
+ - Run /help in your agent to see available commands
253
+ `);
254
+ }
@@ -0,0 +1,303 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ import { dirname, resolve } from 'node:path';
3
+ import { mkdir, copyFile, writeFile, readdir, stat, readFile, rm } from 'node:fs/promises';
4
+
5
+ import { categories } from './catalog.js';
6
+ import { loadMcpConfigs, generateOpenCodeConfig, generateTuiConfig } from './agent-configs.js';
7
+
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const packageRoot = resolve(__dirname, '..');
10
+
11
+ const AGENTS_MD = `# AGENTS.md
12
+
13
+ > Fill this base on project use /init command
14
+ `;
15
+
16
+ const OPENCODE_GITIGNORE = `.env*
17
+ node_modules
18
+ package.json
19
+ package-lock.json
20
+ bun.lock
21
+ `;
22
+
23
+ export async function getPackageVersion() {
24
+ try {
25
+ const pkg = JSON.parse(await readFile(resolve(packageRoot, 'package.json'), 'utf-8'));
26
+ return pkg.version || '0.0.0';
27
+ } catch {
28
+ return '0.0.0';
29
+ }
30
+ }
31
+
32
+ export async function loadLockFile(absTarget) {
33
+ try {
34
+ const content = await readFile(resolve(absTarget, 'system-prompt-lock.json'), 'utf-8');
35
+ return JSON.parse(content);
36
+ } catch {
37
+ return null;
38
+ }
39
+ }
40
+
41
+ function resolveSource(subpath) {
42
+ return resolve(packageRoot, subpath);
43
+ }
44
+
45
+ function targetSubdir(sourceDir) {
46
+ return sourceDir.replace(/^framework\//, '');
47
+ }
48
+
49
+ async function copyDir(src, dest) {
50
+ await mkdir(dest, { recursive: true });
51
+ const entries = await readdir(src, { withFileTypes: true });
52
+
53
+ for (const entry of entries) {
54
+ if (entry.name === '.DS_Store') continue;
55
+ const srcPath = resolve(src, entry.name);
56
+ const destPath = resolve(dest, entry.name);
57
+
58
+ if (entry.isDirectory()) {
59
+ await copyDir(srcPath, destPath);
60
+ } else if (entry.isFile()) {
61
+ await mkdir(dirname(destPath), { recursive: true });
62
+ await copyFile(srcPath, destPath);
63
+ }
64
+ }
65
+ }
66
+
67
+ async function isRemoved(category, id) {
68
+ const catConfig = categories[category];
69
+ if (!catConfig) return false;
70
+ const item = catConfig.items.find(i => i.id === id);
71
+ return item?.removed === true;
72
+ }
73
+
74
+ async function copySelectedDirs(targetDir, category, selectedIds) {
75
+ const catConfig = categories[category];
76
+ if (!catConfig || !selectedIds?.length) return;
77
+
78
+ const relativeDir = targetSubdir(catConfig.sourceDir);
79
+ const destParent = resolve(targetDir, relativeDir);
80
+
81
+ for (const id of selectedIds) {
82
+ if (await isRemoved(category, id)) continue;
83
+
84
+ const srcPath = resolveSource(`${catConfig.sourceDir}/${id}`);
85
+ const destPath = resolve(destParent, id);
86
+
87
+ try {
88
+ await stat(srcPath);
89
+ await copyDir(srcPath, destPath);
90
+ } catch {
91
+ console.warn(` ⚠ Source not found: ${catConfig.sourceDir}/${id}`);
92
+ }
93
+ }
94
+ }
95
+
96
+ async function copySelectedFiles(targetDir, category, selectedIds, skipIfExists = false) {
97
+ const catConfig = categories[category];
98
+ if (!catConfig || !selectedIds?.length) return;
99
+
100
+ const relativeDir = targetSubdir(catConfig.sourceDir);
101
+ const destParent = resolve(targetDir, relativeDir);
102
+ await mkdir(destParent, { recursive: true });
103
+
104
+ for (const id of selectedIds) {
105
+ if (await isRemoved(category, id)) continue;
106
+
107
+ const srcFile = resolveSource(`${catConfig.sourceDir}/${id}.md`);
108
+ const destFile = resolve(destParent, `${id}.md`);
109
+ try {
110
+ await stat(srcFile);
111
+ if (skipIfExists) {
112
+ try {
113
+ await stat(destFile);
114
+ continue;
115
+ } catch {
116
+ // dest doesn't exist — proceed to copy
117
+ }
118
+ }
119
+ await copyFile(srcFile, destFile);
120
+ } catch {
121
+ console.warn(` ⚠ Source not found: ${catConfig.sourceDir}/${id}.md`);
122
+ }
123
+ }
124
+ }
125
+
126
+ function parseEnv(content) {
127
+ const vars = new Map();
128
+ for (const line of content.split('\n')) {
129
+ const trimmed = line.trim();
130
+ if (!trimmed || trimmed.startsWith('#')) continue;
131
+ const eqIndex = trimmed.indexOf('=');
132
+ if (eqIndex === -1) {
133
+ vars.set(trimmed, '');
134
+ } else {
135
+ const key = trimmed.slice(0, eqIndex).trim();
136
+ const value = trimmed.slice(eqIndex + 1).trim();
137
+ if (key) vars.set(key, value);
138
+ }
139
+ }
140
+ return vars;
141
+ }
142
+
143
+ async function collectMcpEnvExamples(mcpIds) {
144
+ const combined = new Map();
145
+ for (const id of mcpIds) {
146
+ try {
147
+ const examplePath = resolveSource(`framework/mcps/${id}/configs/.env.example`);
148
+ const content = await readFile(examplePath, 'utf-8');
149
+ const parsed = parseEnv(content);
150
+ for (const [key, value] of parsed) {
151
+ if (!combined.has(key)) combined.set(key, value);
152
+ }
153
+ } catch {
154
+ // Silently skip MCPs without .env.example
155
+ }
156
+ }
157
+ return combined;
158
+ }
159
+
160
+ async function deleteSelectedItems(absTarget, category, ids) {
161
+ const catConfig = categories[category];
162
+ if (!catConfig || !ids?.length) return;
163
+
164
+ const FILE_BASED = new Set(['agents', 'commands', 'memory', 'modes', 'standards', 'templates']);
165
+ if (!FILE_BASED.has(category) && category !== 'skills' && category !== 'styles') return;
166
+
167
+ const relativeDir = targetSubdir(catConfig.sourceDir);
168
+ const destParent = resolve(absTarget, relativeDir);
169
+
170
+ for (const id of ids) {
171
+ const destPath = FILE_BASED.has(category)
172
+ ? resolve(destParent, `${id}.md`)
173
+ : resolve(destParent, id);
174
+ try {
175
+ await rm(destPath, { recursive: true, force: true });
176
+ } catch {
177
+ // File may not exist — ignore
178
+ }
179
+ }
180
+ }
181
+
182
+ async function writeMergedEnv(absTarget, examples) {
183
+ if (examples.size === 0) return;
184
+
185
+ const envPath = resolve(absTarget, '.env');
186
+ const existing = new Map();
187
+
188
+ try {
189
+ const existingContent = await readFile(envPath, 'utf-8');
190
+ const parsed = parseEnv(existingContent);
191
+ for (const [key, value] of parsed) existing.set(key, value);
192
+ } catch {
193
+ // File doesn't exist yet
194
+ }
195
+
196
+ const merged = new Map(existing);
197
+ for (const [key, value] of examples) {
198
+ if (!merged.has(key)) merged.set(key, value);
199
+ }
200
+
201
+ if (merged.size === 0) return;
202
+
203
+ const lines = [];
204
+ for (const [key, value] of merged) {
205
+ lines.push(`${key}=${value}`);
206
+ }
207
+ lines.push('');
208
+
209
+ await writeFile(envPath, lines.join('\n'));
210
+ }
211
+
212
+ function generateAgentsMd({ selections }) {
213
+ return AGENTS_MD;
214
+ }
215
+
216
+ export async function install({ targetDir, agentType, selections, includeAgentsMd = true, writeAgentsMd, oldSelections }) {
217
+ writeAgentsMd = writeAgentsMd ?? includeAgentsMd;
218
+ const absTarget = resolve(process.cwd(), targetDir);
219
+ await mkdir(absTarget, { recursive: true });
220
+
221
+ // Delete items that are no longer selected
222
+ if (oldSelections) {
223
+ for (const cat of Object.keys(oldSelections)) {
224
+ const oldIds = new Set(oldSelections[cat] || []);
225
+ const newIds = new Set(selections[cat] || []);
226
+ const removedIds = [...oldIds].filter(id => !newIds.has(id));
227
+ if (removedIds.length > 0) {
228
+ await deleteSelectedItems(absTarget, cat, removedIds);
229
+ }
230
+ }
231
+ }
232
+
233
+ const tasks = [];
234
+
235
+ if (selections.skills?.length) {
236
+ tasks.push(copySelectedDirs(absTarget, 'skills', selections.skills));
237
+ }
238
+ if (selections.agents?.length) {
239
+ tasks.push(copySelectedFiles(absTarget, 'agents', selections.agents));
240
+ }
241
+ if (selections.commands?.length) {
242
+ tasks.push(copySelectedFiles(absTarget, 'commands', selections.commands));
243
+ }
244
+ if (selections.styles?.length) {
245
+ tasks.push(copySelectedDirs(absTarget, 'styles', selections.styles));
246
+ }
247
+ if (selections.modes?.length) {
248
+ tasks.push(copySelectedFiles(absTarget, 'modes', selections.modes));
249
+ }
250
+ if (selections.memory?.length) {
251
+ tasks.push(copySelectedFiles(absTarget, 'memory', selections.memory, true));
252
+ }
253
+ if (selections.standards?.length) {
254
+ tasks.push(copySelectedFiles(absTarget, 'standards', selections.standards));
255
+ }
256
+ if (selections.templates?.length) {
257
+ tasks.push(copySelectedFiles(absTarget, 'templates', selections.templates));
258
+ }
259
+
260
+ await Promise.all(tasks);
261
+
262
+ if (writeAgentsMd) {
263
+ const agentsContent = generateAgentsMd({ selections });
264
+ await writeFile(resolve(absTarget, 'AGENTS.md'), agentsContent);
265
+ }
266
+
267
+ if (agentType === 'opencode') {
268
+ let mcpEntries = {};
269
+ if (selections.mcps?.length) {
270
+ mcpEntries = await loadMcpConfigs(selections.mcps);
271
+ }
272
+ const configJson = generateOpenCodeConfig({
273
+ selections,
274
+ mcpEntries,
275
+ includeAgentsMd: includeAgentsMd,
276
+ });
277
+ if (configJson) {
278
+ await writeFile(resolve(absTarget, 'opencode.json'), configJson);
279
+ }
280
+ await writeFile(resolve(absTarget, 'tui.json'), generateTuiConfig({ selections }));
281
+ await writeFile(resolve(absTarget, '.gitignore'), OPENCODE_GITIGNORE);
282
+ }
283
+
284
+ if (selections.mcps?.length) {
285
+ const envExamples = await collectMcpEnvExamples(selections.mcps);
286
+ await writeMergedEnv(absTarget, envExamples);
287
+ }
288
+
289
+ const version = await getPackageVersion();
290
+ const lockData = {
291
+ version,
292
+ agentType,
293
+ targetDir,
294
+ installedAt: new Date().toISOString(),
295
+ selections: Object.fromEntries(
296
+ Object.entries(selections).map(([k, v]) => [k, [...v]])
297
+ ),
298
+ includeAgentsMd,
299
+ };
300
+ await writeFile(resolve(absTarget, 'system-prompt-lock.json'), JSON.stringify(lockData, null, 2));
301
+
302
+ return absTarget;
303
+ }