agentleFS
int2t05int2t05/engineering-skills/skills/08-ship/ci-cd/SKILL.md

ci-cd

Skill3 starsChanged 4 months agoMITView on GitHub

Use when working on CI/CD pipelines and automation — build, test, and deploy automation, pipeline design, and deployment strategies. Triggers on "CI pipeline", "GitHub Actions", "deployment strategy", "CI/CD", "流水线", "持续集成", "部署策略".

  • Reads credentials

25 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use caching, shell-scripting and 5 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.
  • zebbernSkill

    caching

    Caching strategies — invalidation, TTL guidelines, cache keys, cache layers, and when not to cache. Use when implementing or reviewing caching logic.

    Also in 3 projects that use this

  • mylee04Skill

    shell-scripting

    Shell scripting best practices for cross-platform CLI tools

    Also in 3 projects that use this

  • diego-tobalinaSkill

    logging

    Logging best practices for Java (SLF4J/Logback) and Node.js (Winston/Pino). Use for structured logging, log levels, and avoiding sensitive data exposure.

    Also in 3 projects that use this

  • ElasticSkill

    accessibility

    Accessibility guidance for Kibana. Use this skill when working with or reviewing EUI components, resolving a11y-related (@elastic/eui) ESLint issues, and ensuring proper use of ARIA attributes, focus management, keyboard interactions, and accessible naming conventions.

    Also in 5 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

  • NVIDIASkill

    testing

    Run Python and Rust tests for physicsnemo-curator using uv + pytest with coverage reporting via pytest-cov, and cargo-nextest for Rust tests. Includes benchmark workflows with pytest-benchmark and criterion.

    Also in 9 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 4

    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:

    When a change should trigger automated verification.

    line 18
  2. Distinctive:

    Every change goes through these gates before merge — no gate can be skipped.

    line 26
  3. Distinctive:

    Test failure → follow the debugging skill

    line 72
  4. Distinctive:

    After setting up or modifying CI:

    line 109

“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 and Automation

Automate quality gates so no change reaches production without passing tests, lint, type checking, and build. CI/CD is the enforcement mechanism for every other skill — it catches what humans and agents miss, and it does so consistently on every change.

Shift left: catch problems as early in the pipeline as possible. A bug caught in linting costs minutes; the same bug caught in production costs hours. A deployment with 3 changes is easier to debug than one with 30.

When to use

  • Setting up a new project's CI pipeline.
  • Adding or modifying automated checks (lint, types, tests, build, audit).
  • Configuring deployment pipelines or deployment strategies.
  • Debugging CI failures.
  • When a change should trigger automated verification.

Not for: debugging runtime bugs (use debugging); production launch strategy and rollback (use shipping); routine commits (use git-workflow).

Steps

1. Define the quality gate pipeline

Every change goes through these gates before merge — no gate can be skipped. If lint fails, fix lint (don't disable the rule). If a test fails, fix the code (don't skip the test).

Pull Request
  │
  ▼
LINT          → code style + static analysis
TYPE CHECK    → type safety (typed languages only)
UNIT TESTS    → behavior
BUILD         → artifact compiles / bundles
INTEGRATION   → API/DB tests against real deps
E2E (opt.)    → full user journeys in a browser/app
SECURITY      → dependency + secret scan
  │
  ▼
Ready for review

Detect the stack from its manifest, then map each gate to the right command — never assume npm test:

StackManifestLintTestBuild
Node / TSpackage.jsoneslint / prettiernpm test (jest/vitest)npm run build
Pythonpyproject.tomlruff / mypypytestpip build / uv build
Gogo.modgo vet / golangci-lintgo test ./...go build
RustCargo.tomlclippycargo testcargo build --release
Javapom.xml / build.gradlespotbugs / checkstylemvn test / gradle testmvn package / gradle build

2. Configure the CI pipeline (GitHub Actions)

Example: Node.js. For other stacks, swap setup-node for the matching setup action (setup-python, setup-go, rust-toolchain, setup-java) and the commands from the table above. Basic CI (lint → typecheck → test → build → audit) and database-integration CI (Postgres services: block, secrets, migrations) are in references/ci-templates.md — copy and adapt.

E2E (Playwright, or your framework's equivalent) — same shape: install browser deps, build, run the E2E suite. Upload the report directory as an artifact if: failure() so the run isn't a black box.

3. Feed CI failures back to the agent

The power of CI with AI agents is the feedback loop. When CI fails, copy the failure output and feed it to the agent:

"The CI pipeline failed with this error:
[paste specific error]
Fix the issue and verify locally before pushing again."
  • Lint failure → run your linter's auto-fix (npm run lint --fix, ruff check --fix, golangci-lint run --fix) and commit
  • Type error → read the error location and fix the type
  • Test failure → follow the debugging skill
  • Build error → check config and dependencies

4. Choose a deployment strategy

Preview deployments — every PR gets a preview for manual testing (Vercel/Netlify/etc.).

Feature flags — decouple deployment from release. Ship code without enabling it; roll back without redeploying (disable the flag); canary; A/B test. Flag lifecycle: create → enable for testing → canary → full rollout → remove the flag and dead code. Flags that live forever become technical debt — set a cleanup date when you create them. (See the shipping skill for the full flag rollout sequence and thresholds — 5% → 25% → 50% → 100%.)

Staged rollouts — PR merged to main → staging deployment (auto) → manual verification → production deployment → monitor 15-min window → roll back on errors or done.

Rollback plan — every deployment must be reversible. Provide a manual rollback workflow (workflow_dispatch with a version input) that redeploys the specified previous version. YAML templates for preview deployments and rollback are in references/ci-templates.md.

5. Manage environments and secrets

.env.example       → committed (template for developers)
.env               → NOT committed (local development)
.env.test          → committed (test environment, no real secrets)
CI secrets         → stored in GitHub Secrets / vault
Production secrets → stored in deployment platform / vault

CI should never have production secrets. Use separate secrets for CI testing.

6. Automate beyond CI

  • Dependabot / Renovate for automated dependency updates (weekly, limited open PRs; template in references/ci-templates.md).
  • Build Cop — designate someone responsible for keeping CI green. When the build breaks, the Build Cop fixes or reverts, not the person whose change caused the break.
  • PR checks — required reviews (≥1 approval), required status checks (CI must pass), branch protection (no force-pushes to main), auto-merge (when all checks pass and approved).

7. Optimize when the pipeline exceeds 10 minutes

Apply in order of impact: cache dependencies (setup-node cache, setup-python cache, actions/cache for ~/.cargo / ~/go/pkg) → run jobs in parallel (split lint/typecheck/test/build into separate jobs; template in references/ci-templates.md) → only run what changed (path filters; skip e2e for docs-only PRs) → matrix builds (shard test suites) → optimize the test suite (move slow tests to a schedule) → use larger runners.

Verify

After setting up or modifying CI:

  • All quality gates are present (lint, types, tests, build, audit)
  • Pipeline runs on every PR and push to main
  • Failures block merge (branch protection configured)
  • CI results feed back into the development loop
  • Secrets are stored in the secrets manager, not in code
  • Deployment has a rollback mechanism
  • Pipeline runs in under 10 minutes for the test suite

References

  • ${CLAUDE_PLUGIN_ROOT}/references/engineering-principles.md — shared discipline (verify don't assume, surgical scope, simplicity)
  • references/ci-templates.md — Dependabot config, caching/parallelism split jobs, preview deployment, rollback workflow_dispatch

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.