@hasna/skills 0.1.27 → 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 (488) hide show
  1. package/LICENSE +1 -10
  2. package/README.md +141 -39
  3. package/bin/index.js +30121 -27576
  4. package/bin/mcp.js +22073 -18556
  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 +11606 -598
  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 +22 -11
  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/exports/products-2025-12-14T13-50-53-041Z.csv +16 -0
  108. package/skills/consolelog/exports/products-2025-12-14T13-50-53-041Z.json +227 -0
  109. package/skills/consolelog/package.json +1 -1
  110. package/skills/consolelog/src/index.ts +3 -0
  111. package/skills/contract-review-report/SKILL.md +43 -0
  112. package/skills/contract-review-report/package.json +10 -0
  113. package/skills/convert/SKILL.md +2 -3
  114. package/skills/customer-feedback-report/SKILL.md +44 -0
  115. package/skills/customer-feedback-report/package.json +10 -0
  116. package/skills/dashboard-builder/package.json +3 -1
  117. package/skills/database-explorer/package.json +3 -1
  118. package/skills/deepresearch/README.md +4 -13
  119. package/skills/deploy/src/http-client.ts +1 -1
  120. package/skills/diff-viewer/package.json +4 -1
  121. package/skills/doc-generate/package.json +0 -1
  122. package/skills/doc-generate/src/ai.ts +50 -0
  123. package/skills/doc-generate/src/cli.ts +203 -0
  124. package/skills/doc-generate/src/dependencies.ts +44 -0
  125. package/skills/doc-generate/src/document-builder.ts +299 -0
  126. package/skills/doc-generate/src/index.ts +40 -764
  127. package/skills/doc-generate/src/markdown-parser.ts +125 -0
  128. package/skills/doc-generate/src/types.ts +68 -0
  129. package/skills/domainpurchase/SKILL.md +1 -1
  130. package/skills/domainpurchase/package.json +1 -1
  131. package/skills/domainpurchase/src/index.ts +3 -0
  132. package/skills/domainsearch/SKILL.md +1 -1
  133. package/skills/domainsearch/package.json +1 -1
  134. package/skills/domainsearch/src/index.ts +3 -0
  135. package/skills/email-sequence/SKILL.md +44 -0
  136. package/skills/email-sequence/package.json +14 -0
  137. package/skills/excel/CLAUDE.md +2 -2
  138. package/skills/experiment-power-calculator/package.json +3 -1
  139. package/skills/extract-invoice/src/cli.ts +97 -0
  140. package/skills/extract-invoice/src/extractor.ts +170 -0
  141. package/skills/extract-invoice/src/file-utils.ts +46 -0
  142. package/skills/extract-invoice/src/formatters.ts +144 -0
  143. package/skills/extract-invoice/src/index.ts +44 -629
  144. package/skills/extract-invoice/src/runtime.ts +46 -0
  145. package/skills/extract-invoice/src/types.ts +88 -0
  146. package/skills/folder-tree/package.json +3 -1
  147. package/skills/form-filler/package.json +3 -1
  148. package/skills/generate-api-client/package.json +3 -1
  149. package/skills/generate-api-client/src/generator.ts +47 -0
  150. package/skills/generate-api-client/src/index.ts +3 -777
  151. package/skills/generate-api-client/src/logger.ts +34 -0
  152. package/skills/generate-api-client/src/python-generator.ts +245 -0
  153. package/skills/generate-api-client/src/spec-loader.ts +48 -0
  154. package/skills/generate-api-client/src/type-mappers.ts +79 -0
  155. package/skills/generate-api-client/src/types.ts +76 -0
  156. package/skills/generate-api-client/src/typescript-generator.ts +247 -0
  157. package/skills/generate-book-cover/package.json +3 -1
  158. package/skills/generate-dockerfile/src/cli.ts +78 -0
  159. package/skills/generate-dockerfile/src/dockerfile-templates.ts +392 -0
  160. package/skills/generate-dockerfile/src/index.ts +12 -790
  161. package/skills/generate-dockerfile/src/logger.ts +30 -0
  162. package/skills/generate-dockerfile/src/project-detection.ts +68 -0
  163. package/skills/generate-dockerfile/src/support-files.ts +171 -0
  164. package/skills/generate-dockerfile/src/types.ts +29 -0
  165. package/skills/generate-documentation/src/ai.ts +131 -0
  166. package/skills/generate-documentation/src/cli.ts +71 -0
  167. package/skills/generate-documentation/src/code-parser.ts +300 -0
  168. package/skills/generate-documentation/src/file-processing.ts +182 -0
  169. package/skills/generate-documentation/src/index.ts +13 -753
  170. package/skills/generate-documentation/src/runtime.ts +35 -0
  171. package/skills/generate-documentation/src/types.ts +30 -0
  172. package/skills/generate-env/package.json +3 -1
  173. package/skills/generate-env/src/cli.ts +85 -0
  174. package/skills/generate-env/src/detection.ts +161 -0
  175. package/skills/generate-env/src/env-data.ts +66 -0
  176. package/skills/generate-env/src/generators.ts +240 -0
  177. package/skills/generate-env/src/index.ts +76 -676
  178. package/skills/generate-env/src/runtime.ts +30 -0
  179. package/skills/generate-env/src/types.ts +32 -0
  180. package/skills/generate-favicon/package.json +3 -1
  181. package/skills/generate-mock-data/package.json +3 -1
  182. package/skills/generate-mock-data/src/ai.ts +102 -0
  183. package/skills/generate-mock-data/src/formatters.ts +84 -0
  184. package/skills/generate-mock-data/src/generator.ts +377 -0
  185. package/skills/generate-mock-data/src/index.ts +15 -716
  186. package/skills/generate-mock-data/src/logger.ts +37 -0
  187. package/skills/generate-mock-data/src/presets.ts +110 -0
  188. package/skills/generate-mock-data/src/types.ts +21 -0
  189. package/skills/generate-pr-description/src/ai.ts +144 -0
  190. package/skills/generate-pr-description/src/cli.ts +80 -0
  191. package/skills/generate-pr-description/src/clipboard.ts +30 -0
  192. package/skills/generate-pr-description/src/formatters.ts +231 -0
  193. package/skills/generate-pr-description/src/git.ts +153 -0
  194. package/skills/generate-pr-description/src/index.ts +21 -714
  195. package/skills/generate-pr-description/src/types.ts +49 -0
  196. package/skills/generate-presentation/src/ai-clients.ts +61 -0
  197. package/skills/generate-presentation/src/cli.ts +126 -0
  198. package/skills/generate-presentation/src/index.ts +3 -751
  199. package/skills/generate-presentation/src/logger.ts +67 -0
  200. package/skills/generate-presentation/src/presentation-generator.ts +425 -0
  201. package/skills/generate-presentation/src/runtime.ts +6 -0
  202. package/skills/generate-presentation/src/security.ts +12 -0
  203. package/skills/generate-presentation/src/types.ts +28 -0
  204. package/skills/generate-qrcode/package.json +4 -1
  205. package/skills/generate-regex/package.json +3 -1
  206. package/skills/generate-resume/src/cli.ts +157 -0
  207. package/skills/generate-resume/src/index.ts +13 -917
  208. package/skills/generate-resume/src/parsers.ts +95 -0
  209. package/skills/generate-resume/src/renderers.ts +538 -0
  210. package/skills/generate-resume/src/security.ts +39 -0
  211. package/skills/generate-resume/src/types.ts +86 -0
  212. package/skills/generate-social-posts/src/ai.ts +88 -0
  213. package/skills/generate-social-posts/src/cli.ts +118 -0
  214. package/skills/generate-social-posts/src/exporters.ts +126 -0
  215. package/skills/generate-social-posts/src/generator.ts +130 -0
  216. package/skills/generate-social-posts/src/index.ts +19 -709
  217. package/skills/generate-social-posts/src/platforms.ts +39 -0
  218. package/skills/generate-social-posts/src/runtime.ts +34 -0
  219. package/skills/generate-social-posts/src/source.ts +116 -0
  220. package/skills/generate-social-posts/src/types.ts +58 -0
  221. package/skills/gif-maker/package.json +4 -1
  222. package/skills/github-manager/package.json +3 -1
  223. package/skills/gmail/CLAUDE.md +1 -1
  224. package/skills/highlight-reel-generator/src/index.ts +19 -0
  225. package/skills/hook/src/commands/create.ts +20 -845
  226. package/skills/hook/src/templates/root.ts +196 -0
  227. package/skills/hook/src/templates/source.ts +647 -0
  228. package/skills/http-server/package.json +3 -1
  229. package/skills/icon-pack/README.md +28 -0
  230. package/skills/icon-pack/SKILL.md +23 -0
  231. package/skills/icon-pack/package.json +29 -0
  232. package/skills/{audio → icon-pack}/tsconfig.json +10 -12
  233. package/skills/image/package.json +1 -2
  234. package/skills/implementation-agent/package.json +3 -1
  235. package/skills/implementation-agent/src/ai-generation.ts +225 -0
  236. package/skills/implementation-agent/src/index.ts +3 -960
  237. package/skills/implementation-agent/src/minimist.d.ts +15 -0
  238. package/skills/implementation-agent/src/templates.ts +686 -0
  239. package/skills/implementation-agent/src/types.ts +53 -0
  240. package/skills/implementation-plan/package.json +3 -1
  241. package/skills/implementation-todo/package.json +3 -1
  242. package/skills/invoice/package.json +1 -1
  243. package/skills/invoice/src/index.ts +3 -0
  244. package/skills/invoice-reconciliation/SKILL.md +42 -0
  245. package/skills/invoice-reconciliation/package.json +10 -0
  246. package/skills/landing-page-pack/SKILL.md +47 -0
  247. package/skills/landing-page-pack/package.json +14 -0
  248. package/skills/latex-table-generator/package.json +3 -1
  249. package/skills/logo-design/SKILL.md +25 -44
  250. package/skills/logo-design/package.json +3 -15
  251. package/skills/lorem-generator/package.json +3 -1
  252. package/skills/lorem-generator/src/index.ts +13 -0
  253. package/skills/managehook/package.json +1 -1
  254. package/skills/managehook/src/index.ts +3 -0
  255. package/skills/managemcp/package.json +1 -1
  256. package/skills/managemcp/src/index.ts +3 -0
  257. package/skills/manageskill/package.json +1 -1
  258. package/skills/manageskill/src/index.ts +3 -0
  259. package/skills/markdown-validator/package.json +3 -1
  260. package/skills/markdown-validator/src/index.ts +1 -4
  261. package/skills/market-research-report/SKILL.md +41 -0
  262. package/skills/market-research-report/package.json +10 -0
  263. package/skills/mcp-builder/package.json +4 -1
  264. package/skills/mcp-builder/src/ai-descriptions.ts +37 -0
  265. package/skills/mcp-builder/src/generators.ts +513 -0
  266. package/skills/mcp-builder/src/index.ts +7 -908
  267. package/skills/mcp-builder/src/minimist.d.ts +15 -0
  268. package/skills/mcp-builder/src/naming.ts +12 -0
  269. package/skills/mcp-builder/src/options.ts +170 -0
  270. package/skills/mcp-builder/src/templates.ts +149 -0
  271. package/skills/mcp-builder/src/types.ts +42 -0
  272. package/skills/meeting-pack/SKILL.md +43 -0
  273. package/skills/meeting-pack/package.json +10 -0
  274. package/skills/merge-pdfs/package.json +5 -1
  275. package/skills/migration-plan-pack/SKILL.md +45 -0
  276. package/skills/migration-plan-pack/package.json +10 -0
  277. package/skills/music/package.json +2 -3
  278. package/skills/music-album/SKILL.md +37 -0
  279. package/skills/music-album/package.json +10 -0
  280. package/skills/notion-manager/package.json +3 -1
  281. package/skills/npmpublish/CLAUDE.md +5 -8
  282. package/skills/npmpublish/README.md +5 -26
  283. package/skills/npmpublish/src/index.ts +9 -147
  284. package/skills/one-page-website/SKILL.md +46 -0
  285. package/skills/one-page-website/package.json +10 -0
  286. package/skills/one-page-website/tsconfig.json +8 -0
  287. package/skills/pdf-generate/src/cli.ts +162 -0
  288. package/skills/pdf-generate/src/html.ts +84 -0
  289. package/skills/pdf-generate/src/index.ts +11 -800
  290. package/skills/pdf-generate/src/markdown.ts +27 -0
  291. package/skills/pdf-generate/src/pdf-writer.ts +78 -0
  292. package/skills/pdf-generate/src/runtime.ts +34 -0
  293. package/skills/pdf-generate/src/security.ts +37 -0
  294. package/skills/pdf-generate/src/templates.ts +311 -0
  295. package/skills/pdf-generate/src/types.ts +28 -0
  296. package/skills/pdf-read/SKILL.md +10 -10
  297. package/skills/pdf-to-dataset/SKILL.md +45 -0
  298. package/skills/pdf-to-dataset/package.json +10 -0
  299. package/skills/pdf-to-markdown/SKILL.md +49 -0
  300. package/skills/pdf-to-markdown/package.json +10 -0
  301. package/skills/pdf-to-markdown/tsconfig.json +10 -0
  302. package/skills/performance-audit-report/SKILL.md +42 -0
  303. package/skills/performance-audit-report/package.json +10 -0
  304. package/skills/persona-based-adwriter/src/index.ts +19 -0
  305. package/skills/photo-album/SKILL.md +29 -0
  306. package/skills/photo-album/package.json +9 -0
  307. package/skills/photo-album/tsconfig.json +4 -0
  308. package/skills/pitch-deck/SKILL.md +43 -0
  309. package/skills/pitch-deck/package.json +9 -0
  310. package/skills/playlist-maker/SKILL.md +33 -0
  311. package/skills/playlist-maker/package.json +9 -0
  312. package/skills/playlist-maker/tsconfig.json +4 -0
  313. package/skills/product-mockup/SKILL.md +45 -0
  314. package/skills/product-mockup/package.json +3 -20
  315. package/skills/product-mockup/tsconfig.json +3 -5
  316. package/skills/project-retro-companion/src/index.ts +19 -0
  317. package/skills/proposal-pack/SKILL.md +45 -0
  318. package/skills/proposal-pack/package.json +10 -0
  319. package/skills/read-pdf/SKILL.md +5 -4
  320. package/skills/repo-onboarding-report/SKILL.md +42 -0
  321. package/skills/repo-onboarding-report/package.json +10 -0
  322. package/skills/sales-call-recapper/src/index.ts +20 -0
  323. package/skills/salescopy/package.json +1 -1
  324. package/skills/salescopy/src/index.ts +3 -0
  325. package/skills/scaffold-project/src/ai-detect.ts +136 -0
  326. package/skills/scaffold-project/src/file-generators.ts +292 -0
  327. package/skills/scaffold-project/src/index.ts +8 -991
  328. package/skills/scaffold-project/src/project-config.ts +338 -0
  329. package/skills/scaffold-project/src/templates.ts +173 -0
  330. package/skills/scaffold-project/src/types.ts +58 -0
  331. package/skills/scientific-figure-check/package.json +3 -1
  332. package/skills/sdk-generator/SKILL.md +45 -0
  333. package/skills/sdk-generator/package.json +10 -0
  334. package/skills/sdk-generator/tsconfig.json +8 -0
  335. package/skills/security-audit/src/index.ts +25 -6
  336. package/skills/security-audit-report/SKILL.md +40 -0
  337. package/skills/security-audit-report/package.json +10 -0
  338. package/skills/seo-content-pack/SKILL.md +44 -0
  339. package/skills/seo-content-pack/package.json +9 -0
  340. package/skills/short-video-pack/SKILL.md +30 -0
  341. package/skills/short-video-pack/package.json +10 -0
  342. package/skills/slack-assistant/package.json +3 -1
  343. package/skills/slide-deck-generator/SKILL.md +44 -0
  344. package/skills/slide-deck-generator/package.json +10 -0
  345. package/skills/sms/package.json +1 -1
  346. package/skills/sms/src/index.ts +15 -0
  347. package/skills/social-content-calendar/SKILL.md +45 -0
  348. package/skills/social-content-calendar/package.json +14 -0
  349. package/skills/split-pdf/package.json +4 -1
  350. package/skills/subtitle/package.json +2 -1
  351. package/skills/subtitle/src/index.ts +3 -0
  352. package/skills/terraform-generator/package.json +3 -1
  353. package/skills/test-suite-generator/SKILL.md +41 -0
  354. package/skills/test-suite-generator/package.json +10 -0
  355. package/skills/timesheet/package.json +1 -1
  356. package/skills/timesheet/src/index.ts +3 -0
  357. package/skills/transcript/SKILL.md +1 -8
  358. package/skills/validate-config/package.json +3 -1
  359. package/skills/video/package.json +6 -4
  360. package/skills/video-downloader/package.json +3 -1
  361. package/skills/video-highlight-pack/SKILL.md +44 -0
  362. package/skills/video-highlight-pack/package.json +10 -0
  363. package/skills/voiceover-jingle-pack/SKILL.md +28 -0
  364. package/skills/voiceover-jingle-pack/package.json +10 -0
  365. package/skills/watermark/package.json +6 -1
  366. package/skills/webcrawling/package.json +2 -1
  367. package/skills/write/SKILL.md +6 -6
  368. package/dist/server/serve.d.ts +0 -11
  369. package/skills/apidocs/.claude/settings.json +0 -5
  370. package/skills/audio/.env.example +0 -14
  371. package/skills/audio/QUICKSTART.md +0 -158
  372. package/skills/audio/README.md +0 -256
  373. package/skills/audio/src/index-local.ts +0 -206
  374. package/skills/audio/src/index.ts +0 -95
  375. package/skills/audio/src/providers/elevenlabs.ts +0 -115
  376. package/skills/audio/src/providers/google.ts +0 -116
  377. package/skills/audio/src/providers/minimax.ts +0 -83
  378. package/skills/audio/src/providers/openai.ts +0 -115
  379. package/skills/audio/src/types.ts +0 -79
  380. package/skills/audiobook-chapter-proofer/CLAUDE.md +0 -19
  381. package/skills/audiobook-chapter-proofer/package.json +0 -27
  382. package/skills/audiobook-chapter-proofer/src/index.ts +0 -285
  383. package/skills/browse/src/client.ts +0 -373
  384. package/skills/browse/src/index-local.ts +0 -430
  385. package/skills/browse/src/index.ts +0 -110
  386. package/skills/browse/src/sse-server.ts +0 -919
  387. package/skills/browse/src/types.ts +0 -104
  388. package/skills/consolelog/src/server/index.ts +0 -508
  389. package/skills/create-blog-article/CLAUDE.md +0 -19
  390. package/skills/create-blog-article/src/index.ts +0 -745
  391. package/skills/create-blog-article/tsconfig.json +0 -10
  392. package/skills/deepresearch/src/agents/query-generator.ts +0 -91
  393. package/skills/deepresearch/src/agents/synthesizer.ts +0 -111
  394. package/skills/deepresearch/src/index.ts +0 -224
  395. package/skills/deepresearch/src/research.ts +0 -166
  396. package/skills/deepresearch/src/services/anthropic.ts +0 -69
  397. package/skills/deepresearch/src/services/exa.ts +0 -108
  398. package/skills/deepresearch/src/services/firecrawl.ts +0 -88
  399. package/skills/deepresearch/src/services/openai.ts +0 -81
  400. package/skills/deepresearch/src/types.ts +0 -76
  401. package/skills/deepresearch/src/utils/file.ts +0 -111
  402. package/skills/deepresearch/src/utils/logger.ts +0 -84
  403. package/skills/domainpurchase/src/server/index.ts +0 -332
  404. package/skills/domainsearch/src/server/index.ts +0 -229
  405. package/skills/e2bswarm/README.md +0 -135
  406. package/skills/e2bswarm/SKILL.md +0 -118
  407. package/skills/e2bswarm/examples/tasks-example.json +0 -38
  408. package/skills/e2bswarm/package.json +0 -59
  409. package/skills/e2bswarm/src/commands/collect.ts +0 -135
  410. package/skills/e2bswarm/src/commands/install.ts +0 -164
  411. package/skills/e2bswarm/src/commands/kill.ts +0 -62
  412. package/skills/e2bswarm/src/commands/spawn.ts +0 -134
  413. package/skills/e2bswarm/src/commands/status.ts +0 -90
  414. package/skills/e2bswarm/src/commands/sync.ts +0 -208
  415. package/skills/e2bswarm/src/index.ts +0 -121
  416. package/skills/e2bswarm/src/lib/config.ts +0 -75
  417. package/skills/e2bswarm/src/lib/e2b.ts +0 -490
  418. package/skills/e2bswarm/src/lib/github.ts +0 -253
  419. package/skills/e2bswarm/src/lib/logger.ts +0 -41
  420. package/skills/e2bswarm/src/lib/paths.ts +0 -75
  421. package/skills/e2bswarm/src/lib/tasks.ts +0 -320
  422. package/skills/e2bswarm/src/types/index.ts +0 -107
  423. package/skills/e2bswarm/templates/codebox/e2b.Dockerfile +0 -38
  424. package/skills/e2bswarm/templates/codebox/e2b.toml +0 -3
  425. package/skills/e2bswarm/templates/setup.sh +0 -21
  426. package/skills/e2bswarm/tsconfig.json +0 -19
  427. package/skills/generate-book-cover/src/index.ts +0 -694
  428. package/skills/image/src/index-local.ts +0 -206
  429. package/skills/image/src/index.ts +0 -96
  430. package/skills/image/src/providers/google.ts +0 -79
  431. package/skills/image/src/providers/minimax.ts +0 -94
  432. package/skills/image/src/providers/openai.ts +0 -80
  433. package/skills/image/src/providers/xai.ts +0 -73
  434. package/skills/image/src/types.ts +0 -37
  435. package/skills/logo-design/CLAUDE.md +0 -30
  436. package/skills/logo-design/src/index.ts +0 -322
  437. package/skills/managehook/src/server/index.ts +0 -108
  438. package/skills/managemcp/src/server/index.ts +0 -108
  439. package/skills/manageskill/src/server/index.ts +0 -108
  440. package/skills/music/CLAUDE.md +0 -9
  441. package/skills/music/src/index.ts +0 -94
  442. package/skills/music/tsconfig.json +0 -10
  443. package/skills/pdf-read/src/index.ts +0 -320
  444. package/skills/product-mockup/CLAUDE.md +0 -19
  445. package/skills/product-mockup/src/index.ts +0 -290
  446. package/skills/read-pdf/src/index.ts +0 -388
  447. package/skills/remove-background/src/index.ts +0 -405
  448. package/skills/sound-effects/SKILL.md +0 -34
  449. package/skills/sound-effects/package.json +0 -21
  450. package/skills/sound-effects/src/index.ts +0 -172
  451. package/skills/sound-effects/tsconfig.json +0 -8
  452. package/skills/transcript/src/chunker.ts +0 -215
  453. package/skills/transcript/src/formatter.ts +0 -134
  454. package/skills/transcript/src/index-local.ts +0 -226
  455. package/skills/transcript/src/index.ts +0 -110
  456. package/skills/transcript/src/providers/elevenlabs.ts +0 -133
  457. package/skills/transcript/src/providers/gemini.ts +0 -192
  458. package/skills/transcript/src/providers/index.ts +0 -54
  459. package/skills/transcript/src/providers/openai.ts +0 -203
  460. package/skills/transcript/src/types.ts +0 -106
  461. package/skills/video/.env.example +0 -14
  462. package/skills/video/EXAMPLES.md +0 -266
  463. package/skills/video/LICENSE +0 -192
  464. package/skills/video/README.md +0 -174
  465. package/skills/video/src/cli.ts +0 -155
  466. package/skills/video/src/index-local.ts +0 -148
  467. package/skills/video/src/index.ts +0 -96
  468. package/skills/video/src/providers/google-veo.ts +0 -126
  469. package/skills/video/src/providers/index.ts +0 -22
  470. package/skills/video/src/providers/minimax.ts +0 -100
  471. package/skills/video/src/providers/openai-sora.ts +0 -164
  472. package/skills/video/src/providers/runway.ts +0 -159
  473. package/skills/video/src/types.ts +0 -35
  474. package/skills/video/tsconfig.json +0 -22
  475. package/skills/voiceover-casting-assistant/CLAUDE.md +0 -19
  476. package/skills/voiceover-casting-assistant/package.json +0 -27
  477. package/skills/voiceover-casting-assistant/src/index.ts +0 -255
  478. package/skills/voiceover-casting-assistant/tsconfig.json +0 -10
  479. package/skills/webcrawling/src/commands/config.ts +0 -34
  480. package/skills/webcrawling/src/commands/crawl.ts +0 -33
  481. package/skills/webcrawling/src/commands/scrape.ts +0 -32
  482. package/skills/webcrawling/src/commands/sessions.ts +0 -42
  483. package/skills/webcrawling/src/lib/crawler.ts +0 -174
  484. package/skills/webcrawling/src/lib/storage.ts +0 -130
  485. package/skills/webcrawling/src/types/index.ts +0 -45
  486. package/skills/webcrawling/src/utils/logger.ts +0 -30
  487. package/skills/webcrawling/src/utils/paths.ts +0 -28
  488. /package/skills/{audiobook-chapter-proofer → blog-article}/tsconfig.json +0 -0
@@ -0,0 +1,49 @@
1
+ import { appendFileSync, existsSync, mkdirSync } from "fs";
2
+ import { randomUUID } from "crypto";
3
+ import { join } from "path";
4
+ import * as math from "mathjs";
5
+
6
+ export const SKILL_NAME = "advanced-math";
7
+ export const SESSION_ID = randomUUID().slice(0, 8);
8
+ export const SKILLS_OUTPUT_DIR = process.env.SKILLS_OUTPUT_DIR || join(process.cwd(), ".skills");
9
+ export const EXPORTS_DIR = join(SKILLS_OUTPUT_DIR, "exports", SKILL_NAME);
10
+ export const LOGS_DIR = join(SKILLS_OUTPUT_DIR, "logs", SKILL_NAME);
11
+ export const SESSION_TIMESTAMP = new Date()
12
+ .toISOString()
13
+ .replace(/[:.]/g, "_")
14
+ .replace(/-/g, "_")
15
+ .slice(0, 19)
16
+ .toLowerCase();
17
+
18
+ export const mathConfig = math.create(math.all, {
19
+ number: "BigNumber",
20
+ precision: 64,
21
+ });
22
+
23
+ export function ensureDir(dir: string) {
24
+ if (!existsSync(dir)) {
25
+ mkdirSync(dir, { recursive: true });
26
+ }
27
+ }
28
+
29
+ export function log(message: string, level: "info" | "error" | "success" = "info") {
30
+ const timestamp = new Date().toISOString();
31
+ const logFile = join(LOGS_DIR, `log_${SESSION_TIMESTAMP}_${SESSION_ID}.log`);
32
+
33
+ ensureDir(LOGS_DIR);
34
+
35
+ const logEntry = `[${timestamp}] [${level.toUpperCase()}] ${message}\n`;
36
+ appendFileSync(logFile, logEntry);
37
+
38
+ const prefixes = {
39
+ info: "ℹ️ ",
40
+ error: "❌ ",
41
+ success: "✅ ",
42
+ };
43
+
44
+ if (level === "error") {
45
+ console.error(`${prefixes[level]} ${message}`);
46
+ } else {
47
+ console.log(`${prefixes[level]} ${message}`);
48
+ }
49
+ }
@@ -0,0 +1,110 @@
1
+ import { log } from "./runtime";
2
+ import type { SymbolicOperation } from "./types";
3
+
4
+ // ============================================================================
5
+ // Symbolic Math Mode (Using AI)
6
+ // ============================================================================
7
+ export async function performSymbolicMath(
8
+ expression: string,
9
+ operation: SymbolicOperation,
10
+ variable: string = "x",
11
+ showSteps: boolean = false
12
+ ): Promise<{ result: string; steps?: string[]; latex?: string }> {
13
+ const apiKey = process.env.OPENAI_API_KEY;
14
+
15
+ if (!apiKey) {
16
+ throw new Error("OPENAI_API_KEY environment variable is required for symbolic math");
17
+ }
18
+
19
+ const prompt = buildSymbolicPrompt(expression, operation, variable, showSteps);
20
+
21
+ log(`Performing symbolic ${operation} on: ${expression}`);
22
+
23
+ const response = await fetch("https://api.openai.com/v1/chat/completions", {
24
+ method: "POST",
25
+ headers: {
26
+ "Content-Type": "application/json",
27
+ "Authorization": `Bearer ${apiKey}`,
28
+ },
29
+ body: JSON.stringify({
30
+ model: "gpt-4o-mini",
31
+ messages: [
32
+ {
33
+ role: "system",
34
+ content: "You are a mathematics expert. Provide accurate symbolic mathematics solutions. Always show your work clearly and provide LaTeX formatting when requested.",
35
+ },
36
+ {
37
+ role: "user",
38
+ content: prompt,
39
+ },
40
+ ],
41
+ temperature: 0.1,
42
+ }),
43
+ });
44
+
45
+ if (!response.ok) {
46
+ const error = await response.json();
47
+ throw new Error(`OpenAI API error: ${error.error?.message || response.statusText}`);
48
+ }
49
+
50
+ const data = await response.json();
51
+ const content = data.choices[0].message.content;
52
+
53
+ return parseSymbolicResponse(content, showSteps);
54
+ }
55
+
56
+ function buildSymbolicPrompt(expr: string, operation: SymbolicOperation, variable: string, showSteps: boolean): string {
57
+ const basePrompts: Record<SymbolicOperation, string> = {
58
+ derivative: `Calculate the derivative of the expression "${expr}" with respect to ${variable}.`,
59
+ integral: `Calculate the indefinite integral of the expression "${expr}" with respect to ${variable}.`,
60
+ simplify: `Simplify the expression "${expr}".`,
61
+ factor: `Factor the expression "${expr}".`,
62
+ expand: `Expand the expression "${expr}".`,
63
+ solve: `Solve the equation "${expr}" for ${variable}.`,
64
+ };
65
+
66
+ let prompt = basePrompts[operation];
67
+
68
+ if (showSteps) {
69
+ prompt += "\n\nPlease show step-by-step solution with explanations.";
70
+ }
71
+
72
+ prompt += "\n\nFormat your response as follows:";
73
+ prompt += "\nRESULT: [final answer]";
74
+
75
+ if (showSteps) {
76
+ prompt += "\nSTEPS:";
77
+ prompt += "\n1. [step 1]";
78
+ prompt += "\n2. [step 2]";
79
+ prompt += "\n...";
80
+ }
81
+
82
+ prompt += "\nLATEX: [result in LaTeX format]";
83
+
84
+ return prompt;
85
+ }
86
+
87
+ function parseSymbolicResponse(content: string, showSteps: boolean): { result: string; steps?: string[]; latex?: string } {
88
+ const resultMatch = content.match(/RESULT:\s*(.+?)(?=\n|$)/i);
89
+ const latexMatch = content.match(/LATEX:\s*(.+?)(?=\n|$)/i);
90
+
91
+ const result: any = {
92
+ result: resultMatch ? resultMatch[1].trim() : content,
93
+ };
94
+
95
+ if (showSteps) {
96
+ const stepsMatch = content.match(/STEPS:([\s\S]+?)(?=LATEX:|$)/i);
97
+ if (stepsMatch) {
98
+ result.steps = stepsMatch[1]
99
+ .split("\n")
100
+ .map(s => s.trim())
101
+ .filter(s => s && /^\d+\./.test(s));
102
+ }
103
+ }
104
+
105
+ if (latexMatch) {
106
+ result.latex = latexMatch[1].trim();
107
+ }
108
+
109
+ return result;
110
+ }
@@ -0,0 +1,36 @@
1
+ export type Mode = "calc" | "stats" | "matrix" | "convert" | "finance" | "symbolic";
2
+ export type OutputFormat = "text" | "json" | "latex";
3
+ export type NumberFormat = "number" | "scientific" | "fraction" | "percentage";
4
+ export type MatrixOperation = "add" | "multiply" | "transpose" | "determinant" | "inverse" | "eigenvalues" | "rank" | "trace";
5
+ export type FinanceType = "compound" | "simple" | "npv" | "irr" | "pmt" | "fv" | "pv";
6
+ export type SymbolicOperation = "derivative" | "integral" | "simplify" | "factor" | "expand" | "solve";
7
+
8
+ export interface MathOptions {
9
+ mode: Mode;
10
+ precision: number;
11
+ format: NumberFormat;
12
+ output: OutputFormat;
13
+ showSteps: boolean;
14
+ stats?: string;
15
+ matrix?: MatrixOperation;
16
+ from?: string;
17
+ to?: string;
18
+ finance?: FinanceType;
19
+ principal?: number;
20
+ rate?: number;
21
+ years?: number;
22
+ periods?: number;
23
+ payment?: number;
24
+ cashflows?: string;
25
+ operation?: SymbolicOperation;
26
+ var?: string;
27
+ }
28
+
29
+ export interface Result {
30
+ input: string | string[];
31
+ mode: Mode;
32
+ output: any;
33
+ steps?: string[];
34
+ formatted?: string;
35
+ latex?: string;
36
+ }
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: Analyze Data
2
+ name: analyze-data
3
3
  version: 0.1.0
4
4
  description: Instant data science insights for CSV and JSON files with statistical summaries, quality audits, and trend detection
5
5
  author: skills.md
@@ -109,4 +109,4 @@ skills run analyze-data -- metrics.json \
109
109
  ## Requirements
110
110
 
111
111
  - Bun runtime.
112
- - No external API keys required (runs locally).
112
+ - No external API keys required (runs locally).
@@ -0,0 +1,401 @@
1
+ import { readFileSync, statSync } from 'fs';
2
+ import { basename, extname } from 'path';
3
+
4
+ import { parseCSV, parseJSON } from './parsers';
5
+ import { log } from './logger';
6
+ import {
7
+ calculateCorrelation,
8
+ calculatePercentiles,
9
+ calculateStats,
10
+ detectDataType,
11
+ detectOutliers,
12
+ formatBytes,
13
+ roundTo,
14
+ } from './stats';
15
+ import type { AnalysisOptions, AnalysisReport, ColumnStats } from './types';
16
+
17
+ function analyzeColumn(columnName: string, values: any[], options: AnalysisOptions): ColumnStats {
18
+ const dataType = detectDataType(values);
19
+ const nonNullValues = values.filter(v => v !== null && v !== undefined && v !== '');
20
+ const nullCount = values.length - nonNullValues.length;
21
+
22
+ const uniqueValues = new Set(nonNullValues);
23
+ const stats: ColumnStats = {
24
+ name: columnName,
25
+ dataType,
26
+ count: values.length,
27
+ nullCount,
28
+ nullPercentage: roundTo((nullCount / values.length) * 100, 2),
29
+ uniqueCount: uniqueValues.size,
30
+ uniquePercentage: roundTo((uniqueValues.size / nonNullValues.length) * 100, 2),
31
+ sampleValues: nonNullValues.slice(0, 5),
32
+ };
33
+
34
+ // Numeric analysis
35
+ if (dataType === 'numeric') {
36
+ const numericValues = nonNullValues.map(Number).filter(v => !isNaN(v));
37
+ Object.assign(stats, calculateStats(numericValues));
38
+
39
+ if (options.percentiles.length > 0) {
40
+ stats.percentiles = calculatePercentiles(numericValues, options.percentiles);
41
+ }
42
+
43
+ if (options.outliers && stats.q1 !== undefined && stats.q3 !== undefined) {
44
+ stats.outliers = detectOutliers(numericValues, stats.q1, stats.q3);
45
+ }
46
+ }
47
+
48
+ // String analysis
49
+ if (dataType === 'string') {
50
+ const lengths = nonNullValues.map(v => String(v).length);
51
+ stats.avgLength = roundTo(lengths.reduce((a, b) => a + b, 0) / lengths.length, 2);
52
+ stats.minLength = Math.min(...lengths);
53
+ stats.maxLength = Math.max(...lengths);
54
+ }
55
+
56
+ // Distribution (for categorical data)
57
+ if (uniqueValues.size <= 50) {
58
+ const distribution: Record<string, number> = {};
59
+ nonNullValues.forEach(val => {
60
+ const key = String(val);
61
+ distribution[key] = (distribution[key] || 0) + 1;
62
+ });
63
+ stats.distribution = distribution;
64
+
65
+ const topValues = Object.entries(distribution)
66
+ .map(([value, count]) => ({
67
+ value,
68
+ count,
69
+ percentage: roundTo((count / nonNullValues.length) * 100, 2),
70
+ }))
71
+ .sort((a, b) => b.count - a.count)
72
+ .slice(0, 10);
73
+
74
+ stats.topValues = topValues;
75
+ }
76
+
77
+ return stats;
78
+ }
79
+
80
+ function analyzeCorrelations(data: any[], numericColumns: string[]): {
81
+ matrix: number[][];
82
+ pairs: Array<{ col1: string; col2: string; correlation: number }>;
83
+ } {
84
+ const n = numericColumns.length;
85
+ const matrix: number[][] = Array(n).fill(0).map(() => Array(n).fill(0));
86
+ const pairs: Array<{ col1: string; col2: string; correlation: number }> = [];
87
+
88
+ for (let i = 0; i < n; i++) {
89
+ for (let j = i; j < n; j++) {
90
+ if (i === j) {
91
+ matrix[i][j] = 1;
92
+ } else {
93
+ const col1Values = data.map(row => Number(row[numericColumns[i]])).filter(v => !isNaN(v));
94
+ const col2Values = data.map(row => Number(row[numericColumns[j]])).filter(v => !isNaN(v));
95
+
96
+ const correlation = calculateCorrelation(col1Values, col2Values);
97
+ matrix[i][j] = roundTo(correlation, 4);
98
+ matrix[j][i] = roundTo(correlation, 4);
99
+
100
+ if (Math.abs(correlation) > 0.5) {
101
+ pairs.push({
102
+ col1: numericColumns[i],
103
+ col2: numericColumns[j],
104
+ correlation: roundTo(correlation, 4),
105
+ });
106
+ }
107
+ }
108
+ }
109
+ }
110
+
111
+ pairs.sort((a, b) => Math.abs(b.correlation) - Math.abs(a.correlation));
112
+
113
+ return { matrix, pairs };
114
+ }
115
+
116
+ function detectTrends(data: any[], columnStats: ColumnStats[]): {
117
+ detected: boolean;
118
+ patterns: string[];
119
+ insights: string[];
120
+ } {
121
+ const patterns: string[] = [];
122
+ const insights: string[] = [];
123
+
124
+ // Check for time-series columns
125
+ const dateColumns = columnStats.filter(col => col.dataType === 'date');
126
+ const numericColumns = columnStats.filter(col => col.dataType === 'numeric');
127
+
128
+ if (dateColumns.length > 0 && numericColumns.length > 0) {
129
+ patterns.push('Time-series data detected');
130
+ insights.push('Consider visualizing trends over time');
131
+ }
132
+
133
+ // Check for monotonic trends
134
+ numericColumns.forEach(col => {
135
+ if (col.skewness && Math.abs(col.skewness) > 1) {
136
+ patterns.push(`${col.name} shows ${col.skewness > 0 ? 'positive' : 'negative'} skew`);
137
+ }
138
+ });
139
+
140
+ return {
141
+ detected: patterns.length > 0,
142
+ patterns,
143
+ insights,
144
+ };
145
+ }
146
+
147
+ function generateVisualizationRecommendations(columnStats: ColumnStats[]): Array<{
148
+ column: string;
149
+ chartType: string;
150
+ reason: string;
151
+ }> {
152
+ const recommendations: Array<{ column: string; chartType: string; reason: string }> = [];
153
+
154
+ columnStats.forEach(col => {
155
+ if (col.dataType === 'numeric') {
156
+ if (col.uniqueCount > 20) {
157
+ recommendations.push({
158
+ column: col.name,
159
+ chartType: 'Histogram',
160
+ reason: 'Shows distribution of continuous numeric values',
161
+ });
162
+ } else {
163
+ recommendations.push({
164
+ column: col.name,
165
+ chartType: 'Bar Chart',
166
+ reason: 'Shows distribution of discrete numeric values',
167
+ });
168
+ }
169
+ } else if (col.dataType === 'string' && col.uniqueCount <= 20) {
170
+ recommendations.push({
171
+ column: col.name,
172
+ chartType: 'Pie Chart / Bar Chart',
173
+ reason: 'Shows category distribution',
174
+ });
175
+ } else if (col.dataType === 'date') {
176
+ recommendations.push({
177
+ column: col.name,
178
+ chartType: 'Line Chart',
179
+ reason: 'Shows trends over time',
180
+ });
181
+ }
182
+ });
183
+
184
+ return recommendations;
185
+ }
186
+
187
+ function calculateDataQuality(columnStats: ColumnStats[], data: any[]): {
188
+ totalCells: number;
189
+ missingCells: number;
190
+ missingPercentage: number;
191
+ duplicateRows: number;
192
+ duplicatePercentage: number;
193
+ dataQualityScore: number;
194
+ issues: string[];
195
+ } {
196
+ const totalCells = data.length * columnStats.length;
197
+ const missingCells = columnStats.reduce((sum, col) => sum + col.nullCount, 0);
198
+ const missingPercentage = roundTo((missingCells / totalCells) * 100, 2);
199
+
200
+ // Detect duplicates
201
+ const rowStrings = data.map(row => JSON.stringify(row));
202
+ const uniqueRows = new Set(rowStrings);
203
+ const duplicateRows = data.length - uniqueRows.size;
204
+ const duplicatePercentage = roundTo((duplicateRows / data.length) * 100, 2);
205
+
206
+ // Quality issues
207
+ const issues: string[] = [];
208
+
209
+ if (missingPercentage > 10) {
210
+ issues.push(`High missing data rate: ${missingPercentage}%`);
211
+ }
212
+
213
+ if (duplicateRows > 0) {
214
+ issues.push(`${duplicateRows} duplicate rows found`);
215
+ }
216
+
217
+ columnStats.forEach(col => {
218
+ if (col.dataType === 'mixed') {
219
+ issues.push(`Column "${col.name}" has mixed data types`);
220
+ }
221
+ if (col.nullPercentage > 50) {
222
+ issues.push(`Column "${col.name}" has ${col.nullPercentage}% missing values`);
223
+ }
224
+ });
225
+
226
+ // Calculate quality score (0-100)
227
+ let score = 100;
228
+ score -= Math.min(missingPercentage * 2, 30);
229
+ score -= Math.min(duplicatePercentage * 1.5, 20);
230
+ score -= Math.min(issues.length * 5, 30);
231
+
232
+ return {
233
+ totalCells,
234
+ missingCells,
235
+ missingPercentage,
236
+ duplicateRows,
237
+ duplicatePercentage,
238
+ dataQualityScore: Math.max(0, Math.round(score)),
239
+ issues,
240
+ };
241
+ }
242
+
243
+ function generateInsights(report: AnalysisReport): string[] {
244
+ const insights: string[] = [];
245
+
246
+ // Dataset size insights
247
+ if (report.overview.rowCount < 100) {
248
+ insights.push('Small dataset - consider collecting more data for robust analysis');
249
+ } else if (report.overview.rowCount > 10000) {
250
+ insights.push('Large dataset - suitable for machine learning applications');
251
+ }
252
+
253
+ // Data quality insights
254
+ if (report.quality.dataQualityScore >= 90) {
255
+ insights.push('Excellent data quality - ready for analysis');
256
+ } else if (report.quality.dataQualityScore >= 70) {
257
+ insights.push('Good data quality - minor cleaning recommended');
258
+ } else {
259
+ insights.push('Data quality issues detected - cleaning required before analysis');
260
+ }
261
+
262
+ // Column insights
263
+ const numericCols = report.columns.filter(col => col.dataType === 'numeric');
264
+ const categoricalCols = report.columns.filter(col => col.dataType === 'string' && (col.uniqueCount || 0) <= 20);
265
+
266
+ if (numericCols.length > 3) {
267
+ insights.push(`${numericCols.length} numeric columns - suitable for correlation and regression analysis`);
268
+ }
269
+
270
+ if (categoricalCols.length > 0) {
271
+ insights.push(`${categoricalCols.length} categorical columns - consider segmentation analysis`);
272
+ }
273
+
274
+ // Correlation insights
275
+ if (report.correlationPairs && report.correlationPairs.length > 0) {
276
+ const strongPairs = report.correlationPairs.filter(p => Math.abs(p.correlation) > 0.7);
277
+ if (strongPairs.length > 0) {
278
+ insights.push(`${strongPairs.length} strong correlations found - potential feature engineering opportunities`);
279
+ }
280
+ }
281
+
282
+ // Outlier insights
283
+ const colsWithOutliers = report.columns.filter(col => col.outliers && col.outliers.length > 0);
284
+ if (colsWithOutliers.length > 0) {
285
+ insights.push(`Outliers detected in ${colsWithOutliers.length} columns - review for data errors or special cases`);
286
+ }
287
+
288
+ return insights;
289
+ }
290
+
291
+ // ============================================================================
292
+
293
+ export async function analyzeData(filePath: string, options: AnalysisOptions): Promise<AnalysisReport> {
294
+ const startTime = Date.now();
295
+
296
+ // Read file
297
+ if (options.verbose) {
298
+ log(`Reading file: ${filePath}`);
299
+ }
300
+
301
+ const fileStats = statSync(filePath);
302
+ const fileExt = extname(filePath).toLowerCase();
303
+ const content = readFileSync(filePath, 'utf-8');
304
+
305
+ // Parse data
306
+ let data: any[];
307
+ if (fileExt === '.csv') {
308
+ data = parseCSV(content);
309
+ } else if (fileExt === '.json') {
310
+ data = parseJSON(content);
311
+ } else {
312
+ throw new Error(`Unsupported file type: ${fileExt}`);
313
+ }
314
+
315
+ // Apply sampling
316
+ if (options.sample && data.length > options.sample) {
317
+ if (options.verbose) {
318
+ log(`Sampling first ${options.sample} rows out of ${data.length}`);
319
+ }
320
+ data = data.slice(0, options.sample);
321
+ }
322
+
323
+ if (data.length === 0) {
324
+ throw new Error('No data found in file');
325
+ }
326
+
327
+ // Get column names
328
+ const columnNames = Object.keys(data[0]);
329
+
330
+ if (options.verbose) {
331
+ log(`Analyzing ${data.length} rows and ${columnNames.length} columns...`);
332
+ }
333
+
334
+ // Analyze each column
335
+ const columnStats: ColumnStats[] = columnNames.map(colName => {
336
+ const values = data.map(row => row[colName]);
337
+ return analyzeColumn(colName, values, options);
338
+ });
339
+
340
+ // Correlation analysis
341
+ let correlations: number[][] | undefined;
342
+ let correlationPairs: Array<{ col1: string; col2: string; correlation: number }> | undefined;
343
+
344
+ if (options.correlations) {
345
+ const numericColumns = columnStats
346
+ .filter(col => col.dataType === 'numeric')
347
+ .map(col => col.name);
348
+
349
+ if (numericColumns.length >= 2) {
350
+ if (options.verbose) {
351
+ log(`Calculating correlations for ${numericColumns.length} numeric columns...`);
352
+ }
353
+ const corrResult = analyzeCorrelations(data, numericColumns);
354
+ correlations = corrResult.matrix;
355
+ correlationPairs = corrResult.pairs;
356
+ }
357
+ }
358
+
359
+ // Trend analysis
360
+ let trends: AnalysisReport['trends'];
361
+ if (options.trends) {
362
+ if (options.verbose) {
363
+ log('Analyzing trends...');
364
+ }
365
+ trends = detectTrends(data, columnStats);
366
+ }
367
+
368
+ // Data quality
369
+ const quality = calculateDataQuality(columnStats, data);
370
+
371
+ // Visualization recommendations
372
+ const visualizationRecommendations = generateVisualizationRecommendations(columnStats);
373
+
374
+ // Build report
375
+ const report: AnalysisReport = {
376
+ overview: {
377
+ fileName: basename(filePath),
378
+ fileSize: formatBytes(fileStats.size),
379
+ fileType: fileExt.slice(1).toUpperCase(),
380
+ rowCount: data.length,
381
+ columnCount: columnNames.length,
382
+ memoryUsage: formatBytes(JSON.stringify(data).length),
383
+ processingTime: Date.now() - startTime,
384
+ timestamp: new Date().toISOString(),
385
+ },
386
+ columns: columnStats,
387
+ correlations,
388
+ correlationPairs,
389
+ quality,
390
+ trends,
391
+ visualizationRecommendations,
392
+ insights: [],
393
+ };
394
+
395
+ // Generate insights
396
+ report.insights = generateInsights(report);
397
+
398
+ return report;
399
+ }
400
+
401
+ // ============================================================================
@@ -0,0 +1,66 @@
1
+ import { resolve } from 'path';
2
+ import { parseArgs } from 'util';
3
+
4
+ import { log } from './logger';
5
+ import type { AnalysisOptions } from './types';
6
+
7
+ export function parseArguments(): { filePath: string; options: AnalysisOptions } {
8
+ const { values, positionals } = parseArgs({
9
+ args: process.argv.slice(2),
10
+ options: {
11
+ format: { type: 'string', default: 'markdown' },
12
+ output: { type: 'string' },
13
+ correlations: { type: 'boolean', default: false },
14
+ outliers: { type: 'boolean', default: false },
15
+ trends: { type: 'boolean', default: false },
16
+ sample: { type: 'string' },
17
+ percentiles: { type: 'string', default: '25,50,75,90,95' },
18
+ verbose: { type: 'boolean', default: false },
19
+ help: { type: 'boolean', short: 'h' },
20
+ },
21
+ allowPositionals: true,
22
+ });
23
+
24
+ if (values.help) {
25
+ console.log(`
26
+ Analyze Data - Comprehensive data analysis for CSV and JSON files
27
+
28
+ Usage:
29
+ skills run analyze-data -- <file-path> [options]
30
+
31
+ Options:
32
+ --format <fmt> Output format: markdown, json, html (default: markdown)
33
+ --output <path> Save report to file
34
+ --correlations Calculate correlations
35
+ --outliers Detect outliers
36
+ --trends Detect trends
37
+ --sample <n> Analyze only first n rows
38
+ --percentiles <list> Comma-separated percentiles (default: 25,50,75,90,95)
39
+ --verbose Show detailed progress
40
+ --help, -h Show this help
41
+ `);
42
+ process.exit(0);
43
+ }
44
+
45
+ if (positionals.length === 0) {
46
+ log('Error: File path is required', 'error');
47
+ console.log('Usage: skills run analyze-data -- <file-path> [options]');
48
+ process.exit(1);
49
+ }
50
+
51
+ const filePath = resolve(process.cwd(), positionals[0]);
52
+
53
+ return {
54
+ filePath,
55
+ options: {
56
+ format: values.format as 'markdown' | 'json' | 'html',
57
+ output: values.output as string,
58
+ correlations: values.correlations as boolean,
59
+ outliers: values.outliers as boolean,
60
+ trends: values.trends as boolean,
61
+ sample: values.sample ? parseInt(values.sample as string) : undefined,
62
+ percentiles: (values.percentiles as string).split(',').map(Number),
63
+ verbose: values.verbose as boolean,
64
+ }
65
+ };
66
+ }