/oss-skills:ci-pipelinesfrom oss-skills
Designs fast, fork-friendly CI pipelines for open-source repos. Covers workflow structure, caching, concurrency, branch protection, and keeping CI under 10 minutes.
Ships in oss-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
CI in open source has a constraint that internal CI does not: most PRs come from forks, by people who cannot debug your pipeline and will not wait for it. Design for that.
| Metric | Target | Why |
|---|---|---|
| PR feedback time | < 10 min | Beyond this, contributors context-switch away |
| Lint/format feedback | < 2 min | Fail fast on the cheap stuff |
| Flake rate | < 1% | Above this, red CI gets ignored (see testing-strategy) |
| Fork PR success | 100% of non-secret jobs | A contributor must be able to get green |
The last one is the one projects get wrong. If a fork PR always shows a red X because a deploy job cannot access secrets, every contributor's first experience is failure.
Split by purpose and speed, not into one giant workflow:
.github/workflows/
├── ci.yml # lint + test on PR and push to main — the required check
├── release.yml # tag-triggered publish (see release-engineering)
├── codeql.yml # scheduled security scanning
├── nightly.yml # slow: full matrix, fuzzing, benchmarks, downstream tests
└── docs.yml # deploy docs on merge to main
A minimal, correct ci.yml:
name: CI
on:
push:
branches: [main]
pull_request:
# Cancel superseded runs — the single biggest CI cost saving, one block long
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read # least privilege by default; grant per-job as needed
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '22', cache: 'npm' }
- run: npm ci
- run: npm run lint
- run: npm run typecheck
test:
needs: lint # don't burn matrix minutes on unformatted code
strategy:
fail-fast: false # show every failing cell, not just the first
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: ['20', '22']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: ${{ matrix.node }}, cache: 'npm' }
- run: npm ci
- run: npm test
Details that matter and are usually missing:
concurrency with cancel-in-progress — a contributor pushing five times in ten
minutes should not queue five full matrices.fail-fast: false — otherwise one Windows failure hides three others.permissions: contents: read at the top level, elevated only in the job that
needs it. Default-permissive tokens are the main blast radius in a compromised action.needs: lint — cheap gate first.supply-chain-security).
First-party actions/* by major tag is a defensible compromise; anything else, pin.A full cartesian product is the default and it is almost always wasteful. 3 OS × 4 versions × 2 configs = 24 jobs for a project whose bugs are all on one axis.
Test the corners exhaustively and the middle sparsely:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: ['3.10', '3.13'] # oldest supported + newest
include:
- { os: macos-latest, python: '3.13' }
- { os: windows-latest, python: '3.13' }
- { os: ubuntu-latest, python: '3.12' }
Move the exhaustive matrix to nightly.yml. PRs get fast signal; the full grid still
runs daily and you learn about the rare cell within 24 hours.
Cache the dependency store, never node_modules/.venv themselves — restoring a
partially valid install directory produces confusing failures.
- uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
Rules:
restore-keys for partial hits — a near-miss cache still saves most of the time.cache: 'npm', cache: 'pip').
Use them before hand-rolling.The core security constraint: pull_request from a fork gets a read-only token and
no secrets. This is correct and you should not fight it.
pull_request_target runs with full secrets against the base repo and is the
most dangerous trigger in GitHub Actions. If you use it, never check out the PR
head — that executes attacker-controlled code with your secrets. Use it only for
labeling, commenting, and other metadata work.if: github.event.pull_request.head.repo.full_name == github.repository
workflow_run after CI succeeds, or on push to main.Configure on main:
Name required checks stably. Renaming a job silently makes the old required check unsatisfiable and blocks every PR until someone notices.
In order of impact:
concurrency). Often halves total minutes.pytest -n auto, cargo nextest, sharded jest).paths-filter for monorepos, or a task runner with a
dependency graph (Nx, Turborepo, Bazel).on:
pull_request:
paths-ignore: ['**.md', 'docs/**']
Careful: if the workflow is a required check, paths-ignore makes it never run and
never satisfy the requirement. Use a "skip job that reports success" pattern instead.Public repos get free standard-runner minutes on GitHub-hosted runners; private repos do not. Either way, a 40-minute pipeline costs contributor attention, which is the scarcer resource.
A contributor who cannot understand the failure will abandon the PR.
test (ubuntu, py3.13), not build-2.Run \make test-unit` to
reproduce locally.`- uses: actions/upload-artifact@v4
if: failure()
with: { name: logs-${{ matrix.os }}, path: ./logs }
reviewdog wraps the rest).concurrency block. Wasted minutes and contributor waiting time.pull_request_target + checkout of PR head. Full compromise; treat as critical.@v1 is a moving target someone else controls.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub the-open-agent/oss-skills --plugin oss-skills18 skills in this plugin
/api-designDesign public interfaces for libraries and tools that other people depend on. Use when designing or reviewing a public API surface, deciding what to export, naming functions and CLI flags, adding configuration options, planning deprecations, or when the user asks "is this a good API" or "how do I change this without breaking users". Covers minimal surface area, error design, async and extension patterns, CLI ergonomics, config precedence, and stability guarantees. Also use before a 1.0 release to freeze the interface./code-reviewReview a pull request the way a good open-source maintainer does. Use when reviewing an incoming PR, when the user asks "review this PR" or "is this ready to merge", when triaging a stale PR queue, or when writing review feedback to an external contributor. Covers what to check and in what order, severity levels, phrasing feedback so people come back, handling large or unwanted PRs, first-time contributors, AI-generated submissions, and closing PRs kindly. Complements the built-in /code-review command by adding the maintainer and community dimension./contributor-experienceTurn users into contributors and make their first PR succeed. Use when a project gets stars but no contributions, when first-time PRs stall or get abandoned, when writing or improving CONTRIBUTING.md, when setting up a dev environment that works on the first try, or when the user asks "how do I get contributors" or "why does nobody contribute". Covers the contribution funnel, good first issues, local setup, mentorship, recognition, and onboarding a contributor into a maintainer.