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,824 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
allowed-tools: Read, Write, Edit, Bash
|
|
3
|
-
argument-hint: [strategy] | setup | deploy | switch | rollback | status
|
|
4
|
-
description: Implement blue-green deployment strategy with zero-downtime switching, health validation, and automatic rollback
|
|
5
|
-
model: sonnet
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Blue-Green Deployment Strategy
|
|
9
|
-
|
|
10
|
-
Implement blue-green deployment: $ARGUMENTS
|
|
11
|
-
|
|
12
|
-
## Current Infrastructure State
|
|
13
|
-
|
|
14
|
-
- Load balancer config: @nginx.conf or @haproxy.cfg or cloud LB configuration
|
|
15
|
-
- Current deployment: !`curl -s https://api.example.com/version 2>/dev/null || echo "Version endpoint needed"`
|
|
16
|
-
- Container orchestration: !`kubectl get deployments 2>/dev/null || docker service ls 2>/dev/null || echo "Container platform detection needed"`
|
|
17
|
-
- Health endpoints: !`curl -s https://api.example.com/health 2>/dev/null | jq -r '.status // "Unknown"' || echo "Health check setup needed"`
|
|
18
|
-
- DNS configuration: Check for DNS management capabilities
|
|
19
|
-
|
|
20
|
-
## Task
|
|
21
|
-
|
|
22
|
-
Implement production-grade blue-green deployment with comprehensive validation and monitoring.
|
|
23
|
-
|
|
24
|
-
## Blue-Green Architecture Components
|
|
25
|
-
|
|
26
|
-
### 1. **Infrastructure Setup**
|
|
27
|
-
|
|
28
|
-
#### Load Balancer Configuration (NGINX)
|
|
29
|
-
```nginx
|
|
30
|
-
upstream blue {
|
|
31
|
-
server blue-app-1:3000;
|
|
32
|
-
server blue-app-2:3000;
|
|
33
|
-
server blue-app-3:3000;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
upstream green {
|
|
37
|
-
server green-app-1:3000;
|
|
38
|
-
server green-app-2:3000;
|
|
39
|
-
server green-app-3:3000;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
# Current active environment
|
|
43
|
-
upstream active {
|
|
44
|
-
server blue-app-1:3000;
|
|
45
|
-
server blue-app-2:3000;
|
|
46
|
-
server blue-app-3:3000;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
server {
|
|
50
|
-
listen 80;
|
|
51
|
-
server_name example.com;
|
|
52
|
-
|
|
53
|
-
location / {
|
|
54
|
-
proxy_pass http://active;
|
|
55
|
-
proxy_set_header Host $host;
|
|
56
|
-
proxy_set_header X-Real-IP $remote_addr;
|
|
57
|
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
58
|
-
proxy_set_header X-Environment $environment;
|
|
59
|
-
|
|
60
|
-
# Health check configuration
|
|
61
|
-
proxy_connect_timeout 5s;
|
|
62
|
-
proxy_send_timeout 5s;
|
|
63
|
-
proxy_read_timeout 5s;
|
|
64
|
-
|
|
65
|
-
# Retry configuration
|
|
66
|
-
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
|
|
67
|
-
proxy_next_upstream_tries 2;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
# Health check endpoint
|
|
71
|
-
location /health {
|
|
72
|
-
access_log off;
|
|
73
|
-
proxy_pass http://active/health;
|
|
74
|
-
proxy_connect_timeout 1s;
|
|
75
|
-
proxy_send_timeout 1s;
|
|
76
|
-
proxy_read_timeout 1s;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
# Environment indicator
|
|
80
|
-
location /environment {
|
|
81
|
-
access_log off;
|
|
82
|
-
return 200 $environment;
|
|
83
|
-
add_header Content-Type text/plain;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
#### HAProxy Configuration
|
|
89
|
-
```haproxy
|
|
90
|
-
global
|
|
91
|
-
daemon
|
|
92
|
-
log 127.0.0.1:514 local0
|
|
93
|
-
stats socket /var/run/haproxy.sock mode 600 level admin
|
|
94
|
-
|
|
95
|
-
defaults
|
|
96
|
-
mode http
|
|
97
|
-
timeout connect 5000ms
|
|
98
|
-
timeout client 50000ms
|
|
99
|
-
timeout server 50000ms
|
|
100
|
-
option httplog
|
|
101
|
-
option dontlognull
|
|
102
|
-
|
|
103
|
-
# Blue environment
|
|
104
|
-
backend blue_backend
|
|
105
|
-
balance roundrobin
|
|
106
|
-
option httpchk GET /health
|
|
107
|
-
http-check expect status 200
|
|
108
|
-
server blue1 blue-app-1:3000 check
|
|
109
|
-
server blue2 blue-app-2:3000 check
|
|
110
|
-
server blue3 blue-app-3:3000 check
|
|
111
|
-
|
|
112
|
-
# Green environment
|
|
113
|
-
backend green_backend
|
|
114
|
-
balance roundrobin
|
|
115
|
-
option httpchk GET /health
|
|
116
|
-
http-check expect status 200
|
|
117
|
-
server green1 green-app-1:3000 check
|
|
118
|
-
server green2 green-app-2:3000 check
|
|
119
|
-
server green3 green-app-3:3000 check
|
|
120
|
-
|
|
121
|
-
# Frontend with switching logic
|
|
122
|
-
frontend main_frontend
|
|
123
|
-
bind *:80
|
|
124
|
-
# Environment switching via ACL
|
|
125
|
-
use_backend blue_backend if { var(txn.environment) -m str blue }
|
|
126
|
-
use_backend green_backend if { var(txn.environment) -m str green }
|
|
127
|
-
default_backend blue_backend # Default to blue
|
|
128
|
-
|
|
129
|
-
# Stats interface
|
|
130
|
-
frontend stats
|
|
131
|
-
bind *:8404
|
|
132
|
-
stats enable
|
|
133
|
-
stats uri /stats
|
|
134
|
-
stats refresh 5s
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### 2. **Kubernetes Blue-Green Implementation**
|
|
138
|
-
|
|
139
|
-
#### Blue-Green Service Management
|
|
140
|
-
```yaml
|
|
141
|
-
# blue-service.yaml
|
|
142
|
-
apiVersion: v1
|
|
143
|
-
kind: Service
|
|
144
|
-
metadata:
|
|
145
|
-
name: app-service-blue
|
|
146
|
-
labels:
|
|
147
|
-
app: myapp
|
|
148
|
-
environment: blue
|
|
149
|
-
spec:
|
|
150
|
-
selector:
|
|
151
|
-
app: myapp
|
|
152
|
-
environment: blue
|
|
153
|
-
ports:
|
|
154
|
-
- port: 80
|
|
155
|
-
targetPort: 3000
|
|
156
|
-
type: ClusterIP
|
|
157
|
-
|
|
158
|
-
---
|
|
159
|
-
# green-service.yaml
|
|
160
|
-
apiVersion: v1
|
|
161
|
-
kind: Service
|
|
162
|
-
metadata:
|
|
163
|
-
name: app-service-green
|
|
164
|
-
labels:
|
|
165
|
-
app: myapp
|
|
166
|
-
environment: green
|
|
167
|
-
spec:
|
|
168
|
-
selector:
|
|
169
|
-
app: myapp
|
|
170
|
-
environment: green
|
|
171
|
-
ports:
|
|
172
|
-
- port: 80
|
|
173
|
-
targetPort: 3000
|
|
174
|
-
type: ClusterIP
|
|
175
|
-
|
|
176
|
-
---
|
|
177
|
-
# active-service.yaml (points to current active environment)
|
|
178
|
-
apiVersion: v1
|
|
179
|
-
kind: Service
|
|
180
|
-
metadata:
|
|
181
|
-
name: app-service-active
|
|
182
|
-
labels:
|
|
183
|
-
app: myapp
|
|
184
|
-
environment: active
|
|
185
|
-
spec:
|
|
186
|
-
selector:
|
|
187
|
-
app: myapp
|
|
188
|
-
environment: blue # Switch this to 'green' during deployment
|
|
189
|
-
ports:
|
|
190
|
-
- port: 80
|
|
191
|
-
targetPort: 3000
|
|
192
|
-
type: LoadBalancer
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
#### Blue-Green Deployments
|
|
196
|
-
```yaml
|
|
197
|
-
# blue-deployment.yaml
|
|
198
|
-
apiVersion: apps/v1
|
|
199
|
-
kind: Deployment
|
|
200
|
-
metadata:
|
|
201
|
-
name: app-blue
|
|
202
|
-
labels:
|
|
203
|
-
app: myapp
|
|
204
|
-
environment: blue
|
|
205
|
-
spec:
|
|
206
|
-
replicas: 3
|
|
207
|
-
selector:
|
|
208
|
-
matchLabels:
|
|
209
|
-
app: myapp
|
|
210
|
-
environment: blue
|
|
211
|
-
template:
|
|
212
|
-
metadata:
|
|
213
|
-
labels:
|
|
214
|
-
app: myapp
|
|
215
|
-
environment: blue
|
|
216
|
-
spec:
|
|
217
|
-
containers:
|
|
218
|
-
- name: app
|
|
219
|
-
image: myapp:v1.0.0
|
|
220
|
-
ports:
|
|
221
|
-
- containerPort: 3000
|
|
222
|
-
env:
|
|
223
|
-
- name: ENVIRONMENT
|
|
224
|
-
value: "blue"
|
|
225
|
-
- name: VERSION
|
|
226
|
-
value: "v1.0.0"
|
|
227
|
-
livenessProbe:
|
|
228
|
-
httpGet:
|
|
229
|
-
path: /health
|
|
230
|
-
port: 3000
|
|
231
|
-
initialDelaySeconds: 30
|
|
232
|
-
periodSeconds: 10
|
|
233
|
-
readinessProbe:
|
|
234
|
-
httpGet:
|
|
235
|
-
path: /ready
|
|
236
|
-
port: 3000
|
|
237
|
-
initialDelaySeconds: 5
|
|
238
|
-
periodSeconds: 5
|
|
239
|
-
resources:
|
|
240
|
-
requests:
|
|
241
|
-
memory: "128Mi"
|
|
242
|
-
cpu: "100m"
|
|
243
|
-
limits:
|
|
244
|
-
memory: "512Mi"
|
|
245
|
-
cpu: "500m"
|
|
246
|
-
|
|
247
|
-
---
|
|
248
|
-
# green-deployment.yaml
|
|
249
|
-
apiVersion: apps/v1
|
|
250
|
-
kind: Deployment
|
|
251
|
-
metadata:
|
|
252
|
-
name: app-green
|
|
253
|
-
labels:
|
|
254
|
-
app: myapp
|
|
255
|
-
environment: green
|
|
256
|
-
spec:
|
|
257
|
-
replicas: 3
|
|
258
|
-
selector:
|
|
259
|
-
matchLabels:
|
|
260
|
-
app: myapp
|
|
261
|
-
environment: green
|
|
262
|
-
template:
|
|
263
|
-
metadata:
|
|
264
|
-
labels:
|
|
265
|
-
app: myapp
|
|
266
|
-
environment: green
|
|
267
|
-
spec:
|
|
268
|
-
containers:
|
|
269
|
-
- name: app
|
|
270
|
-
image: myapp:v1.1.0 # New version
|
|
271
|
-
ports:
|
|
272
|
-
- containerPort: 3000
|
|
273
|
-
env:
|
|
274
|
-
- name: ENVIRONMENT
|
|
275
|
-
value: "green"
|
|
276
|
-
- name: VERSION
|
|
277
|
-
value: "v1.1.0"
|
|
278
|
-
livenessProbe:
|
|
279
|
-
httpGet:
|
|
280
|
-
path: /health
|
|
281
|
-
port: 3000
|
|
282
|
-
initialDelaySeconds: 30
|
|
283
|
-
periodSeconds: 10
|
|
284
|
-
readinessProbe:
|
|
285
|
-
httpGet:
|
|
286
|
-
path: /ready
|
|
287
|
-
port: 3000
|
|
288
|
-
initialDelaySeconds: 5
|
|
289
|
-
periodSeconds: 5
|
|
290
|
-
resources:
|
|
291
|
-
requests:
|
|
292
|
-
memory: "128Mi"
|
|
293
|
-
cpu: "100m"
|
|
294
|
-
limits:
|
|
295
|
-
memory: "512Mi"
|
|
296
|
-
cpu: "500m"
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
### 3. **Deployment Automation Scripts**
|
|
300
|
-
|
|
301
|
-
#### Blue-Green Deployment Script
|
|
302
|
-
```bash
|
|
303
|
-
#!/bin/bash
|
|
304
|
-
set -e
|
|
305
|
-
|
|
306
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
307
|
-
source "$SCRIPT_DIR/config.sh"
|
|
308
|
-
|
|
309
|
-
# Configuration
|
|
310
|
-
BLUE_ENV="blue"
|
|
311
|
-
GREEN_ENV="green"
|
|
312
|
-
HEALTH_CHECK_URL="${APP_URL}/health"
|
|
313
|
-
READY_CHECK_URL="${APP_URL}/ready"
|
|
314
|
-
VERSION_URL="${APP_URL}/version"
|
|
315
|
-
|
|
316
|
-
# Colors for output
|
|
317
|
-
RED='\033[0;31m'
|
|
318
|
-
GREEN='\033[0;32m'
|
|
319
|
-
BLUE='\033[0;34m'
|
|
320
|
-
YELLOW='\033[1;33m'
|
|
321
|
-
NC='\033[0m' # No Color
|
|
322
|
-
|
|
323
|
-
log() {
|
|
324
|
-
echo -e "${GREEN}[$(date '+%Y-%m-%d %H:%M:%S')] $1${NC}"
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
warn() {
|
|
328
|
-
echo -e "${YELLOW}[WARNING] $1${NC}"
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
error() {
|
|
332
|
-
echo -e "${RED}[ERROR] $1${NC}"
|
|
333
|
-
exit 1
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
# Get current active environment
|
|
337
|
-
get_current_env() {
|
|
338
|
-
if kubectl get service app-service-active &>/dev/null; then
|
|
339
|
-
kubectl get service app-service-active -o jsonpath='{.spec.selector.environment}'
|
|
340
|
-
else
|
|
341
|
-
echo "blue" # Default to blue if service doesn't exist
|
|
342
|
-
fi
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
# Get inactive environment (opposite of current)
|
|
346
|
-
get_inactive_env() {
|
|
347
|
-
local current_env=$1
|
|
348
|
-
if [ "$current_env" = "blue" ]; then
|
|
349
|
-
echo "green"
|
|
350
|
-
else
|
|
351
|
-
echo "blue"
|
|
352
|
-
fi
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
# Deploy to inactive environment
|
|
356
|
-
deploy_to_inactive() {
|
|
357
|
-
local version=$1
|
|
358
|
-
local current_env=$(get_current_env)
|
|
359
|
-
local inactive_env=$(get_inactive_env "$current_env")
|
|
360
|
-
|
|
361
|
-
log "Current active environment: $current_env"
|
|
362
|
-
log "Deploying version $version to $inactive_env environment"
|
|
363
|
-
|
|
364
|
-
# Update deployment with new image
|
|
365
|
-
kubectl set image deployment/app-$inactive_env app=myapp:$version
|
|
366
|
-
|
|
367
|
-
# Wait for rollout to complete
|
|
368
|
-
log "Waiting for deployment rollout to complete..."
|
|
369
|
-
kubectl rollout status deployment/app-$inactive_env --timeout=600s
|
|
370
|
-
|
|
371
|
-
# Verify pods are running
|
|
372
|
-
log "Verifying pods are running..."
|
|
373
|
-
kubectl wait --for=condition=ready pod -l app=myapp,environment=$inactive_env --timeout=300s
|
|
374
|
-
|
|
375
|
-
log "Deployment to $inactive_env environment completed successfully"
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
# Health check function
|
|
379
|
-
health_check() {
|
|
380
|
-
local env=$1
|
|
381
|
-
local service_url="http://app-service-$env.$NAMESPACE.svc.cluster.local"
|
|
382
|
-
|
|
383
|
-
log "Performing health check for $env environment..."
|
|
384
|
-
|
|
385
|
-
# Use kubectl port-forward for internal testing
|
|
386
|
-
kubectl port-forward service/app-service-$env 8080:80 &
|
|
387
|
-
local port_forward_pid=$!
|
|
388
|
-
|
|
389
|
-
sleep 5 # Wait for port-forward to establish
|
|
390
|
-
|
|
391
|
-
local health_status=1
|
|
392
|
-
local attempts=0
|
|
393
|
-
local max_attempts=10
|
|
394
|
-
|
|
395
|
-
while [ $attempts -lt $max_attempts ]; do
|
|
396
|
-
if curl -f -s http://localhost:8080/health > /dev/null; then
|
|
397
|
-
health_status=0
|
|
398
|
-
break
|
|
399
|
-
fi
|
|
400
|
-
|
|
401
|
-
attempts=$((attempts + 1))
|
|
402
|
-
log "Health check attempt $attempts/$max_attempts failed, retrying..."
|
|
403
|
-
sleep 10
|
|
404
|
-
done
|
|
405
|
-
|
|
406
|
-
# Clean up port-forward
|
|
407
|
-
kill $port_forward_pid 2>/dev/null || true
|
|
408
|
-
|
|
409
|
-
if [ $health_status -eq 0 ]; then
|
|
410
|
-
log "Health check passed for $env environment"
|
|
411
|
-
return 0
|
|
412
|
-
else
|
|
413
|
-
error "Health check failed for $env environment after $max_attempts attempts"
|
|
414
|
-
fi
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
# Smoke tests
|
|
418
|
-
run_smoke_tests() {
|
|
419
|
-
local env=$1
|
|
420
|
-
log "Running smoke tests for $env environment..."
|
|
421
|
-
|
|
422
|
-
# Port-forward for testing
|
|
423
|
-
kubectl port-forward service/app-service-$env 8080:80 &
|
|
424
|
-
local port_forward_pid=$!
|
|
425
|
-
sleep 5
|
|
426
|
-
|
|
427
|
-
local test_results=()
|
|
428
|
-
|
|
429
|
-
# Test 1: Health endpoint
|
|
430
|
-
if curl -f -s http://localhost:8080/health | jq -e '.status == "healthy"' > /dev/null; then
|
|
431
|
-
test_results+=("✅ Health endpoint")
|
|
432
|
-
else
|
|
433
|
-
test_results+=("❌ Health endpoint")
|
|
434
|
-
fi
|
|
435
|
-
|
|
436
|
-
# Test 2: Version endpoint
|
|
437
|
-
if curl -f -s http://localhost:8080/version > /dev/null; then
|
|
438
|
-
test_results+=("✅ Version endpoint")
|
|
439
|
-
else
|
|
440
|
-
test_results+=("❌ Version endpoint")
|
|
441
|
-
fi
|
|
442
|
-
|
|
443
|
-
# Test 3: Main application endpoint
|
|
444
|
-
if curl -f -s http://localhost:8080/ > /dev/null; then
|
|
445
|
-
test_results+=("✅ Main endpoint")
|
|
446
|
-
else
|
|
447
|
-
test_results+=("❌ Main endpoint")
|
|
448
|
-
fi
|
|
449
|
-
|
|
450
|
-
# Test 4: Database connectivity (if applicable)
|
|
451
|
-
if curl -f -s http://localhost:8080/db-health 2>/dev/null | jq -e '.connected == true' > /dev/null; then
|
|
452
|
-
test_results+=("✅ Database connectivity")
|
|
453
|
-
else
|
|
454
|
-
test_results+=("⚠️ Database connectivity (not tested)")
|
|
455
|
-
fi
|
|
456
|
-
|
|
457
|
-
# Clean up port-forward
|
|
458
|
-
kill $port_forward_pid 2>/dev/null || true
|
|
459
|
-
|
|
460
|
-
# Display results
|
|
461
|
-
log "Smoke test results for $env:"
|
|
462
|
-
printf '%s\n' "${test_results[@]}"
|
|
463
|
-
|
|
464
|
-
# Check if all critical tests passed
|
|
465
|
-
local failed_tests=$(printf '%s\n' "${test_results[@]}" | grep -c "❌" || true)
|
|
466
|
-
if [ "$failed_tests" -gt 0 ]; then
|
|
467
|
-
error "Smoke tests failed with $failed_tests failures"
|
|
468
|
-
fi
|
|
469
|
-
|
|
470
|
-
log "All smoke tests passed for $env environment"
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
# Switch traffic to new environment
|
|
474
|
-
switch_traffic() {
|
|
475
|
-
local target_env=$1
|
|
476
|
-
local current_env=$(get_current_env)
|
|
477
|
-
|
|
478
|
-
if [ "$target_env" = "$current_env" ]; then
|
|
479
|
-
warn "Target environment ($target_env) is already active"
|
|
480
|
-
return 0
|
|
481
|
-
fi
|
|
482
|
-
|
|
483
|
-
log "Switching traffic from $current_env to $target_env"
|
|
484
|
-
|
|
485
|
-
# Create backup of current service configuration
|
|
486
|
-
kubectl get service app-service-active -o yaml > "/tmp/service-backup-$(date +%Y%m%d-%H%M%S).yaml"
|
|
487
|
-
|
|
488
|
-
# Update service selector to point to new environment
|
|
489
|
-
kubectl patch service app-service-active -p '{"spec":{"selector":{"environment":"'$target_env'"}}}'
|
|
490
|
-
|
|
491
|
-
# Verify the switch
|
|
492
|
-
sleep 10
|
|
493
|
-
local new_active_env=$(get_current_env)
|
|
494
|
-
if [ "$new_active_env" = "$target_env" ]; then
|
|
495
|
-
log "Traffic successfully switched to $target_env environment"
|
|
496
|
-
else
|
|
497
|
-
error "Failed to switch traffic to $target_env environment"
|
|
498
|
-
fi
|
|
499
|
-
|
|
500
|
-
# Wait for load balancer to propagate changes
|
|
501
|
-
log "Waiting for load balancer to propagate changes (30 seconds)..."
|
|
502
|
-
sleep 30
|
|
503
|
-
|
|
504
|
-
# Verify external traffic is flowing to new environment
|
|
505
|
-
local attempts=0
|
|
506
|
-
local max_attempts=5
|
|
507
|
-
while [ $attempts -lt $max_attempts ]; do
|
|
508
|
-
local version=$(curl -s $VERSION_URL | jq -r '.version // "unknown"' 2>/dev/null || echo "unknown")
|
|
509
|
-
if [ "$version" != "unknown" ]; then
|
|
510
|
-
log "External traffic verification successful - Version: $version"
|
|
511
|
-
break
|
|
512
|
-
fi
|
|
513
|
-
attempts=$((attempts + 1))
|
|
514
|
-
sleep 10
|
|
515
|
-
done
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
# Rollback to previous environment
|
|
519
|
-
rollback() {
|
|
520
|
-
local current_env=$(get_current_env)
|
|
521
|
-
local previous_env=$(get_inactive_env "$current_env")
|
|
522
|
-
|
|
523
|
-
warn "Initiating rollback from $current_env to $previous_env"
|
|
524
|
-
|
|
525
|
-
# Verify previous environment is healthy
|
|
526
|
-
health_check "$previous_env"
|
|
527
|
-
|
|
528
|
-
# Switch traffic back
|
|
529
|
-
switch_traffic "$previous_env"
|
|
530
|
-
|
|
531
|
-
log "Rollback completed successfully"
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
# Monitor deployment
|
|
535
|
-
monitor_deployment() {
|
|
536
|
-
local duration=${1:-300} # Default 5 minutes
|
|
537
|
-
local start_time=$(date +%s)
|
|
538
|
-
local end_time=$((start_time + duration))
|
|
539
|
-
|
|
540
|
-
log "Monitoring deployment for ${duration} seconds..."
|
|
541
|
-
|
|
542
|
-
while [ $(date +%s) -lt $end_time ]; do
|
|
543
|
-
local health_status=$(curl -s $HEALTH_CHECK_URL | jq -r '.status // "unknown"' 2>/dev/null || echo "unknown")
|
|
544
|
-
local version=$(curl -s $VERSION_URL | jq -r '.version // "unknown"' 2>/dev/null || echo "unknown")
|
|
545
|
-
|
|
546
|
-
echo "$(date '+%H:%M:%S') - Health: $health_status, Version: $version"
|
|
547
|
-
|
|
548
|
-
# Check for critical issues
|
|
549
|
-
if [ "$health_status" = "unhealthy" ]; then
|
|
550
|
-
error "Application became unhealthy during monitoring period"
|
|
551
|
-
fi
|
|
552
|
-
|
|
553
|
-
sleep 30
|
|
554
|
-
done
|
|
555
|
-
|
|
556
|
-
log "Monitoring completed successfully"
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
# Full blue-green deployment process
|
|
560
|
-
deploy() {
|
|
561
|
-
local version=$1
|
|
562
|
-
|
|
563
|
-
if [ -z "$version" ]; then
|
|
564
|
-
error "Version parameter is required"
|
|
565
|
-
fi
|
|
566
|
-
|
|
567
|
-
log "Starting blue-green deployment for version $version"
|
|
568
|
-
|
|
569
|
-
# Step 1: Deploy to inactive environment
|
|
570
|
-
deploy_to_inactive "$version"
|
|
571
|
-
|
|
572
|
-
# Step 2: Health check inactive environment
|
|
573
|
-
local current_env=$(get_current_env)
|
|
574
|
-
local inactive_env=$(get_inactive_env "$current_env")
|
|
575
|
-
health_check "$inactive_env"
|
|
576
|
-
|
|
577
|
-
# Step 3: Run smoke tests
|
|
578
|
-
run_smoke_tests "$inactive_env"
|
|
579
|
-
|
|
580
|
-
# Step 4: Switch traffic
|
|
581
|
-
switch_traffic "$inactive_env"
|
|
582
|
-
|
|
583
|
-
# Step 5: Monitor new deployment
|
|
584
|
-
monitor_deployment 300
|
|
585
|
-
|
|
586
|
-
log "Blue-green deployment completed successfully"
|
|
587
|
-
log "New active environment: $inactive_env"
|
|
588
|
-
log "Version deployed: $version"
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
# Main script logic
|
|
592
|
-
case "${1:-deploy}" in
|
|
593
|
-
"setup")
|
|
594
|
-
log "Setting up blue-green deployment infrastructure..."
|
|
595
|
-
kubectl apply -f k8s/blue-green/
|
|
596
|
-
log "Blue-green infrastructure setup completed"
|
|
597
|
-
;;
|
|
598
|
-
"deploy")
|
|
599
|
-
deploy "${2:-latest}"
|
|
600
|
-
;;
|
|
601
|
-
"switch")
|
|
602
|
-
local target_env="${2:-$(get_inactive_env $(get_current_env))}"
|
|
603
|
-
switch_traffic "$target_env"
|
|
604
|
-
;;
|
|
605
|
-
"rollback")
|
|
606
|
-
rollback
|
|
607
|
-
;;
|
|
608
|
-
"status")
|
|
609
|
-
local current_env=$(get_current_env)
|
|
610
|
-
local inactive_env=$(get_inactive_env "$current_env")
|
|
611
|
-
|
|
612
|
-
echo "=== Blue-Green Deployment Status ==="
|
|
613
|
-
echo "Current active environment: $current_env"
|
|
614
|
-
echo "Inactive environment: $inactive_env"
|
|
615
|
-
echo ""
|
|
616
|
-
echo "=== Environment Details ==="
|
|
617
|
-
kubectl get deployments -l app=myapp
|
|
618
|
-
echo ""
|
|
619
|
-
kubectl get services -l app=myapp
|
|
620
|
-
echo ""
|
|
621
|
-
echo "=== Health Status ==="
|
|
622
|
-
curl -s $HEALTH_CHECK_URL 2>/dev/null | jq . || echo "Health check unavailable"
|
|
623
|
-
;;
|
|
624
|
-
"monitor")
|
|
625
|
-
monitor_deployment "${2:-300}"
|
|
626
|
-
;;
|
|
627
|
-
*)
|
|
628
|
-
echo "Usage: $0 {setup|deploy|switch|rollback|status|monitor}"
|
|
629
|
-
echo ""
|
|
630
|
-
echo "Commands:"
|
|
631
|
-
echo " setup - Initialize blue-green infrastructure"
|
|
632
|
-
echo " deploy <version> - Deploy new version using blue-green strategy"
|
|
633
|
-
echo " switch [environment] - Switch traffic between environments"
|
|
634
|
-
echo " rollback - Rollback to previous environment"
|
|
635
|
-
echo " status - Show current deployment status"
|
|
636
|
-
echo " monitor [duration] - Monitor deployment for specified duration"
|
|
637
|
-
exit 1
|
|
638
|
-
;;
|
|
639
|
-
esac
|
|
640
|
-
```
|
|
641
|
-
|
|
642
|
-
### 4. **Configuration Management**
|
|
643
|
-
|
|
644
|
-
#### Environment Configuration
|
|
645
|
-
```bash
|
|
646
|
-
# config.sh
|
|
647
|
-
#!/bin/bash
|
|
648
|
-
|
|
649
|
-
# Application configuration
|
|
650
|
-
APP_NAME="myapp"
|
|
651
|
-
APP_URL="https://api.example.com"
|
|
652
|
-
NAMESPACE="default"
|
|
653
|
-
|
|
654
|
-
# Container registry
|
|
655
|
-
REGISTRY="your-registry.com"
|
|
656
|
-
REPOSITORY="myapp"
|
|
657
|
-
|
|
658
|
-
# Health check configuration
|
|
659
|
-
HEALTH_CHECK_TIMEOUT=30
|
|
660
|
-
READY_CHECK_TIMEOUT=10
|
|
661
|
-
DEPLOYMENT_TIMEOUT=600
|
|
662
|
-
|
|
663
|
-
# Monitoring configuration
|
|
664
|
-
MONITORING_DURATION=300
|
|
665
|
-
SMOKE_TEST_TIMEOUT=60
|
|
666
|
-
|
|
667
|
-
# Notification configuration
|
|
668
|
-
SLACK_WEBHOOK_URL="${SLACK_WEBHOOK_URL:-}"
|
|
669
|
-
EMAIL_NOTIFICATIONS="${EMAIL_NOTIFICATIONS:-false}"
|
|
670
|
-
|
|
671
|
-
# Database configuration (if applicable)
|
|
672
|
-
DB_MIGRATION_STRATEGY="${DB_MIGRATION_STRATEGY:-forward-only}"
|
|
673
|
-
DB_BACKUP_BEFORE_DEPLOY="${DB_BACKUP_BEFORE_DEPLOY:-true}"
|
|
674
|
-
```
|
|
675
|
-
|
|
676
|
-
### 5. **Advanced Features**
|
|
677
|
-
|
|
678
|
-
#### Canary Integration
|
|
679
|
-
```yaml
|
|
680
|
-
# canary-service.yaml - For canary releases within blue-green
|
|
681
|
-
apiVersion: v1
|
|
682
|
-
kind: Service
|
|
683
|
-
metadata:
|
|
684
|
-
name: app-service-canary
|
|
685
|
-
labels:
|
|
686
|
-
app: myapp
|
|
687
|
-
environment: canary
|
|
688
|
-
spec:
|
|
689
|
-
selector:
|
|
690
|
-
app: myapp
|
|
691
|
-
environment: green # Route small percentage to green
|
|
692
|
-
ports:
|
|
693
|
-
- port: 80
|
|
694
|
-
targetPort: 3000
|
|
695
|
-
type: ClusterIP
|
|
696
|
-
|
|
697
|
-
---
|
|
698
|
-
# Ingress with traffic splitting
|
|
699
|
-
apiVersion: networking.k8s.io/v1
|
|
700
|
-
kind: Ingress
|
|
701
|
-
metadata:
|
|
702
|
-
name: app-ingress
|
|
703
|
-
annotations:
|
|
704
|
-
nginx.ingress.kubernetes.io/canary: "true"
|
|
705
|
-
nginx.ingress.kubernetes.io/canary-weight: "10" # 10% to canary
|
|
706
|
-
nginx.ingress.kubernetes.io/canary-by-header: "X-Canary"
|
|
707
|
-
nginx.ingress.kubernetes.io/canary-by-header-value: "true"
|
|
708
|
-
spec:
|
|
709
|
-
rules:
|
|
710
|
-
- host: api.example.com
|
|
711
|
-
http:
|
|
712
|
-
paths:
|
|
713
|
-
- path: /
|
|
714
|
-
pathType: Prefix
|
|
715
|
-
backend:
|
|
716
|
-
service:
|
|
717
|
-
name: app-service-canary
|
|
718
|
-
port:
|
|
719
|
-
number: 80
|
|
720
|
-
```
|
|
721
|
-
|
|
722
|
-
#### Database Migration Strategy
|
|
723
|
-
```bash
|
|
724
|
-
#!/bin/bash
|
|
725
|
-
# db-migration-strategy.sh
|
|
726
|
-
|
|
727
|
-
handle_database_migrations() {
|
|
728
|
-
local version=$1
|
|
729
|
-
local target_env=$2
|
|
730
|
-
|
|
731
|
-
log "Handling database migrations for version $version"
|
|
732
|
-
|
|
733
|
-
case "$DB_MIGRATION_STRATEGY" in
|
|
734
|
-
"forward-only")
|
|
735
|
-
# Only run forward migrations, safe for blue-green
|
|
736
|
-
run_forward_migrations "$version"
|
|
737
|
-
;;
|
|
738
|
-
"blue-green-safe")
|
|
739
|
-
# Use database views/aliases for backward compatibility
|
|
740
|
-
setup_db_compatibility_layer "$version"
|
|
741
|
-
run_forward_migrations "$version"
|
|
742
|
-
;;
|
|
743
|
-
"separate-db")
|
|
744
|
-
# Each environment has its own database
|
|
745
|
-
migrate_environment_database "$target_env" "$version"
|
|
746
|
-
;;
|
|
747
|
-
"shared-compatible")
|
|
748
|
-
# Ensure migrations are backward compatible
|
|
749
|
-
validate_migration_compatibility "$version"
|
|
750
|
-
run_forward_migrations "$version"
|
|
751
|
-
;;
|
|
752
|
-
*)
|
|
753
|
-
warn "Unknown database migration strategy: $DB_MIGRATION_STRATEGY"
|
|
754
|
-
;;
|
|
755
|
-
esac
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
run_forward_migrations() {
|
|
759
|
-
local version=$1
|
|
760
|
-
|
|
761
|
-
# Backup database before migrations
|
|
762
|
-
if [ "$DB_BACKUP_BEFORE_DEPLOY" = "true" ]; then
|
|
763
|
-
backup_database "pre-migration-$version-$(date +%Y%m%d-%H%M%S)"
|
|
764
|
-
fi
|
|
765
|
-
|
|
766
|
-
# Run migrations
|
|
767
|
-
kubectl run migration-job-$version \
|
|
768
|
-
--image=myapp:$version \
|
|
769
|
-
--restart=Never \
|
|
770
|
-
--command -- /bin/sh -c "npm run migrate"
|
|
771
|
-
|
|
772
|
-
# Wait for migration to complete
|
|
773
|
-
kubectl wait --for=condition=complete job/migration-job-$version --timeout=300s
|
|
774
|
-
|
|
775
|
-
# Verify migration success
|
|
776
|
-
local exit_code=$(kubectl get job migration-job-$version -o jsonpath='{.status.conditions[?(@.type=="Complete")].status}')
|
|
777
|
-
if [ "$exit_code" != "True" ]; then
|
|
778
|
-
error "Database migration failed"
|
|
779
|
-
fi
|
|
780
|
-
|
|
781
|
-
log "Database migrations completed successfully"
|
|
782
|
-
}
|
|
783
|
-
```
|
|
784
|
-
|
|
785
|
-
#### Monitoring Integration
|
|
786
|
-
```yaml
|
|
787
|
-
# monitoring/prometheus-rules.yaml
|
|
788
|
-
apiVersion: monitoring.coreos.com/v1
|
|
789
|
-
kind: PrometheusRule
|
|
790
|
-
metadata:
|
|
791
|
-
name: blue-green-deployment-rules
|
|
792
|
-
spec:
|
|
793
|
-
groups:
|
|
794
|
-
- name: blue-green-deployment
|
|
795
|
-
rules:
|
|
796
|
-
- alert: BlueGreenEnvironmentDown
|
|
797
|
-
expr: up{job="myapp", environment=~"blue|green"} == 0
|
|
798
|
-
for: 1m
|
|
799
|
-
labels:
|
|
800
|
-
severity: critical
|
|
801
|
-
annotations:
|
|
802
|
-
summary: "Blue-green environment {{ $labels.environment }} is down"
|
|
803
|
-
description: "Environment {{ $labels.environment }} has been down for more than 1 minute"
|
|
804
|
-
|
|
805
|
-
- alert: BlueGreenHighErrorRate
|
|
806
|
-
expr: rate(http_requests_total{job="myapp", status=~"5.."}[5m]) > 0.1
|
|
807
|
-
for: 2m
|
|
808
|
-
labels:
|
|
809
|
-
severity: warning
|
|
810
|
-
annotations:
|
|
811
|
-
summary: "High error rate detected during blue-green deployment"
|
|
812
|
-
description: "Error rate is {{ $value }} errors per second"
|
|
813
|
-
|
|
814
|
-
- alert: BlueGreenDeploymentStuck
|
|
815
|
-
expr: time() - kube_deployment_status_observed_generation{deployment=~"app-blue|app-green"} > 600
|
|
816
|
-
for: 5m
|
|
817
|
-
labels:
|
|
818
|
-
severity: warning
|
|
819
|
-
annotations:
|
|
820
|
-
summary: "Blue-green deployment appears stuck"
|
|
821
|
-
description: "Deployment {{ $labels.deployment }} hasn't updated in over 10 minutes"
|
|
822
|
-
```
|
|
823
|
-
|
|
824
|
-
This blue-green deployment system provides zero-downtime deployments with comprehensive validation, monitoring, and rollback capabilities. The implementation supports multiple platforms (Kubernetes, Docker Swarm, traditional deployments) and includes advanced features like database migration handling and canary releases.
|