@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
|
@@ -1,823 +1,46 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { parseOptions } from "./cli";
|
|
5
|
+
import { generateDockerfile } from "./dockerfile-templates";
|
|
6
|
+
import { EXPORTS_DIR, SESSION_ID, SKILL_NAME, log } from "./logger";
|
|
7
|
+
import { detectProjectType } from "./project-detection";
|
|
8
|
+
import { generateDockerCompose, generateDockerignore } from "./support-files";
|
|
7
9
|
|
|
8
|
-
// Skill configuration
|
|
9
|
-
const SKILL_NAME = "generate-dockerfile";
|
|
10
|
-
const SESSION_ID = randomUUID().slice(0, 8);
|
|
11
|
-
|
|
12
|
-
// Environment paths
|
|
13
|
-
const SKILLS_OUTPUT_DIR = process.env.SKILLS_OUTPUT_DIR || join(process.cwd(), ".skills");
|
|
14
|
-
const EXPORTS_DIR = join(SKILLS_OUTPUT_DIR, "exports", SKILL_NAME);
|
|
15
|
-
const LOGS_DIR = join(SKILLS_OUTPUT_DIR, "logs", SKILL_NAME);
|
|
16
|
-
const SESSION_TIMESTAMP = new Date().toISOString().replace(/[:.]/g, "_").slice(0, 19);
|
|
17
|
-
const LOG_FILE = join(LOGS_DIR, `log_${SESSION_TIMESTAMP}_${SESSION_ID}.log`);
|
|
18
|
-
|
|
19
|
-
// Ensure output directories exist
|
|
20
|
-
[EXPORTS_DIR, LOGS_DIR].forEach((dir) => {
|
|
21
|
-
if (!existsSync(dir)) {
|
|
22
|
-
mkdirSync(dir, { recursive: true });
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// Logging utility
|
|
27
|
-
function log(message: string, level: "info" | "error" | "warn" | "success" = "info") {
|
|
28
|
-
const timestamp = new Date().toISOString();
|
|
29
|
-
const logMessage = `[${timestamp}] [${level.toUpperCase()}] ${message}\n`;
|
|
30
|
-
appendFileSync(LOG_FILE, logMessage);
|
|
31
|
-
|
|
32
|
-
const prefix = level === "error" ? "❌" : level === "success" ? "✅" : level === "warn" ? "⚠️" : "ℹ️";
|
|
33
|
-
if (level === "error") {
|
|
34
|
-
console.error(`${prefix} ${message}`);
|
|
35
|
-
} else {
|
|
36
|
-
console.log(`${prefix} ${message}`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Project type detection patterns
|
|
41
|
-
const PROJECT_PATTERNS = {
|
|
42
|
-
nodejs: ["package.json", "yarn.lock", "pnpm-lock.yaml", "bun.lockb"],
|
|
43
|
-
python: ["requirements.txt", "setup.py", "pyproject.toml", "Pipfile"],
|
|
44
|
-
go: ["go.mod", "go.sum"],
|
|
45
|
-
rust: ["Cargo.toml", "Cargo.lock"],
|
|
46
|
-
java: ["pom.xml", "build.gradle", "build.gradle.kts"],
|
|
47
|
-
ruby: ["Gemfile", "Gemfile.lock"],
|
|
48
|
-
php: ["composer.json", "composer.lock"],
|
|
49
|
-
static: ["index.html", "index.htm"]
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
type ProjectType = keyof typeof PROJECT_PATTERNS;
|
|
53
|
-
type BaseImageVariant = "alpine" | "slim" | "standard";
|
|
54
|
-
|
|
55
|
-
interface GenerateOptions {
|
|
56
|
-
type?: ProjectType;
|
|
57
|
-
base: BaseImageVariant;
|
|
58
|
-
dir: string;
|
|
59
|
-
output: string;
|
|
60
|
-
compose: boolean;
|
|
61
|
-
dockerignore: boolean;
|
|
62
|
-
multistage: boolean;
|
|
63
|
-
healthcheck: boolean;
|
|
64
|
-
minimal: boolean;
|
|
65
|
-
all: boolean;
|
|
66
|
-
port: number;
|
|
67
|
-
user: string;
|
|
68
|
-
workdir: string;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Parse command line arguments
|
|
72
|
-
function parseOptions(): GenerateOptions {
|
|
73
|
-
const { values, positionals } = parseArgs({
|
|
74
|
-
args: process.argv.slice(2),
|
|
75
|
-
options: {
|
|
76
|
-
type: { type: "string" },
|
|
77
|
-
base: { type: "string", default: "alpine" },
|
|
78
|
-
dir: { type: "string" },
|
|
79
|
-
output: { type: "string" },
|
|
80
|
-
compose: { type: "boolean", default: false },
|
|
81
|
-
dockerignore: { type: "boolean", default: true },
|
|
82
|
-
"no-dockerignore": { type: "boolean", default: false },
|
|
83
|
-
multistage: { type: "boolean", default: true },
|
|
84
|
-
"no-multistage": { type: "boolean", default: false },
|
|
85
|
-
healthcheck: { type: "boolean", default: true },
|
|
86
|
-
"no-healthcheck": { type: "boolean", default: false },
|
|
87
|
-
minimal: { type: "boolean", default: false },
|
|
88
|
-
all: { type: "boolean", default: false },
|
|
89
|
-
port: { type: "string", default: "3000" },
|
|
90
|
-
user: { type: "string", default: "appuser" },
|
|
91
|
-
workdir: { type: "string", default: "/app" },
|
|
92
|
-
help: { type: "boolean", short: "h" },
|
|
93
|
-
},
|
|
94
|
-
allowPositionals: true,
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
if (values.help) {
|
|
98
|
-
console.log(`
|
|
99
|
-
Generate Dockerfile - Create Docker configuration files
|
|
100
|
-
|
|
101
|
-
Usage:
|
|
102
|
-
skills run generate-dockerfile -- [options]
|
|
103
|
-
|
|
104
|
-
Options:
|
|
105
|
-
--type <type> Project type (nodejs, python, go, rust, java, ruby, php, static)
|
|
106
|
-
--base <variant> Base image variant (alpine, slim, standard) [default: alpine]
|
|
107
|
-
--dir <path> Project directory [default: cwd]
|
|
108
|
-
--output <path> Output directory [default: cwd]
|
|
109
|
-
--compose Generate docker-compose.yml
|
|
110
|
-
--no-dockerignore Skip .dockerignore generation
|
|
111
|
-
--no-multistage Disable multi-stage build
|
|
112
|
-
--no-healthcheck Disable healthcheck
|
|
113
|
-
--minimal Minimal comments
|
|
114
|
-
--all Generate all files (Dockerfile, .dockerignore, docker-compose.yml)
|
|
115
|
-
--port <number> Application port [default: 3000]
|
|
116
|
-
--user <name> Non-root user name [default: appuser]
|
|
117
|
-
--workdir <path> Working directory [default: /app]
|
|
118
|
-
--help, -h Show this help
|
|
119
|
-
`);
|
|
120
|
-
process.exit(0);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
const options: GenerateOptions = {
|
|
124
|
-
type: values.type as ProjectType | undefined,
|
|
125
|
-
base: values.base as BaseImageVariant,
|
|
126
|
-
dir: values.dir ? resolve(values.dir as string) : process.cwd(),
|
|
127
|
-
output: values.output ? resolve(values.output as string) : process.cwd(),
|
|
128
|
-
compose: values.compose as boolean,
|
|
129
|
-
dockerignore: !(values["no-dockerignore"] as boolean),
|
|
130
|
-
multistage: !(values["no-multistage"] as boolean),
|
|
131
|
-
healthcheck: !(values["no-healthcheck"] as boolean),
|
|
132
|
-
minimal: values.minimal as boolean,
|
|
133
|
-
all: values.all as boolean,
|
|
134
|
-
port: parseInt(values.port as string, 10),
|
|
135
|
-
user: values.user as string,
|
|
136
|
-
workdir: values.workdir as string,
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
if (values.all) {
|
|
140
|
-
options.compose = true;
|
|
141
|
-
options.dockerignore = true;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return options;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// Auto-detect project type
|
|
148
|
-
function detectProjectType(dir: string): ProjectType | null {
|
|
149
|
-
try {
|
|
150
|
-
const files = readdirSync(dir);
|
|
151
|
-
|
|
152
|
-
for (const [type, patterns] of Object.entries(PROJECT_PATTERNS)) {
|
|
153
|
-
for (const pattern of patterns) {
|
|
154
|
-
if (files.includes(pattern)) {
|
|
155
|
-
return type as ProjectType;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
} catch (error) {
|
|
160
|
-
log(`Error detecting project type: ${error}`, "warn");
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return null;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// Get base image for project type
|
|
167
|
-
function getBaseImage(type: ProjectType, variant: BaseImageVariant): string {
|
|
168
|
-
const images: Record<ProjectType, Record<BaseImageVariant, string>> = {
|
|
169
|
-
nodejs: {
|
|
170
|
-
alpine: "node:20-alpine",
|
|
171
|
-
slim: "node:20-slim",
|
|
172
|
-
standard: "node:20"
|
|
173
|
-
},
|
|
174
|
-
python: {
|
|
175
|
-
alpine: "python:3.12-alpine",
|
|
176
|
-
slim: "python:3.12-slim",
|
|
177
|
-
standard: "python:3.12"
|
|
178
|
-
},
|
|
179
|
-
go: {
|
|
180
|
-
alpine: "golang:1.22-alpine",
|
|
181
|
-
slim: "golang:1.22",
|
|
182
|
-
standard: "golang:1.22"
|
|
183
|
-
},
|
|
184
|
-
rust: {
|
|
185
|
-
alpine: "rust:1.75-alpine",
|
|
186
|
-
slim: "rust:1.75-slim",
|
|
187
|
-
standard: "rust:1.75"
|
|
188
|
-
},
|
|
189
|
-
java: {
|
|
190
|
-
alpine: "eclipse-temurin:21-jdk-alpine",
|
|
191
|
-
slim: "eclipse-temurin:21-jdk",
|
|
192
|
-
standard: "eclipse-temurin:21-jdk"
|
|
193
|
-
},
|
|
194
|
-
ruby: {
|
|
195
|
-
alpine: "ruby:3.3-alpine",
|
|
196
|
-
slim: "ruby:3.3-slim",
|
|
197
|
-
standard: "ruby:3.3"
|
|
198
|
-
},
|
|
199
|
-
php: {
|
|
200
|
-
alpine: "php:8.3-fpm-alpine",
|
|
201
|
-
slim: "php:8.3-fpm",
|
|
202
|
-
standard: "php:8.3-fpm"
|
|
203
|
-
},
|
|
204
|
-
static: {
|
|
205
|
-
alpine: "nginx:alpine",
|
|
206
|
-
slim: "nginx:stable",
|
|
207
|
-
standard: "nginx:stable"
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
return images[type][variant];
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// Generate Node.js Dockerfile
|
|
215
|
-
function generateNodejsDockerfile(options: GenerateOptions): string {
|
|
216
|
-
const baseImage = getBaseImage("nodejs", options.base);
|
|
217
|
-
const comment = (text: string) => options.minimal ? "" : `# ${text}\n`;
|
|
218
|
-
|
|
219
|
-
if (options.multistage) {
|
|
220
|
-
return `${comment("Build stage")}FROM ${baseImage} AS builder
|
|
221
|
-
|
|
222
|
-
${comment("Set working directory")}WORKDIR ${options.workdir}
|
|
223
|
-
|
|
224
|
-
${comment("Copy package files")}COPY package*.json ./
|
|
225
|
-
|
|
226
|
-
${comment("Install dependencies")}RUN npm ci --only=production && \\
|
|
227
|
-
npm cache clean --force
|
|
228
|
-
|
|
229
|
-
${comment("Copy application files")}COPY . .
|
|
230
|
-
|
|
231
|
-
${comment("Build application if needed (uncomment if using TypeScript/build step)")}# RUN npm run build
|
|
232
|
-
|
|
233
|
-
${comment("Production stage")}FROM ${baseImage}
|
|
234
|
-
|
|
235
|
-
${comment("Install dumb-init for proper signal handling")}RUN apk add --no-cache dumb-init
|
|
236
|
-
|
|
237
|
-
${comment("Create non-root user")}RUN addgroup -g 1001 -S ${options.user} && \\
|
|
238
|
-
adduser -S ${options.user} -u 1001
|
|
239
|
-
|
|
240
|
-
${comment("Set working directory")}WORKDIR ${options.workdir}
|
|
241
|
-
|
|
242
|
-
${comment("Copy dependencies from builder")}COPY --from=builder --chown=${options.user}:${options.user} ${options.workdir}/node_modules ./node_modules
|
|
243
|
-
|
|
244
|
-
${comment("Copy application files")}COPY --chown=${options.user}:${options.user} . .
|
|
245
|
-
|
|
246
|
-
${comment("Set environment variables")}ENV NODE_ENV=production \\
|
|
247
|
-
PORT=${options.port}
|
|
248
|
-
|
|
249
|
-
${comment("Switch to non-root user")}USER ${options.user}
|
|
250
|
-
|
|
251
|
-
${comment("Expose port")}EXPOSE ${options.port}
|
|
252
|
-
|
|
253
|
-
${comment("Add health check")}${options.healthcheck ? `HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
|
|
254
|
-
CMD node -e "require('http').get('http://localhost:${options.port}/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"
|
|
255
|
-
|
|
256
|
-
` : ""}${comment("Start application")}ENTRYPOINT ["dumb-init", "--"]
|
|
257
|
-
CMD ["node", "index.js"]
|
|
258
|
-
`;
|
|
259
|
-
} else {
|
|
260
|
-
return `FROM ${baseImage}
|
|
261
|
-
|
|
262
|
-
${comment("Create non-root user")}RUN addgroup -g 1001 -S ${options.user} && \\
|
|
263
|
-
adduser -S ${options.user} -u 1001
|
|
264
|
-
|
|
265
|
-
${comment("Set working directory")}WORKDIR ${options.workdir}
|
|
266
|
-
|
|
267
|
-
${comment("Copy package files")}COPY package*.json ./
|
|
268
|
-
|
|
269
|
-
${comment("Install dependencies")}RUN npm ci --only=production && \\
|
|
270
|
-
npm cache clean --force
|
|
271
|
-
|
|
272
|
-
${comment("Copy application files")}COPY --chown=${options.user}:${options.user} . .
|
|
273
|
-
|
|
274
|
-
${comment("Set environment variables")}ENV NODE_ENV=production \\
|
|
275
|
-
PORT=${options.port}
|
|
276
|
-
|
|
277
|
-
${comment("Switch to non-root user")}USER ${options.user}
|
|
278
|
-
|
|
279
|
-
${comment("Expose port")}EXPOSE ${options.port}
|
|
280
|
-
|
|
281
|
-
${comment("Add health check")}${options.healthcheck ? `HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
|
|
282
|
-
CMD node -e "require('http').get('http://localhost:${options.port}/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"
|
|
283
|
-
|
|
284
|
-
` : ""}${comment("Start application")}CMD ["node", "index.js"]
|
|
285
|
-
`;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// Generate Python Dockerfile
|
|
290
|
-
function generatePythonDockerfile(options: GenerateOptions): string {
|
|
291
|
-
const baseImage = getBaseImage("python", options.base);
|
|
292
|
-
const comment = (text: string) => options.minimal ? "" : `# ${text}\n`;
|
|
293
|
-
|
|
294
|
-
if (options.multistage) {
|
|
295
|
-
return `${comment("Build stage")}FROM ${baseImage} AS builder
|
|
296
|
-
|
|
297
|
-
${comment("Set working directory")}WORKDIR ${options.workdir}
|
|
298
|
-
|
|
299
|
-
${comment("Install build dependencies")}${options.base === "alpine" ? `RUN apk add --no-cache gcc musl-dev libffi-dev
|
|
300
|
-
|
|
301
|
-
` : ""}${comment("Create virtual environment")}RUN python -m venv /opt/venv
|
|
302
|
-
ENV PATH="/opt/venv/bin:$PATH"
|
|
303
|
-
|
|
304
|
-
${comment("Copy requirements and install dependencies")}COPY requirements.txt .
|
|
305
|
-
RUN pip install --no-cache-dir -r requirements.txt
|
|
306
|
-
|
|
307
|
-
${comment("Production stage")}FROM ${baseImage}
|
|
308
|
-
|
|
309
|
-
${comment("Install runtime dependencies")}${options.base === "alpine" ? `RUN apk add --no-cache libffi
|
|
310
|
-
|
|
311
|
-
` : ""}${comment("Create non-root user")}RUN addgroup -g 1001 -S ${options.user} && \\
|
|
312
|
-
adduser -S ${options.user} -u 1001
|
|
313
|
-
|
|
314
|
-
${comment("Set working directory")}WORKDIR ${options.workdir}
|
|
315
|
-
|
|
316
|
-
${comment("Copy virtual environment from builder")}COPY --from=builder /opt/venv /opt/venv
|
|
317
|
-
|
|
318
|
-
${comment("Copy application files")}COPY --chown=${options.user}:${options.user} . .
|
|
319
|
-
|
|
320
|
-
${comment("Set environment variables")}ENV PATH="/opt/venv/bin:$PATH" \\
|
|
321
|
-
PYTHONUNBUFFERED=1 \\
|
|
322
|
-
PYTHONDONTWRITEBYTECODE=1 \\
|
|
323
|
-
PORT=${options.port}
|
|
324
|
-
|
|
325
|
-
${comment("Switch to non-root user")}USER ${options.user}
|
|
326
|
-
|
|
327
|
-
${comment("Expose port")}EXPOSE ${options.port}
|
|
328
|
-
|
|
329
|
-
${comment("Add health check")}${options.healthcheck ? `HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
|
|
330
|
-
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:${options.port}/health').read()"
|
|
331
|
-
|
|
332
|
-
` : ""}${comment("Start application")}CMD ["python", "app.py"]
|
|
333
|
-
`;
|
|
334
|
-
} else {
|
|
335
|
-
return `FROM ${baseImage}
|
|
336
|
-
|
|
337
|
-
${comment("Create non-root user")}RUN addgroup -g 1001 -S ${options.user} && \\
|
|
338
|
-
adduser -S ${options.user} -u 1001
|
|
339
|
-
|
|
340
|
-
${comment("Set working directory")}WORKDIR ${options.workdir}
|
|
341
|
-
|
|
342
|
-
${comment("Copy requirements and install dependencies")}COPY requirements.txt .
|
|
343
|
-
RUN pip install --no-cache-dir -r requirements.txt
|
|
344
|
-
|
|
345
|
-
${comment("Copy application files")}COPY --chown=${options.user}:${options.user} . .
|
|
346
|
-
|
|
347
|
-
${comment("Set environment variables")}ENV PYTHONUNBUFFERED=1 \\
|
|
348
|
-
PYTHONDONTWRITEBYTECODE=1 \\
|
|
349
|
-
PORT=${options.port}
|
|
350
|
-
|
|
351
|
-
${comment("Switch to non-root user")}USER ${options.user}
|
|
352
|
-
|
|
353
|
-
${comment("Expose port")}EXPOSE ${options.port}
|
|
354
|
-
|
|
355
|
-
${comment("Add health check")}${options.healthcheck ? `HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
|
|
356
|
-
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:${options.port}/health').read()"
|
|
357
|
-
|
|
358
|
-
` : ""}${comment("Start application")}CMD ["python", "app.py"]
|
|
359
|
-
`;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
// Generate Go Dockerfile
|
|
364
|
-
function generateGoDockerfile(options: GenerateOptions): string {
|
|
365
|
-
const buildImage = getBaseImage("go", options.base);
|
|
366
|
-
const comment = (text: string) => options.minimal ? "" : `# ${text}\n`;
|
|
367
|
-
|
|
368
|
-
return `${comment("Build stage")}FROM ${buildImage} AS builder
|
|
369
|
-
|
|
370
|
-
${comment("Set working directory")}WORKDIR ${options.workdir}
|
|
371
|
-
|
|
372
|
-
${comment("Copy go mod files")}COPY go.mod go.sum ./
|
|
373
|
-
|
|
374
|
-
${comment("Download dependencies")}RUN go mod download
|
|
375
|
-
|
|
376
|
-
${comment("Copy source code")}COPY . .
|
|
377
|
-
|
|
378
|
-
${comment("Build application")}RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
|
|
379
|
-
|
|
380
|
-
${comment("Production stage - use minimal image")}FROM alpine:latest
|
|
381
|
-
|
|
382
|
-
${comment("Install ca-certificates for HTTPS")}RUN apk --no-cache add ca-certificates
|
|
383
|
-
|
|
384
|
-
${comment("Create non-root user")}RUN addgroup -g 1001 -S ${options.user} && \\
|
|
385
|
-
adduser -S ${options.user} -u 1001
|
|
386
|
-
|
|
387
|
-
${comment("Set working directory")}WORKDIR /root/
|
|
388
|
-
|
|
389
|
-
${comment("Copy binary from builder")}COPY --from=builder ${options.workdir}/main .
|
|
390
|
-
|
|
391
|
-
${comment("Set ownership")}RUN chown ${options.user}:${options.user} main
|
|
392
|
-
|
|
393
|
-
${comment("Switch to non-root user")}USER ${options.user}
|
|
394
|
-
|
|
395
|
-
${comment("Expose port")}EXPOSE ${options.port}
|
|
396
|
-
|
|
397
|
-
${comment("Add health check")}${options.healthcheck ? `HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
|
|
398
|
-
CMD wget --no-verbose --tries=1 --spider http://localhost:${options.port}/health || exit 1
|
|
399
|
-
|
|
400
|
-
` : ""}${comment("Start application")}CMD ["./main"]
|
|
401
|
-
`;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
// Generate Rust Dockerfile
|
|
405
|
-
function generateRustDockerfile(options: GenerateOptions): string {
|
|
406
|
-
const buildImage = getBaseImage("rust", options.base);
|
|
407
|
-
const comment = (text: string) => options.minimal ? "" : `# ${text}\n`;
|
|
408
|
-
|
|
409
|
-
return `${comment("Build stage")}FROM ${buildImage} AS builder
|
|
410
|
-
|
|
411
|
-
${comment("Set working directory")}WORKDIR ${options.workdir}
|
|
412
|
-
|
|
413
|
-
${comment("Copy Cargo files")}COPY Cargo.toml Cargo.lock ./
|
|
414
|
-
|
|
415
|
-
${comment("Create dummy main to cache dependencies")}RUN mkdir src && \\
|
|
416
|
-
echo "fn main() {}" > src/main.rs && \\
|
|
417
|
-
cargo build --release && \\
|
|
418
|
-
rm -rf src
|
|
419
|
-
|
|
420
|
-
${comment("Copy source code")}COPY . .
|
|
421
|
-
|
|
422
|
-
${comment("Build application")}RUN cargo build --release
|
|
423
|
-
|
|
424
|
-
${comment("Production stage")}FROM alpine:latest
|
|
425
|
-
|
|
426
|
-
${comment("Install runtime dependencies")}RUN apk --no-cache add ca-certificates libgcc
|
|
427
|
-
|
|
428
|
-
${comment("Create non-root user")}RUN addgroup -g 1001 -S ${options.user} && \\
|
|
429
|
-
adduser -S ${options.user} -u 1001
|
|
430
|
-
|
|
431
|
-
${comment("Set working directory")}WORKDIR /root/
|
|
432
|
-
|
|
433
|
-
${comment("Copy binary from builder")}COPY --from=builder ${options.workdir}/target/release/app .
|
|
434
|
-
|
|
435
|
-
${comment("Set ownership")}RUN chown ${options.user}:${options.user} app
|
|
436
|
-
|
|
437
|
-
${comment("Switch to non-root user")}USER ${options.user}
|
|
438
|
-
|
|
439
|
-
${comment("Expose port")}EXPOSE ${options.port}
|
|
440
|
-
|
|
441
|
-
${comment("Add health check")}${options.healthcheck ? `HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
|
|
442
|
-
CMD wget --no-verbose --tries=1 --spider http://localhost:${options.port}/health || exit 1
|
|
443
|
-
|
|
444
|
-
` : ""}${comment("Start application")}CMD ["./app"]
|
|
445
|
-
`;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
// Generate Java Dockerfile
|
|
449
|
-
function generateJavaDockerfile(options: GenerateOptions): string {
|
|
450
|
-
const buildImage = getBaseImage("java", options.base);
|
|
451
|
-
const runtimeImage = buildImage.replace("-jdk", "-jre");
|
|
452
|
-
const comment = (text: string) => options.minimal ? "" : `# ${text}\n`;
|
|
453
|
-
|
|
454
|
-
return `${comment("Build stage")}FROM ${buildImage} AS builder
|
|
455
|
-
|
|
456
|
-
${comment("Set working directory")}WORKDIR ${options.workdir}
|
|
457
|
-
|
|
458
|
-
${comment("Copy Maven/Gradle files")}COPY pom.xml ./
|
|
459
|
-
${comment("Uncomment for Gradle: COPY build.gradle settings.gradle ./")}\
|
|
460
|
-
|
|
461
|
-
${comment("Copy source code")}COPY src ./src
|
|
462
|
-
|
|
463
|
-
${comment("Build application")}RUN ./mvnw package -DskipTests
|
|
464
|
-
${comment("Uncomment for Gradle: RUN ./gradlew build -x test")}
|
|
465
|
-
|
|
466
|
-
${comment("Production stage")}FROM ${runtimeImage}
|
|
467
|
-
|
|
468
|
-
${comment("Create non-root user")}RUN addgroup -g 1001 -S ${options.user} && \\
|
|
469
|
-
adduser -S ${options.user} -u 1001
|
|
470
|
-
|
|
471
|
-
${comment("Set working directory")}WORKDIR ${options.workdir}
|
|
472
|
-
|
|
473
|
-
${comment("Copy JAR from builder")}COPY --from=builder ${options.workdir}/target/*.jar app.jar
|
|
474
|
-
|
|
475
|
-
${comment("Set ownership")}RUN chown ${options.user}:${options.user} app.jar
|
|
476
|
-
|
|
477
|
-
${comment("Set environment variables")}ENV JAVA_OPTS="-Xmx512m -Xms256m" \\
|
|
478
|
-
PORT=${options.port}
|
|
479
|
-
|
|
480
|
-
${comment("Switch to non-root user")}USER ${options.user}
|
|
481
|
-
|
|
482
|
-
${comment("Expose port")}EXPOSE ${options.port}
|
|
483
|
-
|
|
484
|
-
${comment("Add health check")}${options.healthcheck ? `HEALTHCHECK --interval=30s --timeout=3s --start-period=30s --retries=3 \\
|
|
485
|
-
CMD wget --no-verbose --tries=1 --spider http://localhost:${options.port}/actuator/health || exit 1
|
|
486
|
-
|
|
487
|
-
` : ""}${comment("Start application")}ENTRYPOINT ["java", "-jar", "app.jar"]
|
|
488
|
-
`;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
// Generate Ruby Dockerfile
|
|
492
|
-
function generateRubyDockerfile(options: GenerateOptions): string {
|
|
493
|
-
const baseImage = getBaseImage("ruby", options.base);
|
|
494
|
-
const comment = (text: string) => options.minimal ? "" : `# ${text}\n`;
|
|
495
|
-
|
|
496
|
-
return `FROM ${baseImage}
|
|
497
|
-
|
|
498
|
-
${comment("Install dependencies")}${options.base === "alpine" ? `RUN apk add --no-cache build-base postgresql-dev
|
|
499
|
-
|
|
500
|
-
` : ""}${comment("Create non-root user")}RUN addgroup -g 1001 -S ${options.user} && \\
|
|
501
|
-
adduser -S ${options.user} -u 1001
|
|
502
|
-
|
|
503
|
-
${comment("Set working directory")}WORKDIR ${options.workdir}
|
|
504
|
-
|
|
505
|
-
${comment("Copy Gemfile")}COPY Gemfile Gemfile.lock ./
|
|
506
|
-
|
|
507
|
-
${comment("Install gems")}RUN bundle install --without development test
|
|
508
|
-
|
|
509
|
-
${comment("Copy application files")}COPY --chown=${options.user}:${options.user} . .
|
|
510
|
-
|
|
511
|
-
${comment("Set environment variables")}ENV RAILS_ENV=production \\
|
|
512
|
-
RACK_ENV=production \\
|
|
513
|
-
PORT=${options.port}
|
|
514
|
-
|
|
515
|
-
${comment("Switch to non-root user")}USER ${options.user}
|
|
516
|
-
|
|
517
|
-
${comment("Expose port")}EXPOSE ${options.port}
|
|
518
|
-
|
|
519
|
-
${comment("Add health check")}${options.healthcheck ? `HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
|
|
520
|
-
CMD wget --no-verbose --tries=1 --spider http://localhost:${options.port}/health || exit 1
|
|
521
|
-
|
|
522
|
-
` : ""}${comment("Start application")}CMD ["bundle", "exec", "rackup", "-o", "0.0.0.0", "-p", "${options.port}"]
|
|
523
|
-
`;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
// Generate PHP Dockerfile
|
|
527
|
-
function generatePhpDockerfile(options: GenerateOptions): string {
|
|
528
|
-
const baseImage = getBaseImage("php", options.base);
|
|
529
|
-
const comment = (text: string) => options.minimal ? "" : `# ${text}\n`;
|
|
530
|
-
|
|
531
|
-
return `FROM ${baseImage}
|
|
532
|
-
|
|
533
|
-
${comment("Install dependencies")}${options.base === "alpine" ? `RUN apk add --no-cache nginx supervisor
|
|
534
|
-
|
|
535
|
-
` : ""}${comment("Install composer")}COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
536
|
-
|
|
537
|
-
${comment("Create non-root user")}RUN addgroup -g 1001 -S ${options.user} && \\
|
|
538
|
-
adduser -S ${options.user} -u 1001
|
|
539
|
-
|
|
540
|
-
${comment("Set working directory")}WORKDIR ${options.workdir}
|
|
541
|
-
|
|
542
|
-
${comment("Copy composer files")}COPY composer.json composer.lock ./
|
|
543
|
-
|
|
544
|
-
${comment("Install PHP dependencies")}RUN composer install --no-dev --optimize-autoloader
|
|
545
|
-
|
|
546
|
-
${comment("Copy application files")}COPY --chown=${options.user}:${options.user} . .
|
|
547
|
-
|
|
548
|
-
${comment("Set environment variables")}ENV PHP_FPM_USER=${options.user} \\
|
|
549
|
-
PHP_FPM_GROUP=${options.user}
|
|
550
|
-
|
|
551
|
-
${comment("Expose port")}EXPOSE ${options.port}
|
|
552
|
-
|
|
553
|
-
${comment("Add health check")}${options.healthcheck ? `HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
|
|
554
|
-
CMD wget --no-verbose --tries=1 --spider http://localhost:${options.port}/health.php || exit 1
|
|
555
|
-
|
|
556
|
-
` : ""}${comment("Start PHP-FPM")}CMD ["php-fpm"]
|
|
557
|
-
`;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
// Generate static site Dockerfile
|
|
561
|
-
function generateStaticDockerfile(options: GenerateOptions): string {
|
|
562
|
-
const baseImage = getBaseImage("static", options.base);
|
|
563
|
-
const comment = (text: string) => options.minimal ? "" : `# ${text}\n`;
|
|
564
|
-
|
|
565
|
-
return `FROM ${baseImage}
|
|
566
|
-
|
|
567
|
-
${comment("Remove default nginx config")}RUN rm /etc/nginx/conf.d/default.conf
|
|
568
|
-
|
|
569
|
-
${comment("Copy custom nginx config")}COPY nginx.conf /etc/nginx/conf.d/
|
|
570
|
-
|
|
571
|
-
${comment("Copy static files")}COPY . /usr/share/nginx/html
|
|
572
|
-
|
|
573
|
-
${comment("Set permissions")}RUN chown -R nginx:nginx /usr/share/nginx/html && \\
|
|
574
|
-
chmod -R 755 /usr/share/nginx/html
|
|
575
|
-
|
|
576
|
-
${comment("Switch to non-root user")}USER nginx
|
|
577
|
-
|
|
578
|
-
${comment("Expose port")}EXPOSE 80
|
|
579
|
-
|
|
580
|
-
${comment("Add health check")}${options.healthcheck ? `HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
|
|
581
|
-
CMD wget --no-verbose --tries=1 --spider http://localhost || exit 1
|
|
582
|
-
|
|
583
|
-
` : ""}${comment("Start nginx")}CMD ["nginx", "-g", "daemon off;"]
|
|
584
|
-
`;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
// Generate Dockerfile based on project type
|
|
588
|
-
function generateDockerfile(type: ProjectType, options: GenerateOptions): string {
|
|
589
|
-
switch (type) {
|
|
590
|
-
case "nodejs":
|
|
591
|
-
return generateNodejsDockerfile(options);
|
|
592
|
-
case "python":
|
|
593
|
-
return generatePythonDockerfile(options);
|
|
594
|
-
case "go":
|
|
595
|
-
return generateGoDockerfile(options);
|
|
596
|
-
case "rust":
|
|
597
|
-
return generateRustDockerfile(options);
|
|
598
|
-
case "java":
|
|
599
|
-
return generateJavaDockerfile(options);
|
|
600
|
-
case "ruby":
|
|
601
|
-
return generateRubyDockerfile(options);
|
|
602
|
-
case "php":
|
|
603
|
-
return generatePhpDockerfile(options);
|
|
604
|
-
case "static":
|
|
605
|
-
return generateStaticDockerfile(options);
|
|
606
|
-
default:
|
|
607
|
-
throw new Error(`Unsupported project type: ${type}`);
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
// Generate .dockerignore
|
|
612
|
-
function generateDockerignore(type: ProjectType): string {
|
|
613
|
-
const common = `# Version control
|
|
614
|
-
.git
|
|
615
|
-
.gitignore
|
|
616
|
-
.svn
|
|
617
|
-
.hg
|
|
618
|
-
|
|
619
|
-
# IDE files
|
|
620
|
-
.vscode
|
|
621
|
-
.idea
|
|
622
|
-
*.swp
|
|
623
|
-
*.swo
|
|
624
|
-
*~
|
|
625
|
-
|
|
626
|
-
# OS files
|
|
627
|
-
.DS_Store
|
|
628
|
-
Thumbs.db
|
|
629
|
-
|
|
630
|
-
# Environment files
|
|
631
|
-
.env
|
|
632
|
-
.env.*
|
|
633
|
-
!.env.example
|
|
634
|
-
|
|
635
|
-
# Logs
|
|
636
|
-
*.log
|
|
637
|
-
logs
|
|
638
|
-
npm-debug.log*
|
|
639
|
-
yarn-debug.log*
|
|
640
|
-
yarn-error.log*
|
|
641
|
-
|
|
642
|
-
# Temporary files
|
|
643
|
-
tmp
|
|
644
|
-
temp
|
|
645
|
-
*.tmp
|
|
646
|
-
|
|
647
|
-
# Documentation
|
|
648
|
-
README.md
|
|
649
|
-
CHANGELOG.md
|
|
650
|
-
LICENSE
|
|
651
|
-
docs
|
|
652
|
-
*.md
|
|
653
|
-
|
|
654
|
-
# CI/CD
|
|
655
|
-
.github
|
|
656
|
-
.gitlab-ci.yml
|
|
657
|
-
.travis.yml
|
|
658
|
-
Jenkinsfile
|
|
659
|
-
|
|
660
|
-
# Testing
|
|
661
|
-
coverage
|
|
662
|
-
.nyc_output
|
|
663
|
-
test
|
|
664
|
-
tests
|
|
665
|
-
*.test.js
|
|
666
|
-
*.spec.js
|
|
667
|
-
`;
|
|
668
|
-
|
|
669
|
-
const typeSpecific: Record<ProjectType, string> = {
|
|
670
|
-
nodejs: `# Node.js
|
|
671
|
-
node_modules
|
|
672
|
-
dist
|
|
673
|
-
build
|
|
674
|
-
.npm
|
|
675
|
-
.cache
|
|
676
|
-
`,
|
|
677
|
-
python: `# Python
|
|
678
|
-
__pycache__
|
|
679
|
-
*.py[cod]
|
|
680
|
-
*$py.class
|
|
681
|
-
venv
|
|
682
|
-
env
|
|
683
|
-
.Python
|
|
684
|
-
*.egg-info
|
|
685
|
-
dist
|
|
686
|
-
build
|
|
687
|
-
.pytest_cache
|
|
688
|
-
.coverage
|
|
689
|
-
`,
|
|
690
|
-
go: `# Go
|
|
691
|
-
vendor
|
|
692
|
-
*.exe
|
|
693
|
-
*.exe~
|
|
694
|
-
*.dll
|
|
695
|
-
*.so
|
|
696
|
-
*.dylib
|
|
697
|
-
`,
|
|
698
|
-
rust: `# Rust
|
|
699
|
-
target
|
|
700
|
-
Cargo.lock
|
|
701
|
-
*.rs.bk
|
|
702
|
-
`,
|
|
703
|
-
java: `# Java
|
|
704
|
-
target
|
|
705
|
-
*.class
|
|
706
|
-
*.jar
|
|
707
|
-
*.war
|
|
708
|
-
.mvn
|
|
709
|
-
.gradle
|
|
710
|
-
build
|
|
711
|
-
`,
|
|
712
|
-
ruby: `# Ruby
|
|
713
|
-
.bundle
|
|
714
|
-
vendor/bundle
|
|
715
|
-
*.gem
|
|
716
|
-
.rspec
|
|
717
|
-
`,
|
|
718
|
-
php: `# PHP
|
|
719
|
-
vendor
|
|
720
|
-
composer.phar
|
|
721
|
-
*.cache
|
|
722
|
-
storage/logs
|
|
723
|
-
`,
|
|
724
|
-
static: `# Static
|
|
725
|
-
node_modules
|
|
726
|
-
src
|
|
727
|
-
*.scss
|
|
728
|
-
*.sass
|
|
729
|
-
*.less
|
|
730
|
-
`
|
|
731
|
-
};
|
|
732
|
-
|
|
733
|
-
return common + (typeSpecific[type] || "");
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
// Generate docker-compose.yml
|
|
737
|
-
function generateDockerCompose(type: ProjectType, options: GenerateOptions): string {
|
|
738
|
-
const serviceName = "app";
|
|
739
|
-
|
|
740
|
-
return `version: '3.8'
|
|
741
|
-
|
|
742
|
-
services:
|
|
743
|
-
${serviceName}:
|
|
744
|
-
build:
|
|
745
|
-
context: .
|
|
746
|
-
dockerfile: Dockerfile
|
|
747
|
-
ports:
|
|
748
|
-
- "${options.port}:${options.port}"
|
|
749
|
-
environment:
|
|
750
|
-
- NODE_ENV=production
|
|
751
|
-
- PORT=${options.port}
|
|
752
|
-
volumes:
|
|
753
|
-
- ./${options.workdir}:${options.workdir}
|
|
754
|
-
restart: unless-stopped
|
|
755
|
-
${options.healthcheck ? `healthcheck:
|
|
756
|
-
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:${options.port}/health"]
|
|
757
|
-
interval: 30s
|
|
758
|
-
timeout: 3s
|
|
759
|
-
retries: 3
|
|
760
|
-
start_period: 5s
|
|
761
|
-
` : ""}
|
|
762
|
-
# Uncomment to add database service
|
|
763
|
-
# db:
|
|
764
|
-
# image: postgres:16-alpine
|
|
765
|
-
# environment:
|
|
766
|
-
# POSTGRES_DB: myapp
|
|
767
|
-
# POSTGRES_USER: user
|
|
768
|
-
# POSTGRES_PASSWORD: password
|
|
769
|
-
# volumes:
|
|
770
|
-
# - db_data:/var/lib/postgresql/data
|
|
771
|
-
# restart: unless-stopped
|
|
772
|
-
|
|
773
|
-
# Uncomment to add Redis cache
|
|
774
|
-
# redis:
|
|
775
|
-
# image: redis:7-alpine
|
|
776
|
-
# restart: unless-stopped
|
|
777
|
-
|
|
778
|
-
# volumes:
|
|
779
|
-
# db_data:
|
|
780
|
-
`;
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
// Main execution
|
|
784
10
|
async function main() {
|
|
785
11
|
try {
|
|
786
12
|
log(`Starting ${SKILL_NAME} skill (Session: ${SESSION_ID})`);
|
|
787
|
-
|
|
788
|
-
const options = parseOptions();
|
|
789
13
|
|
|
790
|
-
|
|
14
|
+
const options = parseOptions();
|
|
791
15
|
let projectType = options.type;
|
|
16
|
+
|
|
792
17
|
if (!projectType) {
|
|
793
18
|
console.log("Detecting project type...");
|
|
794
|
-
|
|
19
|
+
const detectedType = detectProjectType(options.dir);
|
|
795
20
|
|
|
796
|
-
if (!
|
|
21
|
+
if (!detectedType) {
|
|
797
22
|
throw new Error(
|
|
798
23
|
"Could not detect project type. Please specify with --type option.\n" +
|
|
799
|
-
|
|
24
|
+
"Supported types: nodejs, python, go, rust, java, ruby, php, static"
|
|
800
25
|
);
|
|
801
26
|
}
|
|
802
27
|
|
|
28
|
+
projectType = detectedType;
|
|
803
29
|
console.log(`✓ Detected: ${projectType}`);
|
|
804
30
|
log(`Auto-detected project type: ${projectType}`);
|
|
805
31
|
}
|
|
806
32
|
|
|
807
33
|
console.log("\nGenerating files...");
|
|
808
34
|
|
|
809
|
-
// Generate Dockerfile
|
|
810
35
|
const dockerfile = generateDockerfile(projectType, options);
|
|
811
36
|
const dockerfilePath = join(options.output, "Dockerfile");
|
|
812
37
|
await Bun.write(dockerfilePath, dockerfile);
|
|
813
38
|
console.log(`✓ Generated: Dockerfile (${options.multistage ? "multi-stage, " : ""}${options.base})`);
|
|
814
39
|
log(`Generated Dockerfile at: ${dockerfilePath}`);
|
|
815
40
|
|
|
816
|
-
// Save to exports
|
|
817
41
|
const exportDockerfile = join(EXPORTS_DIR, `Dockerfile_${SESSION_ID}`);
|
|
818
42
|
await Bun.write(exportDockerfile, dockerfile);
|
|
819
43
|
|
|
820
|
-
// Generate .dockerignore
|
|
821
44
|
if (options.dockerignore) {
|
|
822
45
|
const dockerignore = generateDockerignore(projectType);
|
|
823
46
|
const dockerignorePath = join(options.output, ".dockerignore");
|
|
@@ -829,7 +52,6 @@ async function main() {
|
|
|
829
52
|
await Bun.write(exportDockerignore, dockerignore);
|
|
830
53
|
}
|
|
831
54
|
|
|
832
|
-
// Generate docker-compose.yml
|
|
833
55
|
if (options.compose) {
|
|
834
56
|
const compose = generateDockerCompose(projectType, options);
|
|
835
57
|
const composePath = join(options.output, "docker-compose.yml");
|