@hasna/skills 0.1.26 → 0.1.29

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 (491) hide show
  1. package/LICENSE +1 -10
  2. package/README.md +141 -39
  3. package/bin/index.js +30122 -27575
  4. package/bin/mcp.js +22112 -18593
  5. package/dist/cli/cli.test-utils.d.ts +15 -0
  6. package/dist/cli/commands/auth.d.ts +2 -0
  7. package/dist/cli/commands/install.d.ts +1 -1
  8. package/dist/cli/commands/runtime-mcp.d.ts +4 -0
  9. package/dist/index.d.ts +9 -4
  10. package/dist/index.js +11607 -597
  11. package/dist/lib/auth-store.d.ts +13 -0
  12. package/dist/lib/installer.d.ts +58 -55
  13. package/dist/lib/mcp-contracts.d.ts +86 -0
  14. package/dist/lib/project-state.d.ts +43 -0
  15. package/dist/lib/registry-data/business-marketing.d.ts +2 -0
  16. package/dist/lib/registry-data/communication.d.ts +2 -0
  17. package/dist/lib/registry-data/content-generation.d.ts +2 -0
  18. package/dist/lib/registry-data/data-analysis.d.ts +2 -0
  19. package/dist/lib/registry-data/design-branding.d.ts +2 -0
  20. package/dist/lib/registry-data/development-tools.d.ts +2 -0
  21. package/dist/lib/registry-data/education-learning.d.ts +2 -0
  22. package/dist/lib/registry-data/event-management.d.ts +2 -0
  23. package/dist/lib/registry-data/finance-compliance.d.ts +2 -0
  24. package/dist/lib/registry-data/health-wellness.d.ts +2 -0
  25. package/dist/lib/registry-data/index.d.ts +2 -0
  26. package/dist/lib/registry-data/media-processing.d.ts +2 -0
  27. package/dist/lib/registry-data/productivity-organization.d.ts +2 -0
  28. package/dist/lib/registry-data/project-management.d.ts +2 -0
  29. package/dist/lib/registry-data/research-writing.d.ts +2 -0
  30. package/dist/lib/registry-data/science-academic.d.ts +2 -0
  31. package/dist/lib/registry-data/travel-lifestyle.d.ts +2 -0
  32. package/dist/lib/registry-data/web-browser.d.ts +2 -0
  33. package/dist/lib/registry-types.d.ts +27 -0
  34. package/dist/lib/registry.d.ts +6 -18
  35. package/dist/lib/remote-registry.d.ts +3 -0
  36. package/dist/lib/run-state.d.ts +60 -0
  37. package/dist/lib/skill-aliases.d.ts +17 -0
  38. package/dist/lib/skillinfo.d.ts +5 -1
  39. package/dist/mcp/discovery-tools.d.ts +2 -0
  40. package/dist/mcp/helpers.d.ts +26 -0
  41. package/dist/mcp/http.d.ts +10 -0
  42. package/dist/mcp/index.d.ts +3 -2
  43. package/dist/mcp/operation-tools.d.ts +2 -0
  44. package/dist/mcp/resource-meta-tools.d.ts +2 -0
  45. package/dist/mcp/schedule-tools.d.ts +2 -0
  46. package/dist/mcp/server.d.ts +4 -0
  47. package/dist/types/api.d.ts +7 -4
  48. package/package.json +23 -10
  49. package/skills/_common/http-client.ts +1 -1
  50. package/skills/_common/index.ts +2 -3
  51. package/skills/_common/install.sh +5 -110
  52. package/skills/_common/installer.ts +31 -282
  53. package/skills/_common/skill-install.ts +14 -181
  54. package/skills/ad-creative-pack/SKILL.md +45 -0
  55. package/skills/ad-creative-pack/package.json +14 -0
  56. package/skills/advanced-math/package.json +3 -1
  57. package/skills/advanced-math/src/calculators.ts +118 -0
  58. package/skills/advanced-math/src/cli.ts +130 -0
  59. package/skills/advanced-math/src/conversion.ts +90 -0
  60. package/skills/advanced-math/src/finance.ts +75 -0
  61. package/skills/advanced-math/src/formatting.ts +95 -0
  62. package/skills/advanced-math/src/index.ts +24 -702
  63. package/skills/advanced-math/src/runtime.ts +49 -0
  64. package/skills/advanced-math/src/symbolic.ts +110 -0
  65. package/skills/advanced-math/src/types.ts +36 -0
  66. package/skills/analyze-data/SKILL.md +2 -2
  67. package/skills/analyze-data/src/analysis.ts +401 -0
  68. package/skills/analyze-data/src/cli.ts +66 -0
  69. package/skills/analyze-data/src/formatters.ts +235 -0
  70. package/skills/analyze-data/src/index.ts +6 -1027
  71. package/skills/analyze-data/src/logger.ts +36 -0
  72. package/skills/analyze-data/src/parsers.ts +57 -0
  73. package/skills/analyze-data/src/stats.ts +151 -0
  74. package/skills/analyze-data/src/types.ts +85 -0
  75. package/skills/api-docs-portal/SKILL.md +46 -0
  76. package/skills/api-docs-portal/package.json +9 -0
  77. package/skills/api-test-suite/src/index.ts +13 -0
  78. package/skills/apidocs/package.json +1 -1
  79. package/skills/apidocs/src/index.ts +3 -0
  80. package/skills/audio/package.json +2 -3
  81. package/skills/audio-cleanup-lab/SKILL.md +2 -2
  82. package/skills/audio-extract/CLAUDE.md +1 -1
  83. package/skills/audio-transcript-pack/SKILL.md +43 -0
  84. package/skills/audio-transcript-pack/package.json +10 -0
  85. package/skills/blog-article/CLAUDE.md +12 -0
  86. package/skills/blog-article/SKILL.md +45 -0
  87. package/skills/{create-blog-article → blog-article}/package.json +3 -3
  88. package/skills/brand-kit/SKILL.md +45 -0
  89. package/skills/brand-kit/package.json +14 -0
  90. package/skills/brand-photo-shoot/SKILL.md +28 -0
  91. package/skills/brand-photo-shoot/package.json +10 -0
  92. package/skills/brand-style-guide/SKILL.md +2 -2
  93. package/skills/brand-style-guide/src/index.ts +0 -0
  94. package/skills/budget-variance-analyzer/SKILL.md +2 -2
  95. package/skills/businessactivity/package.json +1 -1
  96. package/skills/businessactivity/src/index.ts +3 -0
  97. package/skills/calendar-events/src/ai-parser.ts +103 -0
  98. package/skills/calendar-events/src/api.ts +157 -0
  99. package/skills/calendar-events/src/auth.ts +22 -0
  100. package/skills/calendar-events/src/config.ts +6 -0
  101. package/skills/calendar-events/src/format.ts +96 -0
  102. package/skills/calendar-events/src/help.ts +54 -0
  103. package/skills/calendar-events/src/index.ts +21 -524
  104. package/skills/calendar-events/src/logger.ts +34 -0
  105. package/skills/calendar-events/src/types.ts +67 -0
  106. package/skills/compress-video/SKILL.md +2 -2
  107. package/skills/consolelog/package.json +1 -1
  108. package/skills/consolelog/src/index.ts +3 -0
  109. package/skills/contract-review-report/SKILL.md +43 -0
  110. package/skills/contract-review-report/package.json +10 -0
  111. package/skills/convert/SKILL.md +2 -3
  112. package/skills/customer-feedback-report/SKILL.md +44 -0
  113. package/skills/customer-feedback-report/package.json +10 -0
  114. package/skills/dashboard-builder/package.json +3 -1
  115. package/skills/database-explorer/package.json +3 -1
  116. package/skills/deepresearch/README.md +4 -13
  117. package/skills/deploy/src/http-client.ts +1 -1
  118. package/skills/diff-viewer/package.json +4 -1
  119. package/skills/doc-generate/package.json +0 -1
  120. package/skills/doc-generate/src/ai.ts +50 -0
  121. package/skills/doc-generate/src/cli.ts +203 -0
  122. package/skills/doc-generate/src/dependencies.ts +44 -0
  123. package/skills/doc-generate/src/document-builder.ts +299 -0
  124. package/skills/doc-generate/src/index.ts +40 -764
  125. package/skills/doc-generate/src/markdown-parser.ts +125 -0
  126. package/skills/doc-generate/src/types.ts +68 -0
  127. package/skills/domainpurchase/SKILL.md +1 -1
  128. package/skills/domainpurchase/package.json +1 -1
  129. package/skills/domainpurchase/src/index.ts +3 -0
  130. package/skills/domainsearch/SKILL.md +1 -1
  131. package/skills/domainsearch/package.json +1 -1
  132. package/skills/domainsearch/src/index.ts +3 -0
  133. package/skills/email-sequence/SKILL.md +44 -0
  134. package/skills/email-sequence/package.json +14 -0
  135. package/skills/excel/CLAUDE.md +2 -2
  136. package/skills/experiment-power-calculator/package.json +3 -1
  137. package/skills/extract-invoice/src/cli.ts +97 -0
  138. package/skills/extract-invoice/src/extractor.ts +170 -0
  139. package/skills/extract-invoice/src/file-utils.ts +46 -0
  140. package/skills/extract-invoice/src/formatters.ts +144 -0
  141. package/skills/extract-invoice/src/index.ts +44 -629
  142. package/skills/extract-invoice/src/runtime.ts +46 -0
  143. package/skills/extract-invoice/src/types.ts +88 -0
  144. package/skills/folder-tree/package.json +3 -1
  145. package/skills/form-filler/package.json +3 -1
  146. package/skills/generate-api-client/package.json +3 -1
  147. package/skills/generate-api-client/src/generator.ts +47 -0
  148. package/skills/generate-api-client/src/index.ts +3 -777
  149. package/skills/generate-api-client/src/logger.ts +34 -0
  150. package/skills/generate-api-client/src/python-generator.ts +245 -0
  151. package/skills/generate-api-client/src/spec-loader.ts +48 -0
  152. package/skills/generate-api-client/src/type-mappers.ts +79 -0
  153. package/skills/generate-api-client/src/types.ts +76 -0
  154. package/skills/generate-api-client/src/typescript-generator.ts +247 -0
  155. package/skills/generate-book-cover/package.json +3 -1
  156. package/skills/generate-dockerfile/src/cli.ts +78 -0
  157. package/skills/generate-dockerfile/src/dockerfile-templates.ts +392 -0
  158. package/skills/generate-dockerfile/src/index.ts +12 -790
  159. package/skills/generate-dockerfile/src/logger.ts +30 -0
  160. package/skills/generate-dockerfile/src/project-detection.ts +68 -0
  161. package/skills/generate-dockerfile/src/support-files.ts +171 -0
  162. package/skills/generate-dockerfile/src/types.ts +29 -0
  163. package/skills/generate-documentation/src/ai.ts +131 -0
  164. package/skills/generate-documentation/src/cli.ts +71 -0
  165. package/skills/generate-documentation/src/code-parser.ts +300 -0
  166. package/skills/generate-documentation/src/file-processing.ts +182 -0
  167. package/skills/generate-documentation/src/index.ts +13 -753
  168. package/skills/generate-documentation/src/runtime.ts +35 -0
  169. package/skills/generate-documentation/src/types.ts +30 -0
  170. package/skills/generate-env/package.json +3 -1
  171. package/skills/generate-env/src/cli.ts +85 -0
  172. package/skills/generate-env/src/detection.ts +161 -0
  173. package/skills/generate-env/src/env-data.ts +66 -0
  174. package/skills/generate-env/src/generators.ts +240 -0
  175. package/skills/generate-env/src/index.ts +76 -676
  176. package/skills/generate-env/src/runtime.ts +30 -0
  177. package/skills/generate-env/src/types.ts +32 -0
  178. package/skills/generate-favicon/package.json +3 -1
  179. package/skills/generate-mock-data/package.json +3 -1
  180. package/skills/generate-mock-data/src/ai.ts +102 -0
  181. package/skills/generate-mock-data/src/formatters.ts +84 -0
  182. package/skills/generate-mock-data/src/generator.ts +377 -0
  183. package/skills/generate-mock-data/src/index.ts +15 -716
  184. package/skills/generate-mock-data/src/logger.ts +37 -0
  185. package/skills/generate-mock-data/src/presets.ts +110 -0
  186. package/skills/generate-mock-data/src/types.ts +21 -0
  187. package/skills/generate-pr-description/src/ai.ts +144 -0
  188. package/skills/generate-pr-description/src/cli.ts +80 -0
  189. package/skills/generate-pr-description/src/clipboard.ts +30 -0
  190. package/skills/generate-pr-description/src/formatters.ts +231 -0
  191. package/skills/generate-pr-description/src/git.ts +153 -0
  192. package/skills/generate-pr-description/src/index.ts +21 -714
  193. package/skills/generate-pr-description/src/types.ts +49 -0
  194. package/skills/generate-presentation/src/ai-clients.ts +61 -0
  195. package/skills/generate-presentation/src/cli.ts +126 -0
  196. package/skills/generate-presentation/src/index.ts +3 -751
  197. package/skills/generate-presentation/src/logger.ts +67 -0
  198. package/skills/generate-presentation/src/presentation-generator.ts +425 -0
  199. package/skills/generate-presentation/src/runtime.ts +6 -0
  200. package/skills/generate-presentation/src/security.ts +12 -0
  201. package/skills/generate-presentation/src/types.ts +28 -0
  202. package/skills/generate-qrcode/package.json +4 -1
  203. package/skills/generate-regex/package.json +3 -1
  204. package/skills/generate-resume/src/cli.ts +157 -0
  205. package/skills/generate-resume/src/index.ts +13 -917
  206. package/skills/generate-resume/src/parsers.ts +95 -0
  207. package/skills/generate-resume/src/renderers.ts +538 -0
  208. package/skills/generate-resume/src/security.ts +39 -0
  209. package/skills/generate-resume/src/types.ts +86 -0
  210. package/skills/generate-social-posts/src/ai.ts +88 -0
  211. package/skills/generate-social-posts/src/cli.ts +118 -0
  212. package/skills/generate-social-posts/src/exporters.ts +126 -0
  213. package/skills/generate-social-posts/src/generator.ts +130 -0
  214. package/skills/generate-social-posts/src/index.ts +19 -709
  215. package/skills/generate-social-posts/src/platforms.ts +39 -0
  216. package/skills/generate-social-posts/src/runtime.ts +34 -0
  217. package/skills/generate-social-posts/src/source.ts +116 -0
  218. package/skills/generate-social-posts/src/types.ts +58 -0
  219. package/skills/gif-maker/package.json +4 -1
  220. package/skills/github-manager/package.json +3 -1
  221. package/skills/gmail/CLAUDE.md +1 -1
  222. package/skills/highlight-reel-generator/src/index.ts +19 -0
  223. package/skills/hook/src/commands/create.ts +20 -845
  224. package/skills/hook/src/templates/root.ts +196 -0
  225. package/skills/hook/src/templates/source.ts +647 -0
  226. package/skills/http-server/package.json +3 -1
  227. package/skills/icon-pack/README.md +28 -0
  228. package/skills/icon-pack/SKILL.md +23 -0
  229. package/skills/icon-pack/package.json +29 -0
  230. package/skills/{audio → icon-pack}/tsconfig.json +10 -12
  231. package/skills/image/package.json +1 -2
  232. package/skills/implementation-agent/package.json +3 -1
  233. package/skills/implementation-agent/src/ai-generation.ts +225 -0
  234. package/skills/implementation-agent/src/index.ts +3 -960
  235. package/skills/implementation-agent/src/minimist.d.ts +15 -0
  236. package/skills/implementation-agent/src/templates.ts +686 -0
  237. package/skills/implementation-agent/src/types.ts +53 -0
  238. package/skills/implementation-plan/package.json +3 -1
  239. package/skills/implementation-todo/package.json +3 -1
  240. package/skills/invoice/package.json +1 -1
  241. package/skills/invoice/src/index.ts +3 -0
  242. package/skills/invoice-reconciliation/SKILL.md +42 -0
  243. package/skills/invoice-reconciliation/package.json +10 -0
  244. package/skills/landing-page-pack/SKILL.md +47 -0
  245. package/skills/landing-page-pack/package.json +14 -0
  246. package/skills/latex-table-generator/package.json +3 -1
  247. package/skills/logo-design/SKILL.md +25 -44
  248. package/skills/logo-design/package.json +3 -15
  249. package/skills/lorem-generator/package.json +3 -1
  250. package/skills/lorem-generator/src/index.ts +13 -0
  251. package/skills/managehook/package.json +1 -1
  252. package/skills/managehook/src/index.ts +3 -0
  253. package/skills/managemcp/package.json +1 -1
  254. package/skills/managemcp/src/index.ts +3 -0
  255. package/skills/manageskill/package.json +1 -1
  256. package/skills/manageskill/src/index.ts +3 -0
  257. package/skills/markdown-validator/package.json +3 -1
  258. package/skills/markdown-validator/src/index.ts +1 -4
  259. package/skills/market-research-report/SKILL.md +41 -0
  260. package/skills/market-research-report/package.json +10 -0
  261. package/skills/mcp-builder/package.json +4 -1
  262. package/skills/mcp-builder/src/ai-descriptions.ts +37 -0
  263. package/skills/mcp-builder/src/generators.ts +513 -0
  264. package/skills/mcp-builder/src/index.ts +7 -908
  265. package/skills/mcp-builder/src/minimist.d.ts +15 -0
  266. package/skills/mcp-builder/src/naming.ts +12 -0
  267. package/skills/mcp-builder/src/options.ts +170 -0
  268. package/skills/mcp-builder/src/templates.ts +149 -0
  269. package/skills/mcp-builder/src/types.ts +42 -0
  270. package/skills/meeting-pack/SKILL.md +43 -0
  271. package/skills/meeting-pack/package.json +10 -0
  272. package/skills/merge-pdfs/package.json +5 -1
  273. package/skills/migration-plan-pack/SKILL.md +45 -0
  274. package/skills/migration-plan-pack/package.json +10 -0
  275. package/skills/music/package.json +2 -3
  276. package/skills/music-album/SKILL.md +37 -0
  277. package/skills/music-album/package.json +10 -0
  278. package/skills/notion-manager/package.json +3 -1
  279. package/skills/npmpublish/CLAUDE.md +5 -8
  280. package/skills/npmpublish/README.md +5 -26
  281. package/skills/npmpublish/src/index.ts +9 -147
  282. package/skills/one-page-website/SKILL.md +46 -0
  283. package/skills/one-page-website/package.json +10 -0
  284. package/skills/one-page-website/tsconfig.json +8 -0
  285. package/skills/pdf-generate/src/cli.ts +162 -0
  286. package/skills/pdf-generate/src/html.ts +84 -0
  287. package/skills/pdf-generate/src/index.ts +11 -800
  288. package/skills/pdf-generate/src/markdown.ts +27 -0
  289. package/skills/pdf-generate/src/pdf-writer.ts +78 -0
  290. package/skills/pdf-generate/src/runtime.ts +34 -0
  291. package/skills/pdf-generate/src/security.ts +37 -0
  292. package/skills/pdf-generate/src/templates.ts +311 -0
  293. package/skills/pdf-generate/src/types.ts +28 -0
  294. package/skills/pdf-read/SKILL.md +10 -10
  295. package/skills/pdf-to-dataset/SKILL.md +45 -0
  296. package/skills/pdf-to-dataset/package.json +10 -0
  297. package/skills/pdf-to-markdown/SKILL.md +49 -0
  298. package/skills/pdf-to-markdown/package.json +10 -0
  299. package/skills/pdf-to-markdown/tsconfig.json +10 -0
  300. package/skills/performance-audit-report/SKILL.md +42 -0
  301. package/skills/performance-audit-report/package.json +10 -0
  302. package/skills/persona-based-adwriter/src/index.ts +19 -0
  303. package/skills/photo-album/SKILL.md +29 -0
  304. package/skills/photo-album/package.json +9 -0
  305. package/skills/photo-album/tsconfig.json +4 -0
  306. package/skills/pitch-deck/SKILL.md +43 -0
  307. package/skills/pitch-deck/package.json +9 -0
  308. package/skills/playlist-maker/SKILL.md +33 -0
  309. package/skills/playlist-maker/package.json +9 -0
  310. package/skills/playlist-maker/tsconfig.json +4 -0
  311. package/skills/product-mockup/SKILL.md +45 -0
  312. package/skills/product-mockup/package.json +3 -20
  313. package/skills/product-mockup/tsconfig.json +3 -5
  314. package/skills/project-retro-companion/src/index.ts +19 -0
  315. package/skills/proposal-pack/SKILL.md +45 -0
  316. package/skills/proposal-pack/package.json +10 -0
  317. package/skills/read-pdf/SKILL.md +5 -4
  318. package/skills/repo-onboarding-report/SKILL.md +42 -0
  319. package/skills/repo-onboarding-report/package.json +10 -0
  320. package/skills/sales-call-recapper/src/index.ts +20 -0
  321. package/skills/salescopy/package.json +1 -1
  322. package/skills/salescopy/src/index.ts +3 -0
  323. package/skills/scaffold-project/src/ai-detect.ts +136 -0
  324. package/skills/scaffold-project/src/file-generators.ts +292 -0
  325. package/skills/scaffold-project/src/index.ts +8 -991
  326. package/skills/scaffold-project/src/project-config.ts +338 -0
  327. package/skills/scaffold-project/src/templates.ts +173 -0
  328. package/skills/scaffold-project/src/types.ts +58 -0
  329. package/skills/scientific-figure-check/package.json +3 -1
  330. package/skills/sdk-generator/SKILL.md +45 -0
  331. package/skills/sdk-generator/package.json +10 -0
  332. package/skills/sdk-generator/tsconfig.json +8 -0
  333. package/skills/security-audit/src/index.ts +25 -6
  334. package/skills/security-audit-report/SKILL.md +40 -0
  335. package/skills/security-audit-report/package.json +10 -0
  336. package/skills/seo-content-pack/SKILL.md +44 -0
  337. package/skills/seo-content-pack/package.json +9 -0
  338. package/skills/short-video-pack/SKILL.md +30 -0
  339. package/skills/short-video-pack/package.json +10 -0
  340. package/skills/slack-assistant/package.json +3 -1
  341. package/skills/slide-deck-generator/SKILL.md +44 -0
  342. package/skills/slide-deck-generator/package.json +10 -0
  343. package/skills/sms/package.json +1 -1
  344. package/skills/sms/src/index.ts +15 -0
  345. package/skills/social-content-calendar/SKILL.md +45 -0
  346. package/skills/social-content-calendar/package.json +14 -0
  347. package/skills/split-pdf/package.json +4 -1
  348. package/skills/subtitle/package.json +2 -1
  349. package/skills/subtitle/src/index.ts +3 -0
  350. package/skills/terraform-generator/package.json +3 -1
  351. package/skills/test-suite-generator/SKILL.md +41 -0
  352. package/skills/test-suite-generator/package.json +10 -0
  353. package/skills/timesheet/package.json +1 -1
  354. package/skills/timesheet/src/index.ts +3 -0
  355. package/skills/transcript/SKILL.md +1 -8
  356. package/skills/validate-config/package.json +3 -1
  357. package/skills/video/package.json +6 -4
  358. package/skills/video-downloader/package.json +3 -1
  359. package/skills/video-highlight-pack/SKILL.md +44 -0
  360. package/skills/video-highlight-pack/package.json +10 -0
  361. package/skills/voiceover-jingle-pack/SKILL.md +28 -0
  362. package/skills/voiceover-jingle-pack/package.json +10 -0
  363. package/skills/watermark/package.json +6 -1
  364. package/skills/webcrawling/package.json +2 -1
  365. package/skills/write/SKILL.md +6 -6
  366. package/dist/server/serve.d.ts +0 -11
  367. package/skills/apidocs/.claude/settings.json +0 -5
  368. package/skills/audio/.env.example +0 -14
  369. package/skills/audio/QUICKSTART.md +0 -158
  370. package/skills/audio/README.md +0 -256
  371. package/skills/audio/src/index-local.ts +0 -206
  372. package/skills/audio/src/index.ts +0 -95
  373. package/skills/audio/src/providers/elevenlabs.ts +0 -115
  374. package/skills/audio/src/providers/google.ts +0 -116
  375. package/skills/audio/src/providers/minimax.ts +0 -83
  376. package/skills/audio/src/providers/openai.ts +0 -115
  377. package/skills/audio/src/types.ts +0 -79
  378. package/skills/audiobook-chapter-proofer/CLAUDE.md +0 -19
  379. package/skills/audiobook-chapter-proofer/package.json +0 -27
  380. package/skills/audiobook-chapter-proofer/src/index.ts +0 -285
  381. package/skills/browse/src/client.ts +0 -373
  382. package/skills/browse/src/index-local.ts +0 -430
  383. package/skills/browse/src/index.ts +0 -110
  384. package/skills/browse/src/sse-server.ts +0 -919
  385. package/skills/browse/src/types.ts +0 -104
  386. package/skills/consolelog/src/server/index.ts +0 -508
  387. package/skills/create-blog-article/CLAUDE.md +0 -19
  388. package/skills/create-blog-article/src/index.ts +0 -745
  389. package/skills/create-blog-article/tsconfig.json +0 -10
  390. package/skills/deepresearch/src/agents/query-generator.ts +0 -91
  391. package/skills/deepresearch/src/agents/synthesizer.ts +0 -111
  392. package/skills/deepresearch/src/index.ts +0 -224
  393. package/skills/deepresearch/src/research.ts +0 -166
  394. package/skills/deepresearch/src/services/anthropic.ts +0 -69
  395. package/skills/deepresearch/src/services/exa.ts +0 -108
  396. package/skills/deepresearch/src/services/firecrawl.ts +0 -88
  397. package/skills/deepresearch/src/services/openai.ts +0 -81
  398. package/skills/deepresearch/src/types.ts +0 -76
  399. package/skills/deepresearch/src/utils/file.ts +0 -111
  400. package/skills/deepresearch/src/utils/logger.ts +0 -84
  401. package/skills/domainpurchase/src/server/index.ts +0 -332
  402. package/skills/domainsearch/src/server/index.ts +0 -229
  403. package/skills/e2bswarm/README.md +0 -135
  404. package/skills/e2bswarm/SKILL.md +0 -118
  405. package/skills/e2bswarm/examples/tasks-example.json +0 -38
  406. package/skills/e2bswarm/package.json +0 -59
  407. package/skills/e2bswarm/src/commands/collect.ts +0 -135
  408. package/skills/e2bswarm/src/commands/install.ts +0 -164
  409. package/skills/e2bswarm/src/commands/kill.ts +0 -62
  410. package/skills/e2bswarm/src/commands/spawn.ts +0 -134
  411. package/skills/e2bswarm/src/commands/status.ts +0 -90
  412. package/skills/e2bswarm/src/commands/sync.ts +0 -208
  413. package/skills/e2bswarm/src/index.ts +0 -121
  414. package/skills/e2bswarm/src/lib/config.ts +0 -75
  415. package/skills/e2bswarm/src/lib/e2b.ts +0 -490
  416. package/skills/e2bswarm/src/lib/github.ts +0 -253
  417. package/skills/e2bswarm/src/lib/logger.ts +0 -41
  418. package/skills/e2bswarm/src/lib/paths.ts +0 -75
  419. package/skills/e2bswarm/src/lib/tasks.ts +0 -320
  420. package/skills/e2bswarm/src/types/index.ts +0 -107
  421. package/skills/e2bswarm/templates/codebox/e2b.Dockerfile +0 -38
  422. package/skills/e2bswarm/templates/codebox/e2b.toml +0 -3
  423. package/skills/e2bswarm/templates/setup.sh +0 -21
  424. package/skills/e2bswarm/tsconfig.json +0 -19
  425. package/skills/generate-book-cover/src/index.ts +0 -694
  426. package/skills/image/src/index-local.ts +0 -206
  427. package/skills/image/src/index.ts +0 -96
  428. package/skills/image/src/providers/google.ts +0 -79
  429. package/skills/image/src/providers/minimax.ts +0 -94
  430. package/skills/image/src/providers/openai.ts +0 -80
  431. package/skills/image/src/providers/xai.ts +0 -73
  432. package/skills/image/src/types.ts +0 -37
  433. package/skills/logo-design/CLAUDE.md +0 -30
  434. package/skills/logo-design/src/index.ts +0 -322
  435. package/skills/managehook/src/server/index.ts +0 -108
  436. package/skills/managemcp/src/server/index.ts +0 -108
  437. package/skills/manageskill/src/server/index.ts +0 -108
  438. package/skills/music/CLAUDE.md +0 -9
  439. package/skills/music/src/index.ts +0 -94
  440. package/skills/music/tsconfig.json +0 -10
  441. package/skills/pdf-read/src/index.ts +0 -320
  442. package/skills/product-mockup/CLAUDE.md +0 -19
  443. package/skills/product-mockup/src/index.ts +0 -290
  444. package/skills/read-pdf/src/index.ts +0 -388
  445. package/skills/remove-background/src/index.ts +0 -405
  446. package/skills/scaffold-project/my-app/.env.example +0 -2
  447. package/skills/scaffold-project/my-app/README.md +0 -72
  448. package/skills/scaffold-project/my-app/package.json +0 -29
  449. package/skills/scaffold-project/my-app/src/index.ts +0 -23
  450. package/skills/scaffold-project/my-app/tsconfig.json +0 -33
  451. package/skills/sound-effects/SKILL.md +0 -34
  452. package/skills/sound-effects/package.json +0 -21
  453. package/skills/sound-effects/src/index.ts +0 -172
  454. package/skills/sound-effects/tsconfig.json +0 -8
  455. package/skills/transcript/src/chunker.ts +0 -215
  456. package/skills/transcript/src/formatter.ts +0 -134
  457. package/skills/transcript/src/index-local.ts +0 -226
  458. package/skills/transcript/src/index.ts +0 -110
  459. package/skills/transcript/src/providers/elevenlabs.ts +0 -133
  460. package/skills/transcript/src/providers/gemini.ts +0 -192
  461. package/skills/transcript/src/providers/index.ts +0 -54
  462. package/skills/transcript/src/providers/openai.ts +0 -203
  463. package/skills/transcript/src/types.ts +0 -106
  464. package/skills/video/.env.example +0 -14
  465. package/skills/video/EXAMPLES.md +0 -266
  466. package/skills/video/LICENSE +0 -192
  467. package/skills/video/README.md +0 -174
  468. package/skills/video/src/cli.ts +0 -155
  469. package/skills/video/src/index-local.ts +0 -148
  470. package/skills/video/src/index.ts +0 -96
  471. package/skills/video/src/providers/google-veo.ts +0 -126
  472. package/skills/video/src/providers/index.ts +0 -22
  473. package/skills/video/src/providers/minimax.ts +0 -100
  474. package/skills/video/src/providers/openai-sora.ts +0 -164
  475. package/skills/video/src/providers/runway.ts +0 -159
  476. package/skills/video/src/types.ts +0 -35
  477. package/skills/video/tsconfig.json +0 -22
  478. package/skills/voiceover-casting-assistant/CLAUDE.md +0 -19
  479. package/skills/voiceover-casting-assistant/package.json +0 -27
  480. package/skills/voiceover-casting-assistant/src/index.ts +0 -255
  481. package/skills/voiceover-casting-assistant/tsconfig.json +0 -10
  482. package/skills/webcrawling/src/commands/config.ts +0 -34
  483. package/skills/webcrawling/src/commands/crawl.ts +0 -33
  484. package/skills/webcrawling/src/commands/scrape.ts +0 -32
  485. package/skills/webcrawling/src/commands/sessions.ts +0 -42
  486. package/skills/webcrawling/src/lib/crawler.ts +0 -174
  487. package/skills/webcrawling/src/lib/storage.ts +0 -130
  488. package/skills/webcrawling/src/types/index.ts +0 -45
  489. package/skills/webcrawling/src/utils/logger.ts +0 -30
  490. package/skills/webcrawling/src/utils/paths.ts +0 -28
  491. /package/skills/{audiobook-chapter-proofer → blog-article}/tsconfig.json +0 -0
@@ -6,709 +6,29 @@
6
6
  * Auto-generate comprehensive PR descriptions from git diff with AI-powered analysis
7
7
  */
8
8
 
9
- import { readFileSync, writeFileSync, existsSync } from 'fs';
10
- import { resolve, relative, basename } from 'path';
11
- import { spawnSync } from 'child_process';
12
-
13
- // ============================================================================
14
- // Types and Interfaces
15
- // ============================================================================
16
-
17
- interface Options {
18
- base: string;
19
- head?: string;
20
- format: 'github' | 'gitlab' | 'bitbucket' | 'plain';
21
- output?: string;
22
- includeFiles: boolean;
23
- template?: string;
24
- staged: boolean;
25
- unstaged: boolean;
26
- noAi: boolean;
27
- model: string;
28
- copy: boolean;
29
- verbose: boolean;
30
- }
31
-
32
- interface GitDiffResult {
33
- diff: string;
34
- stats: {
35
- filesChanged: number;
36
- insertions: number;
37
- deletions: number;
38
- };
39
- files: {
40
- added: string[];
41
- modified: string[];
42
- deleted: string[];
43
- };
44
- }
45
-
46
- interface CommitInfo {
47
- hash: string;
48
- message: string;
49
- author: string;
50
- date: string;
51
- }
52
-
53
- interface PRDescription {
54
- summary: string;
55
- changes: string[];
56
- whatChanged: {
57
- added: string[];
58
- modified: string[];
59
- deleted: string[];
60
- };
61
- whyChanged: string;
62
- breakingChanges: string[];
63
- testPlan: string[];
64
- additionalNotes: string[];
65
- }
66
-
67
- // ============================================================================
68
- // Utility Functions
69
- // ============================================================================
70
-
71
- function parseArguments(): Options {
72
- const args = process.argv.slice(2);
73
- const options: Options = {
74
- base: 'main',
75
- format: 'github',
76
- includeFiles: false,
77
- staged: false,
78
- unstaged: false,
79
- noAi: false,
80
- model: 'claude-3-5-sonnet-20241022',
81
- copy: false,
82
- verbose: false,
83
- };
84
-
85
- for (let i = 0; i < args.length; i++) {
86
- const arg = args[i];
87
-
88
- switch (arg) {
89
- case '--base':
90
- options.base = args[++i];
91
- break;
92
- case '--head':
93
- options.head = args[++i];
94
- break;
95
- case '--format':
96
- options.format = args[++i] as Options['format'];
97
- break;
98
- case '--output':
99
- options.output = args[++i];
100
- break;
101
- case '--include-files':
102
- options.includeFiles = true;
103
- break;
104
- case '--template':
105
- options.template = args[++i];
106
- break;
107
- case '--staged':
108
- options.staged = true;
109
- break;
110
- case '--unstaged':
111
- options.unstaged = true;
112
- break;
113
- case '--no-ai':
114
- options.noAi = true;
115
- break;
116
- case '--model':
117
- options.model = args[++i];
118
- break;
119
- case '--copy':
120
- options.copy = true;
121
- break;
122
- case '--verbose':
123
- options.verbose = true;
124
- break;
125
- }
126
- }
127
-
128
- return options;
129
- }
130
-
131
- function runGitCommand(args: string[], cwd?: string): string {
132
- const result = spawnSync('git', args, {
133
- cwd: cwd || process.cwd(),
134
- encoding: 'utf-8',
135
- maxBuffer: 10 * 1024 * 1024, // 10MB buffer for large diffs
136
- });
137
-
138
- if (result.error) {
139
- throw new Error(`Git command failed: ${result.error.message}`);
140
- }
141
-
142
- if (result.status !== 0) {
143
- throw new Error(`Git command failed: ${result.stderr || result.stdout}`);
144
- }
145
-
146
- return result.stdout.trim();
147
- }
148
-
149
- function isGitRepository(): boolean {
150
- try {
151
- runGitCommand(['rev-parse', '--git-dir']);
152
- return true;
153
- } catch {
154
- return false;
155
- }
156
- }
157
-
158
- function getCurrentBranch(): string {
159
- try {
160
- return runGitCommand(['rev-parse', '--abbrev-ref', 'HEAD']);
161
- } catch {
162
- return 'HEAD';
163
- }
164
- }
165
-
166
- function branchExists(branch: string): boolean {
167
- try {
168
- runGitCommand(['rev-parse', '--verify', branch]);
169
- return true;
170
- } catch {
171
- return false;
172
- }
173
- }
174
-
175
- function getDiff(options: Options): GitDiffResult {
176
- let diffArgs: string[] = ['diff'];
177
-
178
- if (options.staged) {
179
- diffArgs.push('--staged');
180
- } else if (options.unstaged) {
181
- // Just diff working tree
182
- } else {
183
- // Compare branches
184
- const head = options.head || getCurrentBranch();
185
- diffArgs.push(`${options.base}...${head}`);
186
- }
187
-
188
- const diff = runGitCommand(diffArgs);
189
-
190
- // Get diff stats
191
- const statsArgs = [...diffArgs, '--stat'];
192
- const statsOutput = runGitCommand(statsArgs);
193
- const stats = parseDiffStats(statsOutput);
194
-
195
- // Get file changes
196
- const nameStatusArgs = [...diffArgs, '--name-status'];
197
- const nameStatus = runGitCommand(nameStatusArgs);
198
- const files = parseNameStatus(nameStatus);
199
-
200
- return { diff, stats, files };
201
- }
202
-
203
- function parseDiffStats(output: string): GitDiffResult['stats'] {
204
- const lines = output.split('\n');
205
- const summaryLine = lines[lines.length - 1];
206
-
207
- const stats = {
208
- filesChanged: 0,
209
- insertions: 0,
210
- deletions: 0,
211
- };
212
-
213
- const fileMatch = summaryLine.match(/(\d+) files? changed/);
214
- if (fileMatch) stats.filesChanged = parseInt(fileMatch[1]);
215
-
216
- const insertMatch = summaryLine.match(/(\d+) insertions?\(\+\)/);
217
- if (insertMatch) stats.insertions = parseInt(insertMatch[1]);
218
-
219
- const deleteMatch = summaryLine.match(/(\d+) deletions?\(-\)/);
220
- if (deleteMatch) stats.deletions = parseInt(deleteMatch[1]);
221
-
222
- return stats;
223
- }
224
-
225
- function parseNameStatus(output: string): GitDiffResult['files'] {
226
- const files = {
227
- added: [] as string[],
228
- modified: [] as string[],
229
- deleted: [] as string[],
230
- };
231
-
232
- const lines = output.split('\n').filter(line => line.trim());
233
-
234
- for (const line of lines) {
235
- const [status, ...pathParts] = line.split('\t');
236
- const path = pathParts.join('\t');
237
-
238
- switch (status[0]) {
239
- case 'A':
240
- files.added.push(path);
241
- break;
242
- case 'M':
243
- files.modified.push(path);
244
- break;
245
- case 'D':
246
- files.deleted.push(path);
247
- break;
248
- case 'R':
249
- // Renamed file - treat as modified
250
- files.modified.push(path);
251
- break;
252
- }
253
- }
254
-
255
- return files;
256
- }
257
-
258
- function getCommitHistory(options: Options): CommitInfo[] {
259
- let logArgs = ['log', '--pretty=format:%H|%s|%an|%ad', '--date=short'];
260
-
261
- if (options.staged || options.unstaged) {
262
- // Just get the last few commits for context
263
- logArgs.push('-10');
264
- } else {
265
- const head = options.head || getCurrentBranch();
266
- logArgs.push(`${options.base}..${head}`);
267
- }
268
-
269
- try {
270
- const output = runGitCommand(logArgs);
271
- const lines = output.split('\n').filter(line => line.trim());
272
-
273
- return lines.map(line => {
274
- const [hash, message, author, date] = line.split('|');
275
- return { hash: hash.substring(0, 7), message, author, date };
276
- });
277
- } catch {
278
- return [];
279
- }
280
- }
281
-
282
- function copyToClipboard(text: string): boolean {
283
- try {
284
- // Try pbcopy (macOS)
285
- const pbcopy = spawnSync('pbcopy', [], {
286
- input: text,
287
- encoding: 'utf-8',
288
- });
289
- if (pbcopy.status === 0) return true;
290
-
291
- // Try xclip (Linux)
292
- const xclip = spawnSync('xclip', ['-selection', 'clipboard'], {
293
- input: text,
294
- encoding: 'utf-8',
295
- });
296
- if (xclip.status === 0) return true;
297
-
298
- // Try wl-copy (Wayland)
299
- const wlcopy = spawnSync('wl-copy', [], {
300
- input: text,
301
- encoding: 'utf-8',
302
- });
303
- if (wlcopy.status === 0) return true;
304
-
305
- return false;
306
- } catch {
307
- return false;
308
- }
309
- }
310
-
311
- // ============================================================================
312
- // AI Analysis
313
- // ============================================================================
314
-
315
- async function analyzeWithAI(
316
- diff: string,
317
- commits: CommitInfo[],
318
- files: GitDiffResult['files'],
319
- options: Options
320
- ): Promise<PRDescription> {
321
- const apiKey = process.env.ANTHROPIC_API_KEY;
322
-
323
- if (!apiKey) {
324
- if (options.verbose) {
325
- console.log('⚠️ ANTHROPIC_API_KEY not set, using basic template');
326
- }
327
- return generateBasicDescription(diff, commits, files);
328
- }
329
-
330
- try {
331
- const prompt = buildAnalysisPrompt(diff, commits, files);
332
-
333
- const response = await fetch('https://api.anthropic.com/v1/messages', {
334
- method: 'POST',
335
- headers: {
336
- 'Content-Type': 'application/json',
337
- 'x-api-key': apiKey,
338
- 'anthropic-version': '2023-06-01',
339
- },
340
- body: JSON.stringify({
341
- model: options.model,
342
- max_tokens: 4096,
343
- messages: [
344
- {
345
- role: 'user',
346
- content: prompt,
347
- },
348
- ],
349
- }),
350
- });
351
-
352
- if (!response.ok) {
353
- throw new Error(`API request failed: ${response.statusText}`);
354
- }
355
-
356
- const data = await response.json();
357
- const content = data.content[0].text;
358
-
359
- return parseAIResponse(content, files);
360
- } catch (error) {
361
- if (options.verbose) {
362
- console.error('AI analysis failed:', error);
363
- console.log('Falling back to basic template');
364
- }
365
- return generateBasicDescription(diff, commits, files);
366
- }
367
- }
368
-
369
- function buildAnalysisPrompt(
370
- diff: string,
371
- commits: CommitInfo[],
372
- files: GitDiffResult['files']
373
- ): string {
374
- // Truncate diff if too large
375
- const maxDiffLength = 50000;
376
- const truncatedDiff = diff.length > maxDiffLength
377
- ? diff.substring(0, maxDiffLength) + '\n\n[... diff truncated ...]'
378
- : diff;
379
-
380
- const commitMessages = commits.map(c => `- ${c.message} (${c.hash})`).join('\n');
381
-
382
- return `Analyze the following git changes and generate a comprehensive pull request description.
383
-
384
- FILES CHANGED:
385
- Added: ${files.added.join(', ') || 'none'}
386
- Modified: ${files.modified.join(', ') || 'none'}
387
- Deleted: ${files.deleted.join(', ') || 'none'}
388
-
389
- COMMIT HISTORY:
390
- ${commitMessages || 'No commits'}
391
-
392
- GIT DIFF:
393
- ${truncatedDiff}
394
-
395
- Please provide a PR description in the following JSON format:
396
- {
397
- "summary": "Brief 1-2 sentence overview of what this PR does",
398
- "changes": ["List of key changes made (3-7 items)"],
399
- "whyChanged": "Detailed explanation of why these changes were needed and the approach taken",
400
- "breakingChanges": ["List any breaking changes, or empty array if none"],
401
- "testPlan": ["Suggested testing steps"],
402
- "additionalNotes": ["Any other relevant notes"]
403
- }
404
-
405
- Focus on:
406
- 1. What problem is being solved
407
- 2. Key technical changes
408
- 3. Any breaking changes or migration notes
409
- 4. Testing recommendations
410
-
411
- Return only the JSON, no additional text.`;
412
- }
413
-
414
- function parseAIResponse(content: string, files: GitDiffResult['files']): PRDescription {
415
- try {
416
- // Extract JSON from markdown code blocks if present
417
- const jsonMatch = content.match(/\`\`\`(?:json)?\s*(\{[\s\S]*\})\s*\`\`\`/);
418
- const jsonStr = jsonMatch ? jsonMatch[1] : content;
419
-
420
- const parsed = JSON.parse(jsonStr);
421
-
422
- return {
423
- summary: parsed.summary || 'Changes made to the codebase',
424
- changes: parsed.changes || [],
425
- whatChanged: files,
426
- whyChanged: parsed.whyChanged || 'No detailed explanation provided',
427
- breakingChanges: parsed.breakingChanges || [],
428
- testPlan: parsed.testPlan || [],
429
- additionalNotes: parsed.additionalNotes || [],
430
- };
431
- } catch (error) {
432
- throw new Error(`Failed to parse AI response: ${error}`);
433
- }
434
- }
435
-
436
- function generateBasicDescription(
437
- diff: string,
438
- commits: CommitInfo[],
439
- files: GitDiffResult['files']
440
- ): PRDescription {
441
- const summary = commits.length > 0
442
- ? commits[0].message
443
- : 'Changes to the codebase';
444
-
445
- const changes = commits.map(c => c.message);
446
-
447
- return {
448
- summary,
449
- changes: changes.length > 0 ? changes : ['Various code changes'],
450
- whatChanged: files,
451
- whyChanged: 'Please add context about why these changes were made.',
452
- breakingChanges: [],
453
- testPlan: ['Run existing test suite', 'Manual testing as needed'],
454
- additionalNotes: [],
455
- };
456
- }
457
-
458
- // ============================================================================
459
- // Output Formatters
460
- // ============================================================================
461
-
462
- function formatGitHub(description: PRDescription, options: Options): string {
463
- let output = '## Summary\n\n';
464
- output += `${description.summary}\n\n`;
465
-
466
- if (description.changes.length > 0) {
467
- output += '## Changes\n\n';
468
- description.changes.forEach(change => {
469
- output += `- ${change}\n`;
470
- });
471
- output += '\n';
472
- }
473
-
474
- if (options.includeFiles) {
475
- output += '## What Changed\n\n';
476
-
477
- if (description.whatChanged.added.length > 0) {
478
- output += '### Added\n';
479
- description.whatChanged.added.forEach(file => {
480
- output += `- \`${file}\`\n`;
481
- });
482
- output += '\n';
483
- }
484
-
485
- if (description.whatChanged.modified.length > 0) {
486
- output += '### Modified\n';
487
- description.whatChanged.modified.forEach(file => {
488
- output += `- \`${file}\`\n`;
489
- });
490
- output += '\n';
491
- }
492
-
493
- if (description.whatChanged.deleted.length > 0) {
494
- output += '### Deleted\n';
495
- description.whatChanged.deleted.forEach(file => {
496
- output += `- \`${file}\`\n`;
497
- });
498
- output += '\n';
499
- }
500
- }
501
-
502
- output += '## Why These Changes\n\n';
503
- output += `${description.whyChanged}\n\n`;
504
-
505
- if (description.breakingChanges.length > 0) {
506
- output += '## Breaking Changes\n\n';
507
- description.breakingChanges.forEach(change => {
508
- output += `- 🚨 ${change}\n`;
509
- });
510
- output += '\n';
511
- }
512
-
513
- if (description.testPlan.length > 0) {
514
- output += '## Testing\n\n';
515
- output += '### Test Plan\n';
516
- description.testPlan.forEach(test => {
517
- output += `- [ ] ${test}\n`;
518
- });
519
- output += '\n';
520
- }
521
-
522
- if (description.additionalNotes.length > 0) {
523
- output += '## Additional Notes\n\n';
524
- description.additionalNotes.forEach(note => {
525
- output += `- ${note}\n`;
526
- });
527
- output += '\n';
528
- }
529
-
530
- return output;
531
- }
532
-
533
- function formatGitLab(description: PRDescription, options: Options): string {
534
- let output = '## What does this MR do?\n\n';
535
- output += `${description.summary}\n\n`;
536
-
537
- if (description.changes.length > 0) {
538
- output += '## Changes Made\n\n';
539
- description.changes.forEach(change => {
540
- output += `- ${change}\n`;
541
- });
542
- output += '\n';
543
- }
544
-
545
- output += '## Why was this MR needed?\n\n';
546
- output += `${description.whyChanged}\n\n`;
547
-
548
- if (description.breakingChanges.length > 0) {
549
- output += '## Breaking Changes\n\n';
550
- description.breakingChanges.forEach(change => {
551
- output += `- ⚠️ ${change}\n`;
552
- });
553
- output += '\n';
554
- }
555
-
556
- output += '## Does this MR meet the acceptance criteria?\n\n';
557
- if (description.testPlan.length > 0) {
558
- description.testPlan.forEach(test => {
559
- output += `- [ ] ${test}\n`;
560
- });
561
- } else {
562
- output += '- [ ] Tests added/updated\n';
563
- output += '- [ ] Documentation updated\n';
564
- output += '- [ ] Code reviewed\n';
565
- output += '- [ ] All pipelines pass\n';
566
- }
567
- output += '\n';
568
-
569
- if (options.includeFiles) {
570
- output += '## Files Changed\n\n';
571
- const totalFiles =
572
- description.whatChanged.added.length +
573
- description.whatChanged.modified.length +
574
- description.whatChanged.deleted.length;
575
- output += `${totalFiles} files changed\n\n`;
576
- }
577
-
578
- return output;
579
- }
580
-
581
- function formatBitbucket(description: PRDescription, options: Options): string {
582
- let output = '# Description\n\n';
583
- output += `${description.summary}\n\n`;
584
-
585
- if (description.changes.length > 0) {
586
- output += '## Changes\n\n';
587
- description.changes.forEach(change => {
588
- output += `* ${change}\n`;
589
- });
590
- output += '\n';
591
- }
592
-
593
- output += '## Context\n\n';
594
- output += `${description.whyChanged}\n\n`;
595
-
596
- if (description.breakingChanges.length > 0) {
597
- output += '## Breaking Changes\n\n';
598
- description.breakingChanges.forEach(change => {
599
- output += `* ${change}\n`;
600
- });
601
- output += '\n';
602
- }
603
-
604
- output += '## Testing\n\n';
605
- if (description.testPlan.length > 0) {
606
- description.testPlan.forEach(test => {
607
- output += `* [ ] ${test}\n`;
608
- });
609
- } else {
610
- output += '* [ ] Tests pass\n';
611
- output += '* [ ] Code reviewed\n';
612
- }
613
- output += '\n';
614
-
615
- return output;
616
- }
617
-
618
- function formatPlain(description: PRDescription, options: Options): string {
619
- let output = `# ${description.summary}\n\n`;
620
-
621
- if (description.changes.length > 0) {
622
- output += '## Changes\n\n';
623
- description.changes.forEach(change => {
624
- output += `- ${change}\n`;
625
- });
626
- output += '\n';
627
- }
628
-
629
- if (options.includeFiles) {
630
- const totalFiles =
631
- description.whatChanged.added.length +
632
- description.whatChanged.modified.length +
633
- description.whatChanged.deleted.length;
634
- output += `## Files Changed: ${totalFiles}\n\n`;
635
- }
636
-
637
- output += '## Details\n\n';
638
- output += `${description.whyChanged}\n\n`;
639
-
640
- if (description.breakingChanges.length > 0) {
641
- output += '## Breaking Changes\n\n';
642
- description.breakingChanges.forEach(change => {
643
- output += `- ${change}\n`;
644
- });
645
- output += '\n';
646
- }
647
-
648
- return output;
649
- }
650
-
651
- function formatOutput(description: PRDescription, options: Options): string {
652
- switch (options.format) {
653
- case 'gitlab':
654
- return formatGitLab(description, options);
655
- case 'bitbucket':
656
- return formatBitbucket(description, options);
657
- case 'plain':
658
- return formatPlain(description, options);
659
- case 'github':
660
- default:
661
- return formatGitHub(description, options);
662
- }
663
- }
664
-
665
- function applyTemplate(template: string, description: PRDescription): string {
666
- let output = template;
667
-
668
- output = output.replace(/\{\{summary\}\}/g, description.summary);
669
- output = output.replace(/\{\{changes\}\}/g, description.changes.join('\n- '));
670
- output = output.replace(/\{\{why_changed\}\}/g, description.whyChanged);
671
- output = output.replace(
672
- /\{\{breaking_changes\}\}/g,
673
- description.breakingChanges.join('\n- ')
674
- );
675
- output = output.replace(/\{\{test_plan\}\}/g, description.testPlan.join('\n- [ ] '));
676
- output = output.replace(
677
- /\{\{files_added\}\}/g,
678
- description.whatChanged.added.join('\n- ')
679
- );
680
- output = output.replace(
681
- /\{\{files_modified\}\}/g,
682
- description.whatChanged.modified.join('\n- ')
683
- );
684
- output = output.replace(
685
- /\{\{files_deleted\}\}/g,
686
- description.whatChanged.deleted.join('\n- ')
687
- );
688
-
689
- return output;
690
- }
691
-
692
- // ============================================================================
693
- // Main Function
694
- // ============================================================================
9
+ import { existsSync, readFileSync, writeFileSync } from "fs";
10
+ import { resolve } from "path";
11
+ import { analyzeWithAI, generateBasicDescription } from "./ai";
12
+ import { parseArguments } from "./cli";
13
+ import { copyToClipboard } from "./clipboard";
14
+ import { applyTemplate, formatOutput } from "./formatters";
15
+ import { branchExists, getCommitHistory, getDiff, isGitRepository } from "./git";
16
+ import type { PRDescription } from "./types";
695
17
 
696
18
  async function main() {
697
19
  try {
698
20
  const options = parseArguments();
699
21
 
700
- // Validate git repository
701
22
  if (!isGitRepository()) {
702
- console.error('❌ Error: Not a git repository');
703
- console.error('Run this command from within a git repository');
23
+ console.error("❌ Error: Not a git repository");
24
+ console.error("Run this command from within a git repository");
704
25
  process.exit(1);
705
26
  }
706
27
 
707
28
  if (options.verbose) {
708
- console.log('🔍 Analyzing git changes...');
29
+ console.log("🔍 Analyzing git changes...");
709
30
  }
710
31
 
711
- // Validate branches
712
32
  if (!options.staged && !options.unstaged) {
713
33
  if (!branchExists(options.base)) {
714
34
  console.error(`❌ Error: Base branch '${options.base}' does not exist`);
@@ -721,49 +41,40 @@ async function main() {
721
41
  }
722
42
  }
723
43
 
724
- // Get diff
725
44
  const diffResult = getDiff(options);
726
45
 
727
46
  if (!diffResult.diff) {
728
- console.log('ℹ️ No changes to analyze');
47
+ console.log("ℹ️ No changes to analyze");
729
48
  process.exit(0);
730
49
  }
731
50
 
732
51
  if (options.verbose) {
733
52
  console.log(
734
53
  `📊 Found ${diffResult.stats.filesChanged} files changed ` +
735
- `(+${diffResult.stats.insertions}, -${diffResult.stats.deletions})`
54
+ `(+${diffResult.stats.insertions}, -${diffResult.stats.deletions})`
736
55
  );
737
56
  }
738
57
 
739
- // Get commit history
740
58
  const commits = getCommitHistory(options);
741
59
 
742
60
  if (options.verbose && commits.length > 0) {
743
61
  console.log(`📝 Analyzing ${commits.length} commits`);
744
62
  }
745
63
 
746
- // Generate description
747
64
  let description: PRDescription;
748
65
 
749
66
  if (options.noAi) {
750
67
  if (options.verbose) {
751
- console.log('📄 Generating basic template (AI disabled)');
68
+ console.log("📄 Generating basic template (AI disabled)");
752
69
  }
753
70
  description = generateBasicDescription(diffResult.diff, commits, diffResult.files);
754
71
  } else {
755
72
  if (options.verbose) {
756
- console.log('🤖 Analyzing with AI...');
73
+ console.log("🤖 Analyzing with AI...");
757
74
  }
758
- description = await analyzeWithAI(
759
- diffResult.diff,
760
- commits,
761
- diffResult.files,
762
- options
763
- );
75
+ description = await analyzeWithAI(diffResult.diff, commits, diffResult.files, options);
764
76
  }
765
77
 
766
- // Format output
767
78
  let output: string;
768
79
 
769
80
  if (options.template) {
@@ -771,37 +82,33 @@ async function main() {
771
82
  console.error(`❌ Error: Template file not found: ${options.template}`);
772
83
  process.exit(1);
773
84
  }
774
- const template = readFileSync(options.template, 'utf-8');
85
+ const template = readFileSync(options.template, "utf-8");
775
86
  output = applyTemplate(template, description);
776
87
  } else {
777
88
  output = formatOutput(description, options);
778
89
  }
779
90
 
780
- // Save or print
781
91
  if (options.output) {
782
92
  const outputPath = resolve(process.cwd(), options.output);
783
- writeFileSync(outputPath, output, 'utf-8');
93
+ writeFileSync(outputPath, output, "utf-8");
784
94
  console.log(`✅ PR description saved to: ${outputPath}`);
785
95
  } else {
786
96
  console.log(output);
787
97
  }
788
98
 
789
- // Copy to clipboard
790
99
  if (options.copy) {
791
100
  if (copyToClipboard(output)) {
792
- console.log('📋 Copied to clipboard');
101
+ console.log("📋 Copied to clipboard");
793
102
  } else {
794
- console.log('⚠️ Could not copy to clipboard (no clipboard utility found)');
103
+ console.log("⚠️ Could not copy to clipboard (no clipboard utility found)");
795
104
  }
796
105
  }
797
-
798
106
  } catch (error) {
799
- console.error('❌ Error:', error instanceof Error ? error.message : String(error));
107
+ console.error("❌ Error:", error instanceof Error ? error.message : String(error));
800
108
  process.exit(1);
801
109
  }
802
110
  }
803
111
 
804
- // Run if called directly
805
112
  if (import.meta.main) {
806
113
  main();
807
114
  }