From devops
Write a CI/CD pipeline configuration — build, test, lint, deploy stages.
How this skill is triggered — by the user, by Claude, or both
Slash command
/devops:write-pipelineThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Write a CI/CD pipeline for $ARGUMENTS.
Write a CI/CD pipeline for $ARGUMENTS.
Before writing any pipeline configuration:
.github/workflows/, .gitlab-ci.yml, Jenkinsfile, azure-pipelines.ymlpackage.json scripts, Makefile, Taskfile, scripts/ directoryEvery pipeline follows this ordering principle: fail fast — cheapest checks first.
Lint/Format → Build → Unit Tests → Integration Tests → Security Scan → Deploy
If any stage fails, subsequent stages do not run. Total pipeline time budget: under 10 minutes for the fast path (lint + build + unit tests).
# Purpose: catch style and type errors in <30 seconds
- name: Lint
run: |
npm run lint
npm run typecheck
npm run format:check # --check flag, never auto-fix in CI
Rules:
# Purpose: compile/bundle and verify the artifact is producible
- name: Build
run: npm run build
Rules:
- name: Unit Tests
run: CI=true npm test -- --coverage
Rules:
CI=true or explicit --run flag)- name: Integration Tests
run: CI=true npm run test:integration
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_PASSWORD: test
Rules:
- name: Security Scan
run: |
npm audit --audit-level=high
# or: trivy fs . --severity HIGH,CRITICAL
Rules:
- name: Deploy
if: github.ref == 'refs/heads/main' && success()
run: ./scripts/deploy.sh
Rules:
Cache aggressively to reduce pipeline time:
# Node.js
- uses: actions/cache@v4
with:
path: node_modules
key: node-${{ hashFiles('package-lock.json') }}
# .NET
- uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ hashFiles('**/*.csproj') }}
# Python
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements*.txt') }}
# Docker layers
- uses: docker/build-push-action@v5
with:
cache-from: type=gha
cache-to: type=gha,mode=max
Rules:
Use matrix builds for multi-version or multi-project testing:
# Multi-version testing
strategy:
matrix:
node-version: [20, 22]
fail-fast: true # Stop all jobs if one fails
# Monorepo auto-discovery
strategy:
matrix:
project: ${{ fromJson(needs.detect-changes.outputs.projects) }}
Rules:
fail-fast: true — no point running other versions if one failsFor monorepo projects:
git diffmoon ci) or similar task runners that resolve the dependency graph automaticallyIf using Moon:
# Moon handles change detection + dependency graph resolution
- name: Run affected checks
run: moon ci # builds/tests all projects affected by changes, in dependency order
Without a task runner, use path filters as a fallback:
# GitHub Actions path filter (manual, no dependency graph awareness)
on:
push:
paths:
- 'services/api/**'
- 'packages/shared/**' # shared dependency — must be listed manually
# Pin action versions to full SHA (not tags)
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# Pin tool versions
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc' # or package.json engines
Rules:
.nvmrc, global.json, .python-version)CI=true or --runPipeline design affects all four DORA metrics: deployment frequency (how often the pipeline runs), lead time for changes (pipeline duration), change failure rate (test/gate effectiveness), and time to restore service (rollback speed).
Deliver:
.github/workflows/*.yml or equivalent).dockerignore or equivalent if building containers/devops:write-dockerfile — pipelines that build containers need a Dockerfile. Ensure the pipeline's build stage matches the Dockerfile's target.npx claudepluginhub hpsgd/turtlestack --plugin devopsProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.