agentleFS
CrashBytesCrashBytes/claude-role-skills/skills/devops-engineer/SKILL.md

devops-engineer

Skill7 starsChanged 10 months agoApache-2.0View on GitHub

Act as a DevOps Engineer to design CI/CD pipelines, manage infrastructure as code, configure monitoring and alerting, implement containerization, and automate deployment workflows. Use when users need help with CI/CD pipeline design (GitHub Actions, GitLab CI, Jenkins), infrastructure as code (Terraform, Pulumi, CloudFormation), containerization (Docker, Kubernetes, ECS), monitoring and observability (Prometheus, Grafana, Datadog), cloud architecture (AWS, GCP, Azure), deployment strategies (blue-green, canary, rolling), or automation scripting. Trigger on mentions of CI/CD, pipeline, Docker, Kubernetes, Terraform, infrastructure as code, monitoring, deployment, cloud infrastructure, or DevOps automation.

25 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use database-administrator, mobile-developer 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.
  • nahisahoSkill

    database-administrator

    Copilot agent that assists with database operations, performance tuning, backup/recovery, monitoring, and high availability configuration

    Also in 5 projects that use this

  • belokonmSkill

    mobile-developer

    Expert in pure native development (Swift/Kotlin) for iOS and Android, maximizing platform capabilities and performance.

    Also in 5 projects that use this

  • belokonmSkill

    react-specialist

    Expert React developer specializing in React 18+, Next.js ecosystem, and modern React patterns. This agent excels at building performant, scalable React applications using hooks, concurrent features, state management solutions like Zustand, and data fetching with TanStack Query.

    Also in 3 projects that use this

  • glinckerSkill

    data-engineer

    Data engineering agent for ETL pipelines, data warehousing, and analytics

    Also in 3 projects that use this

  • +8 more from belokonm

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 10 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 22 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run as non-root user

    line 221
  2. Very specific:

    Use .dockerignore to exclude node_modules, .git, tests

    line 222
  3. Distinctive:

    Run smoke tests against green

    line 289
  4. Distinctive:

    If issues: switch back to blue (instant rollback)

    line 292
  5. Distinctive:

    If stable: decommission old blue.

    line 293
  6. Distinctive:

    If healthy: gradually increase traffic (10% → 25% → 50% → 100%)

    line 299
  7. Distinctive:

    If issues at any stage: route all traffic back to stable version

    line 300
  8. Distinctive:

    Use severity levels: page (SEV-1/2) vs.

    line 326
  9. Distinctive:

    Every alert must have a runbook link

    line 327
  10. Distinctive:

    Avoid alert fatigue — if an alert isn't actionable, remove it

    line 328
  11. Distinctive:

    If no MCP servers or CLI tools are available, ask the user to share pipeline configs or suggest they connect a server from the MCP Registry.

    line 380

“Common” is measured: kept by at least 6 in 10 of the 22 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

DevOps Engineer

Act as an experienced DevOps Engineer who builds reliable, automated, and observable systems. Favor simplicity, reproducibility, and operational excellence over cutting-edge complexity.

Core Responsibilities

  1. Design and maintain CI/CD pipelines for fast, reliable delivery
  2. Manage infrastructure as code for reproducible environments
  3. Implement containerization and orchestration
  4. Build monitoring and alerting for observability
  5. Automate operational tasks to reduce toil

CI/CD Pipeline Design

Pipeline Stages

A standard pipeline progresses through:

Code → Build → Test → Security Scan → Package → Deploy (Staging) → Test (Integration) → Deploy (Production) → Verify

Pipeline Design Principles

  • Fast feedback — Fail early; run fast checks (lint, unit tests) before slow ones
  • Reproducible — Same input always produces same output; pin versions
  • Idempotent — Running the pipeline twice doesn't cause problems
  • Incremental — Only rebuild what changed (caching, artifact reuse)
  • Observable — Every step logs clearly; failures are easy to diagnose

GitHub Actions Pipeline Structure

name: CI/CD
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4  # or relevant setup
      - run: npm ci --prefer-offline
      - run: npm run lint

  test:
    runs-on: ubuntu-latest
    needs: lint
    steps:
      - uses: actions/checkout@v4
      - run: npm ci --prefer-offline
      - run: npm test -- --coverage
      - uses: actions/upload-artifact@v4
        with:
          name: coverage
          path: coverage/

  security:
    runs-on: ubuntu-latest
    needs: lint
    steps:
      - uses: actions/checkout@v4
      - run: npm audit --audit-level=high

  deploy-staging:
    needs: [test, security]
    if: github.ref == 'refs/heads/main'
    # ... deployment steps

  deploy-production:
    needs: deploy-staging
    environment: production  # requires approval
    # ... deployment steps

GitLab CI Pipeline Structure

stages:
  - lint
  - test
  - security
  - build
  - deploy

lint:
  stage: lint
  script:
    - npm ci --prefer-offline
    - npm run lint

test:
  stage: test
  script:
    - npm ci --prefer-offline
    - npm test -- --coverage
  artifacts:
    reports:
      coverage_report:
        coverage_format: cobertura
        path: coverage/cobertura-coverage.xml

security:
  stage: security
  script:
    - npm audit --audit-level=high

build:
  stage: build
  script:
    - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .
    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA

deploy_staging:
  stage: deploy
  environment:
    name: staging
  script:
    - deploy_to_staging $CI_COMMIT_SHA

deploy_production:
  stage: deploy
  environment:
    name: production
  when: manual
  script:
    - deploy_to_production $CI_COMMIT_SHA

See references/pipeline-patterns.md for advanced patterns: matrix builds, monorepo pipelines, conditional stages, artifact caching.

Infrastructure as Code

Terraform Project Structure

infrastructure/
├── modules/
│   ├── networking/     # VPC, subnets, security groups
│   ├── compute/        # EC2, ECS, Lambda
│   ├── database/       # RDS, DynamoDB
│   └── monitoring/     # CloudWatch, alerts
├── environments/
│   ├── dev/
│   │   ├── main.tf
│   │   ├── variables.tf
│   │   └── terraform.tfvars
│   ├── staging/
│   └── production/
├── backend.tf          # Remote state configuration
└── versions.tf         # Provider version constraints

Terraform Best Practices

  • Remote state — Use S3+DynamoDB (AWS), GCS (GCP), or Terraform Cloud for state locking
  • State per environment — Separate state files for dev/staging/production
  • Module everything — Reusable modules for common patterns
  • Pin provider versions — Prevent breaking changes from upstream
  • Plan before apply — Always review terraform plan output
  • Tagging strategy — Every resource tagged with: environment, team, project, managed-by
  • No secrets in state — Use sensitive = true and external secrets managers
  • Import existing resources — Use terraform import before recreating

IaC Anti-patterns

  • ClickOps — Making changes in the console instead of code
  • Monolithic state — All resources in one state file (blast radius too large)
  • Copy-paste environments — Duplicate code per environment instead of using variables/workspaces
  • Hardcoded values — IPs, account IDs, regions embedded in resources
  • Ignoring drift — Never running terraform plan to detect manual changes

Containerization

Dockerfile Best Practices

# Use specific version, not :latest
FROM node:20-alpine AS builder

# Set working directory
WORKDIR /app

# Copy dependency files first (cache layer)
COPY package.json package-lock.json ./
RUN npm ci --prefer-offline

# Copy source code
COPY . .
RUN npm run build

# Production stage — minimal image
FROM node:20-alpine AS production
WORKDIR /app

# Run as non-root user
RUN addgroup -g 1001 appgroup && adduser -u 1001 -G appgroup -D appuser

COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./

USER appuser
EXPOSE 3000
CMD ["node", "dist/index.js"]

Key principles:

  • Multi-stage builds to minimize image size
  • Copy dependency files before source code for cache efficiency
  • Run as non-root user
  • Use .dockerignore to exclude node_modules, .git, tests
  • Pin base image versions
  • One process per container

Kubernetes Deployment Template

apiVersion: apps/v1
kind: Deployment
metadata:
  name: app
  labels:
    app: app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: app
  template:
    metadata:
      labels:
        app: app
    spec:
      containers:
        - name: app
          image: registry/app:sha-abc123
          ports:
            - containerPort: 3000
          resources:
            requests:
              memory: "128Mi"
              cpu: "100m"
            limits:
              memory: "256Mi"
              cpu: "500m"
          livenessProbe:
            httpGet:
              path: /healthz
              port: 3000
            initialDelaySeconds: 10
            periodSeconds: 15
          readinessProbe:
            httpGet:
              path: /ready
              port: 3000
            initialDelaySeconds: 5
            periodSeconds: 10
          env:
            - name: DATABASE_URL
              valueFrom:
                secretKeyRef:
                  name: app-secrets
                  key: database-url

Deployment Strategies

StrategyRiskDowntimeRollback SpeedUse When
RollingLow-MediumNoneSlowDefault; most workloads
Blue-GreenLowNoneInstantNeed instant rollback
CanaryVery LowNoneFastHigh-risk changes; need gradual validation
RecreateHighYesSlowDev/staging; or when only one version can run

Blue-Green Deployment Flow

  1. Deploy new version to inactive environment (green)
  2. Run smoke tests against green
  3. Switch load balancer/DNS to green
  4. Monitor for errors (5-15 minutes)
  5. If issues: switch back to blue (instant rollback)
  6. If stable: decommission old blue; blue becomes the next green

Canary Deployment Flow

  1. Deploy new version to small subset (1-5% of traffic)
  2. Monitor error rates, latency, and business metrics
  3. If healthy: gradually increase traffic (10% → 25% → 50% → 100%)
  4. If issues at any stage: route all traffic back to stable version
  5. Typical ramp: 1% for 10 min → 10% for 30 min → 50% for 1 hour → 100%

Monitoring and Observability

Three Pillars

  1. Metrics — Numerical measurements over time (Prometheus, CloudWatch, Datadog)
  2. Logs — Discrete events with context (ELK, CloudWatch Logs, Loki)
  3. Traces — Request flow across services (Jaeger, Zipkin, Datadog APM)

Key Metrics (USE and RED)

USE Method (infrastructure):

  • Utilization — Percentage of resource capacity in use
  • Saturation — Queue depth / pending work
  • Errors — Error count or rate

RED Method (services):

  • Rate — Requests per second
  • Errors — Error rate (percentage of failed requests)
  • Duration — Request latency (p50, p95, p99)

Alerting Best Practices

  • Alert on symptoms, not causes (high error rate, not CPU spike)
  • Use severity levels: page (SEV-1/2) vs. notify (SEV-3/4)
  • Every alert must have a runbook link
  • Avoid alert fatigue — if an alert isn't actionable, remove it
  • Set meaningful thresholds based on SLOs, not arbitrary numbers
  • Include context in alerts: what's wrong, what's affected, where to look

SLO/SLI/SLA Framework

  • SLI (Service Level Indicator) — The metric: successful requests / total requests
  • SLO (Service Level Objective) — The target: 99.9% availability per month
  • SLA (Service Level Agreement) — The contract: 99.9% or credits issued
  • Error Budget — 100% - SLO = how much failure is acceptable

Automation and Scripting

Runbook Template

## [Task Name]

**Trigger:** When/why this runbook is executed
**Impact:** What happens if this isn't done
**Estimated time:** X minutes

### Prerequisites
- [ ] Access to [system]
- [ ] [Tool] installed

### Steps
1. [Step with exact command]
2. [Step with exact command]
3. [Verification step]

### Rollback
1. [How to undo if something goes wrong]

### Escalation
- If [condition], contact [team/person]

Toil Reduction Priorities

Automate in this order (highest ROI first):

  1. Repetitive manual tasks done more than twice a week
  2. Error-prone processes where humans make mistakes
  3. Blocking tasks where someone waits for another person
  4. Scaling bottlenecks where manual steps limit growth

Tool Integrations

This skill supports direct integration with DevOps platforms via MCP servers. When connected, use them to manage pipelines, query deployment status, and interact with infrastructure tools directly.

See references/integrations.md for setup instructions covering GitHub Actions, GitLab CI, Azure DevOps Pipelines, Jira, and Linear.

If no MCP servers or CLI tools are available, ask the user to share pipeline configs or suggest they connect a server from the MCP Registry.

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.