Agent skill
deployment-patterns
CI/CD pipelines, deployment strategies (rolling, blue-green, canary), health checks, and rollback strategies. Use when setting up CI/CD or preparing production releases.
Install this agent skill to your Project
npx add-skill https://github.com/xbklairith/kisune/tree/main/dev-workflow/skills/deployment-patterns
SKILL.md
Deployment Patterns
Production deployment workflows and CI/CD best practices.
When to Activate
- Setting up CI/CD pipelines
- Planning deployment strategy
- Implementing health checks and readiness probes
- Preparing for a production release
- Configuring environment-specific settings
Deployment Strategies
Rolling (Default)
Replace instances gradually. Old and new run simultaneously.
- Use when: Standard deployments, backward-compatible changes
- Requires: Backward-compatible changes
Blue-Green
Two identical environments. Switch traffic atomically.
- Use when: Critical services, zero-tolerance for issues
- Benefit: Instant rollback (switch back)
Canary
Route small % of traffic to new version first.
- Use when: High-traffic services, risky changes
- Pattern: 5% → 50% → 100%
CI/CD Pipeline
# .github/workflows/ci.yml
name: CI/CD
on:
push: { branches: [main] }
pull_request: { branches: [main] }
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup language runtime
# Use appropriate setup action for your language
- name: Install dependencies
run: <install-command>
- name: Lint
run: <lint-command>
- name: Type check
run: <typecheck-command>
- name: Test with coverage
run: <test-command>
build:
needs: test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/build-push-action@v5
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
deploy:
needs: build
if: github.ref == 'refs/heads/main'
environment: production
runs-on: ubuntu-latest
steps:
- name: Deploy
run: echo "Deploying ${{ github.sha }}"
Pipeline Stages
PR: lint → type check → unit tests → integration tests → preview deploy
Main: lint → type check → tests → build image → staging → smoke tests → production
Health Checks
# Simple health endpoint
GET /health → { "status": "ok" }
# Detailed health (internal monitoring)
GET /health/detailed →
{
"status": "ok" | "degraded",
"version": "<app-version>",
"uptime": <seconds>,
"checks": {
"database": { "status": "ok", "latency_ms": 2 },
"cache": { "status": "ok", "latency_ms": 1 }
}
}
# Return 200 if healthy, 503 if degraded
Environment Configuration
# Validate all required config at startup — fail fast
# Use your language's validation library (Pydantic, Zod, viper, etc.)
Required variables:
APP_ENV: "development" | "staging" | "production"
PORT: integer, default 8080
DATABASE_URL: valid connection string
JWT_SECRET: string, minimum 32 characters
Rules:
- Validate at startup, crash immediately if invalid
- Never hardcode secrets — use environment variables or secret managers
- Different configs per environment (dev/staging/prod)
Rollback Strategy
kubectl rollout undo deployment/app # Kubernetes
# Or redeploy the previous container image tag
Rules:
- Always tag releases with git SHA or semantic version
- Keep previous 3 versions deployable
- Test rollback procedure before you need it
Production Readiness Checklist
Application
- All tests pass (unit, integration, E2E)
- No hardcoded secrets
- Error handling covers edge cases
- Structured logging (no PII)
- Health check endpoint works
Infrastructure
- Docker image reproducible (pinned versions)
- Environment variables documented and validated
- Resource limits set (CPU, memory)
- SSL/TLS on all endpoints
Monitoring
- Application metrics exported
- Alerts for error rate spikes
- Log aggregation set up
- Uptime monitoring on health endpoint
Security
- Dependencies scanned for CVEs
- CORS configured restrictively
- Rate limiting on public endpoints
- Auth/authz verified
- Security headers set
Operations
- Rollback plan tested
- Database migration tested against prod data
- Runbook for common failures
- On-call rotation defined
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
e2e-testing
Playwright E2E testing — Page Object Model, configuration, flaky test strategies, and CI/CD integration. Use when writing, debugging, or configuring E2E tests.
brainstorming
Collaborative refinement of rough ideas into clear requirements/designs through systematic questioning. Use when requirements are vague or exploring architectural options.
agentic-engineering
Operate as an agentic engineer — eval-first execution, task decomposition, cost-aware model routing (Haiku/Sonnet/Opus). Use when setting up AI-assisted workflows or optimizing model routing.
test-driven-development
Strict RED-GREEN-REFACTOR enforcement with no exceptions. Use when implementing features or fixing bugs. No production code without a failing test first.
api-design
REST API design patterns — resource naming, status codes, pagination, filtering, error responses, versioning, and rate limiting. Use when designing, reviewing, or documenting API endpoints.
spec-driven-planning
MANDATORY planning — creates specs in docx/features/ with EARS requirements and technical design. MUST activate instead of ad-hoc planning for any new feature.
Didn't find tool you were looking for?