battery-pack-rs/battery-pack/github-ci-fundamentals

Claude Code and agent skill by battery-pack-rs/battery-pack

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Standard GitHub Actions CI structure for Rust projects using ci-battery-pack

Install

npx vskill@latest install battery-pack-rs/battery-pack/github-ci-fundamentals

SKILL.md

GitHub CI Fundamentals

Standard CI structure generated by ci-battery-pack for Rust projects on GitHub Actions.

Setup:
```sh
cargo install cargo-bp
cargo bp new ci --name my-project # full project scaffold
cargo bp add ci -t spellcheck # add individual features to existing projects
```

Workflow Structure

The core CI workflow (ci.yml) runs on PRs, merge queue, and pushes to main. It includes:

JobPurpose
fmtcargo fmt --check
clippyLint with -D warnings
warningscargo check with RUSTFLAGS="-Dwarnings" (separate from clippy so test failures don't hide warnings)
docsrsDocs build with all features under cfg(docsrs)
buildMatrix: stable × nightly, --all-features × --no-default-features
featurescargo hack check --feature-powerset --depth 2 --no-dev-deps
msrvcargo hack check --rust-version (verifies declared MSRV)
lockfilecargo update --workspace --locked (catches stale lockfiles)
minimal-versionsGenerates a minimal-version lockfile, then checks with stable
semvercargo-semver-checks (catches accidental breaking changes)

audit.yml runs RustSec audit-check daily and on Cargo manifest, lockfile, or audit workflow changes. Set audit_issue=false to run cargo audit without issue creation.

dependency-policy.yml runs cargo-deny for licenses, bans, and sources. Set dependency_policy=false to skip it.

The Gate Job Pattern

All jobs feed into a single ci-pass job that uses jq to assert all dependencies succeeded or were skipped:

yaml
ci-pass:
needs: [fmt, clippy, warnings, docsrs, build, features, msrv, lockfile, minimal-versions, semver]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- run: jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'

Set ci-pass as the single required status check in branch protection. This avoids updating branch protection rules every time you add or remove a CI job.

SHA Pinning

All GitHub Actions are pinned to commit SHAs at generation time (e.g., actions/checkout@abc123 # v6.0.2). This follows GitHub's security hardening guidance. Dependabot keeps them updated via the generated dependabot.yml, which also handles Cargo dependency updates (major versions only, since Cargo resolves compatible versions automatically).

Concurrency

PR workflows use concurrency groups to cancel superseded runs:

yaml
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

Adding Features to an Existing Project

Each additional workflow or scaffold is available as a standalone template:

sh
cargo bp add ci -t trusted-publishing # release-plz with OIDC
cargo bp add ci -t binary-release # cross-platform binaries
cargo bp add ci -t fuzzing # cargo-fuzz scaffold + CI
cargo bp add ci -t benchmarks # Criterion + Bencher CI
cargo bp add ci -t security-scanning # RustSec audit workflow
cargo bp add ci -t dependency-policy # cargo-deny licenses, bans, sources
cargo bp add ci -t spellcheck # typos config + workflow
cargo bp add ci -t mutation-testing # cargo-mutants workflow
cargo bp add ci -t clippy-sarif # PR annotations via SARIF
cargo bp add ci -t mdbook # mdBook + GitHub Pages
cargo bp add ci -t xtask # cargo-xtask scaffold
cargo bp add ci -t stress-test # nextest stress testing

Preview before applying: cargo bp show ci -t fuzzing

YAML and TOML files are merged additively (new keys added, existing preserved). Other file types prompt for skip/overwrite.

What the agent can do

  • Run cargo bp new ci --name <project> or cargo bp add ci -t <template> to generate files
  • Edit generated workflow YAML, deny.toml, _typos.toml, release-plz.toml
  • Add or modify Cargo.toml sections (features, metadata, dependencies)
  • Preview templates with cargo bp show ci -t <template>

What requires human action (outside the repo)

These steps involve GitHub/crates.io web UIs that the agent cannot access. After generating files, instruct the user to complete:

  1. Set ci-pass as the required status check in branch protection
  2. See the trusted-publishing skill for release pipeline setup (crates.io + GitHub settings)
  3. See the binary-releases skill for PAT and secret configuration

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
78
Repository forks
12
7-day trend score
22

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/battery-pack-rs/battery-pack/github-ci-fundamentals/badge)](https://verified-skill.com/skills/battery-pack-rs/battery-pack/github-ci-fundamentals)

Something wrong with this skill or its page? Tell us.