ワンクリックで
deployment-patterns
CI/CD, health checks, and rollback patterns. Use when deploying, setting up CI/CD, or writing GitHub Actions.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
CI/CD, health checks, and rollback patterns. Use when deploying, setting up CI/CD, or writing GitHub Actions.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Promotes recurring feedback into the right skill, then guides /compact at phase boundaries.
Testing guidance for pytest, Jest/Vitest, Go, and TDD. Use when writing tests or improving coverage.
Methodical debugging with evidence and hypothesis testing. Use when troubleshooting fails or root cause is unclear.
Create new skills, commands, hooks, or subagents. Use when adding capabilities to Claude Code or Cursor.
PostgreSQL patterns for queries, schema, indexing, security. Use when writing SQL, designing schema, or adding indexes.
Reviews a GitHub PR diff for correctness, security, tests, architecture. Use when asked to review a PR or pull request.
| name | deployment-patterns |
| description | CI/CD, health checks, and rollback patterns. Use when deploying, setting up CI/CD, or writing GitHub Actions. |
<when_to_activate>
<deployment_strategies>
| Strategy | How | Best For | Risk |
|---|---|---|---|
| Rolling | Replace instances gradually | Most deployments | Low |
| Blue-Green | Two identical environments, switch traffic | Zero-downtime, easy rollback | Medium (2x resources) |
| Canary | Route % of traffic to new version | High-traffic, risk-sensitive | Low (gradual) |
</deployment_strategies>
<github_actions>
name: CI/CD
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20 }
- run: npm ci
- run: npm run lint
- run: npm test -- --coverage
- run: npm run build
deploy:
needs: test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./scripts/deploy.sh
- run: curl -f https://myapp.com/health || exit 1
Skip output '<X>' since it may contain secret and the downstream job receives an empty string with no error). Resolve the secret inside the job that uses it, even if that duplicates a setup step. Cross-job outputs are fine for non-sensitive values only.kubectl rollout status deploy/<name> --timeout=5m, OR assert that the deployed image tag matches the head SHA (kubectl get deploy <name> -o jsonpath='{.spec.template.spec.containers[0].image}'), OR pull the running image from observability (Groundcover/Datadog/k8s API) and assert it matches. Either gate the test on rollout-status or fail the test if the image SHA doesn't match. Skipping the confirmation collapses half the test's value into a meaningless number.
</github_actions><health_checks>
# FastAPI
@app.get("/health")
async def health():
return {"status": "ok", "version": settings.VERSION}
@app.get("/health/ready")
async def readiness():
# Check dependencies
await db.execute("SELECT 1")
return {"status": "ready"}
livenessProbe:
httpGet: { path: /health, port: 8000 }
initialDelaySeconds: 10
periodSeconds: 30
readinessProbe:
httpGet: { path: /health/ready, port: 8000 }
initialDelaySeconds: 5
periodSeconds: 10
</health_checks>
```bash # Immediate rollback strategies git revert HEAD && git push # Revert last commit kubectl rollout undo deployment/myapp # K8s rollback docker compose up -d --no-deps app # Redeploy previous image ```Rollback checklist:
<production_readiness>
Universal Application + Infrastructure readiness items live in ~/.claude/rules/infrastructure/references/deployment-checklist.md (entry: ~/.claude/rules/infrastructure/RULE.md §"Deployment — Core Rules"). Operations items kept here because they're org-process, not infra-pattern:
Operations:
<success_criteria>