agentleFS
pvnarppvnarp/agent-skills/skills/ci-cd/SKILL.md

ci-cd

Skill1 starsChanged 9 months agoMITView on GitHub

Designs and reviews CI/CD pipelines. Covers build automation, test stages, deployment gates, caching, secrets management, and pipeline optimization. Use when setting up pipelines, debugging CI failures, or improving build times.

25 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use shell-scripting, observability and 4 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.
  • mylee04Skill

    shell-scripting

    Shell scripting best practices for cross-platform CLI tools

    Also in 3 projects that use this

  • OpenAISkill

    observability

    Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.

    Also in 8 projects that use this

  • AnthropicSkill

    incident-response

    Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.

    Also in 7 projects that use this

  • pproencaSkill

    refactoring

    Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles. This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.

    Also in 4 projects that use this

  • xiaobei930Skill

    database

    Database design, query optimization, migrations, and indexing. Use when designing schemas, writing queries, or managing migrations.

    Also in 3 projects that use this

  • akornmeierSkill

    docker

    Guide for using Docker - a containerization platform for building, running, and deploying applications in isolated containers. Use when containerizing applications, creating Dockerfiles, working with Docker Compose, managing images/containers, configuring networking and storage, optimizing builds, deploying to production, or implementing CI/CD pipelines with Docker.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run linter and formatter check (not fix - fail if code isn't formatted)

    line 25
  2. Distinctive:

    Fast: Should complete in under 30 seconds.

    line 27
  3. Distinctive:

    Run smoke tests against staging

    line 48
  4. Distinctive:

    Only run what changed (monorepo: detect affected packages)

    line 67
  5. Distinctive:

    Use matrix builds for multi-version testing, not sequential

    line 68
  6. Distinctive:

    Never echo secrets in logs

    line 83
  7. Distinctive:

    Use CI platform's secret storage (not env vars in config files)

    line 84
  8. Distinctive:

    Reproducing locally: Run the exact same commands CI runs.

    line 146
  9. Distinctive:

    Flaky tests: If a test fails intermittently in CI, it's flaky.

    line 147
  10. Distinctive:

    Cache corruption: If builds fail mysteriously after a dependency change, clear the cache.

    line 148

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

CI/CD Pipeline

A pipeline has one job: prove the code is safe to ship, then ship it. Every step that doesn't serve that goal is waste.

Pipeline Stages

┌──────────┐   ┌──────────┐   ┌──────────┐   ┌──────────┐   ┌──────────┐
│  Lint    │ → │  Build   │ → │  Test    │ → │  Deploy  │ → │  Verify  │
│          │   │          │   │          │   │ (staging)│   │          │
└──────────┘   └──────────┘   └──────────┘   └──────────┘   └──────────┘
                                                  │
                                            ┌─────┴─────┐
                                            │  Deploy   │
                                            │ (prod)    │
                                            └───────────┘

1. Lint & Format

  • Run linter and formatter check (not fix - fail if code isn't formatted)
  • Static analysis / type checking
  • Fast. Should complete in under 30 seconds.

2. Build

  • Compile / bundle production artifact
  • Fail on warnings (treat warnings as errors in CI)
  • Output build artifact for later stages (don't rebuild per stage)

3. Test

  • Unit tests (fast, no external deps)
  • Integration tests (database, APIs - may need service containers)
  • E2E tests (if applicable - run in parallel where possible)
  • Test against the built artifact, not a fresh build

4. Security Checks

  • Dependency vulnerability scan (npm audit, pip-audit, etc.)
  • Secret scanning (detect accidentally committed credentials)
  • SAST (Static Application Security Testing) if available
  • License compliance check (if applicable)

5. Deploy to Staging

  • Automatic on main branch merge
  • Run smoke tests against staging
  • Gate: manual approval or automated health check before production

6. Deploy to Production

  • Triggered by staging gate passing
  • Canary or rolling deploy
  • Automated rollback on health check failure

7. Post-Deploy Verification

  • Smoke tests against production
  • Monitor error rate for 15 minutes
  • Alert if metrics degrade

Pipeline Design Principles

Speed

  • Target: < 10 min for PR checks, < 20 min for full deploy pipeline.
  • Parallelize independent stages (lint + test can run simultaneously)
  • Cache dependencies aggressively (node_modules, pip cache, Docker layers)
  • Only run what changed (monorepo: detect affected packages)
  • Use matrix builds for multi-version testing, not sequential

Caching

# Cache pattern - adapt to your CI platform
cache:
  key: ${{ hashFiles('**/lock-file') }}
  paths:
    - node_modules/        # or .venv/, target/, etc.
    - ~/.cache/            # build tool caches

Cache by lock file hash. Invalidate when dependencies change, not on every commit.

Secrets

  • Never echo secrets in logs
  • Use CI platform's secret storage (not env vars in config files)
  • Rotate secrets on a schedule
  • Scope secrets to the environments that need them (prod secrets not in PR builds)
  • Mask secrets in output automatically

Artifacts

  • Build once, deploy the same artifact everywhere (dev → staging → prod)
  • Tag artifacts with commit SHA or build number
  • Retain artifacts for rollback (keep last N builds)

PR Pipeline vs Main Pipeline

StepPRMain
LintYesYes
BuildYesYes
Unit testsYesYes
Integration testsYesYes
E2E testsOptional (slow)Yes
Security scanYesYes
Deploy stagingNoYes
Deploy productionNoAfter gate

Common CI Platforms

GitHub Actions

on:
  pull_request:
    branches: [main]
  push:
    branches: [main]

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4  # or python, go, etc.
      - run: npm ci
      - run: npm run lint
      - run: npm run build
      - run: npm test

GitLab CI

stages: [lint, build, test, deploy]

lint:
  stage: lint
  script: npm run lint

test:
  stage: test
  script: npm test
  services:
    - postgres:16  # service containers for integration tests

Debugging CI Failures

  1. Reproducing locally: Run the exact same commands CI runs. If it passes locally but fails in CI, the difference is the environment.
  2. Flaky tests: If a test fails intermittently in CI, it's flaky. Fix or delete it. Don't add retries.
  3. Cache corruption: If builds fail mysteriously after a dependency change, clear the cache.
  4. Resource limits: CI runners have limited CPU/memory. Tests that pass locally may OOM in CI.
  5. Timing issues: Tests depending on wall clock time or sleeps are fragile in CI where resources are shared.

Pipeline Review Checklist

  • Every stage has a clear purpose (no "just in case" steps)
  • Pipeline completes in < 10 min for PRs
  • Dependencies cached effectively
  • Secrets not exposed in logs or config
  • Failure messages are actionable (not just "exit code 1")
  • Pipeline works for new contributors (no hidden setup steps)
  • Deploy pipeline has rollback capability
  • Status checks required for PR merge

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.