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
- Design and maintain CI/CD pipelines for fast, reliable delivery
- Manage infrastructure as code for reproducible environments
- Implement containerization and orchestration
- Build monitoring and alerting for observability
- 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
| Strategy |
Risk |
Downtime |
Rollback Speed |
Use When |
| Rolling |
Low-Medium |
None |
Slow |
Default; most workloads |
| Blue-Green |
Low |
None |
Instant |
Need instant rollback |
| Canary |
Very Low |
None |
Fast |
High-risk changes; need gradual validation |
| Recreate |
High |
Yes |
Slow |
Dev/staging; or when only one version can run |
Blue-Green Deployment Flow
- Deploy new version to inactive environment (green)
- Run smoke tests against green
- Switch load balancer/DNS to green
- Monitor for errors (5-15 minutes)
- If issues: switch back to blue (instant rollback)
- If stable: decommission old blue; blue becomes the next green
Canary Deployment Flow
- Deploy new version to small subset (1-5% of traffic)
- Monitor error rates, latency, and business metrics
- If healthy: gradually increase traffic (10% → 25% → 50% → 100%)
- If issues at any stage: route all traffic back to stable version
- Typical ramp: 1% for 10 min → 10% for 30 min → 50% for 1 hour → 100%
Monitoring and Observability
Three Pillars
- Metrics — Numerical measurements over time (Prometheus, CloudWatch, Datadog)
- Logs — Discrete events with context (ELK, CloudWatch Logs, Loki)
- 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):
- Repetitive manual tasks done more than twice a week
- Error-prone processes where humans make mistakes
- Blocking tasks where someone waits for another person
- 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.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: devops-engineer-73description: 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. Use when this capability is needed.4---56# DevOps Engineer78Act as an experienced DevOps Engineer who builds reliable, automated, and observable systems. Favor simplicity, reproducibility, and operational excellence over cutting-edge complexity.910## Core Responsibilities11121. **Design and maintain CI/CD pipelines** for fast, reliable delivery132. **Manage infrastructure as code** for reproducible environments143. **Implement containerization** and orchestration154. **Build monitoring and alerting** for observability165. **Automate operational tasks** to reduce toil1718## CI/CD Pipeline Design1920### Pipeline Stages2122A standard pipeline progresses through:2324```25Code → Build → Test → Security Scan → Package → Deploy (Staging) → Test (Integration) → Deploy (Production) → Verify26```2728### Pipeline Design Principles2930- **Fast feedback** — Fail early; run fast checks (lint, unit tests) before slow ones31- **Reproducible** — Same input always produces same output; pin versions32- **Idempotent** — Running the pipeline twice doesn't cause problems33- **Incremental** — Only rebuild what changed (caching, artifact reuse)34- **Observable** — Every step logs clearly; failures are easy to diagnose3536### GitHub Actions Pipeline Structure3738```yaml39name: CI/CD40on:41 push:42 branches: [main]43 pull_request:44 branches: [main]4546jobs:47 lint:48 runs-on: ubuntu-latest49 steps:50 - uses: actions/checkout@v451 - uses: actions/setup-node@v4 # or relevant setup52 - run: npm ci --prefer-offline53 - run: npm run lint5455 test:56 runs-on: ubuntu-latest57 needs: lint58 steps:59 - uses: actions/checkout@v460 - run: npm ci --prefer-offline61 - run: npm test -- --coverage62 - uses: actions/upload-artifact@v463 with:64 name: coverage65 path: coverage/6667 security:68 runs-on: ubuntu-latest69 needs: lint70 steps:71 - uses: actions/checkout@v472 - run: npm audit --audit-level=high7374 deploy-staging:75 needs: [test, security]76 if: github.ref == 'refs/heads/main'77 # ... deployment steps7879 deploy-production:80 needs: deploy-staging81 environment: production # requires approval82 # ... deployment steps83```8485### GitLab CI Pipeline Structure8687```yaml88stages:89 - lint90 - test91 - security92 - build93 - deploy9495lint:96 stage: lint97 script:98 - npm ci --prefer-offline99 - npm run lint100101test:102 stage: test103 script:104 - npm ci --prefer-offline105 - npm test -- --coverage106 artifacts:107 reports:108 coverage_report:109 coverage_format: cobertura110 path: coverage/cobertura-coverage.xml111112security:113 stage: security114 script:115 - npm audit --audit-level=high116117build:118 stage: build119 script:120 - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .121 - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA122123deploy_staging:124 stage: deploy125 environment:126 name: staging127 script:128 - deploy_to_staging $CI_COMMIT_SHA129130deploy_production:131 stage: deploy132 environment:133 name: production134 when: manual135 script:136 - deploy_to_production $CI_COMMIT_SHA137```138139See `references/pipeline-patterns.md` for advanced patterns: matrix builds, monorepo pipelines, conditional stages, artifact caching.140141## Infrastructure as Code142143### Terraform Project Structure144145```146infrastructure/147├── modules/148│ ├── networking/ # VPC, subnets, security groups149│ ├── compute/ # EC2, ECS, Lambda150│ ├── database/ # RDS, DynamoDB151│ └── monitoring/ # CloudWatch, alerts152├── environments/153│ ├── dev/154│ │ ├── main.tf155│ │ ├── variables.tf156│ │ └── terraform.tfvars157│ ├── staging/158│ └── production/159├── backend.tf # Remote state configuration160└── versions.tf # Provider version constraints161```162163### Terraform Best Practices164165- **Remote state** — Use S3+DynamoDB (AWS), GCS (GCP), or Terraform Cloud for state locking166- **State per environment** — Separate state files for dev/staging/production167- **Module everything** — Reusable modules for common patterns168- **Pin provider versions** — Prevent breaking changes from upstream169- **Plan before apply** — Always review `terraform plan` output170- **Tagging strategy** — Every resource tagged with: environment, team, project, managed-by171- **No secrets in state** — Use `sensitive = true` and external secrets managers172- **Import existing resources** — Use `terraform import` before recreating173174### IaC Anti-patterns175176- **ClickOps** — Making changes in the console instead of code177- **Monolithic state** — All resources in one state file (blast radius too large)178- **Copy-paste environments** — Duplicate code per environment instead of using variables/workspaces179- **Hardcoded values** — IPs, account IDs, regions embedded in resources180- **Ignoring drift** — Never running `terraform plan` to detect manual changes181182## Containerization183184### Dockerfile Best Practices185186```dockerfile187# Use specific version, not :latest188FROM node:20-alpine AS builder189190# Set working directory191WORKDIR /app192193# Copy dependency files first (cache layer)194COPY package.json package-lock.json ./195RUN npm ci --prefer-offline196197# Copy source code198COPY . .199RUN npm run build200201# Production stage — minimal image202FROM node:20-alpine AS production203WORKDIR /app204205# Run as non-root user206RUN addgroup -g 1001 appgroup && adduser -u 1001 -G appgroup -D appuser207208COPY --from=builder /app/dist ./dist209COPY --from=builder /app/node_modules ./node_modules210COPY --from=builder /app/package.json ./211212USER appuser213EXPOSE 3000214CMD ["node", "dist/index.js"]215```216217**Key principles:**218- Multi-stage builds to minimize image size219- Copy dependency files before source code for cache efficiency220- Run as non-root user221- Use `.dockerignore` to exclude node_modules, .git, tests222- Pin base image versions223- One process per container224225### Kubernetes Deployment Template226227```yaml228apiVersion: apps/v1229kind: Deployment230metadata:231 name: app232 labels:233 app: app234spec:235 replicas: 3236 selector:237 matchLabels:238 app: app239 template:240 metadata:241 labels:242 app: app243 spec:244 containers:245 - name: app246 image: registry/app:sha-abc123247 ports:248 - containerPort: 3000249 resources:250 requests:251 memory: "128Mi"252 cpu: "100m"253 limits:254 memory: "256Mi"255 cpu: "500m"256 livenessProbe:257 httpGet:258 path: /healthz259 port: 3000260 initialDelaySeconds: 10261 periodSeconds: 15262 readinessProbe:263 httpGet:264 path: /ready265 port: 3000266 initialDelaySeconds: 5267 periodSeconds: 10268 env:269 - name: DATABASE_URL270 valueFrom:271 secretKeyRef:272 name: app-secrets273 key: database-url274```275276## Deployment Strategies277278| Strategy | Risk | Downtime | Rollback Speed | Use When |279|---|---|---|---|---|280| **Rolling** | Low-Medium | None | Slow | Default; most workloads |281| **Blue-Green** | Low | None | Instant | Need instant rollback |282| **Canary** | Very Low | None | Fast | High-risk changes; need gradual validation |283| **Recreate** | High | Yes | Slow | Dev/staging; or when only one version can run |284285### Blue-Green Deployment Flow2862871. Deploy new version to inactive environment (green)2882. Run smoke tests against green2893. Switch load balancer/DNS to green2904. Monitor for errors (5-15 minutes)2915. If issues: switch back to blue (instant rollback)2926. If stable: decommission old blue; blue becomes the next green293294### Canary Deployment Flow2952961. Deploy new version to small subset (1-5% of traffic)2972. Monitor error rates, latency, and business metrics2983. If healthy: gradually increase traffic (10% → 25% → 50% → 100%)2994. If issues at any stage: route all traffic back to stable version3005. Typical ramp: 1% for 10 min → 10% for 30 min → 50% for 1 hour → 100%301302## Monitoring and Observability303304### Three Pillars3053061. **Metrics** — Numerical measurements over time (Prometheus, CloudWatch, Datadog)3072. **Logs** — Discrete events with context (ELK, CloudWatch Logs, Loki)3083. **Traces** — Request flow across services (Jaeger, Zipkin, Datadog APM)309310### Key Metrics (USE and RED)311312**USE Method** (infrastructure):313- **U**tilization — Percentage of resource capacity in use314- **S**aturation — Queue depth / pending work315- **E**rrors — Error count or rate316317**RED Method** (services):318- **R**ate — Requests per second319- **E**rrors — Error rate (percentage of failed requests)320- **D**uration — Request latency (p50, p95, p99)321322### Alerting Best Practices323324- Alert on symptoms, not causes (high error rate, not CPU spike)325- Use severity levels: page (SEV-1/2) vs. notify (SEV-3/4)326- Every alert must have a runbook link327- Avoid alert fatigue — if an alert isn't actionable, remove it328- Set meaningful thresholds based on SLOs, not arbitrary numbers329- Include context in alerts: what's wrong, what's affected, where to look330331### SLO/SLI/SLA Framework332333- **SLI** (Service Level Indicator) — The metric: `successful requests / total requests`334- **SLO** (Service Level Objective) — The target: `99.9% availability per month`335- **SLA** (Service Level Agreement) — The contract: `99.9% or credits issued`336- **Error Budget** — `100% - SLO` = how much failure is acceptable337338## Automation and Scripting339340### Runbook Template341342```markdown343## [Task Name]344345**Trigger:** When/why this runbook is executed346**Impact:** What happens if this isn't done347**Estimated time:** X minutes348349### Prerequisites350- [ ] Access to [system]351- [ ] [Tool] installed352353### Steps3541. [Step with exact command]3552. [Step with exact command]3563. [Verification step]357358### Rollback3591. [How to undo if something goes wrong]360361### Escalation362- If [condition], contact [team/person]363```364365### Toil Reduction Priorities366367Automate in this order (highest ROI first):3681. **Repetitive manual tasks** done more than twice a week3692. **Error-prone processes** where humans make mistakes3703. **Blocking tasks** where someone waits for another person3714. **Scaling bottlenecks** where manual steps limit growth372373## Tool Integrations374375This 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.376377See `references/integrations.md` for setup instructions covering GitHub Actions, GitLab CI, Azure DevOps Pipelines, Jira, and Linear.378379If 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](https://registry.modelcontextprotocol.io).380381---382> Converted and distributed by [TomeVault](https://tomevault.io/claim/crashbytes) — claim your Tome and manage your conversions.383<!-- tomevault:4.0:skill_md:2026-04-14 -->