@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.
- package/LICENSE +1 -10
- package/README.md +141 -39
- package/bin/index.js +30122 -27575
- package/bin/mcp.js +22112 -18593
- package/dist/cli/cli.test-utils.d.ts +15 -0
- package/dist/cli/commands/auth.d.ts +2 -0
- package/dist/cli/commands/install.d.ts +1 -1
- package/dist/cli/commands/runtime-mcp.d.ts +4 -0
- package/dist/index.d.ts +9 -4
- package/dist/index.js +11607 -597
- package/dist/lib/auth-store.d.ts +13 -0
- package/dist/lib/installer.d.ts +58 -55
- package/dist/lib/mcp-contracts.d.ts +86 -0
- package/dist/lib/project-state.d.ts +43 -0
- package/dist/lib/registry-data/business-marketing.d.ts +2 -0
- package/dist/lib/registry-data/communication.d.ts +2 -0
- package/dist/lib/registry-data/content-generation.d.ts +2 -0
- package/dist/lib/registry-data/data-analysis.d.ts +2 -0
- package/dist/lib/registry-data/design-branding.d.ts +2 -0
- package/dist/lib/registry-data/development-tools.d.ts +2 -0
- package/dist/lib/registry-data/education-learning.d.ts +2 -0
- package/dist/lib/registry-data/event-management.d.ts +2 -0
- package/dist/lib/registry-data/finance-compliance.d.ts +2 -0
- package/dist/lib/registry-data/health-wellness.d.ts +2 -0
- package/dist/lib/registry-data/index.d.ts +2 -0
- package/dist/lib/registry-data/media-processing.d.ts +2 -0
- package/dist/lib/registry-data/productivity-organization.d.ts +2 -0
- package/dist/lib/registry-data/project-management.d.ts +2 -0
- package/dist/lib/registry-data/research-writing.d.ts +2 -0
- package/dist/lib/registry-data/science-academic.d.ts +2 -0
- package/dist/lib/registry-data/travel-lifestyle.d.ts +2 -0
- package/dist/lib/registry-data/web-browser.d.ts +2 -0
- package/dist/lib/registry-types.d.ts +27 -0
- package/dist/lib/registry.d.ts +6 -18
- package/dist/lib/remote-registry.d.ts +3 -0
- package/dist/lib/run-state.d.ts +60 -0
- package/dist/lib/skill-aliases.d.ts +17 -0
- package/dist/lib/skillinfo.d.ts +5 -1
- package/dist/mcp/discovery-tools.d.ts +2 -0
- package/dist/mcp/helpers.d.ts +26 -0
- package/dist/mcp/http.d.ts +10 -0
- package/dist/mcp/index.d.ts +3 -2
- package/dist/mcp/operation-tools.d.ts +2 -0
- package/dist/mcp/resource-meta-tools.d.ts +2 -0
- package/dist/mcp/schedule-tools.d.ts +2 -0
- package/dist/mcp/server.d.ts +4 -0
- package/dist/types/api.d.ts +7 -4
- package/package.json +23 -10
- package/skills/_common/http-client.ts +1 -1
- package/skills/_common/index.ts +2 -3
- package/skills/_common/install.sh +5 -110
- package/skills/_common/installer.ts +31 -282
- package/skills/_common/skill-install.ts +14 -181
- package/skills/ad-creative-pack/SKILL.md +45 -0
- package/skills/ad-creative-pack/package.json +14 -0
- package/skills/advanced-math/package.json +3 -1
- package/skills/advanced-math/src/calculators.ts +118 -0
- package/skills/advanced-math/src/cli.ts +130 -0
- package/skills/advanced-math/src/conversion.ts +90 -0
- package/skills/advanced-math/src/finance.ts +75 -0
- package/skills/advanced-math/src/formatting.ts +95 -0
- package/skills/advanced-math/src/index.ts +24 -702
- package/skills/advanced-math/src/runtime.ts +49 -0
- package/skills/advanced-math/src/symbolic.ts +110 -0
- package/skills/advanced-math/src/types.ts +36 -0
- package/skills/analyze-data/SKILL.md +2 -2
- package/skills/analyze-data/src/analysis.ts +401 -0
- package/skills/analyze-data/src/cli.ts +66 -0
- package/skills/analyze-data/src/formatters.ts +235 -0
- package/skills/analyze-data/src/index.ts +6 -1027
- package/skills/analyze-data/src/logger.ts +36 -0
- package/skills/analyze-data/src/parsers.ts +57 -0
- package/skills/analyze-data/src/stats.ts +151 -0
- package/skills/analyze-data/src/types.ts +85 -0
- package/skills/api-docs-portal/SKILL.md +46 -0
- package/skills/api-docs-portal/package.json +9 -0
- package/skills/api-test-suite/src/index.ts +13 -0
- package/skills/apidocs/package.json +1 -1
- package/skills/apidocs/src/index.ts +3 -0
- package/skills/audio/package.json +2 -3
- package/skills/audio-cleanup-lab/SKILL.md +2 -2
- package/skills/audio-extract/CLAUDE.md +1 -1
- package/skills/audio-transcript-pack/SKILL.md +43 -0
- package/skills/audio-transcript-pack/package.json +10 -0
- package/skills/blog-article/CLAUDE.md +12 -0
- package/skills/blog-article/SKILL.md +45 -0
- package/skills/{create-blog-article → blog-article}/package.json +3 -3
- package/skills/brand-kit/SKILL.md +45 -0
- package/skills/brand-kit/package.json +14 -0
- package/skills/brand-photo-shoot/SKILL.md +28 -0
- package/skills/brand-photo-shoot/package.json +10 -0
- package/skills/brand-style-guide/SKILL.md +2 -2
- package/skills/brand-style-guide/src/index.ts +0 -0
- package/skills/budget-variance-analyzer/SKILL.md +2 -2
- package/skills/businessactivity/package.json +1 -1
- package/skills/businessactivity/src/index.ts +3 -0
- package/skills/calendar-events/src/ai-parser.ts +103 -0
- package/skills/calendar-events/src/api.ts +157 -0
- package/skills/calendar-events/src/auth.ts +22 -0
- package/skills/calendar-events/src/config.ts +6 -0
- package/skills/calendar-events/src/format.ts +96 -0
- package/skills/calendar-events/src/help.ts +54 -0
- package/skills/calendar-events/src/index.ts +21 -524
- package/skills/calendar-events/src/logger.ts +34 -0
- package/skills/calendar-events/src/types.ts +67 -0
- package/skills/compress-video/SKILL.md +2 -2
- package/skills/consolelog/package.json +1 -1
- package/skills/consolelog/src/index.ts +3 -0
- package/skills/contract-review-report/SKILL.md +43 -0
- package/skills/contract-review-report/package.json +10 -0
- package/skills/convert/SKILL.md +2 -3
- package/skills/customer-feedback-report/SKILL.md +44 -0
- package/skills/customer-feedback-report/package.json +10 -0
- package/skills/dashboard-builder/package.json +3 -1
- package/skills/database-explorer/package.json +3 -1
- package/skills/deepresearch/README.md +4 -13
- package/skills/deploy/src/http-client.ts +1 -1
- package/skills/diff-viewer/package.json +4 -1
- package/skills/doc-generate/package.json +0 -1
- package/skills/doc-generate/src/ai.ts +50 -0
- package/skills/doc-generate/src/cli.ts +203 -0
- package/skills/doc-generate/src/dependencies.ts +44 -0
- package/skills/doc-generate/src/document-builder.ts +299 -0
- package/skills/doc-generate/src/index.ts +40 -764
- package/skills/doc-generate/src/markdown-parser.ts +125 -0
- package/skills/doc-generate/src/types.ts +68 -0
- package/skills/domainpurchase/SKILL.md +1 -1
- package/skills/domainpurchase/package.json +1 -1
- package/skills/domainpurchase/src/index.ts +3 -0
- package/skills/domainsearch/SKILL.md +1 -1
- package/skills/domainsearch/package.json +1 -1
- package/skills/domainsearch/src/index.ts +3 -0
- package/skills/email-sequence/SKILL.md +44 -0
- package/skills/email-sequence/package.json +14 -0
- package/skills/excel/CLAUDE.md +2 -2
- package/skills/experiment-power-calculator/package.json +3 -1
- package/skills/extract-invoice/src/cli.ts +97 -0
- package/skills/extract-invoice/src/extractor.ts +170 -0
- package/skills/extract-invoice/src/file-utils.ts +46 -0
- package/skills/extract-invoice/src/formatters.ts +144 -0
- package/skills/extract-invoice/src/index.ts +44 -629
- package/skills/extract-invoice/src/runtime.ts +46 -0
- package/skills/extract-invoice/src/types.ts +88 -0
- package/skills/folder-tree/package.json +3 -1
- package/skills/form-filler/package.json +3 -1
- package/skills/generate-api-client/package.json +3 -1
- package/skills/generate-api-client/src/generator.ts +47 -0
- package/skills/generate-api-client/src/index.ts +3 -777
- package/skills/generate-api-client/src/logger.ts +34 -0
- package/skills/generate-api-client/src/python-generator.ts +245 -0
- package/skills/generate-api-client/src/spec-loader.ts +48 -0
- package/skills/generate-api-client/src/type-mappers.ts +79 -0
- package/skills/generate-api-client/src/types.ts +76 -0
- package/skills/generate-api-client/src/typescript-generator.ts +247 -0
- package/skills/generate-book-cover/package.json +3 -1
- package/skills/generate-dockerfile/src/cli.ts +78 -0
- package/skills/generate-dockerfile/src/dockerfile-templates.ts +392 -0
- package/skills/generate-dockerfile/src/index.ts +12 -790
- package/skills/generate-dockerfile/src/logger.ts +30 -0
- package/skills/generate-dockerfile/src/project-detection.ts +68 -0
- package/skills/generate-dockerfile/src/support-files.ts +171 -0
- package/skills/generate-dockerfile/src/types.ts +29 -0
- package/skills/generate-documentation/src/ai.ts +131 -0
- package/skills/generate-documentation/src/cli.ts +71 -0
- package/skills/generate-documentation/src/code-parser.ts +300 -0
- package/skills/generate-documentation/src/file-processing.ts +182 -0
- package/skills/generate-documentation/src/index.ts +13 -753
- package/skills/generate-documentation/src/runtime.ts +35 -0
- package/skills/generate-documentation/src/types.ts +30 -0
- package/skills/generate-env/package.json +3 -1
- package/skills/generate-env/src/cli.ts +85 -0
- package/skills/generate-env/src/detection.ts +161 -0
- package/skills/generate-env/src/env-data.ts +66 -0
- package/skills/generate-env/src/generators.ts +240 -0
- package/skills/generate-env/src/index.ts +76 -676
- package/skills/generate-env/src/runtime.ts +30 -0
- package/skills/generate-env/src/types.ts +32 -0
- package/skills/generate-favicon/package.json +3 -1
- package/skills/generate-mock-data/package.json +3 -1
- package/skills/generate-mock-data/src/ai.ts +102 -0
- package/skills/generate-mock-data/src/formatters.ts +84 -0
- package/skills/generate-mock-data/src/generator.ts +377 -0
- package/skills/generate-mock-data/src/index.ts +15 -716
- package/skills/generate-mock-data/src/logger.ts +37 -0
- package/skills/generate-mock-data/src/presets.ts +110 -0
- package/skills/generate-mock-data/src/types.ts +21 -0
- package/skills/generate-pr-description/src/ai.ts +144 -0
- package/skills/generate-pr-description/src/cli.ts +80 -0
- package/skills/generate-pr-description/src/clipboard.ts +30 -0
- package/skills/generate-pr-description/src/formatters.ts +231 -0
- package/skills/generate-pr-description/src/git.ts +153 -0
- package/skills/generate-pr-description/src/index.ts +21 -714
- package/skills/generate-pr-description/src/types.ts +49 -0
- package/skills/generate-presentation/src/ai-clients.ts +61 -0
- package/skills/generate-presentation/src/cli.ts +126 -0
- package/skills/generate-presentation/src/index.ts +3 -751
- package/skills/generate-presentation/src/logger.ts +67 -0
- package/skills/generate-presentation/src/presentation-generator.ts +425 -0
- package/skills/generate-presentation/src/runtime.ts +6 -0
- package/skills/generate-presentation/src/security.ts +12 -0
- package/skills/generate-presentation/src/types.ts +28 -0
- package/skills/generate-qrcode/package.json +4 -1
- package/skills/generate-regex/package.json +3 -1
- package/skills/generate-resume/src/cli.ts +157 -0
- package/skills/generate-resume/src/index.ts +13 -917
- package/skills/generate-resume/src/parsers.ts +95 -0
- package/skills/generate-resume/src/renderers.ts +538 -0
- package/skills/generate-resume/src/security.ts +39 -0
- package/skills/generate-resume/src/types.ts +86 -0
- package/skills/generate-social-posts/src/ai.ts +88 -0
- package/skills/generate-social-posts/src/cli.ts +118 -0
- package/skills/generate-social-posts/src/exporters.ts +126 -0
- package/skills/generate-social-posts/src/generator.ts +130 -0
- package/skills/generate-social-posts/src/index.ts +19 -709
- package/skills/generate-social-posts/src/platforms.ts +39 -0
- package/skills/generate-social-posts/src/runtime.ts +34 -0
- package/skills/generate-social-posts/src/source.ts +116 -0
- package/skills/generate-social-posts/src/types.ts +58 -0
- package/skills/gif-maker/package.json +4 -1
- package/skills/github-manager/package.json +3 -1
- package/skills/gmail/CLAUDE.md +1 -1
- package/skills/highlight-reel-generator/src/index.ts +19 -0
- package/skills/hook/src/commands/create.ts +20 -845
- package/skills/hook/src/templates/root.ts +196 -0
- package/skills/hook/src/templates/source.ts +647 -0
- package/skills/http-server/package.json +3 -1
- package/skills/icon-pack/README.md +28 -0
- package/skills/icon-pack/SKILL.md +23 -0
- package/skills/icon-pack/package.json +29 -0
- package/skills/{audio → icon-pack}/tsconfig.json +10 -12
- package/skills/image/package.json +1 -2
- package/skills/implementation-agent/package.json +3 -1
- package/skills/implementation-agent/src/ai-generation.ts +225 -0
- package/skills/implementation-agent/src/index.ts +3 -960
- package/skills/implementation-agent/src/minimist.d.ts +15 -0
- package/skills/implementation-agent/src/templates.ts +686 -0
- package/skills/implementation-agent/src/types.ts +53 -0
- package/skills/implementation-plan/package.json +3 -1
- package/skills/implementation-todo/package.json +3 -1
- package/skills/invoice/package.json +1 -1
- package/skills/invoice/src/index.ts +3 -0
- package/skills/invoice-reconciliation/SKILL.md +42 -0
- package/skills/invoice-reconciliation/package.json +10 -0
- package/skills/landing-page-pack/SKILL.md +47 -0
- package/skills/landing-page-pack/package.json +14 -0
- package/skills/latex-table-generator/package.json +3 -1
- package/skills/logo-design/SKILL.md +25 -44
- package/skills/logo-design/package.json +3 -15
- package/skills/lorem-generator/package.json +3 -1
- package/skills/lorem-generator/src/index.ts +13 -0
- package/skills/managehook/package.json +1 -1
- package/skills/managehook/src/index.ts +3 -0
- package/skills/managemcp/package.json +1 -1
- package/skills/managemcp/src/index.ts +3 -0
- package/skills/manageskill/package.json +1 -1
- package/skills/manageskill/src/index.ts +3 -0
- package/skills/markdown-validator/package.json +3 -1
- package/skills/markdown-validator/src/index.ts +1 -4
- package/skills/market-research-report/SKILL.md +41 -0
- package/skills/market-research-report/package.json +10 -0
- package/skills/mcp-builder/package.json +4 -1
- package/skills/mcp-builder/src/ai-descriptions.ts +37 -0
- package/skills/mcp-builder/src/generators.ts +513 -0
- package/skills/mcp-builder/src/index.ts +7 -908
- package/skills/mcp-builder/src/minimist.d.ts +15 -0
- package/skills/mcp-builder/src/naming.ts +12 -0
- package/skills/mcp-builder/src/options.ts +170 -0
- package/skills/mcp-builder/src/templates.ts +149 -0
- package/skills/mcp-builder/src/types.ts +42 -0
- package/skills/meeting-pack/SKILL.md +43 -0
- package/skills/meeting-pack/package.json +10 -0
- package/skills/merge-pdfs/package.json +5 -1
- package/skills/migration-plan-pack/SKILL.md +45 -0
- package/skills/migration-plan-pack/package.json +10 -0
- package/skills/music/package.json +2 -3
- package/skills/music-album/SKILL.md +37 -0
- package/skills/music-album/package.json +10 -0
- package/skills/notion-manager/package.json +3 -1
- package/skills/npmpublish/CLAUDE.md +5 -8
- package/skills/npmpublish/README.md +5 -26
- package/skills/npmpublish/src/index.ts +9 -147
- package/skills/one-page-website/SKILL.md +46 -0
- package/skills/one-page-website/package.json +10 -0
- package/skills/one-page-website/tsconfig.json +8 -0
- package/skills/pdf-generate/src/cli.ts +162 -0
- package/skills/pdf-generate/src/html.ts +84 -0
- package/skills/pdf-generate/src/index.ts +11 -800
- package/skills/pdf-generate/src/markdown.ts +27 -0
- package/skills/pdf-generate/src/pdf-writer.ts +78 -0
- package/skills/pdf-generate/src/runtime.ts +34 -0
- package/skills/pdf-generate/src/security.ts +37 -0
- package/skills/pdf-generate/src/templates.ts +311 -0
- package/skills/pdf-generate/src/types.ts +28 -0
- package/skills/pdf-read/SKILL.md +10 -10
- package/skills/pdf-to-dataset/SKILL.md +45 -0
- package/skills/pdf-to-dataset/package.json +10 -0
- package/skills/pdf-to-markdown/SKILL.md +49 -0
- package/skills/pdf-to-markdown/package.json +10 -0
- package/skills/pdf-to-markdown/tsconfig.json +10 -0
- package/skills/performance-audit-report/SKILL.md +42 -0
- package/skills/performance-audit-report/package.json +10 -0
- package/skills/persona-based-adwriter/src/index.ts +19 -0
- package/skills/photo-album/SKILL.md +29 -0
- package/skills/photo-album/package.json +9 -0
- package/skills/photo-album/tsconfig.json +4 -0
- package/skills/pitch-deck/SKILL.md +43 -0
- package/skills/pitch-deck/package.json +9 -0
- package/skills/playlist-maker/SKILL.md +33 -0
- package/skills/playlist-maker/package.json +9 -0
- package/skills/playlist-maker/tsconfig.json +4 -0
- package/skills/product-mockup/SKILL.md +45 -0
- package/skills/product-mockup/package.json +3 -20
- package/skills/product-mockup/tsconfig.json +3 -5
- package/skills/project-retro-companion/src/index.ts +19 -0
- package/skills/proposal-pack/SKILL.md +45 -0
- package/skills/proposal-pack/package.json +10 -0
- package/skills/read-pdf/SKILL.md +5 -4
- package/skills/repo-onboarding-report/SKILL.md +42 -0
- package/skills/repo-onboarding-report/package.json +10 -0
- package/skills/sales-call-recapper/src/index.ts +20 -0
- package/skills/salescopy/package.json +1 -1
- package/skills/salescopy/src/index.ts +3 -0
- package/skills/scaffold-project/src/ai-detect.ts +136 -0
- package/skills/scaffold-project/src/file-generators.ts +292 -0
- package/skills/scaffold-project/src/index.ts +8 -991
- package/skills/scaffold-project/src/project-config.ts +338 -0
- package/skills/scaffold-project/src/templates.ts +173 -0
- package/skills/scaffold-project/src/types.ts +58 -0
- package/skills/scientific-figure-check/package.json +3 -1
- package/skills/sdk-generator/SKILL.md +45 -0
- package/skills/sdk-generator/package.json +10 -0
- package/skills/sdk-generator/tsconfig.json +8 -0
- package/skills/security-audit/src/index.ts +25 -6
- package/skills/security-audit-report/SKILL.md +40 -0
- package/skills/security-audit-report/package.json +10 -0
- package/skills/seo-content-pack/SKILL.md +44 -0
- package/skills/seo-content-pack/package.json +9 -0
- package/skills/short-video-pack/SKILL.md +30 -0
- package/skills/short-video-pack/package.json +10 -0
- package/skills/slack-assistant/package.json +3 -1
- package/skills/slide-deck-generator/SKILL.md +44 -0
- package/skills/slide-deck-generator/package.json +10 -0
- package/skills/sms/package.json +1 -1
- package/skills/sms/src/index.ts +15 -0
- package/skills/social-content-calendar/SKILL.md +45 -0
- package/skills/social-content-calendar/package.json +14 -0
- package/skills/split-pdf/package.json +4 -1
- package/skills/subtitle/package.json +2 -1
- package/skills/subtitle/src/index.ts +3 -0
- package/skills/terraform-generator/package.json +3 -1
- package/skills/test-suite-generator/SKILL.md +41 -0
- package/skills/test-suite-generator/package.json +10 -0
- package/skills/timesheet/package.json +1 -1
- package/skills/timesheet/src/index.ts +3 -0
- package/skills/transcript/SKILL.md +1 -8
- package/skills/validate-config/package.json +3 -1
- package/skills/video/package.json +6 -4
- package/skills/video-downloader/package.json +3 -1
- package/skills/video-highlight-pack/SKILL.md +44 -0
- package/skills/video-highlight-pack/package.json +10 -0
- package/skills/voiceover-jingle-pack/SKILL.md +28 -0
- package/skills/voiceover-jingle-pack/package.json +10 -0
- package/skills/watermark/package.json +6 -1
- package/skills/webcrawling/package.json +2 -1
- package/skills/write/SKILL.md +6 -6
- package/dist/server/serve.d.ts +0 -11
- package/skills/apidocs/.claude/settings.json +0 -5
- package/skills/audio/.env.example +0 -14
- package/skills/audio/QUICKSTART.md +0 -158
- package/skills/audio/README.md +0 -256
- package/skills/audio/src/index-local.ts +0 -206
- package/skills/audio/src/index.ts +0 -95
- package/skills/audio/src/providers/elevenlabs.ts +0 -115
- package/skills/audio/src/providers/google.ts +0 -116
- package/skills/audio/src/providers/minimax.ts +0 -83
- package/skills/audio/src/providers/openai.ts +0 -115
- package/skills/audio/src/types.ts +0 -79
- package/skills/audiobook-chapter-proofer/CLAUDE.md +0 -19
- package/skills/audiobook-chapter-proofer/package.json +0 -27
- package/skills/audiobook-chapter-proofer/src/index.ts +0 -285
- package/skills/browse/src/client.ts +0 -373
- package/skills/browse/src/index-local.ts +0 -430
- package/skills/browse/src/index.ts +0 -110
- package/skills/browse/src/sse-server.ts +0 -919
- package/skills/browse/src/types.ts +0 -104
- package/skills/consolelog/src/server/index.ts +0 -508
- package/skills/create-blog-article/CLAUDE.md +0 -19
- package/skills/create-blog-article/src/index.ts +0 -745
- package/skills/create-blog-article/tsconfig.json +0 -10
- package/skills/deepresearch/src/agents/query-generator.ts +0 -91
- package/skills/deepresearch/src/agents/synthesizer.ts +0 -111
- package/skills/deepresearch/src/index.ts +0 -224
- package/skills/deepresearch/src/research.ts +0 -166
- package/skills/deepresearch/src/services/anthropic.ts +0 -69
- package/skills/deepresearch/src/services/exa.ts +0 -108
- package/skills/deepresearch/src/services/firecrawl.ts +0 -88
- package/skills/deepresearch/src/services/openai.ts +0 -81
- package/skills/deepresearch/src/types.ts +0 -76
- package/skills/deepresearch/src/utils/file.ts +0 -111
- package/skills/deepresearch/src/utils/logger.ts +0 -84
- package/skills/domainpurchase/src/server/index.ts +0 -332
- package/skills/domainsearch/src/server/index.ts +0 -229
- package/skills/e2bswarm/README.md +0 -135
- package/skills/e2bswarm/SKILL.md +0 -118
- package/skills/e2bswarm/examples/tasks-example.json +0 -38
- package/skills/e2bswarm/package.json +0 -59
- package/skills/e2bswarm/src/commands/collect.ts +0 -135
- package/skills/e2bswarm/src/commands/install.ts +0 -164
- package/skills/e2bswarm/src/commands/kill.ts +0 -62
- package/skills/e2bswarm/src/commands/spawn.ts +0 -134
- package/skills/e2bswarm/src/commands/status.ts +0 -90
- package/skills/e2bswarm/src/commands/sync.ts +0 -208
- package/skills/e2bswarm/src/index.ts +0 -121
- package/skills/e2bswarm/src/lib/config.ts +0 -75
- package/skills/e2bswarm/src/lib/e2b.ts +0 -490
- package/skills/e2bswarm/src/lib/github.ts +0 -253
- package/skills/e2bswarm/src/lib/logger.ts +0 -41
- package/skills/e2bswarm/src/lib/paths.ts +0 -75
- package/skills/e2bswarm/src/lib/tasks.ts +0 -320
- package/skills/e2bswarm/src/types/index.ts +0 -107
- package/skills/e2bswarm/templates/codebox/e2b.Dockerfile +0 -38
- package/skills/e2bswarm/templates/codebox/e2b.toml +0 -3
- package/skills/e2bswarm/templates/setup.sh +0 -21
- package/skills/e2bswarm/tsconfig.json +0 -19
- package/skills/generate-book-cover/src/index.ts +0 -694
- package/skills/image/src/index-local.ts +0 -206
- package/skills/image/src/index.ts +0 -96
- package/skills/image/src/providers/google.ts +0 -79
- package/skills/image/src/providers/minimax.ts +0 -94
- package/skills/image/src/providers/openai.ts +0 -80
- package/skills/image/src/providers/xai.ts +0 -73
- package/skills/image/src/types.ts +0 -37
- package/skills/logo-design/CLAUDE.md +0 -30
- package/skills/logo-design/src/index.ts +0 -322
- package/skills/managehook/src/server/index.ts +0 -108
- package/skills/managemcp/src/server/index.ts +0 -108
- package/skills/manageskill/src/server/index.ts +0 -108
- package/skills/music/CLAUDE.md +0 -9
- package/skills/music/src/index.ts +0 -94
- package/skills/music/tsconfig.json +0 -10
- package/skills/pdf-read/src/index.ts +0 -320
- package/skills/product-mockup/CLAUDE.md +0 -19
- package/skills/product-mockup/src/index.ts +0 -290
- package/skills/read-pdf/src/index.ts +0 -388
- package/skills/remove-background/src/index.ts +0 -405
- package/skills/scaffold-project/my-app/.env.example +0 -2
- package/skills/scaffold-project/my-app/README.md +0 -72
- package/skills/scaffold-project/my-app/package.json +0 -29
- package/skills/scaffold-project/my-app/src/index.ts +0 -23
- package/skills/scaffold-project/my-app/tsconfig.json +0 -33
- package/skills/sound-effects/SKILL.md +0 -34
- package/skills/sound-effects/package.json +0 -21
- package/skills/sound-effects/src/index.ts +0 -172
- package/skills/sound-effects/tsconfig.json +0 -8
- package/skills/transcript/src/chunker.ts +0 -215
- package/skills/transcript/src/formatter.ts +0 -134
- package/skills/transcript/src/index-local.ts +0 -226
- package/skills/transcript/src/index.ts +0 -110
- package/skills/transcript/src/providers/elevenlabs.ts +0 -133
- package/skills/transcript/src/providers/gemini.ts +0 -192
- package/skills/transcript/src/providers/index.ts +0 -54
- package/skills/transcript/src/providers/openai.ts +0 -203
- package/skills/transcript/src/types.ts +0 -106
- package/skills/video/.env.example +0 -14
- package/skills/video/EXAMPLES.md +0 -266
- package/skills/video/LICENSE +0 -192
- package/skills/video/README.md +0 -174
- package/skills/video/src/cli.ts +0 -155
- package/skills/video/src/index-local.ts +0 -148
- package/skills/video/src/index.ts +0 -96
- package/skills/video/src/providers/google-veo.ts +0 -126
- package/skills/video/src/providers/index.ts +0 -22
- package/skills/video/src/providers/minimax.ts +0 -100
- package/skills/video/src/providers/openai-sora.ts +0 -164
- package/skills/video/src/providers/runway.ts +0 -159
- package/skills/video/src/types.ts +0 -35
- package/skills/video/tsconfig.json +0 -22
- package/skills/voiceover-casting-assistant/CLAUDE.md +0 -19
- package/skills/voiceover-casting-assistant/package.json +0 -27
- package/skills/voiceover-casting-assistant/src/index.ts +0 -255
- package/skills/voiceover-casting-assistant/tsconfig.json +0 -10
- package/skills/webcrawling/src/commands/config.ts +0 -34
- package/skills/webcrawling/src/commands/crawl.ts +0 -33
- package/skills/webcrawling/src/commands/scrape.ts +0 -32
- package/skills/webcrawling/src/commands/sessions.ts +0 -42
- package/skills/webcrawling/src/lib/crawler.ts +0 -174
- package/skills/webcrawling/src/lib/storage.ts +0 -130
- package/skills/webcrawling/src/types/index.ts +0 -45
- package/skills/webcrawling/src/utils/logger.ts +0 -30
- package/skills/webcrawling/src/utils/paths.ts +0 -28
- /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
|
|
10
|
-
import { resolve
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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(
|
|
703
|
-
console.error(
|
|
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(
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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(
|
|
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,
|
|
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,
|
|
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(
|
|
101
|
+
console.log("📋 Copied to clipboard");
|
|
793
102
|
} else {
|
|
794
|
-
console.log(
|
|
103
|
+
console.log("⚠️ Could not copy to clipboard (no clipboard utility found)");
|
|
795
104
|
}
|
|
796
105
|
}
|
|
797
|
-
|
|
798
106
|
} catch (error) {
|
|
799
|
-
console.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
|
}
|