claude-code-templates 1.21.6 โ 1.21.7
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/package.json +2 -2
- package/components/agents/ai-specialists/ai-ethics-advisor.md +0 -195
- package/components/agents/ai-specialists/hackathon-ai-strategist.md +0 -46
- package/components/agents/ai-specialists/llms-maintainer.md +0 -94
- package/components/agents/ai-specialists/model-evaluator.md +0 -150
- package/components/agents/ai-specialists/prompt-engineer.md +0 -112
- package/components/agents/ai-specialists/search-specialist.md +0 -59
- package/components/agents/ai-specialists/task-decomposition-expert.md +0 -97
- package/components/agents/api-graphql/graphql-architect.md +0 -208
- package/components/agents/api-graphql/graphql-performance-optimizer.md +0 -357
- package/components/agents/api-graphql/graphql-security-specialist.md +0 -519
- package/components/agents/blockchain-web3/smart-contract-auditor.md +0 -32
- package/components/agents/blockchain-web3/smart-contract-specialist.md +0 -32
- package/components/agents/blockchain-web3/web3-integration-specialist.md +0 -32
- package/components/agents/business-marketing/business-analyst.md +0 -194
- package/components/agents/business-marketing/content-marketer.md +0 -36
- package/components/agents/business-marketing/customer-support.md +0 -36
- package/components/agents/business-marketing/legal-advisor.md +0 -50
- package/components/agents/business-marketing/marketing-attribution-analyst.md +0 -352
- package/components/agents/business-marketing/payment-integration.md +0 -33
- package/components/agents/business-marketing/product-strategist.md +0 -212
- package/components/agents/business-marketing/risk-manager.md +0 -42
- package/components/agents/business-marketing/sales-automator.md +0 -36
- package/components/agents/data-ai/ai-engineer.md +0 -33
- package/components/agents/data-ai/computer-vision-engineer.md +0 -562
- package/components/agents/data-ai/data-engineer.md +0 -33
- package/components/agents/data-ai/data-scientist.md +0 -337
- package/components/agents/data-ai/ml-engineer.md +0 -33
- package/components/agents/data-ai/mlops-engineer.md +0 -58
- package/components/agents/data-ai/nlp-engineer.md +0 -680
- package/components/agents/data-ai/quant-analyst.md +0 -33
- package/components/agents/database/database-admin.md +0 -33
- package/components/agents/database/database-architect.md +0 -590
- package/components/agents/database/database-optimization.md +0 -33
- package/components/agents/database/database-optimizer.md +0 -33
- package/components/agents/database/nosql-specialist.md +0 -708
- package/components/agents/database/supabase-schema-architect.md +0 -138
- package/components/agents/deep-research-team/academic-researcher.md +0 -33
- package/components/agents/deep-research-team/agent-overview.md +0 -235
- package/components/agents/deep-research-team/competitive-intelligence-analyst.md +0 -530
- package/components/agents/deep-research-team/data-analyst.md +0 -112
- package/components/agents/deep-research-team/fact-checker.md +0 -553
- package/components/agents/deep-research-team/query-clarifier.md +0 -73
- package/components/agents/deep-research-team/report-generator.md +0 -108
- package/components/agents/deep-research-team/research-brief-generator.md +0 -108
- package/components/agents/deep-research-team/research-coordinator.md +0 -94
- package/components/agents/deep-research-team/research-orchestrator.md +0 -119
- package/components/agents/deep-research-team/research-synthesizer.md +0 -109
- package/components/agents/deep-research-team/technical-researcher.md +0 -95
- package/components/agents/development-team/backend-architect.md +0 -31
- package/components/agents/development-team/cli-ui-designer.md +0 -405
- package/components/agents/development-team/devops-engineer.md +0 -886
- package/components/agents/development-team/frontend-developer.md +0 -32
- package/components/agents/development-team/fullstack-developer.md +0 -1205
- package/components/agents/development-team/ios-developer.md +0 -36
- package/components/agents/development-team/mobile-developer.md +0 -33
- package/components/agents/development-team/ui-ux-designer.md +0 -36
- package/components/agents/development-tools/code-reviewer.md +0 -30
- package/components/agents/development-tools/command-expert.md +0 -422
- package/components/agents/development-tools/context-manager.md +0 -65
- package/components/agents/development-tools/debugger.md +0 -31
- package/components/agents/development-tools/dx-optimizer.md +0 -64
- package/components/agents/development-tools/error-detective.md +0 -33
- package/components/agents/development-tools/mcp-expert.md +0 -259
- package/components/agents/development-tools/performance-profiler.md +0 -799
- package/components/agents/development-tools/test-engineer.md +0 -936
- package/components/agents/devops-infrastructure/cloud-architect.md +0 -33
- package/components/agents/devops-infrastructure/deployment-engineer.md +0 -33
- package/components/agents/devops-infrastructure/devops-troubleshooter.md +0 -33
- package/components/agents/devops-infrastructure/monitoring-specialist.md +0 -36
- package/components/agents/devops-infrastructure/network-engineer.md +0 -33
- package/components/agents/devops-infrastructure/security-engineer.md +0 -971
- package/components/agents/devops-infrastructure/terraform-specialist.md +0 -36
- package/components/agents/devops-infrastructure/vercel-deployment-specialist.md +0 -357
- package/components/agents/documentation/api-documenter.md +0 -33
- package/components/agents/documentation/changelog-generator.md +0 -37
- package/components/agents/documentation/docusaurus-expert.md +0 -52
- package/components/agents/documentation/technical-writer.md +0 -37
- package/components/agents/expert-advisors/agent-expert.md +0 -477
- package/components/agents/expert-advisors/architect-review.md +0 -50
- package/components/agents/expert-advisors/dependency-manager.md +0 -45
- package/components/agents/expert-advisors/documentation-expert.md +0 -47
- package/components/agents/ffmpeg-clip-team/audio-mixer.md +0 -37
- package/components/agents/ffmpeg-clip-team/audio-quality-controller.md +0 -100
- package/components/agents/ffmpeg-clip-team/podcast-content-analyzer.md +0 -60
- package/components/agents/ffmpeg-clip-team/podcast-metadata-specialist.md +0 -46
- package/components/agents/ffmpeg-clip-team/podcast-transcriber.md +0 -68
- package/components/agents/ffmpeg-clip-team/social-media-clip-creator.md +0 -69
- package/components/agents/ffmpeg-clip-team/timestamp-precision-specialist.md +0 -98
- package/components/agents/ffmpeg-clip-team/video-editor.md +0 -37
- package/components/agents/game-development/3d-artist.md +0 -37
- package/components/agents/game-development/game-designer.md +0 -37
- package/components/agents/game-development/unity-game-developer.md +0 -110
- package/components/agents/game-development/unreal-engine-developer.md +0 -128
- package/components/agents/mcp-dev-team/mcp-deployment-orchestrator.md +0 -101
- package/components/agents/mcp-dev-team/mcp-integration-engineer.md +0 -37
- package/components/agents/mcp-dev-team/mcp-protocol-specialist.md +0 -37
- package/components/agents/mcp-dev-team/mcp-registry-navigator.md +0 -112
- package/components/agents/mcp-dev-team/mcp-security-auditor.md +0 -70
- package/components/agents/mcp-dev-team/mcp-server-architect.md +0 -74
- package/components/agents/mcp-dev-team/mcp-testing-engineer.md +0 -106
- package/components/agents/modernization/architecture-modernizer.md +0 -37
- package/components/agents/modernization/cloud-migration-specialist.md +0 -37
- package/components/agents/modernization/legacy-modernizer.md +0 -33
- package/components/agents/obsidian-ops-team/Scripts/daily_notes_connector.py +0 -306
- package/components/agents/obsidian-ops-team/Scripts/enhance_tag_standardizer.py +0 -343
- package/components/agents/obsidian-ops-team/Scripts/find_keyword_connections.py +0 -216
- package/components/agents/obsidian-ops-team/Scripts/fix_quoted_tags.py +0 -82
- package/components/agents/obsidian-ops-team/Scripts/implement_entity_connections.py +0 -195
- package/components/agents/obsidian-ops-team/Scripts/link_suggester.py +0 -301
- package/components/agents/obsidian-ops-team/Scripts/metadata_adder.py +0 -197
- package/components/agents/obsidian-ops-team/Scripts/moc_generator.py +0 -296
- package/components/agents/obsidian-ops-team/Scripts/parse_keyword_connections.py +0 -122
- package/components/agents/obsidian-ops-team/Scripts/tag_standardizer.py +0 -387
- package/components/agents/obsidian-ops-team/connection-agent.md +0 -67
- package/components/agents/obsidian-ops-team/content-curator.md +0 -81
- package/components/agents/obsidian-ops-team/metadata-agent.md +0 -51
- package/components/agents/obsidian-ops-team/moc-agent.md +0 -112
- package/components/agents/obsidian-ops-team/review-agent.md +0 -94
- package/components/agents/obsidian-ops-team/tag-agent.md +0 -92
- package/components/agents/obsidian-ops-team/vault-optimizer.md +0 -76
- package/components/agents/ocr-extraction-team/document-structure-analyzer.md +0 -37
- package/components/agents/ocr-extraction-team/markdown-syntax-formatter.md +0 -58
- package/components/agents/ocr-extraction-team/ocr-grammar-fixer.md +0 -36
- package/components/agents/ocr-extraction-team/ocr-preprocessing-optimizer.md +0 -37
- package/components/agents/ocr-extraction-team/ocr-quality-assurance.md +0 -62
- package/components/agents/ocr-extraction-team/text-comparison-validator.md +0 -60
- package/components/agents/ocr-extraction-team/visual-analysis-ocr.md +0 -52
- package/components/agents/performance-testing/load-testing-specialist.md +0 -37
- package/components/agents/performance-testing/performance-engineer.md +0 -33
- package/components/agents/performance-testing/react-performance-optimization.md +0 -65
- package/components/agents/performance-testing/test-automator.md +0 -33
- package/components/agents/performance-testing/web-vitals-optimizer.md +0 -37
- package/components/agents/podcast-creator-team/academic-research-synthesizer.md +0 -61
- package/components/agents/podcast-creator-team/comprehensive-researcher.md +0 -49
- package/components/agents/podcast-creator-team/episode-orchestrator.md +0 -52
- package/components/agents/podcast-creator-team/guest-outreach-coordinator.md +0 -37
- package/components/agents/podcast-creator-team/market-research-analyst.md +0 -54
- package/components/agents/podcast-creator-team/podcast-editor.md +0 -37
- package/components/agents/podcast-creator-team/podcast-trend-scout.md +0 -60
- package/components/agents/podcast-creator-team/project-supervisor-orchestrator.md +0 -48
- package/components/agents/podcast-creator-team/seo-podcast-optimizer.md +0 -58
- package/components/agents/podcast-creator-team/social-media-copywriter.md +0 -57
- package/components/agents/podcast-creator-team/twitter-ai-influencer-manager.md +0 -62
- package/components/agents/programming-languages/c-pro.md +0 -36
- package/components/agents/programming-languages/c-sharp-pro.md +0 -40
- package/components/agents/programming-languages/cpp-pro.md +0 -39
- package/components/agents/programming-languages/golang-pro.md +0 -33
- package/components/agents/programming-languages/javascript-pro.md +0 -36
- package/components/agents/programming-languages/php-pro.md +0 -44
- package/components/agents/programming-languages/python-pro.md +0 -33
- package/components/agents/programming-languages/rust-pro.md +0 -36
- package/components/agents/programming-languages/shell-scripting-pro.md +0 -38
- package/components/agents/programming-languages/sql-pro.md +0 -36
- package/components/agents/programming-languages/typescript-pro.md +0 -38
- package/components/agents/realtime/supabase-realtime-optimizer.md +0 -193
- package/components/agents/security/api-security-audit.md +0 -93
- package/components/agents/security/compliance-specialist.md +0 -37
- package/components/agents/security/incident-responder.md +0 -75
- package/components/agents/security/penetration-tester.md +0 -37
- package/components/agents/security/security-auditor.md +0 -33
- package/components/agents/web-tools/nextjs-architecture-expert.md +0 -194
- package/components/agents/web-tools/react-performance-optimizer.md +0 -425
- package/components/agents/web-tools/seo-analyzer.md +0 -37
- package/components/agents/web-tools/url-context-validator.md +0 -61
- package/components/agents/web-tools/url-link-extractor.md +0 -59
- package/components/agents/web-tools/web-accessibility-checker.md +0 -37
- package/components/commands/automation/act.md +0 -57
- package/components/commands/automation/ci-pipeline.md +0 -378
- package/components/commands/automation/husky.md +0 -130
- package/components/commands/automation/workflow-orchestrator.md +0 -576
- package/components/commands/database/supabase-backup-manager.md +0 -37
- package/components/commands/database/supabase-data-explorer.md +0 -37
- package/components/commands/database/supabase-migration-assistant.md +0 -37
- package/components/commands/database/supabase-performance-optimizer.md +0 -37
- package/components/commands/database/supabase-realtime-monitor.md +0 -37
- package/components/commands/database/supabase-schema-sync.md +0 -37
- package/components/commands/database/supabase-security-audit.md +0 -37
- package/components/commands/database/supabase-type-generator.md +0 -37
- package/components/commands/deployment/add-changelog.md +0 -92
- package/components/commands/deployment/blue-green-deployment.md +0 -824
- package/components/commands/deployment/changelog-demo-command.md +0 -43
- package/components/commands/deployment/ci-setup.md +0 -323
- package/components/commands/deployment/containerize-application.md +0 -93
- package/components/commands/deployment/deployment-monitoring.md +0 -1228
- package/components/commands/deployment/hotfix-deploy.md +0 -283
- package/components/commands/deployment/prepare-release.md +0 -357
- package/components/commands/deployment/rollback-deploy.md +0 -145
- package/components/commands/deployment/setup-automated-releases.md +0 -143
- package/components/commands/deployment/setup-kubernetes-deployment.md +0 -93
- package/components/commands/documentation/create-architecture-documentation.md +0 -95
- package/components/commands/documentation/create-onboarding-guide.md +0 -93
- package/components/commands/documentation/doc-api.md +0 -242
- package/components/commands/documentation/docs-maintenance.md +0 -119
- package/components/commands/documentation/generate-api-documentation.md +0 -97
- package/components/commands/documentation/interactive-documentation.md +0 -133
- package/components/commands/documentation/load-llms-txt.md +0 -39
- package/components/commands/documentation/migration-guide.md +0 -250
- package/components/commands/documentation/troubleshooting-guide.md +0 -370
- package/components/commands/documentation/update-docs.md +0 -107
- package/components/commands/game-development/game-analytics-integration.md +0 -128
- package/components/commands/game-development/game-asset-pipeline.md +0 -108
- package/components/commands/game-development/game-performance-profiler.md +0 -78
- package/components/commands/game-development/game-testing-framework.md +0 -112
- package/components/commands/game-development/unity-project-setup.md +0 -190
- package/components/commands/git-workflow/branch-cleanup.md +0 -181
- package/components/commands/git-workflow/commit.md +0 -167
- package/components/commands/git-workflow/create-pr.md +0 -19
- package/components/commands/git-workflow/create-pull-request.md +0 -126
- package/components/commands/git-workflow/create-worktrees.md +0 -174
- package/components/commands/git-workflow/fix-github-issue.md +0 -13
- package/components/commands/git-workflow/git-bisect-helper.md +0 -261
- package/components/commands/git-workflow/pr-review.md +0 -76
- package/components/commands/git-workflow/update-branch-name.md +0 -9
- package/components/commands/nextjs-vercel/nextjs-api-tester.md +0 -480
- package/components/commands/nextjs-vercel/nextjs-bundle-analyzer.md +0 -406
- package/components/commands/nextjs-vercel/nextjs-component-generator.md +0 -489
- package/components/commands/nextjs-vercel/nextjs-middleware-creator.md +0 -712
- package/components/commands/nextjs-vercel/nextjs-migration-helper.md +0 -778
- package/components/commands/nextjs-vercel/nextjs-performance-audit.md +0 -653
- package/components/commands/nextjs-vercel/nextjs-scaffold.md +0 -237
- package/components/commands/nextjs-vercel/vercel-deploy-optimize.md +0 -341
- package/components/commands/nextjs-vercel/vercel-edge-function.md +0 -810
- package/components/commands/nextjs-vercel/vercel-env-sync.md +0 -666
- package/components/commands/orchestration/archive.md +0 -414
- package/components/commands/orchestration/commit.md +0 -305
- package/components/commands/orchestration/find.md +0 -272
- package/components/commands/orchestration/log.md +0 -355
- package/components/commands/orchestration/move.md +0 -220
- package/components/commands/orchestration/optimize.md +0 -375
- package/components/commands/orchestration/remove.md +0 -301
- package/components/commands/orchestration/report.md +0 -292
- package/components/commands/orchestration/resume.md +0 -256
- package/components/commands/orchestration/start.md +0 -169
- package/components/commands/orchestration/status.md +0 -219
- package/components/commands/orchestration/sync.md +0 -294
- package/components/commands/performance/add-performance-monitoring.md +0 -84
- package/components/commands/performance/implement-caching-strategy.md +0 -84
- package/components/commands/performance/optimize-api-performance.md +0 -119
- package/components/commands/performance/optimize-build.md +0 -139
- package/components/commands/performance/optimize-bundle-size.md +0 -84
- package/components/commands/performance/optimize-database-performance.md +0 -84
- package/components/commands/performance/optimize-memory-usage.md +0 -91
- package/components/commands/performance/performance-audit.md +0 -89
- package/components/commands/performance/setup-cdn-optimization.md +0 -84
- package/components/commands/performance/system-behavior-simulator.md +0 -415
- package/components/commands/project-management/add-package.md +0 -90
- package/components/commands/project-management/add-to-changelog.md +0 -37
- package/components/commands/project-management/create-feature.md +0 -130
- package/components/commands/project-management/create-jtbd.md +0 -37
- package/components/commands/project-management/create-prd.md +0 -36
- package/components/commands/project-management/create-prp.md +0 -37
- package/components/commands/project-management/init-project.md +0 -80
- package/components/commands/project-management/milestone-tracker.md +0 -44
- package/components/commands/project-management/pac-configure.md +0 -32
- package/components/commands/project-management/pac-create-epic.md +0 -41
- package/components/commands/project-management/pac-create-ticket.md +0 -42
- package/components/commands/project-management/pac-update-status.md +0 -39
- package/components/commands/project-management/pac-validate.md +0 -35
- package/components/commands/project-management/project-health-check.md +0 -58
- package/components/commands/project-management/project-timeline-simulator.md +0 -37
- package/components/commands/project-management/project-to-linear.md +0 -38
- package/components/commands/project-management/release.md +0 -31
- package/components/commands/project-management/todo.md +0 -62
- package/components/commands/security/add-authentication-system.md +0 -34
- package/components/commands/security/dependency-audit.md +0 -32
- package/components/commands/security/penetration-test.md +0 -40
- package/components/commands/security/secrets-scanner.md +0 -39
- package/components/commands/security/security-audit.md +0 -82
- package/components/commands/security/security-hardening.md +0 -33
- package/components/commands/setup/create-database-migrations.md +0 -35
- package/components/commands/setup/design-database-schema.md +0 -37
- package/components/commands/setup/design-rest-api.md +0 -37
- package/components/commands/setup/implement-graphql-api.md +0 -37
- package/components/commands/setup/migrate-to-typescript.md +0 -37
- package/components/commands/setup/setup-ci-cd-pipeline.md +0 -37
- package/components/commands/setup/setup-development-environment.md +0 -37
- package/components/commands/setup/setup-docker-containers.md +0 -37
- package/components/commands/setup/setup-formatting.md +0 -37
- package/components/commands/setup/setup-linting.md +0 -37
- package/components/commands/setup/setup-monitoring-observability.md +0 -37
- package/components/commands/setup/setup-monorepo.md +0 -37
- package/components/commands/setup/setup-rate-limiting.md +0 -37
- package/components/commands/setup/update-dependencies.md +0 -35
- package/components/commands/simulation/business-scenario-explorer.md +0 -37
- package/components/commands/simulation/constraint-modeler.md +0 -37
- package/components/commands/simulation/decision-tree-explorer.md +0 -37
- package/components/commands/simulation/digital-twin-creator.md +0 -37
- package/components/commands/simulation/future-scenario-generator.md +0 -37
- package/components/commands/simulation/market-response-modeler.md +0 -37
- package/components/commands/simulation/monte-carlo-simulator.md +0 -37
- package/components/commands/simulation/simulation-calibrator.md +0 -37
- package/components/commands/simulation/system-dynamics-modeler.md +0 -37
- package/components/commands/simulation/timeline-compressor.md +0 -37
- package/components/commands/svelte/svelte:a11y.md +0 -105
- package/components/commands/svelte/svelte:component.md +0 -81
- package/components/commands/svelte/svelte:debug.md +0 -48
- package/components/commands/svelte/svelte:migrate.md +0 -79
- package/components/commands/svelte/svelte:optimize.md +0 -99
- package/components/commands/svelte/svelte:scaffold.md +0 -89
- package/components/commands/svelte/svelte:storybook-migrate.md +0 -204
- package/components/commands/svelte/svelte:storybook-mock.md +0 -213
- package/components/commands/svelte/svelte:storybook-setup.md +0 -113
- package/components/commands/svelte/svelte:storybook-story.md +0 -145
- package/components/commands/svelte/svelte:storybook-troubleshoot.md +0 -191
- package/components/commands/svelte/svelte:storybook.md +0 -48
- package/components/commands/svelte/svelte:test-coverage.md +0 -77
- package/components/commands/svelte/svelte:test-fix.md +0 -74
- package/components/commands/svelte/svelte:test-setup.md +0 -85
- package/components/commands/svelte/svelte:test.md +0 -60
- package/components/commands/sync/bidirectional-sync.md +0 -37
- package/components/commands/sync/bulk-import-issues.md +0 -37
- package/components/commands/sync/cross-reference-manager.md +0 -37
- package/components/commands/sync/issue-to-linear-task.md +0 -37
- package/components/commands/sync/linear-task-to-issue.md +0 -37
- package/components/commands/sync/sync-automation-setup.md +0 -37
- package/components/commands/sync/sync-conflict-resolver.md +0 -37
- package/components/commands/sync/sync-health-monitor.md +0 -37
- package/components/commands/sync/sync-issues-to-linear.md +0 -37
- package/components/commands/sync/sync-linear-to-issues.md +0 -37
- package/components/commands/sync/sync-migration-assistant.md +0 -37
- package/components/commands/sync/sync-pr-to-task.md +0 -37
- package/components/commands/sync/sync-status.md +0 -391
- package/components/commands/sync/task-from-pr.md +0 -37
- package/components/commands/team/architecture-review.md +0 -37
- package/components/commands/team/decision-quality-analyzer.md +0 -37
- package/components/commands/team/dependency-mapper.md +0 -37
- package/components/commands/team/estimate-assistant.md +0 -37
- package/components/commands/team/issue-triage.md +0 -37
- package/components/commands/team/memory-spring-cleaning.md +0 -37
- package/components/commands/team/migration-assistant.md +0 -37
- package/components/commands/team/retrospective-analyzer.md +0 -37
- package/components/commands/team/session-learning-capture.md +0 -37
- package/components/commands/team/sprint-planning.md +0 -189
- package/components/commands/team/standup-report.md +0 -37
- package/components/commands/team/team-knowledge-mapper.md +0 -37
- package/components/commands/team/team-velocity-tracker.md +0 -37
- package/components/commands/team/team-workload-balancer.md +0 -37
- package/components/commands/testing/add-mutation-testing.md +0 -37
- package/components/commands/testing/add-property-based-testing.md +0 -37
- package/components/commands/testing/e2e-setup.md +0 -37
- package/components/commands/testing/generate-test-cases.md +0 -37
- package/components/commands/testing/generate-tests.md +0 -82
- package/components/commands/testing/setup-comprehensive-testing.md +0 -37
- package/components/commands/testing/setup-load-testing.md +0 -37
- package/components/commands/testing/setup-visual-testing.md +0 -37
- package/components/commands/testing/test-automation-orchestrator.md +0 -37
- package/components/commands/testing/test-changelog-automation.md +0 -37
- package/components/commands/testing/test-coverage.md +0 -37
- package/components/commands/testing/test-quality-analyzer.md +0 -37
- package/components/commands/testing/testing_plan_integration.md +0 -37
- package/components/commands/testing/write-tests.md +0 -37
- package/components/commands/utilities/all-tools.md +0 -31
- package/components/commands/utilities/architecture-scenario-explorer.md +0 -375
- package/components/commands/utilities/check-file.md +0 -53
- package/components/commands/utilities/clean-branches.md +0 -243
- package/components/commands/utilities/clean.md +0 -1
- package/components/commands/utilities/code-permutation-tester.md +0 -341
- package/components/commands/utilities/code-review.md +0 -70
- package/components/commands/utilities/code-to-task.md +0 -583
- package/components/commands/utilities/context-prime.md +0 -1
- package/components/commands/utilities/debug-error.md +0 -121
- package/components/commands/utilities/directory-deep-dive.md +0 -34
- package/components/commands/utilities/explain-code.md +0 -194
- package/components/commands/utilities/fix-issue.md +0 -85
- package/components/commands/utilities/generate-linear-worklog.md +0 -113
- package/components/commands/utilities/git-status.md +0 -39
- package/components/commands/utilities/initref.md +0 -3
- package/components/commands/utilities/prime.md +0 -41
- package/components/commands/utilities/refactor-code.md +0 -116
- package/components/commands/utilities/ultra-think.md +0 -153
- package/components/hooks/HOOK_PATTERNS_COMPRESSED.json +0 -1
- package/components/hooks/automation/build-on-change.json +0 -16
- package/components/hooks/automation/dependency-checker.json +0 -16
- package/components/hooks/automation/deployment-health-monitor.json +0 -29
- package/components/hooks/automation/discord-detailed-notifications.json +0 -26
- package/components/hooks/automation/discord-error-notifications.json +0 -37
- package/components/hooks/automation/discord-notifications.json +0 -25
- package/components/hooks/automation/simple-notifications.json +0 -16
- package/components/hooks/automation/slack-detailed-notifications.json +0 -26
- package/components/hooks/automation/slack-error-notifications.json +0 -37
- package/components/hooks/automation/slack-notifications.json +0 -25
- package/components/hooks/automation/telegram-detailed-notifications.json +0 -26
- package/components/hooks/automation/telegram-error-notifications.json +0 -37
- package/components/hooks/automation/telegram-notifications.json +0 -25
- package/components/hooks/automation/vercel-auto-deploy.json +0 -17
- package/components/hooks/automation/vercel-environment-sync.json +0 -29
- package/components/hooks/development-tools/change-tracker.json +0 -25
- package/components/hooks/development-tools/command-logger.json +0 -16
- package/components/hooks/development-tools/file-backup.json +0 -16
- package/components/hooks/development-tools/lint-on-save.json +0 -16
- package/components/hooks/development-tools/nextjs-code-quality-enforcer.json +0 -17
- package/components/hooks/development-tools/smart-formatting.json +0 -16
- package/components/hooks/git-workflow/auto-git-add.json +0 -16
- package/components/hooks/git-workflow/smart-commit.json +0 -25
- package/components/hooks/performance/performance-budget-guard.json +0 -27
- package/components/hooks/performance/performance-monitor.json +0 -27
- package/components/hooks/post-tool/format-javascript-files.json +0 -16
- package/components/hooks/post-tool/format-python-files.json +0 -16
- package/components/hooks/post-tool/git-add-changes.json +0 -25
- package/components/hooks/post-tool/run-tests-after-changes.json +0 -16
- package/components/hooks/pre-tool/backup-before-edit.json +0 -16
- package/components/hooks/pre-tool/notify-before-bash.json +0 -16
- package/components/hooks/security/file-protection.json +0 -16
- package/components/hooks/security/security-scanner.json +0 -16
- package/components/hooks/testing/test-runner.json +0 -16
- package/components/mcps/browser_automation/browser-use-mcp-server.json +0 -20
- package/components/mcps/browser_automation/browsermcp.json +0 -9
- package/components/mcps/browser_automation/mcp-server-browserbase.json +0 -14
- package/components/mcps/browser_automation/mcp-server-playwright.json +0 -9
- package/components/mcps/browser_automation/playwright-mcp-server.json +0 -9
- package/components/mcps/browser_automation/playwright-mcp.json +0 -11
- package/components/mcps/database/mysql-integration.json +0 -12
- package/components/mcps/database/postgresql-integration.json +0 -12
- package/components/mcps/database/supabase.json +0 -17
- package/components/mcps/deepgraph/deepgraph-nextjs.json +0 -13
- package/components/mcps/deepgraph/deepgraph-react.json +0 -13
- package/components/mcps/deepgraph/deepgraph-typescript.json +0 -13
- package/components/mcps/deepgraph/deepgraph-vue.json +0 -13
- package/components/mcps/devtools/circleci.json +0 -13
- package/components/mcps/devtools/context7.json +0 -9
- package/components/mcps/devtools/firefly-mcp.json +0 -13
- package/components/mcps/devtools/ios-simulator-mcp.json +0 -9
- package/components/mcps/devtools/just-mcp.json +0 -9
- package/components/mcps/devtools/leetcode.json +0 -8
- package/components/mcps/devtools/mcp-server-atlassian-bitbucket.json +0 -9
- package/components/mcps/devtools/mcp-server-trello.json +0 -12
- package/components/mcps/filesystem/filesystem-access.json +0 -13
- package/components/mcps/integration/github-integration.json +0 -12
- package/components/mcps/integration/memory-integration.json +0 -9
- package/components/mcps/marketing/facebook-ads-mcp-server.json +0 -13
- package/components/mcps/marketing/google-ads-mcp-server.json +0 -11
- package/components/mcps/web/web-fetch.json +0 -9
- package/components/settings/api/bedrock-configuration.json +0 -7
- package/components/settings/api/corporate-proxy.json +0 -7
- package/components/settings/api/custom-headers.json +0 -6
- package/components/settings/api/vertex-configuration.json +0 -8
- package/components/settings/authentication/api-key-helper.json +0 -7
- package/components/settings/authentication/force-claudeai-login.json +0 -4
- package/components/settings/authentication/force-console-login.json +0 -4
- package/components/settings/cleanup/retention-7-days.json +0 -4
- package/components/settings/cleanup/retention-90-days.json +0 -4
- package/components/settings/environment/bash-timeouts.json +0 -8
- package/components/settings/environment/development-utils.json +0 -8
- package/components/settings/environment/performance-optimization.json +0 -8
- package/components/settings/environment/privacy-focused.json +0 -10
- package/components/settings/global/aws-credentials.json +0 -5
- package/components/settings/global/custom-model.json +0 -7
- package/components/settings/global/git-commit-settings.json +0 -4
- package/components/settings/mcp/disable-risky-servers.json +0 -8
- package/components/settings/mcp/enable-all-project-servers.json +0 -4
- package/components/settings/mcp/enable-specific-servers.json +0 -8
- package/components/settings/mcp/mcp-timeouts.json +0 -8
- package/components/settings/model/use-haiku.json +0 -4
- package/components/settings/model/use-sonnet.json +0 -4
- package/components/settings/permissions/additional-directories.json +0 -11
- package/components/settings/permissions/allow-git-operations.json +0 -14
- package/components/settings/permissions/allow-npm-commands.json +0 -11
- package/components/settings/permissions/deny-sensitive-files.json +0 -11
- package/components/settings/permissions/development-mode.json +0 -31
- package/components/settings/permissions/read-only-mode.json +0 -18
- package/components/settings/statusline/asset-pipeline-controller-statusline.json +0 -7
- package/components/settings/statusline/bug-circus-statusline.json +0 -7
- package/components/settings/statusline/code-casino-statusline.json +0 -7
- package/components/settings/statusline/code-spaceship-statusline.json +0 -7
- package/components/settings/statusline/colorful-statusline.json +0 -7
- package/components/settings/statusline/command-statusline.json +0 -8
- package/components/settings/statusline/context-monitor.json +0 -7
- package/components/settings/statusline/context-monitor.py +0 -236
- package/components/settings/statusline/data-ocean-statusline.json +0 -7
- package/components/settings/statusline/emotion-theater-statusline.json +0 -7
- package/components/settings/statusline/game-performance-monitor-statusline.json +0 -7
- package/components/settings/statusline/git-branch-statusline.json +0 -7
- package/components/settings/statusline/minimal-statusline.json +0 -7
- package/components/settings/statusline/multiplatform-build-status-statusline.json +0 -7
- package/components/settings/statusline/productivity-rainbow-statusline.json +0 -7
- package/components/settings/statusline/programmer-tamagotchi-statusline.json +0 -7
- package/components/settings/statusline/programming-fitness-tracker-statusline.json +0 -7
- package/components/settings/statusline/project-info-statusline.json +0 -7
- package/components/settings/statusline/rpg-status-bar-statusline.json +0 -7
- package/components/settings/statusline/time-statusline.json +0 -7
- package/components/settings/statusline/unity-project-dashboard-statusline.json +0 -7
- package/components/settings/statusline/vercel-deployment-monitor.json +0 -7
- package/components/settings/statusline/vercel-error-alert-system.json +0 -7
- package/components/settings/statusline/vercel-multi-env-status.json +0 -7
- package/components/settings/statusline/virtual-code-garden-statusline.json +0 -7
- package/components/settings/statusline/zero-config-deployment-monitor.json +0 -7
- package/components/settings/telemetry/custom-telemetry.json +0 -7
- package/components/settings/telemetry/disable-telemetry.json +0 -6
- package/components/settings/telemetry/enable-telemetry.json +0 -6
|
@@ -1,778 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
allowed-tools: Read, Write, Edit, Bash, Grep, Glob
|
|
3
|
-
argument-hint: [--pages-to-app] [--js-to-ts] [--class-to-hooks] [--analyze]
|
|
4
|
-
description: Comprehensive Next.js migration assistant for Pages Router to App Router, JavaScript to TypeScript, and modern patterns
|
|
5
|
-
model: sonnet
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Next.js Migration Helper
|
|
9
|
-
|
|
10
|
-
**Migration Type**: $ARGUMENTS
|
|
11
|
-
|
|
12
|
-
## Current Project Analysis
|
|
13
|
-
|
|
14
|
-
### Project Structure Analysis
|
|
15
|
-
- Next.js version: !`grep '"next"' package.json | head -1`
|
|
16
|
-
- Current router: !`ls -la pages/ 2>/dev/null && echo "Pages Router detected" || echo "No pages/ directory found"`
|
|
17
|
-
- App router: !`ls -la app/ 2>/dev/null && echo "App Router detected" || echo "No app/ directory found"`
|
|
18
|
-
- TypeScript: @tsconfig.json (if exists)
|
|
19
|
-
|
|
20
|
-
### File Structure Overview
|
|
21
|
-
- Pages directory: @pages/ (if exists)
|
|
22
|
-
- App directory: @app/ (if exists)
|
|
23
|
-
- Components: @components/ (if exists)
|
|
24
|
-
- API routes: @pages/api/ or @app/api/
|
|
25
|
-
- Styles: @styles/ (if exists)
|
|
26
|
-
|
|
27
|
-
## Migration Strategies
|
|
28
|
-
|
|
29
|
-
### 1. Pages Router to App Router Migration
|
|
30
|
-
|
|
31
|
-
#### Pre-Migration Analysis
|
|
32
|
-
```typescript
|
|
33
|
-
// Migration analysis tool
|
|
34
|
-
interface MigrationAnalysis {
|
|
35
|
-
currentStructure: 'pages' | 'app' | 'hybrid';
|
|
36
|
-
pagesCount: number;
|
|
37
|
-
apiRoutesCount: number;
|
|
38
|
-
customApp: boolean;
|
|
39
|
-
customDocument: boolean;
|
|
40
|
-
customError: boolean;
|
|
41
|
-
middlewareExists: boolean;
|
|
42
|
-
complexityScore: number;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const analyzeMigrationComplexity = (): MigrationAnalysis => {
|
|
46
|
-
return {
|
|
47
|
-
currentStructure: 'pages', // Detected from file structure
|
|
48
|
-
pagesCount: 0, // Count .js/.tsx files in pages/
|
|
49
|
-
apiRoutesCount: 0, // Count files in pages/api/
|
|
50
|
-
customApp: false, // Check for pages/_app
|
|
51
|
-
customDocument: false, // Check for pages/_document
|
|
52
|
-
customError: false, // Check for pages/_error or 404
|
|
53
|
-
middlewareExists: false, // Check for middleware.ts
|
|
54
|
-
complexityScore: 0, // 1-10 scale
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
#### Migration Steps
|
|
60
|
-
|
|
61
|
-
##### Step 1: Create App Directory Structure
|
|
62
|
-
```bash
|
|
63
|
-
#!/bin/bash
|
|
64
|
-
# Create app directory structure
|
|
65
|
-
|
|
66
|
-
echo "๐ Creating App Router directory structure..."
|
|
67
|
-
|
|
68
|
-
# Create base app directory
|
|
69
|
-
mkdir -p app
|
|
70
|
-
mkdir -p app/globals
|
|
71
|
-
mkdir -p app/api
|
|
72
|
-
|
|
73
|
-
# Create layout files
|
|
74
|
-
echo "๐ Creating layout structure..."
|
|
75
|
-
|
|
76
|
-
# Root layout
|
|
77
|
-
cat > app/layout.tsx << 'EOF'
|
|
78
|
-
import type { Metadata } from 'next'
|
|
79
|
-
import { Inter } from 'next/font/google'
|
|
80
|
-
import './globals.css'
|
|
81
|
-
|
|
82
|
-
const inter = Inter({ subsets: ['latin'] })
|
|
83
|
-
|
|
84
|
-
export const metadata: Metadata = {
|
|
85
|
-
title: 'Your App',
|
|
86
|
-
description: 'Migrated to App Router',
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export default function RootLayout({
|
|
90
|
-
children,
|
|
91
|
-
}: {
|
|
92
|
-
children: React.ReactNode
|
|
93
|
-
}) {
|
|
94
|
-
return (
|
|
95
|
-
<html lang="en">
|
|
96
|
-
<body className={inter.className}>{children}</body>
|
|
97
|
-
</html>
|
|
98
|
-
)
|
|
99
|
-
}
|
|
100
|
-
EOF
|
|
101
|
-
|
|
102
|
-
# Global CSS
|
|
103
|
-
cat > app/globals.css << 'EOF'
|
|
104
|
-
/* Global styles for App Router */
|
|
105
|
-
:root {
|
|
106
|
-
--max-width: 1100px;
|
|
107
|
-
--border-radius: 12px;
|
|
108
|
-
--font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Code', 'Segoe UI Mono',
|
|
109
|
-
'Roboto Mono', 'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro',
|
|
110
|
-
'Fira Code', 'Droid Sans Mono', 'Courier New', monospace;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
* {
|
|
114
|
-
box-sizing: border-box;
|
|
115
|
-
padding: 0;
|
|
116
|
-
margin: 0;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
html,
|
|
120
|
-
body {
|
|
121
|
-
max-width: 100vw;
|
|
122
|
-
overflow-x: hidden;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
body {
|
|
126
|
-
color: rgb(var(--foreground-rgb));
|
|
127
|
-
background: linear-gradient(
|
|
128
|
-
to bottom,
|
|
129
|
-
transparent,
|
|
130
|
-
rgb(var(--background-end-rgb))
|
|
131
|
-
)
|
|
132
|
-
rgb(var(--background-start-rgb));
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
a {
|
|
136
|
-
color: inherit;
|
|
137
|
-
text-decoration: none;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
@media (prefers-color-scheme: dark) {
|
|
141
|
-
html {
|
|
142
|
-
color-scheme: dark;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
EOF
|
|
146
|
-
|
|
147
|
-
echo "โ
App Router structure created"
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
##### Step 2: Migrate Pages to App Router
|
|
151
|
-
```typescript
|
|
152
|
-
// Page migration utility
|
|
153
|
-
interface PageMigration {
|
|
154
|
-
source: string;
|
|
155
|
-
destination: string;
|
|
156
|
-
type: 'page' | 'api' | 'dynamic' | 'nested';
|
|
157
|
-
hasGetServerSideProps: boolean;
|
|
158
|
-
hasGetStaticProps: boolean;
|
|
159
|
-
hasGetStaticPaths: boolean;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const migratePage = async (pagePath: string): Promise<string> => {
|
|
163
|
-
const pageContent = readFileSync(pagePath, 'utf-8');
|
|
164
|
-
|
|
165
|
-
// Extract page component
|
|
166
|
-
const componentMatch = pageContent.match(/export default function (\w+)/);
|
|
167
|
-
const componentName = componentMatch?.[1] || 'Page';
|
|
168
|
-
|
|
169
|
-
// Check for data fetching methods
|
|
170
|
-
const hasGetServerSideProps = pageContent.includes('getServerSideProps');
|
|
171
|
-
const hasGetStaticProps = pageContent.includes('getStaticProps');
|
|
172
|
-
const hasGetStaticPaths = pageContent.includes('getStaticPaths');
|
|
173
|
-
|
|
174
|
-
// Convert to App Router format
|
|
175
|
-
let appRouterCode = '';
|
|
176
|
-
|
|
177
|
-
// Add metadata if page has Head component
|
|
178
|
-
if (pageContent.includes('from \'next/head\'')) {
|
|
179
|
-
appRouterCode += `import type { Metadata } from 'next'\n\n`;
|
|
180
|
-
appRouterCode += generateMetadata(pageContent);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// Convert data fetching
|
|
184
|
-
if (hasGetServerSideProps) {
|
|
185
|
-
appRouterCode += convertGetServerSideProps(pageContent);
|
|
186
|
-
} else if (hasGetStaticProps) {
|
|
187
|
-
appRouterCode += convertGetStaticProps(pageContent);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// Convert component
|
|
191
|
-
appRouterCode += convertPageComponent(pageContent);
|
|
192
|
-
|
|
193
|
-
return appRouterCode;
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
const convertGetServerSideProps = (content: string): string => {
|
|
197
|
-
// Extract getServerSideProps logic and convert to Server Component
|
|
198
|
-
const gsspMatch = content.match(/export async function getServerSideProps[\s\S]*?(?=export|$)/);
|
|
199
|
-
|
|
200
|
-
if (!gsspMatch) return '';
|
|
201
|
-
|
|
202
|
-
return `
|
|
203
|
-
// Server Component with direct data fetching
|
|
204
|
-
async function fetchData(context: any) {
|
|
205
|
-
// Converted from getServerSideProps
|
|
206
|
-
// Add your data fetching logic here
|
|
207
|
-
return { data: null };
|
|
208
|
-
}
|
|
209
|
-
`;
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
const generateMetadata = (content: string): string => {
|
|
213
|
-
// Extract Head component content and convert to metadata
|
|
214
|
-
return `
|
|
215
|
-
export const metadata: Metadata = {
|
|
216
|
-
title: 'Page Title',
|
|
217
|
-
description: 'Page description',
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
`;
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
const convertPageComponent = (content: string): string => {
|
|
224
|
-
// Convert page component to App Router format
|
|
225
|
-
return content
|
|
226
|
-
.replace(/import Head from \'next\/head\'/g, '')
|
|
227
|
-
.replace(/<Head>[\s\S]*?<\/Head>/g, '')
|
|
228
|
-
.replace(/export async function getServerSideProps[\s\S]*?(?=export)/g, '')
|
|
229
|
-
.replace(/export async function getStaticProps[\s\S]*?(?=export)/g, '')
|
|
230
|
-
.replace(/export async function getStaticPaths[\s\S]*?(?=export)/g, '');
|
|
231
|
-
};
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
##### Step 3: Migrate API Routes
|
|
235
|
-
```typescript
|
|
236
|
-
// API route migration
|
|
237
|
-
const migrateApiRoute = (apiPath: string): string => {
|
|
238
|
-
const apiContent = readFileSync(apiPath, 'utf-8');
|
|
239
|
-
|
|
240
|
-
// Convert to App Router API format
|
|
241
|
-
let newApiContent = `import { NextRequest, NextResponse } from 'next/server'\n\n`;
|
|
242
|
-
|
|
243
|
-
// Extract handler functions
|
|
244
|
-
const methods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'];
|
|
245
|
-
|
|
246
|
-
methods.forEach(method => {
|
|
247
|
-
const handlerRegex = new RegExp(`if.*req\\.method.*===.*['"]${method}['"]`, 'i');
|
|
248
|
-
|
|
249
|
-
if (apiContent.match(handlerRegex)) {
|
|
250
|
-
newApiContent += `
|
|
251
|
-
export async function ${method}(
|
|
252
|
-
request: NextRequest,
|
|
253
|
-
{ params }: { params: { [key: string]: string } }
|
|
254
|
-
) {
|
|
255
|
-
try {
|
|
256
|
-
// Migrated ${method} handler
|
|
257
|
-
// Add your logic here
|
|
258
|
-
|
|
259
|
-
return NextResponse.json({ message: '${method} success' })
|
|
260
|
-
} catch (error) {
|
|
261
|
-
console.error('${method} error:', error)
|
|
262
|
-
return NextResponse.json(
|
|
263
|
-
{ error: 'Internal server error' },
|
|
264
|
-
{ status: 500 }
|
|
265
|
-
)
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
`;
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
return newApiContent;
|
|
273
|
-
};
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
### 2. JavaScript to TypeScript Migration
|
|
277
|
-
|
|
278
|
-
#### TypeScript Configuration Setup
|
|
279
|
-
```json
|
|
280
|
-
// tsconfig.json
|
|
281
|
-
{
|
|
282
|
-
"compilerOptions": {
|
|
283
|
-
"target": "es5",
|
|
284
|
-
"lib": ["dom", "dom.iterable", "es6"],
|
|
285
|
-
"allowJs": true,
|
|
286
|
-
"skipLibCheck": true,
|
|
287
|
-
"strict": true,
|
|
288
|
-
"noEmit": true,
|
|
289
|
-
"esModuleInterop": true,
|
|
290
|
-
"module": "esnext",
|
|
291
|
-
"moduleResolution": "bundler",
|
|
292
|
-
"resolveJsonModule": true,
|
|
293
|
-
"isolatedModules": true,
|
|
294
|
-
"jsx": "preserve",
|
|
295
|
-
"incremental": true,
|
|
296
|
-
"plugins": [
|
|
297
|
-
{
|
|
298
|
-
"name": "next"
|
|
299
|
-
}
|
|
300
|
-
],
|
|
301
|
-
"baseUrl": ".",
|
|
302
|
-
"paths": {
|
|
303
|
-
"@/*": ["./*"]
|
|
304
|
-
}
|
|
305
|
-
},
|
|
306
|
-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
307
|
-
"exclude": ["node_modules"]
|
|
308
|
-
}
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
#### File Conversion Process
|
|
312
|
-
```bash
|
|
313
|
-
#!/bin/bash
|
|
314
|
-
# Convert JavaScript files to TypeScript
|
|
315
|
-
|
|
316
|
-
echo "๐ Converting JavaScript files to TypeScript..."
|
|
317
|
-
|
|
318
|
-
# Find all .js and .jsx files
|
|
319
|
-
find . -name "*.js" -o -name "*.jsx" | grep -v node_modules | grep -v .next | while read file; do
|
|
320
|
-
# Skip if TypeScript version already exists
|
|
321
|
-
ts_file="${file%.*}.ts"
|
|
322
|
-
tsx_file="${file%.*}.tsx"
|
|
323
|
-
|
|
324
|
-
if [[ -f "$ts_file" ]] || [[ -f "$tsx_file" ]]; then
|
|
325
|
-
echo "โญ๏ธ Skipping $file (TypeScript version exists)"
|
|
326
|
-
continue
|
|
327
|
-
fi
|
|
328
|
-
|
|
329
|
-
# Determine if file contains JSX
|
|
330
|
-
if grep -q "jsx\|<.*>" "$file"; then
|
|
331
|
-
new_file="${file%.*}.tsx"
|
|
332
|
-
else
|
|
333
|
-
new_file="${file%.*}.ts"
|
|
334
|
-
fi
|
|
335
|
-
|
|
336
|
-
echo "๐ Converting $file -> $new_file"
|
|
337
|
-
|
|
338
|
-
# Copy file with new extension
|
|
339
|
-
cp "$file" "$new_file"
|
|
340
|
-
|
|
341
|
-
# Add basic type annotations
|
|
342
|
-
sed -i.bak '
|
|
343
|
-
# Add React import for TSX files
|
|
344
|
-
/^import.*React/!{
|
|
345
|
-
/\.tsx$/s/^/import React from '\''react'\''\n/
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
# Add basic prop types
|
|
349
|
-
s/function \([A-Z][a-zA-Z]*\)(\([^)]*\))/function \1(\2: any)/g
|
|
350
|
-
|
|
351
|
-
# Add return type annotations for simple functions
|
|
352
|
-
s/const \([a-zA-Z][a-zA-Z0-9]*\) = (/const \1 = (/g
|
|
353
|
-
' "$new_file"
|
|
354
|
-
|
|
355
|
-
# Remove backup file
|
|
356
|
-
rm "${new_file}.bak" 2>/dev/null || true
|
|
357
|
-
|
|
358
|
-
echo "โ
Converted $file"
|
|
359
|
-
done
|
|
360
|
-
|
|
361
|
-
echo "๐ JavaScript to TypeScript conversion completed"
|
|
362
|
-
echo "โ ๏ธ Please review and add proper type annotations"
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
### 3. Class Components to Function Components Migration
|
|
366
|
-
|
|
367
|
-
#### Component Analysis and Conversion
|
|
368
|
-
```typescript
|
|
369
|
-
// Class to function component converter
|
|
370
|
-
const convertClassComponent = (componentCode: string): string => {
|
|
371
|
-
// Extract class component parts
|
|
372
|
-
const classMatch = componentCode.match(/class (\w+) extends (?:React\.)?Component/);
|
|
373
|
-
const componentName = classMatch?.[1] || 'Component';
|
|
374
|
-
|
|
375
|
-
// Extract state
|
|
376
|
-
const stateMatch = componentCode.match(/state\s*=\s*{([^}]+)}/);
|
|
377
|
-
const initialState = stateMatch?.[1] || '';
|
|
378
|
-
|
|
379
|
-
// Extract lifecycle methods
|
|
380
|
-
const lifecycleMethods = extractLifecycleMethods(componentCode);
|
|
381
|
-
|
|
382
|
-
// Extract render method
|
|
383
|
-
const renderMatch = componentCode.match(/render\(\)\s*{([\s\S]*?)(?=^\s*})/m);
|
|
384
|
-
const renderContent = renderMatch?.[1] || '';
|
|
385
|
-
|
|
386
|
-
// Generate function component
|
|
387
|
-
let functionComponent = `import React, { useState, useEffect } from 'react';\n\n`;
|
|
388
|
-
|
|
389
|
-
// Add prop types if they exist
|
|
390
|
-
const propsMatch = componentCode.match(/(\w+)Props/);
|
|
391
|
-
if (propsMatch) {
|
|
392
|
-
functionComponent += `interface ${propsMatch[1]}Props {\n // Add prop definitions here\n}\n\n`;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
functionComponent += `const ${componentName}: React.FC<${componentName}Props> = (props) => {\n`;
|
|
396
|
-
|
|
397
|
-
// Convert state
|
|
398
|
-
if (initialState) {
|
|
399
|
-
const stateVars = parseState(initialState);
|
|
400
|
-
stateVars.forEach(({ name, value }) => {
|
|
401
|
-
functionComponent += ` const [${name}, set${capitalize(name)}] = useState(${value});\n`;
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
// Convert lifecycle methods to hooks
|
|
406
|
-
if (lifecycleMethods.componentDidMount) {
|
|
407
|
-
functionComponent += `\n useEffect(() => {\n`;
|
|
408
|
-
functionComponent += ` ${lifecycleMethods.componentDidMount}\n`;
|
|
409
|
-
functionComponent += ` }, []);\n`;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
if (lifecycleMethods.componentDidUpdate) {
|
|
413
|
-
functionComponent += `\n useEffect(() => {\n`;
|
|
414
|
-
functionComponent += ` ${lifecycleMethods.componentDidUpdate}\n`;
|
|
415
|
-
functionComponent += ` });\n`;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
if (lifecycleMethods.componentWillUnmount) {
|
|
419
|
-
functionComponent += `\n useEffect(() => {\n`;
|
|
420
|
-
functionComponent += ` return () => {\n`;
|
|
421
|
-
functionComponent += ` ${lifecycleMethods.componentWillUnmount}\n`;
|
|
422
|
-
functionComponent += ` };\n`;
|
|
423
|
-
functionComponent += ` }, []);\n`;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
// Add render return
|
|
427
|
-
functionComponent += `\n return (\n`;
|
|
428
|
-
functionComponent += renderContent.replace(/this\.state\./g, '').replace(/this\.props\./g, 'props.');
|
|
429
|
-
functionComponent += ` );\n`;
|
|
430
|
-
functionComponent += `};\n\n`;
|
|
431
|
-
functionComponent += `export default ${componentName};`;
|
|
432
|
-
|
|
433
|
-
return functionComponent;
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
const extractLifecycleMethods = (code: string) => {
|
|
437
|
-
return {
|
|
438
|
-
componentDidMount: extractMethod(code, 'componentDidMount'),
|
|
439
|
-
componentDidUpdate: extractMethod(code, 'componentDidUpdate'),
|
|
440
|
-
componentWillUnmount: extractMethod(code, 'componentWillUnmount'),
|
|
441
|
-
};
|
|
442
|
-
};
|
|
443
|
-
|
|
444
|
-
const extractMethod = (code: string, methodName: string): string | null => {
|
|
445
|
-
const regex = new RegExp(`${methodName}\\(\\)\\s*{([\\s\\S]*?)(?=^\\s*})`);
|
|
446
|
-
const match = code.match(regex);
|
|
447
|
-
return match?.[1] || null;
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
const parseState = (stateString: string) => {
|
|
451
|
-
// Simple state parser - would need more robust implementation
|
|
452
|
-
return [
|
|
453
|
-
{ name: 'example', value: 'null' }
|
|
454
|
-
];
|
|
455
|
-
};
|
|
456
|
-
|
|
457
|
-
const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
### 4. Modern React Patterns Migration
|
|
461
|
-
|
|
462
|
-
#### Hook Conversion Patterns
|
|
463
|
-
```typescript
|
|
464
|
-
// Convert common patterns to modern hooks
|
|
465
|
-
|
|
466
|
-
// State management
|
|
467
|
-
const convertStateManagement = `
|
|
468
|
-
// โ Old class component state
|
|
469
|
-
class MyComponent extends Component {
|
|
470
|
-
state = { count: 0, name: '' };
|
|
471
|
-
|
|
472
|
-
updateCount = () => {
|
|
473
|
-
this.setState({ count: this.state.count + 1 });
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
// โ
Modern function component with hooks
|
|
478
|
-
const MyComponent = () => {
|
|
479
|
-
const [count, setCount] = useState(0);
|
|
480
|
-
const [name, setName] = useState('');
|
|
481
|
-
|
|
482
|
-
const updateCount = () => {
|
|
483
|
-
setCount(prev => prev + 1);
|
|
484
|
-
};
|
|
485
|
-
};
|
|
486
|
-
`;
|
|
487
|
-
|
|
488
|
-
// Effect management
|
|
489
|
-
const convertEffects = `
|
|
490
|
-
// โ Old lifecycle methods
|
|
491
|
-
componentDidMount() {
|
|
492
|
-
this.fetchData();
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
componentDidUpdate(prevProps) {
|
|
496
|
-
if (prevProps.id !== this.props.id) {
|
|
497
|
-
this.fetchData();
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
componentWillUnmount() {
|
|
502
|
-
clearInterval(this.timer);
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
// โ
Modern useEffect
|
|
506
|
-
useEffect(() => {
|
|
507
|
-
fetchData();
|
|
508
|
-
}, []); // componentDidMount
|
|
509
|
-
|
|
510
|
-
useEffect(() => {
|
|
511
|
-
fetchData();
|
|
512
|
-
}, [id]); // componentDidUpdate with dependency
|
|
513
|
-
|
|
514
|
-
useEffect(() => {
|
|
515
|
-
return () => {
|
|
516
|
-
clearInterval(timer);
|
|
517
|
-
};
|
|
518
|
-
}, []); // componentWillUnmount
|
|
519
|
-
`;
|
|
520
|
-
|
|
521
|
-
// Context usage
|
|
522
|
-
const convertContext = `
|
|
523
|
-
// โ Old context usage
|
|
524
|
-
import { ThemeContext } from './context';
|
|
525
|
-
|
|
526
|
-
class MyComponent extends Component {
|
|
527
|
-
static contextType = ThemeContext;
|
|
528
|
-
|
|
529
|
-
render() {
|
|
530
|
-
const theme = this.context;
|
|
531
|
-
return <div style={{ color: theme.color }}>Content</div>;
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
// โ
Modern context with hooks
|
|
536
|
-
import { useContext } from 'react';
|
|
537
|
-
import { ThemeContext } from './context';
|
|
538
|
-
|
|
539
|
-
const MyComponent = () => {
|
|
540
|
-
const theme = useContext(ThemeContext);
|
|
541
|
-
|
|
542
|
-
return <div style={{ color: theme.color }}>Content</div>;
|
|
543
|
-
};
|
|
544
|
-
`;
|
|
545
|
-
```
|
|
546
|
-
|
|
547
|
-
## Comprehensive Migration Process
|
|
548
|
-
|
|
549
|
-
### 1. Pre-Migration Checklist
|
|
550
|
-
```bash
|
|
551
|
-
#!/bin/bash
|
|
552
|
-
# Pre-migration validation
|
|
553
|
-
|
|
554
|
-
echo "๐ Running pre-migration checks..."
|
|
555
|
-
|
|
556
|
-
# Check Next.js version
|
|
557
|
-
NEXT_VERSION=$(grep '"next"' package.json | grep -o '[0-9.]*')
|
|
558
|
-
echo "๐ฆ Next.js version: $NEXT_VERSION"
|
|
559
|
-
|
|
560
|
-
# Check for potential blockers
|
|
561
|
-
BLOCKERS=0
|
|
562
|
-
|
|
563
|
-
# Check for custom server
|
|
564
|
-
if [ -f "server.js" ] || [ -f "server.ts" ]; then
|
|
565
|
-
echo "โ ๏ธ Custom server detected - may need special handling"
|
|
566
|
-
((BLOCKERS++))
|
|
567
|
-
fi
|
|
568
|
-
|
|
569
|
-
# Check for pages/_document with custom logic
|
|
570
|
-
if [ -f "pages/_document.js" ] || [ -f "pages/_document.tsx" ]; then
|
|
571
|
-
if grep -q "getInitialProps" pages/_document.*; then
|
|
572
|
-
echo "โ ๏ธ Custom _document with getInitialProps - needs manual migration"
|
|
573
|
-
((BLOCKERS++))
|
|
574
|
-
fi
|
|
575
|
-
fi
|
|
576
|
-
|
|
577
|
-
# Check for pages/_error
|
|
578
|
-
if [ -f "pages/_error.js" ] || [ -f "pages/_error.tsx" ]; then
|
|
579
|
-
echo "โน๏ธ Custom error page found - will need to migrate to error.tsx"
|
|
580
|
-
fi
|
|
581
|
-
|
|
582
|
-
# Check for middleware
|
|
583
|
-
if [ -f "middleware.ts" ] || [ -f "middleware.js" ]; then
|
|
584
|
-
echo "โ
Middleware already exists"
|
|
585
|
-
else
|
|
586
|
-
echo "โน๏ธ No middleware found"
|
|
587
|
-
fi
|
|
588
|
-
|
|
589
|
-
echo ""
|
|
590
|
-
if [ $BLOCKERS -eq 0 ]; then
|
|
591
|
-
echo "โ
Ready for migration!"
|
|
592
|
-
else
|
|
593
|
-
echo "โ ๏ธ Found $BLOCKERS potential blockers - review before proceeding"
|
|
594
|
-
fi
|
|
595
|
-
```
|
|
596
|
-
|
|
597
|
-
### 2. Migration Execution
|
|
598
|
-
```bash
|
|
599
|
-
#!/bin/bash
|
|
600
|
-
# Execute migration
|
|
601
|
-
|
|
602
|
-
echo "๐ Starting Next.js migration process..."
|
|
603
|
-
|
|
604
|
-
# Step 1: Backup current project
|
|
605
|
-
echo "๐ฆ Creating backup..."
|
|
606
|
-
tar -czf "project-backup-$(date +%Y%m%d_%H%M%S).tar.gz" \
|
|
607
|
-
--exclude=node_modules \
|
|
608
|
-
--exclude=.next \
|
|
609
|
-
--exclude=.git \
|
|
610
|
-
.
|
|
611
|
-
|
|
612
|
-
# Step 2: Install dependencies
|
|
613
|
-
echo "๐ฅ Installing required dependencies..."
|
|
614
|
-
npm install --save-dev @types/react @types/react-dom @types/node
|
|
615
|
-
npm install --save-dev typescript
|
|
616
|
-
|
|
617
|
-
# Step 3: Create TypeScript config
|
|
618
|
-
if [ ! -f "tsconfig.json" ]; then
|
|
619
|
-
echo "โ๏ธ Creating TypeScript configuration..."
|
|
620
|
-
npx tsc --init --jsx preserve --esModuleInterop --allowJs --strict
|
|
621
|
-
fi
|
|
622
|
-
|
|
623
|
-
# Step 4: Create App Router structure
|
|
624
|
-
echo "๐๏ธ Creating App Router structure..."
|
|
625
|
-
mkdir -p app
|
|
626
|
-
# ... (creation logic from previous steps)
|
|
627
|
-
|
|
628
|
-
# Step 5: Migrate pages
|
|
629
|
-
echo "๐ Migrating pages..."
|
|
630
|
-
# ... (migration logic)
|
|
631
|
-
|
|
632
|
-
# Step 6: Migrate API routes
|
|
633
|
-
echo "๐ Migrating API routes..."
|
|
634
|
-
# ... (API migration logic)
|
|
635
|
-
|
|
636
|
-
# Step 7: Update configurations
|
|
637
|
-
echo "โ๏ธ Updating configurations..."
|
|
638
|
-
# Update next.config.js, package.json scripts, etc.
|
|
639
|
-
|
|
640
|
-
echo "โ
Migration completed!"
|
|
641
|
-
echo "โ ๏ธ Please review the migrated code and test thoroughly"
|
|
642
|
-
```
|
|
643
|
-
|
|
644
|
-
### 3. Post-Migration Validation
|
|
645
|
-
```bash
|
|
646
|
-
#!/bin/bash
|
|
647
|
-
# Post-migration validation
|
|
648
|
-
|
|
649
|
-
echo "๐ Running post-migration validation..."
|
|
650
|
-
|
|
651
|
-
# Check if project builds
|
|
652
|
-
echo "๐๏ธ Testing build..."
|
|
653
|
-
npm run build
|
|
654
|
-
|
|
655
|
-
if [ $? -eq 0 ]; then
|
|
656
|
-
echo "โ
Build successful"
|
|
657
|
-
else
|
|
658
|
-
echo "โ Build failed - check errors above"
|
|
659
|
-
exit 1
|
|
660
|
-
fi
|
|
661
|
-
|
|
662
|
-
# Check TypeScript compilation
|
|
663
|
-
echo "๐ Checking TypeScript..."
|
|
664
|
-
npx tsc --noEmit
|
|
665
|
-
|
|
666
|
-
if [ $? -eq 0 ]; then
|
|
667
|
-
echo "โ
TypeScript validation passed"
|
|
668
|
-
else
|
|
669
|
-
echo "โ ๏ธ TypeScript errors found - review and fix"
|
|
670
|
-
fi
|
|
671
|
-
|
|
672
|
-
# Run tests if they exist
|
|
673
|
-
if [ -f "package.json" ] && grep -q '"test"' package.json; then
|
|
674
|
-
echo "๐งช Running tests..."
|
|
675
|
-
npm test
|
|
676
|
-
fi
|
|
677
|
-
|
|
678
|
-
# Check for unused files
|
|
679
|
-
echo "๐งน Checking for unused files..."
|
|
680
|
-
if [ -d "pages" ]; then
|
|
681
|
-
echo "โน๏ธ Original pages/ directory still exists"
|
|
682
|
-
echo "๐ก Review and remove after confirming migration is complete"
|
|
683
|
-
fi
|
|
684
|
-
|
|
685
|
-
echo "โ
Post-migration validation completed"
|
|
686
|
-
```
|
|
687
|
-
|
|
688
|
-
## Migration Documentation and Guides
|
|
689
|
-
|
|
690
|
-
### 1. Migration Report Generation
|
|
691
|
-
```typescript
|
|
692
|
-
// Generate comprehensive migration report
|
|
693
|
-
interface MigrationReport {
|
|
694
|
-
summary: {
|
|
695
|
-
totalFiles: number;
|
|
696
|
-
migratedFiles: number;
|
|
697
|
-
skippedFiles: number;
|
|
698
|
-
errorFiles: number;
|
|
699
|
-
};
|
|
700
|
-
details: {
|
|
701
|
-
pages: MigratedFile[];
|
|
702
|
-
components: MigratedFile[];
|
|
703
|
-
apiRoutes: MigratedFile[];
|
|
704
|
-
};
|
|
705
|
-
issues: Issue[];
|
|
706
|
-
recommendations: string[];
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
interface MigratedFile {
|
|
710
|
-
original: string;
|
|
711
|
-
migrated: string;
|
|
712
|
-
status: 'success' | 'warning' | 'error';
|
|
713
|
-
notes: string[];
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
interface Issue {
|
|
717
|
-
file: string;
|
|
718
|
-
type: 'error' | 'warning';
|
|
719
|
-
message: string;
|
|
720
|
-
solution?: string;
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
const generateMigrationReport = (): MigrationReport => {
|
|
724
|
-
// Implementation to generate comprehensive migration report
|
|
725
|
-
return {
|
|
726
|
-
summary: {
|
|
727
|
-
totalFiles: 0,
|
|
728
|
-
migratedFiles: 0,
|
|
729
|
-
skippedFiles: 0,
|
|
730
|
-
errorFiles: 0,
|
|
731
|
-
},
|
|
732
|
-
details: {
|
|
733
|
-
pages: [],
|
|
734
|
-
components: [],
|
|
735
|
-
apiRoutes: [],
|
|
736
|
-
},
|
|
737
|
-
issues: [],
|
|
738
|
-
recommendations: [
|
|
739
|
-
'Test all functionality thoroughly',
|
|
740
|
-
'Update any hardcoded imports',
|
|
741
|
-
'Review and optimize bundle splitting',
|
|
742
|
-
'Update documentation and README',
|
|
743
|
-
],
|
|
744
|
-
};
|
|
745
|
-
};
|
|
746
|
-
```
|
|
747
|
-
|
|
748
|
-
### 2. Best Practices Guide
|
|
749
|
-
```markdown
|
|
750
|
-
# Migration Best Practices
|
|
751
|
-
|
|
752
|
-
## Before Migration
|
|
753
|
-
- [ ] Update to latest Next.js version
|
|
754
|
-
- [ ] Run full test suite
|
|
755
|
-
- [ ] Create comprehensive backup
|
|
756
|
-
- [ ] Review custom configurations
|
|
757
|
-
|
|
758
|
-
## During Migration
|
|
759
|
-
- [ ] Migrate incrementally (pages first, then components)
|
|
760
|
-
- [ ] Test each migration step
|
|
761
|
-
- [ ] Keep detailed notes of changes
|
|
762
|
-
- [ ] Handle TypeScript errors immediately
|
|
763
|
-
|
|
764
|
-
## After Migration
|
|
765
|
-
- [ ] Update all imports and references
|
|
766
|
-
- [ ] Test all functionality
|
|
767
|
-
- [ ] Update documentation
|
|
768
|
-
- [ ] Monitor performance metrics
|
|
769
|
-
- [ ] Clean up old files after validation
|
|
770
|
-
|
|
771
|
-
## Common Gotchas
|
|
772
|
-
- Dynamic imports syntax changes
|
|
773
|
-
- Middleware configuration updates
|
|
774
|
-
- Environment variable handling
|
|
775
|
-
- CSS and styling adjustments
|
|
776
|
-
```
|
|
777
|
-
|
|
778
|
-
Provide comprehensive migration assistance with automated tools, validation steps, and detailed documentation for successful Next.js modernization.
|