agentleFS
vndeevndee/engineering-skills/.claude/skills/deploy/SKILL.md

deploy

Skill3 starsChanged 8 months agoMITView on GitHub

Use when setting up deployment pipelines, Kubernetes manifests, environment promotion, or production infrastructure for Go, Python, or React applications

  • Reads credentials

100 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use azure-kusto-graph, azure-kusto-irql and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    azure-kusto-graph

    Build and query Kusto graphs from natural language. Covers transient graphs (make-graph), persistent graph models/snapshots, pattern matching (graph-match), shortest paths, connected components, and graph-to-table export. Generates the edges-first thinking: define edges, define node lookups, union, make-graph. WHEN: make-graph, graph-match, graph-shortest-paths, graph-to-table, graph-mark-components, persistent graph, graph model, graph snapshot, build a graph from data, find paths between nodes, pattern matching in graph, connected components, transient graph, Kusto graph, KQL graph.

    Also in 3 projects that use this

  • MicrosoftSkill

    azure-kusto-irql

    Compose IRQL (Incident Response Query Language) queries for Kusto cybersecurity investigations. Translates natural language hunting questions into composable IRQL pipelines using Get_*, Extract_*, and Enrich_* functions. WHEN: IRQL query, security hunt, threat hunting KQL, incident response query, compose hunting pipeline, failed logins, phishing investigation, lateral movement, process execution, file creation events.

    Also in 3 projects that use this

  • pvnarpSkill

    incident

    Guides incident response and post-mortem analysis. Covers triage, mitigation, root cause analysis, and prevention. Use when responding to active incidents, writing post-mortems, or improving incident processes.

    Also in 7 projects that use this

  • ww-w-aiSkill

    starter

    Static web development guide for beginners. Covers HTML/CSS/JavaScript and Next.js App Router basics. Project initialization with "init starter". Triggers: static website, portfolio, landing page, HTML CSS, beginner, 정적 웹, 포트폴리오, 초보자, 静的サイト, 初心者, 静态网站, 初学者, sitio web estático, site statique, statische Website, sito web statico Do NOT use for: fullstack apps (use $dynamic), enterprise (use $enterprise).

    Also in 3 projects that use this

  • +8 more from microsoft

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 85 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Core principle: Every deploy must be reversible.

    line 12
  2. Very specific:

    After docker-build and ci-pipeline are ready

    line 20
  3. Distinctive:

    Add columns as nullable first

    line 202
  4. Distinctive:

    Never rename columns in one step

    line 203
  5. Distinctive:

    Never drop columns until old code is fully replaced

    line 204
  6. Very specific:

    REQUIRED: Update CLAUDE.md with deployment commands and env vars (claude-md)

    line 252

“Common” is measured: kept by at least 6 in 10 of the 85 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Deployment & Infrastructure

Overview

Get code from CI to production safely. Covers environment setup, deployment strategies, and rollback procedures.

Core principle: Every deploy must be reversible. If you can't rollback in under 2 minutes, your deploy process is broken.

When to Use

  • Setting up production deployment for the first time
  • Adding staging environment
  • Configuring Kubernetes manifests
  • Setting up environment promotion (staging -> prod)
  • After docker-build and ci-pipeline are ready

Environment Strategy

local (Docker Compose) -> staging -> production
EnvironmentPurposeDeploy trigger
LocalDevelopmentdocker compose up
StagingTesting, QAPush to staging branch
ProductionUsersPush to main or manual promote

Environment parity: staging should mirror production as closely as possible (same DB engine, same Redis version, same env var structure).

Docker-Based Deployment

Build & Push

# .github/workflows/deploy.yml
deploy:
  runs-on: ubuntu-latest
  needs: [lint, test]
  if: github.ref == 'refs/heads/main'
  steps:
    - uses: actions/checkout@v4

    - uses: docker/login-action@v3
      with:
        registry: ghcr.io
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}

    - uses: docker/build-push-action@v5
      with:
        context: .
        push: true
        tags: |
          ghcr.io/${{ github.repository }}:${{ github.sha }}
          ghcr.io/${{ github.repository }}:latest
        cache-from: type=gha
        cache-to: type=gha,mode=max

Docker Compose (VPS/Simple Deploy)

# docker-compose.prod.yml
services:
  api:
    image: ghcr.io/org/api:latest
    restart: unless-stopped
    environment:
      APP_ENV: production
      DATABASE_URL: ${DATABASE_URL}
      REDIS_URL: ${REDIS_URL}
    ports: ["8000:8000"]
    healthcheck:
      test: wget -q --spider http://localhost:8000/health || exit 1
      interval: 10s
      retries: 3

  web:
    image: ghcr.io/org/web:latest
    restart: unless-stopped
    ports: ["80:80", "443:443"]

  postgres:
    image: postgres:16-alpine
    restart: unless-stopped
    volumes: [pgdata:/var/lib/postgresql/data]
    environment:
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}

volumes:
  pgdata:

Deploy script:

#!/bin/bash
set -euo pipefail

echo "Pulling latest images..."
docker compose -f docker-compose.prod.yml pull

echo "Running migrations..."
docker compose -f docker-compose.prod.yml run --rm api migrate up

echo "Deploying..."
docker compose -f docker-compose.prod.yml up -d --remove-orphans

echo "Verifying health..."
sleep 5
curl -sf http://localhost:8000/health || { echo "Health check failed!"; exit 1; }

echo "Deploy complete."

Kubernetes (k8s)

# k8s/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
spec:
  replicas: 2
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  selector:
    matchLabels:
      app: api
  template:
    metadata:
      labels:
        app: api
    spec:
      containers:
        - name: api
          image: ghcr.io/org/api:TAG
          ports:
            - containerPort: 8000
          env:
            - name: DATABASE_URL
              valueFrom:
                secretKeyRef:
                  name: api-secrets
                  key: database-url
          readinessProbe:
            httpGet:
              path: /health
              port: 8000
            initialDelaySeconds: 5
            periodSeconds: 10
          livenessProbe:
            httpGet:
              path: /health
              port: 8000
            initialDelaySeconds: 15
            periodSeconds: 20
          resources:
            requests:
              cpu: 100m
              memory: 128Mi
            limits:
              cpu: 500m
              memory: 512Mi
---
apiVersion: v1
kind: Service
metadata:
  name: api
spec:
  selector:
    app: api
  ports:
    - port: 80
      targetPort: 8000

Migration Strategy

Always run migrations before deploying new code:

# In CI/CD pipeline
# 1. Run migration
docker run --rm api migrate up
# 2. Deploy new code
kubectl set image deployment/api api=ghcr.io/org/api:$SHA
# 3. Verify
kubectl rollout status deployment/api

Zero-downtime migration rules (from db-migrate / py-migrate):

  • Add columns as nullable first
  • Never rename columns in one step
  • Never drop columns until old code is fully replaced

Rollback Procedures

# Docker Compose
docker compose -f docker-compose.prod.yml pull ghcr.io/org/api:PREVIOUS_TAG
docker compose -f docker-compose.prod.yml up -d

# Kubernetes
kubectl rollout undo deployment/api

# Database (if needed)
# Go
migrate -path migrations -database "$DATABASE_URL" down 1
# Python
alembic downgrade -1

Environment Variables Management

# .env.example (committed — shows structure, no secrets)
APP_ENV=development
DATABASE_URL=postgres://app:secret@localhost:5432/app
REDIS_URL=redis://localhost:6379
JWT_SECRET=change-me
SENTRY_DSN=

# Production: use platform's secret management
# GitHub Actions: Settings -> Secrets
# K8s: kubectl create secret generic api-secrets --from-env-file=.env.prod
# AWS: Parameter Store or Secrets Manager

Deploy Checklist

  • CI passes (lint, type-check, test)
  • Docker image builds successfully
  • Migrations are backward-compatible
  • Health check endpoint works
  • Rollback procedure tested
  • Environment variables configured
  • Secrets are not in code or Docker image
  • Monitoring/alerting configured for the new deploy

Chains

  • REQUIRED: Update CLAUDE.md with deployment commands and env vars (claude-md)
  • Before: docker-build for Dockerfiles, ci-pipeline for CI
  • After deploy: observability for monitoring
  • If broken: incident-response for handling failures

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.