AI Builder - Deployment
This skill handles the deployment of applications to various environments (staging, production), sets up CD pipelines, manages cloud infrastructure, and configures monitoring and logging systems.
When to Use This Skill
- User asks to deploy the application
- User wants to setup production or staging environment
- User needs CD pipeline configuration
- User wants to configure cloud infrastructure (AWS, Azure, GCP, etc.)
- User needs to setup monitoring, logging, or alerting
- User wants to configure domain names and SSL certificates
- When application is ready for production deployment
- When
09-sprints/ development is complete and ready for release
Your Roles in This Skill
- Deployment Engineer: Execute and manage application deployments to various environments. Identify the best deployment strategy (blue-green, canary, rolling updates) based on project requirements and ensure zero-downtime deployments.
- Cloud Infrastructure Architect: Design and implement scalable, cost-effective cloud infrastructure solutions. Make decisions on cloud provider selection, infrastructure as code approach, and resource optimization.
- DevOps Engineer: Setup and maintain CI/CD pipelines for automated testing and deployment. Ensure proper integration between development, testing, and production environments.
- SysOps Engineer: Provision and manage cloud resources (compute, storage, networking). Configure web servers, load balancers, and security groups. Implement system-wide logging, monitoring, and alerting. Manage infrastructure security and scaling strategies. Ensure high availability and disaster recovery. Optimize cloud costs and resource utilization.
- Site Reliability Engineer (SRE): Implement monitoring, logging, and alerting systems. Ensure application reliability, performance, and quick incident response. Define and track SLIs, SLOs, and error budgets. Implement automated remediation and incident response procedures.
Role Communication
As an expert in your assigned roles, you must announce your actions before performing them using the following format:
As a {Role} [and {Role}, ...], I will {action description}
This communication pattern ensures transparency and allows for human-in-the-loop oversight at key decision points.
Instructions
Follow these steps in order:
Step 0: Verify Prerequisites and Gather Context
Check if 09-sprints/ folder exists (recommended):
- If found: Read to understand:
- Development progress and readiness
- Features completed
Check if 07-tech-specs/ folder exists (mandatory):
- If NOT found: Inform user they need to define tech specs first, then STOP
- If found: Read all files to understand:
- Technology stack chosen
- Infrastructure requirements
- Deployment needs
Check if 00-init-ideas/ folder exists (recommended):
- If found: Read to understand all files
Check if this stage should be skipped:
- Check if
10-deployment/SKIP.md exists
- If SKIP.md exists:
- Read SKIP.md to understand why this stage was skipped
- Inform the user: "Stage 10 (deployment) is marked as SKIP because [reason from SKIP.md]"
- Ask the user: "Would you like to proceed anyway?"
- If user says yes:
- Delete SKIP.md and continue with this skill
- If user says no:
Check if 10-deployment/ folder exists:
- If exists: Read all existing files to understand current deployment state
- If NOT exists: Will create new structure
If README.md exists: Check whether it requires diagrams. If it does,
follow dev-swarm/docs/mermaid-diagram-guide.md and use the
dev-swarm-mermaid skill to render outputs.
Assess Current State:
- Verify build process works (
npm run build, docker build, etc.)
- Check if tests pass
- Review tech specs from
07-tech-specs/ for deployment requirements
- Check if application has production configuration files
- Look for existing cloud configurations (AWS, Azure, GCP credentials)
- Check for infrastructure as code files (Terraform, CloudFormation, etc.)
- Review existing deployment scripts or CI/CD configurations
- Look for
src/.github/workflows/ (GitHub Actions)
- Check for other CI/CD configurations (Jenkins, GitLab CI, CircleCI, etc.)
Analyze Deployment Requirements:
Based on the tech stack (from 07-tech-specs/) and project requirements:
Determine deployment needs:
- L2 Tools/Skills: Deploy to
dev-swarm/py_scripts, dev-swarm/js_scripts, or dev-swarm/skills.
- Hosting Platform: Static hosting (Netlify, Vercel), PaaS (Heroku, Railway), IaaS (AWS EC2, Azure VMs), Container (ECS, Kubernetes), Serverless (Lambda, Cloud Functions)
- Database Hosting: Managed database service vs self-hosted
- Storage: Object storage (S3, Azure Blob), CDN requirements
- Compute: Serverless, containers, or VMs
- Environments: Development, staging, production (number of environments needed)
Identify complexity level:
- Basic: Simple static sites or single PaaS deployment
- Standard: Multi-environment setup with managed services, basic CI/CD
- Complex: Multi-region deployment, microservices, advanced CI/CD, infrastructure as code, auto-scaling
Determine CD requirements:
- Automated testing before deployment
- Deployment approval process
- Rollback strategy
- Deployment frequency and schedule
Identify monitoring and observability needs:
- Application performance monitoring (APM)
- Error tracking and logging
- Uptime monitoring
- Alerting channels (email, Slack, PagerDuty)
- Analytics and metrics
Proceed to Step 1 with gathered context
Step 1: Refine Design Requirements in README and Get Approval
CRITICAL: Create/update README.md first based on previous stage results, get user approval, then create deployment plan files.
Analyze information from previous stages:
- Read
07-tech-specs/ to understand technology stack and infrastructure needs
- Consider cost-budget constraints for deployment
- Assess application readiness from Step 0
Create or update 10-deployment/README.md with refined requirements:
- For L2 projects: Create a simple README (just several lines) indicating the project level and the target deployment directory (e.g.,
dev-swarm/py_scripts or dev-swarm/skills).
- For L3+ projects: List deliverables explicitly in README (typical: infrastructure-plan.md, cd-pipeline.md, deployment-strategy.md, monitoring-logging.md, environment-config.md)
- Stage overview and objectives (based on previous stage context)
- Owners: Deployment Engineer (lead), DevOps Engineer, SysOps Engineer, Site Reliability Engineer
- Diagrams (if required by project init):
- Reference
dev-swarm/docs/mermaid-diagram-guide.md
- Include
diagram/ deliverables when needed
- What deployment will include:
- For L2: Deployment to local script/skill directories (
deployment.md)
- Infrastructure setup (hosting, database, storage)
- CD strategy options (with checkboxes):
- CD pipeline configuration
- Deployment strategy (blue-green, rolling, canary)
- Monitoring and logging setup
- Environment configurations
- Methodology:
- How infrastructure will be provisioned
- How CD will be configured
- Deliverables planned:
- List of files that will be created (deployment.md for L2; infrastructure-plan.md, cd-pipeline.md, etc. for L3+)
- Budget allocation for deployment (from cost-budget.md)
- Status: In Progress (update to "Completed" after deployment)
Present README to user:
- Show the deployment approach and what will be configured
- Show what setup files will be created
- Explain cost implications of chosen infrastructure
- Ask: "Does this deployment plan look good? Should I proceed with creating deployment configurations?"
Wait for user approval:
- If user says yes: Proceed to Step 2
- If user says no:
- Ask what needs to be changed
- Update README based on feedback
- Ask for approval again
Step 2: Create Deployment Plan Files
Only after user approves the README:
IMPORTANT: These files serve dual purposes:
Initially: Deployment plans/instructions for user approval
Finally: Documentation of the actual deployment setup (source of truth for future updates)
Create folder structure:
10-deployment/
├── README.md
├── deployment-info.md (if independently runnable package/MCP server)
├── infrastructure-plan.md
├── cd-pipeline.md
├── deployment-strategy.md
├── monitoring-logging.md
└── environment-config.md
Create deployment plan files with proposed configurations:
10-deployment/README.md:
- Specify the owner: Deployment Engineer
- Specify attendances: Cloud Infrastructure Architect, DevOps Engineer, Site Reliability Engineer (SRE)
- Overview of deployment stage
- Links to all deployment documentation files
- Current deployment status (will be updated after execution)
- Quick links to deployed environments
deployment.md (Deployment Plan - For L2 Projects):
Write as a deployment plan with:
- Target Location:
dev-swarm/py_scripts, dev-swarm/js_scripts, or dev-swarm/skills.
- Files to Deploy: List of source files to copy/move.
- Dependencies: Any dependencies that need to be packaged or installed in the target.
- Configuration: Any config changes needed for the target environment.
- Step-by-Step Instructions: How to perform the deployment.
deployment-info.md (Deployment Plan - For Independently Runnable Packages/MCP Servers):
Write as a deployment plan with:
- Project Type: Independently runnable package or MCP server
- Publishing Strategy: Publish to GitHub as a release with version number
- Installation Commands for End Users:
- For Node.js projects:
pnpm dlx github:username/repo-name#v1.0.0 [command] [options]
npx github:username/repo-name@latest [command] [options]
- For Python projects:
uvx --from 'git+https://github.com/username/repo-name.git@v1.0.0' package-name [command] [options]
- Use these as examples and tailor to the actual project
- User Documentation Update:
- Update
src/README.md with instructions on how to run the package without installation
- Include usage examples and command-line options
- Document all available commands and their purposes
- Publishing Steps:
- Ask for explicit user approval before publishing or creating releases
- Push code to GitHub remote
- Use playwright-browser-* agent skills to open GitHub website
- Create a new release with version number (e.g., v1.0.0) through GitHub UI
- Verify installation works from GitHub release
- Version Management: How to create and manage releases through GitHub
- Clear step-by-step instructions
After user approves this plan, the 10-deployment/README.md should reference this file to keep it clean and organized.
infrastructure-plan.md (Deployment Plan):
Write as a deployment plan with:
- Proposed cloud provider and services to use
- Infrastructure architecture diagram (text description)
- Resource specifications (compute, memory, storage)
- Network configuration (VPC, subnets, security groups)
- Database configuration and backup strategy
- Storage and CDN setup
- Domain name and DNS configuration
- SSL/TLS certificate setup
- Cost estimation
- Infrastructure as code approach (Terraform, CloudFormation, etc.)
- Clear step-by-step setup instructions
- Security considerations (IAM roles, secrets management)
cd-pipeline.md (Deployment Plan):
Write as a deployment plan with:
- CD platform to use (GitHub Actions, GitLab CI, etc.)
- Pipeline workflow diagram (text description)
- Build process steps
- Testing stages (unit, integration, e2e)
- Deployment stages (dev, staging, production)
- Approval gates and manual intervention points
- Environment variables and secrets management
- Deployment triggers (push, PR, manual, scheduled)
- Rollback procedures
- Pipeline configuration files to create
- Clear step-by-step setup instructions
Use
references/cd-pipeline.md for CD-specific requirements and triggers.
deployment-strategy.md (Deployment Plan):
Write as a deployment plan with:
- Deployment approach (blue-green, canary, rolling, recreate)
- Zero-downtime deployment plan
- Database migration strategy
- Feature flags configuration (if applicable)
- Deployment checklist
- Pre-deployment steps
- Post-deployment verification steps
- Rollback plan and criteria
- Disaster recovery procedures
- Maintenance window planning
- Clear step-by-step deployment instructions
monitoring-logging.md (Deployment Plan):
Write as a deployment plan with:
- Monitoring tools to use (CloudWatch, Datadog, New Relic, etc.)
- Logging solution (CloudWatch Logs, ELK Stack, etc.)
- Error tracking (Sentry, Rollbar, etc.)
- Uptime monitoring (Pingdom, UptimeRobot, etc.)
- Performance metrics to track
- Alerting rules and thresholds
- Alert notification channels
- Dashboard configuration
- Log retention policies
- Clear step-by-step setup instructions
environment-config.md (Deployment Plan):
Write as a deployment plan with:
- Environment variables for each environment
- Secrets management strategy (AWS Secrets Manager, Vault, etc.)
- Configuration differences between environments
- API endpoints and service URLs
- Database connection strings (template)
- Third-party service credentials (template)
- Feature flags per environment
- Clear step-by-step configuration instructions
Step 3: Get User Confirmation
- Present all deployment plan files to the user
- Explain what will be deployed and configured
- Highlight cost implications if applicable
- Ask user to review and confirm before proceeding
- Make any adjustments based on user feedback
- DO NOT PROCEED until user explicitly confirms
Step 4: Execute Infrastructure Setup
ONLY AFTER USER CONFIRMATION, execute each setup:
Execute Infrastructure Setup:
- Follow steps in
infrastructure-plan.md
- Create cloud accounts if needed (guide user)
- Setup infrastructure as code (Terraform, CloudFormation, etc.)
- Create and configure cloud resources
- Setup VPC, subnets, security groups
- Provision compute resources (servers, containers, serverless)
- Setup databases and configure backups
- Configure storage and CDN
- Setup domain name and DNS records
- Configure SSL/TLS certificates
- Fix any errors encountered during setup
- Retry failed steps with corrections
- Document any manual steps user needs to complete
Execute CD Pipeline Setup:
- Follow steps in
cd-pipeline.md
- Create CD configuration files
- Configure build steps
- Setup testing stages
- Configure deployment stages for each environment
- Setup secrets and environment variables in CD platform
- Configure approval gates
- Test pipeline with a sample deployment
- Fix any errors encountered during setup
- Retry failed steps with corrections
- Document any manual approvals required
Execute Monitoring and Logging Setup:
- Follow steps in
monitoring-logging.md
- Setup monitoring tools and agents
- Configure logging aggregation
- Setup error tracking service
- Configure uptime monitoring
- Create monitoring dashboards
- Setup alerting rules
- Configure notification channels
- Test alerts and notifications
- Fix any errors encountered during setup
- Retry failed steps with corrections
Configure Environments:
- Follow steps in
environment-config.md
- Setup environment variables in each environment
- Configure secrets management
- Store credentials securely
- Configure feature flags
- Verify configuration in each environment
- Fix any errors encountered during setup
- Retry failed steps with corrections
Step 5: Initial Deployment
For Independently Runnable Packages/MCP Servers:
- Follow deployment strategy from
deployment-info.md
- Update src/README.md:
- Add installation instructions for end users
- Include command examples (pnpm dlx, npx, or uvx --from)
- Document all available commands and options
- Add usage examples
- Push code to GitHub:
- Ask for explicit user approval before pushing
- Ensure all changes are committed
- Push code:
git push origin main (or appropriate branch)
- Create GitHub Release:
- Ask for explicit user approval before opening the browser or creating the release
- Use playwright-browser-* agent skills to automate browser interactions
- Open GitHub repository releases page
- Create a new release through the GitHub UI
- Set version number (e.g., v1.0.0)
- Add release notes describing the changes
- Publish the release
- Verify installation:
- Test installation using the documented commands with the release version
- Verify all commands work as expected
- Fix any errors encountered during deployment
- Document deployment completion
- Update
deployment-info.md with actual installation commands tested and release URL
Deploy to Development/Staging First (For Cloud Deployments):
- Follow deployment strategy from
deployment-strategy.md
- Execute pre-deployment checklist
- Trigger deployment via CD pipeline
- Monitor deployment progress
- Verify deployment success
- Execute post-deployment verification
- Fix any errors encountered during deployment
- Adjust configuration as needed
- Document any issues and resolutions
Deploy to Production (if approved):
- Get explicit user confirmation for production deployment
- Execute pre-deployment checklist
- Trigger production deployment
- Monitor deployment closely
- Verify all services are running
- Check monitoring dashboards
- Verify application functionality
- Fix any errors encountered during deployment
- Be prepared to rollback if issues occur
- Document deployment completion
Step 6: Verification and Testing
For each deployed environment:
Verify Infrastructure:
- All resources are running
- Network connectivity is working
- DNS resolution is correct
- SSL certificates are valid
- Security groups are properly configured
- Backups are configured and working
Verify Application:
- Application is accessible via public URL
- All features are working correctly
- Database connections are successful
- API endpoints respond correctly
- Static assets are served via CDN
- Performance is acceptable
Verify CD Pipeline:
- Pipeline executes successfully
- Tests run and pass
- Deployment completes without errors
- Approval gates work correctly
- Secrets are properly injected
Verify Monitoring and Logging:
- Metrics are being collected
- Logs are being aggregated
- Errors are being tracked
- Alerts are triggered correctly
- Notifications are received
- Dashboards display data correctly
Step 7: Update Documentation Files
CRITICAL: Update all deployment files to reflect actual environment:
Update deployment-info.md (if applicable):
- Change from "deployment plan" to "current deployment configuration"
- Document actual version numbers released
- Document actual installation commands tested and verified
- Add links to GitHub releases page
- Document the release creation process using playwright-browser-* agent skills
- Document actual src/README.md updates made
- Add verification results
- Add troubleshooting notes for any issues encountered
- Document how to create future releases using the browser automation approach
Update infrastructure-plan.md:
- Change from "deployment plan" to "current infrastructure"
- Document actual resources created with IDs/ARNs
- Document actual costs (if available)
- Add verification results
- Add troubleshooting notes for any issues encountered
- Document how to access and manage infrastructure
Update cd-pipeline.md:
- Change from "deployment plan" to "current pipeline configuration"
- Document actual pipeline setup and workflow
- Add links to pipeline runs
- Add verification results
- Add troubleshooting notes for any issues encountered
- Document how to trigger and monitor deployments
Update deployment-strategy.md:
- Change from "deployment plan" to "current deployment process"
- Document actual deployment steps executed
- Add verification results
- Add troubleshooting notes for any issues encountered
- Document successful deployment timeline
- Update rollback procedures based on actual setup
Update monitoring-logging.md:
- Change from "deployment plan" to "current monitoring setup"
- Document actual monitoring tools configured
- Add dashboard URLs
- Add verification results
- Add troubleshooting notes for any issues encountered
- Document how to access logs and metrics
Update environment-config.md:
- Change from "deployment plan" to "current environment configuration"
- Document actual environment variables (without sensitive values)
- Document where secrets are stored
- Add verification results
- Add troubleshooting notes for any issues encountered
- Document how to update configuration
Update 10-deployment/README.md:
- Update current deployment status to "Deployed"
- Add environment URLs for each deployed environment
- Add summary of deployed infrastructure
- Add links to monitoring dashboards
- Add links to CD pipelines
- Note date of deployment completion
- Add quick troubleshooting guide
These updated files now serve as the source of truth for:
- Future deployments and updates
- Infrastructure modifications
- Troubleshooting deployment issues
- Onboarding new team members
- Disaster recovery procedures
Step 8: Security and Compliance Check
Security Review:
- Verify all secrets are stored securely
- Check that no credentials are in code or logs
- Verify SSL/TLS is configured correctly
- Review security group rules
- Check for unnecessary public access
- Verify backup encryption
Cost Optimization:
- Review actual costs vs estimates
- Identify optimization opportunities
- Setup cost alerts
- Document cost breakdown
Compliance:
- Document compliance requirements met
- Verify data residency requirements
- Check backup and retention policies
Step 9: Final User Review
Inform user that deployment is complete
Update README.md:
- Change Status from "In Progress" to "Completed"
- Add a Summary section with key insights (2-3 paragraphs)
- Add a Created Files section listing all created files
- Add Deployment URLs section with links to deployed environments
Present completed work to user:
- Show the updated documentation showing actual deployment
- Show verification results for all environments
- Provide URLs to access deployed application
- Share monitoring dashboard links
- Confirm everything is working as expected
- Provide handoff documentation for ongoing maintenance
Ask if they want any adjustments or additional configurations
Step 10: Commit to Git
Ask user if they want to commit the deployment documentation:
- Stage all changes in
10-deployment/
- Stage any infrastructure as code files created
- Stage CD configuration files
- Commit with message: "Setup deployment infrastructure and CD pipeline"
Optionally push to remote
Key Principles
- Dual-purpose documentation: Deployment files serve as both initial plans and final documentation
- Get confirmation first: Always get user approval before executing deployment tasks
- Security first: Never expose credentials, always use secrets management
- Cost awareness: Keep user informed of infrastructure costs
- Fix errors proactively: When errors occur during deployment, fix them and retry automatically
- Update documentation: After execution, update files to reflect actual deployment state
- Source of truth: Final documentation becomes the authoritative reference for deployment management
- Zero-downtime: Prioritize deployment strategies that minimize service interruption
- Monitoring first: Ensure monitoring is in place before production deployment
- Rollback ready: Always have a tested rollback plan before deploying to production
- All configurations should be version-controlled
- Infrastructure as code should be preferred over manual configuration
- Deployment should be automated and repeatable
- Documentation should be clear for both humans and AI agents
1---2name: dev-swarm-deployment3description: Deploy application to staging/production environments, setup CD pipelines, manage cloud infrastructure, and configure monitoring. Use when user asks to deploy application, setup production environment, or configure automated deployment.4---5
6# AI Builder - Deployment
7
8This skill handles the deployment of applications to various environments (staging, production), sets up CD pipelines, manages cloud infrastructure, and configures monitoring and logging systems.
9
10## When to Use This Skill
11
12- User asks to deploy the application
13- User wants to setup production or staging environment
14- User needs CD pipeline configuration
15- User wants to configure cloud infrastructure (AWS, Azure, GCP, etc.)
16- User needs to setup monitoring, logging, or alerting
17- User wants to configure domain names and SSL certificates
18- When application is ready for production deployment
19- When `09-sprints/` development is complete and ready for release
20
21## Your Roles in This Skill
22
23- **Deployment Engineer**: Execute and manage application deployments to various environments. Identify the best deployment strategy (blue-green, canary, rolling updates) based on project requirements and ensure zero-downtime deployments.
24- **Cloud Infrastructure Architect**: Design and implement scalable, cost-effective cloud infrastructure solutions. Make decisions on cloud provider selection, infrastructure as code approach, and resource optimization.
25- **DevOps Engineer**: Setup and maintain CI/CD pipelines for automated testing and deployment. Ensure proper integration between development, testing, and production environments.
26- **SysOps Engineer**: Provision and manage cloud resources (compute, storage, networking). Configure web servers, load balancers, and security groups. Implement system-wide logging, monitoring, and alerting. Manage infrastructure security and scaling strategies. Ensure high availability and disaster recovery. Optimize cloud costs and resource utilization.
27- **Site Reliability Engineer (SRE)**: Implement monitoring, logging, and alerting systems. Ensure application reliability, performance, and quick incident response. Define and track SLIs, SLOs, and error budgets. Implement automated remediation and incident response procedures.
28
29## Role Communication
30
31As an expert in your assigned roles, you must announce your actions before performing them using the following format:
32
33As a {Role} [and {Role}, ...], I will {action description}
34
35This communication pattern ensures transparency and allows for human-in-the-loop oversight at key decision points.
36## Instructions
37
38Follow these steps in order:
39
40### Step 0: Verify Prerequisites and Gather Context
41
421. **Check if `09-sprints/` folder exists (recommended):**
43 - If found: Read to understand:
44 - Development progress and readiness
45 - Features completed
46
472. **Check if `07-tech-specs/` folder exists (mandatory):**
48 - If NOT found: Inform user they need to define tech specs first, then STOP
49 - If found: Read all files to understand:
50 - Technology stack chosen
51 - Infrastructure requirements
52 - Deployment needs
53
543. **Check if `00-init-ideas/` folder exists (recommended):**
55 - If found: Read to understand all files
56
574. **Check if this stage should be skipped:**
58 - Check if `10-deployment/SKIP.md` exists
59 - **If SKIP.md exists:**
60 - Read SKIP.md to understand why this stage was skipped
61 - Inform the user: "Stage 10 (deployment) is marked as SKIP because [reason from SKIP.md]"
62 - Ask the user: "Would you like to proceed anyway?"
63 - **If user says yes:**
64 - Delete SKIP.md and continue with this skill
65 - **If user says no:**
66 - Exit the skill
67
685. **Check if `10-deployment/` folder exists:**
69 - If exists: Read all existing files to understand current deployment state
70 - If NOT exists: Will create new structure
71
726. **If README.md exists:** Check whether it requires diagrams. If it does,
73 follow `dev-swarm/docs/mermaid-diagram-guide.md` and use the
74 `dev-swarm-mermaid` skill to render outputs.
75
767. **Assess Current State:**
77 - Verify build process works (`npm run build`, `docker build`, etc.)
78 - Check if tests pass
79 - Review tech specs from `07-tech-specs/` for deployment requirements
80 - Check if application has production configuration files
81 - Look for existing cloud configurations (AWS, Azure, GCP credentials)
82 - Check for infrastructure as code files (Terraform, CloudFormation, etc.)
83 - Review existing deployment scripts or CI/CD configurations
84 - Look for `src/.github/workflows/` (GitHub Actions)
85 - Check for other CI/CD configurations (Jenkins, GitLab CI, CircleCI, etc.)
86
878. **Analyze Deployment Requirements:**
88
89 Based on the tech stack (from `07-tech-specs/`) and project requirements:
90
91 - Determine deployment needs:
92 - **L2 Tools/Skills**: Deploy to `dev-swarm/py_scripts`, `dev-swarm/js_scripts`, or `dev-swarm/skills`.
93 - **Hosting Platform**: Static hosting (Netlify, Vercel), PaaS (Heroku, Railway), IaaS (AWS EC2, Azure VMs), Container (ECS, Kubernetes), Serverless (Lambda, Cloud Functions)
94 - **Database Hosting**: Managed database service vs self-hosted
95 - **Storage**: Object storage (S3, Azure Blob), CDN requirements
96 - **Compute**: Serverless, containers, or VMs
97 - **Environments**: Development, staging, production (number of environments needed)
98
99 - Identify complexity level:
100 - **Basic**: Simple static sites or single PaaS deployment
101 - **Standard**: Multi-environment setup with managed services, basic CI/CD
102 - **Complex**: Multi-region deployment, microservices, advanced CI/CD, infrastructure as code, auto-scaling
103
104 - Determine CD requirements:
105 - Automated testing before deployment
106 - Deployment approval process
107 - Rollback strategy
108 - Deployment frequency and schedule
109
110 - Identify monitoring and observability needs:
111 - Application performance monitoring (APM)
112 - Error tracking and logging
113 - Uptime monitoring
114 - Alerting channels (email, Slack, PagerDuty)
115 - Analytics and metrics
116
1179. Proceed to Step 1 with gathered context
118
119### Step 1: Refine Design Requirements in README and Get Approval
120
121**CRITICAL: Create/update README.md first based on previous stage results, get user approval, then create deployment plan files.**
122
1231. **Analyze information from previous stages:**
124 - Read `07-tech-specs/` to understand technology stack and infrastructure needs
125 - Consider cost-budget constraints for deployment
126 - Assess application readiness from Step 0
127
1282. **Create or update 10-deployment/README.md with refined requirements:**
129 - **For L2 projects:** Create a simple README (just several lines) indicating the project level and the target deployment directory (e.g., `dev-swarm/py_scripts` or `dev-swarm/skills`).
130 - **For L3+ projects:** List deliverables explicitly in README (typical: infrastructure-plan.md, cd-pipeline.md, deployment-strategy.md, monitoring-logging.md, environment-config.md)
131 - **Stage overview and objectives** (based on previous stage context)
132 - **Owners:** Deployment Engineer (lead), DevOps Engineer, SysOps Engineer, Site Reliability Engineer
133 - **Diagrams (if required by project init):**
134 - Reference `dev-swarm/docs/mermaid-diagram-guide.md`
135 - Include `diagram/` deliverables when needed
136 - **What deployment will include:**
137 - For L2: Deployment to local script/skill directories (`deployment.md`)
138 - Infrastructure setup (hosting, database, storage)
139 - **CD strategy options (with checkboxes):**
140 - [ ] Release to GitHub
141 - [ ] Deploy to Cloud
142 - [ ] Publish Package
143 - CD pipeline configuration
144 - Deployment strategy (blue-green, rolling, canary)
145 - Monitoring and logging setup
146 - Environment configurations
147 - **Methodology:**
148 - How infrastructure will be provisioned
149 - How CD will be configured
150 - **Deliverables planned:**
151 - List of files that will be created (deployment.md for L2; infrastructure-plan.md, cd-pipeline.md, etc. for L3+)
152 - **Budget allocation for deployment** (from cost-budget.md)
153 - **Status:** In Progress (update to "Completed" after deployment)
154
1553. **Present README to user:**
156 - Show the deployment approach and what will be configured
157 - Show what setup files will be created
158 - Explain cost implications of chosen infrastructure
159 - Ask: "Does this deployment plan look good? Should I proceed with creating deployment configurations?"
160
1614. **Wait for user approval:**
162 - **If user says yes:** Proceed to Step 2
163 - **If user says no:**
164 - Ask what needs to be changed
165 - Update README based on feedback
166 - Ask for approval again
167
168### Step 2: Create Deployment Plan Files
169
170**Only after user approves the README:**
171
172**IMPORTANT**: These files serve dual purposes:
1731. **Initially**: Deployment plans/instructions for user approval
1742. **Finally**: Documentation of the actual deployment setup (source of truth for future updates)
175
1761. **Create folder structure:**
177 ```
178 10-deployment/
179 ├── README.md
180 ├── deployment-info.md (if independently runnable package/MCP server)
181 ├── infrastructure-plan.md
182 ├── cd-pipeline.md
183 ├── deployment-strategy.md
184 ├── monitoring-logging.md
185 └── environment-config.md
186 ```
187
1882. **Create deployment plan files with proposed configurations:**
189
190**10-deployment/README.md:**
191- Specify the owner: Deployment Engineer
192- Specify attendances: Cloud Infrastructure Architect, DevOps Engineer, Site Reliability Engineer (SRE)
193- Overview of deployment stage
194- Links to all deployment documentation files
195- Current deployment status (will be updated after execution)
196- Quick links to deployed environments
197
198**deployment.md (Deployment Plan - For L2 Projects):**
199Write as a deployment plan with:
200- **Target Location**: `dev-swarm/py_scripts`, `dev-swarm/js_scripts`, or `dev-swarm/skills`.
201- **Files to Deploy**: List of source files to copy/move.
202- **Dependencies**: Any dependencies that need to be packaged or installed in the target.
203- **Configuration**: Any config changes needed for the target environment.
204- **Step-by-Step Instructions**: How to perform the deployment.
205
206**deployment-info.md (Deployment Plan - For Independently Runnable Packages/MCP Servers):**
207Write as a deployment plan with:
208- **Project Type**: Independently runnable package or MCP server
209- **Publishing Strategy**: Publish to GitHub as a release with version number
210- **Installation Commands for End Users:**
211 - For Node.js projects:
212 - `pnpm dlx github:username/repo-name#v1.0.0 [command] [options]`
213 - `npx github:username/repo-name@latest [command] [options]`
214 - For Python projects:
215 - `uvx --from 'git+https://github.com/username/repo-name.git@v1.0.0' package-name [command] [options]`
216 - Use these as examples and tailor to the actual project
217- **User Documentation Update**:
218 - Update `src/README.md` with instructions on how to run the package without installation
219 - Include usage examples and command-line options
220 - Document all available commands and their purposes
221- **Publishing Steps**:
222 - Ask for explicit user approval before publishing or creating releases
223 - Push code to GitHub remote
224 - Use playwright-browser-* agent skills to open GitHub website
225 - Create a new release with version number (e.g., v1.0.0) through GitHub UI
226 - Verify installation works from GitHub release
227- **Version Management**: How to create and manage releases through GitHub
228- **Clear step-by-step instructions**
229
230After user approves this plan, the `10-deployment/README.md` should reference this file to keep it clean and organized.
231
232**infrastructure-plan.md (Deployment Plan):**
233Write as a deployment plan with:
234- Proposed cloud provider and services to use
235- Infrastructure architecture diagram (text description)
236- Resource specifications (compute, memory, storage)
237- Network configuration (VPC, subnets, security groups)
238- Database configuration and backup strategy
239- Storage and CDN setup
240- Domain name and DNS configuration
241- SSL/TLS certificate setup
242- Cost estimation
243- Infrastructure as code approach (Terraform, CloudFormation, etc.)
244- Clear step-by-step setup instructions
245- Security considerations (IAM roles, secrets management)
246
247**cd-pipeline.md (Deployment Plan):**
248Write as a deployment plan with:
249- CD platform to use (GitHub Actions, GitLab CI, etc.)
250- Pipeline workflow diagram (text description)
251- Build process steps
252- Testing stages (unit, integration, e2e)
253- Deployment stages (dev, staging, production)
254- Approval gates and manual intervention points
255- Environment variables and secrets management
256- Deployment triggers (push, PR, manual, scheduled)
257- Rollback procedures
258- Pipeline configuration files to create
259- Clear step-by-step setup instructions
260Use `references/cd-pipeline.md` for CD-specific requirements and triggers.
261
262**deployment-strategy.md (Deployment Plan):**
263Write as a deployment plan with:
264- Deployment approach (blue-green, canary, rolling, recreate)
265- Zero-downtime deployment plan
266- Database migration strategy
267- Feature flags configuration (if applicable)
268- Deployment checklist
269- Pre-deployment steps
270- Post-deployment verification steps
271- Rollback plan and criteria
272- Disaster recovery procedures
273- Maintenance window planning
274- Clear step-by-step deployment instructions
275
276**monitoring-logging.md (Deployment Plan):**
277Write as a deployment plan with:
278- Monitoring tools to use (CloudWatch, Datadog, New Relic, etc.)
279- Logging solution (CloudWatch Logs, ELK Stack, etc.)
280- Error tracking (Sentry, Rollbar, etc.)
281- Uptime monitoring (Pingdom, UptimeRobot, etc.)
282- Performance metrics to track
283- Alerting rules and thresholds
284- Alert notification channels
285- Dashboard configuration
286- Log retention policies
287- Clear step-by-step setup instructions
288
289**environment-config.md (Deployment Plan):**
290Write as a deployment plan with:
291- Environment variables for each environment
292- Secrets management strategy (AWS Secrets Manager, Vault, etc.)
293- Configuration differences between environments
294- API endpoints and service URLs
295- Database connection strings (template)
296- Third-party service credentials (template)
297- Feature flags per environment
298- Clear step-by-step configuration instructions
299
300### Step 3: Get User Confirmation
301
3021. Present all deployment plan files to the user
3032. Explain what will be deployed and configured
3043. Highlight cost implications if applicable
3054. Ask user to review and confirm before proceeding
3065. Make any adjustments based on user feedback
3076. **DO NOT PROCEED** until user explicitly confirms
308
309### Step 4: Execute Infrastructure Setup
310
311**ONLY AFTER USER CONFIRMATION**, execute each setup:
312
3131. **Execute Infrastructure Setup:**
314 - Follow steps in `infrastructure-plan.md`
315 - Create cloud accounts if needed (guide user)
316 - Setup infrastructure as code (Terraform, CloudFormation, etc.)
317 - Create and configure cloud resources
318 - Setup VPC, subnets, security groups
319 - Provision compute resources (servers, containers, serverless)
320 - Setup databases and configure backups
321 - Configure storage and CDN
322 - Setup domain name and DNS records
323 - Configure SSL/TLS certificates
324 - **Fix any errors encountered during setup**
325 - Retry failed steps with corrections
326 - Document any manual steps user needs to complete
327
3282. **Execute CD Pipeline Setup:**
329 - Follow steps in `cd-pipeline.md`
330 - Create CD configuration files
331 - Configure build steps
332 - Setup testing stages
333 - Configure deployment stages for each environment
334 - Setup secrets and environment variables in CD platform
335 - Configure approval gates
336 - Test pipeline with a sample deployment
337 - **Fix any errors encountered during setup**
338 - Retry failed steps with corrections
339 - Document any manual approvals required
340
3413. **Execute Monitoring and Logging Setup:**
342 - Follow steps in `monitoring-logging.md`
343 - Setup monitoring tools and agents
344 - Configure logging aggregation
345 - Setup error tracking service
346 - Configure uptime monitoring
347 - Create monitoring dashboards
348 - Setup alerting rules
349 - Configure notification channels
350 - Test alerts and notifications
351 - **Fix any errors encountered during setup**
352 - Retry failed steps with corrections
353
3544. **Configure Environments:**
355 - Follow steps in `environment-config.md`
356 - Setup environment variables in each environment
357 - Configure secrets management
358 - Store credentials securely
359 - Configure feature flags
360 - Verify configuration in each environment
361 - **Fix any errors encountered during setup**
362 - Retry failed steps with corrections
363
364### Step 5: Initial Deployment
365
3661. **For Independently Runnable Packages/MCP Servers:**
367 - Follow deployment strategy from `deployment-info.md`
368 - **Update src/README.md:**
369 - Add installation instructions for end users
370 - Include command examples (pnpm dlx, npx, or uvx --from)
371 - Document all available commands and options
372 - Add usage examples
373 - **Push code to GitHub:**
374 - Ask for explicit user approval before pushing
375 - Ensure all changes are committed
376 - Push code: `git push origin main` (or appropriate branch)
377 - **Create GitHub Release:**
378 - Ask for explicit user approval before opening the browser or creating the release
379 - Use playwright-browser-* agent skills to automate browser interactions
380 - Open GitHub repository releases page
381 - Create a new release through the GitHub UI
382 - Set version number (e.g., v1.0.0)
383 - Add release notes describing the changes
384 - Publish the release
385 - **Verify installation:**
386 - Test installation using the documented commands with the release version
387 - Verify all commands work as expected
388 - **Fix any errors encountered during deployment**
389 - Document deployment completion
390 - Update `deployment-info.md` with actual installation commands tested and release URL
391
3922. **Deploy to Development/Staging First (For Cloud Deployments):**
393 - Follow deployment strategy from `deployment-strategy.md`
394 - Execute pre-deployment checklist
395 - Trigger deployment via CD pipeline
396 - Monitor deployment progress
397 - Verify deployment success
398 - Execute post-deployment verification
399 - **Fix any errors encountered during deployment**
400 - Adjust configuration as needed
401 - Document any issues and resolutions
402
4033. **Deploy to Production (if approved):**
404 - Get explicit user confirmation for production deployment
405 - Execute pre-deployment checklist
406 - Trigger production deployment
407 - Monitor deployment closely
408 - Verify all services are running
409 - Check monitoring dashboards
410 - Verify application functionality
411 - **Fix any errors encountered during deployment**
412 - Be prepared to rollback if issues occur
413 - Document deployment completion
414
415### Step 6: Verification and Testing
416
417For each deployed environment:
418
4191. **Verify Infrastructure:**
420 - All resources are running
421 - Network connectivity is working
422 - DNS resolution is correct
423 - SSL certificates are valid
424 - Security groups are properly configured
425 - Backups are configured and working
426
4272. **Verify Application:**
428 - Application is accessible via public URL
429 - All features are working correctly
430 - Database connections are successful
431 - API endpoints respond correctly
432 - Static assets are served via CDN
433 - Performance is acceptable
434
4353. **Verify CD Pipeline:**
436 - Pipeline executes successfully
437 - Tests run and pass
438 - Deployment completes without errors
439 - Approval gates work correctly
440 - Secrets are properly injected
441
4424. **Verify Monitoring and Logging:**
443 - Metrics are being collected
444 - Logs are being aggregated
445 - Errors are being tracked
446 - Alerts are triggered correctly
447 - Notifications are received
448 - Dashboards display data correctly
449
450### Step 7: Update Documentation Files
451
452**CRITICAL**: Update all deployment files to reflect actual environment:
453
4541. **Update deployment-info.md (if applicable):**
455 - Change from "deployment plan" to "current deployment configuration"
456 - Document actual version numbers released
457 - Document actual installation commands tested and verified
458 - Add links to GitHub releases page
459 - Document the release creation process using playwright-browser-* agent skills
460 - Document actual src/README.md updates made
461 - Add verification results
462 - Add troubleshooting notes for any issues encountered
463 - Document how to create future releases using the browser automation approach
464
4652. **Update infrastructure-plan.md:**
466 - Change from "deployment plan" to "current infrastructure"
467 - Document actual resources created with IDs/ARNs
468 - Document actual costs (if available)
469 - Add verification results
470 - Add troubleshooting notes for any issues encountered
471 - Document how to access and manage infrastructure
472
4733. **Update cd-pipeline.md:**
474 - Change from "deployment plan" to "current pipeline configuration"
475 - Document actual pipeline setup and workflow
476 - Add links to pipeline runs
477 - Add verification results
478 - Add troubleshooting notes for any issues encountered
479 - Document how to trigger and monitor deployments
480
4814. **Update deployment-strategy.md:**
482 - Change from "deployment plan" to "current deployment process"
483 - Document actual deployment steps executed
484 - Add verification results
485 - Add troubleshooting notes for any issues encountered
486 - Document successful deployment timeline
487 - Update rollback procedures based on actual setup
488
4895. **Update monitoring-logging.md:**
490 - Change from "deployment plan" to "current monitoring setup"
491 - Document actual monitoring tools configured
492 - Add dashboard URLs
493 - Add verification results
494 - Add troubleshooting notes for any issues encountered
495 - Document how to access logs and metrics
496
4976. **Update environment-config.md:**
498 - Change from "deployment plan" to "current environment configuration"
499 - Document actual environment variables (without sensitive values)
500 - Document where secrets are stored
501 - Add verification results
502 - Add troubleshooting notes for any issues encountered
503 - Document how to update configuration
504
5057. **Update 10-deployment/README.md:**
506 - Update current deployment status to "Deployed"
507 - Add environment URLs for each deployed environment
508 - Add summary of deployed infrastructure
509 - Add links to monitoring dashboards
510 - Add links to CD pipelines
511 - Note date of deployment completion
512 - Add quick troubleshooting guide
513
514**These updated files now serve as the source of truth for:**
515- Future deployments and updates
516- Infrastructure modifications
517- Troubleshooting deployment issues
518- Onboarding new team members
519- Disaster recovery procedures
520
521### Step 8: Security and Compliance Check
522
5231. **Security Review:**
524 - Verify all secrets are stored securely
525 - Check that no credentials are in code or logs
526 - Verify SSL/TLS is configured correctly
527 - Review security group rules
528 - Check for unnecessary public access
529 - Verify backup encryption
530
5312. **Cost Optimization:**
532 - Review actual costs vs estimates
533 - Identify optimization opportunities
534 - Setup cost alerts
535 - Document cost breakdown
536
5373. **Compliance:**
538 - Document compliance requirements met
539 - Verify data residency requirements
540 - Check backup and retention policies
541
542### Step 9: Final User Review
543
5441. **Inform user that deployment is complete**
5452. **Update README.md:**
546 - Change **Status** from "In Progress" to "Completed"
547 - Add a **Summary** section with key insights (2-3 paragraphs)
548 - Add a **Created Files** section listing all created files
549 - Add **Deployment URLs** section with links to deployed environments
550
5513. **Present completed work to user:**
552 - Show the updated documentation showing actual deployment
553 - Show verification results for all environments
554 - Provide URLs to access deployed application
555 - Share monitoring dashboard links
556 - Confirm everything is working as expected
557 - Provide handoff documentation for ongoing maintenance
558
5594. Ask if they want any adjustments or additional configurations
560
561### Step 10: Commit to Git
562
5631. **Ask user if they want to commit the deployment documentation:**
564 - Stage all changes in `10-deployment/`
565 - Stage any infrastructure as code files created
566 - Stage CD configuration files
567 - Commit with message: "Setup deployment infrastructure and CD pipeline"
568
5692. **Optionally push to remote**
570
571
572## Key Principles
573
574- **Dual-purpose documentation**: Deployment files serve as both initial plans and final documentation
575- **Get confirmation first**: Always get user approval before executing deployment tasks
576- **Security first**: Never expose credentials, always use secrets management
577- **Cost awareness**: Keep user informed of infrastructure costs
578- **Fix errors proactively**: When errors occur during deployment, fix them and retry automatically
579- **Update documentation**: After execution, update files to reflect actual deployment state
580- **Source of truth**: Final documentation becomes the authoritative reference for deployment management
581- **Zero-downtime**: Prioritize deployment strategies that minimize service interruption
582- **Monitoring first**: Ensure monitoring is in place before production deployment
583- **Rollback ready**: Always have a tested rollback plan before deploying to production
584- All configurations should be version-controlled
585- Infrastructure as code should be preferred over manual configuration
586- Deployment should be automated and repeatable
587- Documentation should be clear for both humans and AI agents