agentleFS
iulianditaiuliandita/skills/skills/ci-cd/SKILL.md

ci-cd

Skill12 starsChanged yesterdayMITView on GitHub

CI/CD pipelines and runners: GitHub Actions, GitLab CI, Forgejo/Gitea Actions, Woodpecker. Use for failing or flaky jobs, caching, SHA pinning.

39 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use caching, api-versioning and 7 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.
  • wpankSkill

    caching

    Caching strategies, invalidation, eviction policies, HTTP caching, distributed caching, and anti-patterns. Use when designing cache layers, choosing eviction policies, debugging stale data, or optimizing read-heavy workloads.

    Also in 5 projects that use this

  • wpankSkill

    api-versioning

    API versioning strategies — URL path, header, query param, content negotiation — with breaking change classification, deprecation timelines, migration patterns, and multi-version support. Use when evolving APIs, planning breaking changes, or managing version lifecycles.

    Also in 3 projects that use this

  • SentrySkill

    feature-flags

    Gate a Sentry feature behind a FlagPole feature flag. Use when adding a feature flag, registering a flag in temporary.py, checking a flag from Python or the frontend, enabling a flag in tests, or asking where FlagPole rollout config lives. Trigger on "add a feature flag", "gate this behind a flag", "register a flag", "features.has", "api_expose", "OrganizationFeature", "ProjectFeature", "FlagPole".

    Also in 4 projects that use this

  • OpenAISkill

    auth

    Authentication integration guidance — Clerk (native Vercel Marketplace), Descope, and Auth0 setup for Next.js applications. Covers middleware auth patterns, sign-in/sign-up flows, and Marketplace provisioning. Use when implementing user authentication.

    Also in 4 projects that use this

  • MicrosoftSkill

    authentication

    Wire this in whenever the app uses or connects to data — records, a database, entities, per-user data, row-level security — or when the user wants sign-in, accounts, login, or protected pages. Rayfin data is always accessed as an authenticated user, so **data implies auth**; only a static page over public data skips it. The starter ships as a no-auth "hello world" that previews with no backend, and the full Fabric auth scaffolding is already in the project — this skill wires it in: AuthProvider + bootstrapAuth in main.tsx, the route guard in App.tsx, the sign-in page, sign-out, and the env/deploy requirement. Triggers: auth, authentication, sign in, sign-in, login, log in, sign out, logout, account, user, identity, protect route, require login, gated page, data, database, records, per-user, row-level security, who is the current user, Fabric auth, Entra.

    Also in 4 projects that use this

  • HamzaSheikh768Skill

    dependency-injection

    Leverages FastAPI's powerful Depends system for reusable authentication, database sessions, rate limiting, and business logic injection.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 26 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write, review, and architect CI/CD pipelines across GitHub Actions, GitLab CI/CD, Forgejo Actions, Gitea Actions, and Woodpecker.

    line 16
  2. Distinctive:

    Review mode: if auditing an existing pipeline rather than generating one, invert this checklist - each item that fails is a finding.

    line 54
  3. Distinctive:

    Use path filters and matrix limits to keep monorepo pipelines proportional to the change.

    line 85
  4. Distinctive:

    Use OIDC or short-lived federation for cloud deploys instead of long-lived static secrets.

    line 89
  5. Distinctive:

    Keep pull-request workflows from forks read-only unless explicitly isolated.

    line 90
  6. Distinctive:

    If unclear, ask. The platforms have significant differences despite surface similarity.

    line 116
  7. Distinctive:

    Before writing pipeline config:

    line 127
  8. Distinctive:

    Read the appropriate reference file:

    line 137
  9. Very specific:

    Check CI, lockfile consistency, and grouped updates before merging.

    line 165
  10. Very specific:

    All platforms: never echo secrets, never pass as CLI args (visible in ps), never write to artifacts.

    line 210
  11. Distinctive:

    Platform-first: Always confirm which CI/CD platform before writing config.

    line 295
  12. Distinctive:

    Secrets stay out of logs, artifacts, and argv: Never use protected variables on unprotected branches.

    line 297
  13. Very specific:

    Test the pipeline itself: Use act for GitHub Actions or gitlab-ci-local for GitLab, or the platform's dry-run mode.

    line 299

“Common” is measured: kept by at least 6 in 10 of the 26 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 Pipelines: Multi-Platform Production Infrastructure

Write, review, and architect CI/CD pipelines across GitHub Actions, GitLab CI/CD, Forgejo Actions, Gitea Actions, and Woodpecker. The goal is secure, fast, auditable pipelines that satisfy both engineering needs and compliance requirements (PCI-DSS 4.0).

Target versions: see references/versions.md (verified per the receipt date in that file). Do not restate version numbers here.

This skill covers workflow design, security, compliance, cross-platform migration, runners, dependency updates, scanning, review gates, and rollout order.

When to use

  • Writing or reviewing CI/CD pipeline configs (GitHub/Forgejo/Gitea Actions, .gitlab-ci.yml, .woodpecker/*.yaml)
  • Designing pipeline architecture (stages, parallelism, caching, deployment strategies)
  • Hardening pipelines against supply chain attacks (SHA pinning, image signing, provenance)
  • Setting up security scanning in CI (SAST, SCA, container scanning, secret detection)
  • Configuring runners (install, register, executor choice, hardening) - see references/runners.md
  • Setting up caching strategies or artifact management
  • PCI-DSS 4.0 compliance for CI/CD (Req 6.2.1, 6.2.4, 6.3.2, 6.4.2, 6.5.3)
  • Migrating pipelines between platforms (GitLab -> GitHub, GitHub -> Forgejo)
  • Troubleshooting failed pipelines, flaky jobs, or runner issues

When NOT to use

  • Kubernetes manifests, Helm charts, cluster architecture - use kubernetes
  • Dockerfiles, Compose stacks, container image optimization - use docker
  • Terraform/OpenTofu infrastructure-as-code - use terraform
  • Ansible playbooks, configuration management - use ansible
  • Security audits of application code (SAST findings, auth bugs) - use security-audit
  • Correctness review of application code that happens to be pipeline-adjacent - use code-review. Pipeline config review, debugging, architecture, and CI-specific hardening stay in this skill.
  • Database migration or schema work - use databases

AI Self-Check

AI tools consistently produce the same CI/CD mistakes. Before returning any generated pipeline config, verify against this list.

Review mode: if auditing an existing pipeline rather than generating one, invert this checklist - each item that fails is a finding. Work through the list top-to-bottom and report every failure with file and line reference.

  • SHA pinning: all third-party actions/images pinned to full commit SHA or digest, not mutable tags. Add # vX.Y.Z comment for readability. The tj-actions, reviewdog, and Trivy compromises all moved mutable tags.
  • Permissions: explicit permissions: block on every GitHub Actions workflow (read-only default). GitLab: protected variables scoped correctly.
  • No secrets in config: no hardcoded tokens, passwords, or API keys. Use CI/CD secret variables or vault integration.
  • No latest tags: runner images, tool images, and base images pinned to specific versions or SHA256 digests.
  • Caching strategy: dependencies cached correctly (lockfile-based keys), build outputs use artifacts (not cache).
  • Fail-fast security: SAST, dependency scanning, and secret detection run early (not after deployment).
  • Production authorization: honor required environment approvals and the repository deployment policy; preserve explicit authorization already granted for the release, which does not waive required environment protection.
  • SBOM generation: release pipelines generate and attach SBOMs (SPDX or CycloneDX). Useful inventory evidence; mandatory only when an applicable control/policy requires this format.
  • Minimal scope: jobs have minimum required permissions, access only needed secrets, and run only needed steps.
  • No allow_failure without justification: if a job can fail, explain why in a comment.
  • Version pinning on tools: specific versions over floating aliases - node:22, not node:lts; python:3.13, not python:3. Specific versions prevent silent breakage; the SHA pinning item above still applies.
  • Trigger scoping: on: push without branch/path filters runs on every push to every branch - scope to branches: [main] and/or paths: filters. Same for GitLab: rules: with if conditions, not bare only: [pushes].
  • No expression injection (GitHub Actions): ${{ }} expressions never used directly in run: blocks. Assign to env: first. github.event.* is attacker-controlled. Avoid github.ref_name in security-sensitive contexts (injectable via crafted tag/branch names).
  • Self-hosted runners ephemeral on public/untrusted repos: non-ephemeral shell runners on repos that accept outside PRs is the top self-hosted-runner compromise vector. Verify --ephemeral (GitHub, Gitea) or, on Forgejo, a verified single-job exit lifecycle plus fresh per-job host/container state - a capacity limit or daemon restart alone is not ephemerality. Add approval gates for outside contributors. See references/runners.md.
  • Docker socket mount scope: /var/run/docker.sock mounted into a job gives it root on the host. Only acceptable for trusted internal pipelines. Public/shared runners need DinD sidecar or rootless buildkit instead.
  • Scan gate has a baseline, not a blanket block: container/IaC/SAST scanners introduced with exit-code 1 and zero suppression always get disabled. Use the ratchet pattern (non-blocking -> baseline -> block new only) from references/best-practices.md.
  • Ignore-list entries have expiry dates: every .trivyignore, .grype.yaml, Dependabot ignore, or Renovate ignoreDeps entry includes a comment with revisit date + owner. No dates = zombie tech debt.
  • Lockfiles committed: package-lock.json, bun.lock, Cargo.lock, go.sum, uv.lock belong in version control for applications. Manifest-only commits break reproducibility.
  • Auto-merge gated on tests, not just lint: Dependabot/Renovate auto-merge without test coverage of the changed area is a supply-chain shortcut.
  • Runner trust checked: workflow advice distinguishes hosted, self-hosted, fork, and protected-branch execution
  • Mutable references controlled: actions, images, includes, and templates are pinned where supply-chain risk matters
  • Cross-cutting agent hygiene applied - see references/agent-hygiene.md

Performance

  • Key caches by lockfiles and toolchain versions; avoid broad caches that restore stale dependencies.
  • Split quick lint/unit gates from slow integration, image, and deployment jobs.
  • Use path filters and matrix limits to keep monorepo pipelines proportional to the change.

Best Practices

  • Use OIDC or short-lived federation for cloud deploys instead of long-lived static secrets.
  • Keep pull-request workflows from forks read-only unless explicitly isolated.
  • Generate provenance or attestations for release artifacts where the forge supports it.

Workflow

Copy this checklist and track progress:

  • Step 1: Platform identified (or asked)
  • Step 2: Domain chosen
  • Step 3: Triggers, build, test, deploy, compliance, and runner requirements gathered
  • Step 4: Platform reference read and config written
  • Step 5: Linter clean and AI Self-Check passed (loop back to Step 4 on failure)

Step 1: Identify the platform

SignalPlatform
.github/workflows/*.ymlGitHub Actions
.gitlab-ci.ymlGitLab CI/CD
.forgejo/workflows/*.ymlForgejo Actions
.gitea/workflows/*.ymlGitea Actions
.woodpecker/*.yaml or .woodpecker.yamlWoodpecker (Gitea/Forgejo)
User says "work" / "gitlab" / glabGitLab CI/CD
User says "home" / "forgejo" / fjForgejo Actions
User says "gitea"Gitea Actions (or Woodpecker if 1.20 or older)
User says "github" / "ghcr" / ghGitHub Actions

If unclear, ask. The platforms have significant differences despite surface similarity.

Step 2: Determine the domain

  • "Create a CI pipeline for my project" -> Workflow design
  • "Harden my pipeline" / "pin actions" -> Security
  • "Make this PCI compliant" / "SBOM" -> Compliance
  • "Port this from GitLab to GitHub" -> Cross-platform

Step 3: Gather requirements

Before writing pipeline config:

  • What triggers the pipeline? Push, PR/MR, tag, schedule, manual
  • What does it build? Language, runtime, package manager, build tool
  • What does it test? Unit, integration, e2e, linting, typechecking
  • Where does it deploy? K8s, Docker registry, cloud, bare metal
  • What compliance requirements? PCI-DSS, SOC 2, internal policies
  • Self-hosted or managed runners? Affects available tools and caching

Step 4: Apply platform-specific patterns

Read the appropriate reference file:

  • GitHub Actions: references/github-actions.md
  • GitLab CI/CD: references/gitlab-ci.md
  • Forgejo/Gitea Actions and Woodpecker: references/forgejo-gitea-actions.md
  • Self-hosted runners (all 5 implementations): references/runners.md
  • Best practices (deps, linting, scanning, review gates, rollout): references/best-practices.md
  • Supply chain / compliance: references/supply-chain.md

For Forgejo CI/CD, start with the key-differences table in the Forgejo section below.

For a requested deployment pipeline, account for every lifecycle stage selected in Step 3 and include an explicit deployment job or a clearly marked deployment placeholder. Name its target environment and authorization/protection requirement. Label test/build-only output as incomplete for deployment. Do not add a deploy stage to a CI-only request.

Step 5: Validate

Lint generated config (actionlint for GitHub/Forgejo/Gitea Actions, glab ci lint for GitLab). Detect first: command -v actionlint >/dev/null || echo "actionlint missing". If the linter or the AI Self-Check fails, fix the config and return to Step 4; repeat until clean. Report any linter you could not run. actionlint only auto-discovers .github/workflows; pass .forgejo/workflows/*.yml paths explicitly. Declare custom runner labels under self-hosted-runner.labels in actionlint.yaml; never change runs-on only to satisfy the linter.

Dependency update PRs

For Renovate or Dependabot PRs, read the changelog and release notes across the version range, identify affected callers, and choose a behavioral check for the changed dependency. Check CI, lockfile consistency, and grouped updates before merging. See references/dependency-prs.md for triage and when to close or pin an update.

Cross-Platform Patterns

Stage ordering (all platforms)

Select stages by changed behavior, dependencies, and repository policy; this is an ordering guide, not a requirement to run every stage on every PR. Start with fast affected checks. Build or run integration suites when the change can affect their results; reserve unrelated expensive matrices and release work for suitable scheduled, post-merge, or release runs. See references/best-practices.md for check selection and conditional required gates.

lint -> test -> build -> scan -> deploy
  1. Lint first - fastest feedback, catches formatting/syntax early
  2. Test - unit tests, typechecking
  3. Build - compile, bundle, create artifacts
  4. Scan - SAST, dependency audit, container scan (on build output)
  5. Deploy - staging auto, production manual

Caching strategy

WhatCache keyPlatform notes
npm/bun${{ hashFiles('**/package-lock.json') }} or bun.lockGH: actions/cache. GL: cache:key:files. Forgejo: same as GH.
pip${{ hashFiles('**/requirements*.txt') }}GH: setup-python with cache: pip. GL: cache ~/.cache/pip.
poetry${{ hashFiles('**/poetry.lock') }}GH: setup-python with cache: poetry. GL: cache ~/.cache/pypoetry.
uv${{ hashFiles('**/uv.lock') }}GH: astral-sh/setup-uv has built-in cache. GL: cache ~/.cache/uv.
Go${{ hashFiles('**/go.sum') }}GH: actions/setup-go has built-in cache.
Docker layersBuildKit cache mount or registry cacheGH: --cache-from type=gha. GL: --cache-from $CI_REGISTRY_IMAGE:cache.

Rule: cache is a speed optimization, not a correctness mechanism. Artifacts are for inter-job data. Cache may evict at any time - pipelines must work without it.

Secret management

PlatformMechanismScope control
GitHubRepository/org/environment secretsPer-environment, per-repo, per-org. Deployment branches.
GitLabCI/CD variables (project/group/instance)Protected branches/tags, environments, masked in logs.
ForgejoRepository/org secretsPer-repo, per-org. No environment scoping yet.

All platforms: never echo secrets, never pass as CLI args (visible in ps), never write to artifacts. Use environment variables or file-based injection.

Credential lifecycle

Trace issuer trust, job identity, secret injection, downstream permissions, rotation, and revocation. Test expired or revoked credentials in an approved nonproduction job and confirm logs, caches, and artifacts contain no values. Keep provisioning/state concerns with terraform and workload refresh/reload with kubernetes; document the owner at each boundary.

Deployment gates

EnvironmentTriggerApproval
Dev/PreviewRelevant app changes or requested previewPer project policy
StagingMerge to mainNone (auto-deploy)
ProductionTag or manual dispatchRequired reviewer(s)

GitLab: when: manual + environment:. GitHub: environment: with protection rules. Forgejo: manual dispatch (workflow_dispatch).

Monorepo Patterns

For a repo with several services sharing a library, read references/monorepo-patterns.md: path-based triggering, shared library detection, selective builds, and Python monorepo specifics.

Forgejo CI/CD

Forgejo Actions reuses the GitHub Actions syntax without a compatibility guarantee. Read references/forgejo-gitea-actions.md for the key differences from GitHub Actions and the Gitea notes.

PCI-DSS: CI/CD Compliance Mapping

For in-scope systems, map controls to the actual requirement and assessment evidence:

RequirementCI/CD contribution
6.2.3Review bespoke/custom software before release; document coverage and findings handling
6.3.2Maintain software/component inventory; an SBOM can support this
6.5.1Record production change approval, testing, impact, and recovery procedures

Tool presence does not establish compliance. Artifact signing and SBOM formats are useful controls, not universally prescribed PCI implementations. See references/supply-chain.md for assessment boundaries and primary sources.

Template Conventions

  • @<sha> in GitHub Actions templates is a placeholder. Replace with the real 40-character commit SHA for the indicated version. Look up SHAs on the action's releases page or use Dependabot to manage them automatically.
  • Image tags in templates use floating minor versions (e.g., oven/bun:1.2, docker:29.9) for readability. For production, pin to a specific patch version or SHA256 digest. The templates show the minimum acceptable granularity, not the ideal.

Reference Files

  • references/github-actions.md - GitHub Actions patterns, templates, and security hardening
  • references/forgejo-gitea-actions.md - Forgejo Actions templates, SHA discovery, gotchas, and fj; Gitea Actions differences, troubleshooting, Woodpecker patterns, and Drone migration guidance
  • references/gitlab-ci.md - GitLab CI/CD 19.x patterns, SaaS vs self-managed differences, Catalog, Components, security
  • references/runners.md - Self-hosted runners (actions-runner, gitlab-runner, forgejo-runner, gitea-runner, woodpecker-agent) - install, register, executor choice, Linux vs macOS, security hardening
  • references/best-practices.md - Dependency updates (Dependabot/Renovate), layered linting, scanning matrix (secrets/SCA/container/IaC/SAST), review gates, merge queues, rollout order
  • references/supply-chain.md - supply chain security, incident timeline, SHA pinning, SBOM/SLSA, PCI-DSS compliance, image signing, post-compromise response; read its AI-Age Supply Chain Risks section for slopsquatting, AI agents in CI/CD, and prompt injection in pipelines
  • references/versions.md - dated version receipts (pins, sources, security floors)
  • references/monorepo-patterns.md - path-based triggering, shared library detection, selective builds, Python monorepos

Output Contract

See references/output-contract.md for the full contract.

  • Skill name: CI-CD
  • Deliverable bucket: audits
  • Mode: conditional. When invoked to analyze, review, audit, or improve existing repo content, apply the reporting size and evidence rules in references/output-contract.md and write the deliverable to docs/local/audits/ci-cd/<YYYY-MM-DD>-<slug>.md. When invoked to answer a question, teach a concept, build a new artifact, or generate content, respond freely without the contract.
  • Severity scale: P0 | P1 | P2 | P3 | info (see shared contract; only used in audit/review mode).

Related Skills

  • code-review - reviews application-code correctness. Pipeline YAML, expressions, runner behavior, caching, and deployment-job bugs stay in this skill.
  • security-audit - for auditing application code, not pipeline code
  • docker - for Dockerfile and container image optimization
  • kubernetes - for K8s manifests and Helm charts that pipelines deploy to
  • git - for git operations (commits, PRs/MRs, tags, releases) that trigger pipelines. CI/CD reacts to git events; git handles the operations that produce them.

Rules

The AI Self-Check covers SHA pinning, secrets in config, production authorization, and scan ordering; the Caching strategy and PCI sections cover cache vs artifact and compliance evidence. These add:

  • Platform-first. Always confirm which CI/CD platform before writing config. GitHub Actions syntax that "mostly works" in Forgejo will silently break on edge cases.
  • Secrets stay out of logs, artifacts, and argv. Never use protected variables on unprotected branches; GitLab leaves them silently empty there.
  • Test the pipeline itself. Use act for GitHub Actions or gitlab-ci-local for GitLab, or the platform's dry-run mode. Don't discover pipeline bugs in production.

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.