kid-sid/claude-spellbook/ci-cd

Claude Code and agent skill by kid-sid/claude-spellbook

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

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

Use when setting up or debugging GitHub Actions pipelines — adding quality gates, configuring OIDC cloud auth, building matrix test runs, publishing artifacts to GHCR/PyPI/npm, or promoting builds from staging to production.

Install

npx vskill@latest install kid-sid/claude-spellbook/ci-cd

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as kid-sid/claude-spellbook/ci-cd.

CI/CD with GitHub Actions

A complete reference for building robust, secure, and efficient CI/CD pipelines using GitHub Actions, covering everything from workflow anatomy to multi-environment deployment promotion.

When to Activate

  • Creating or modifying a GitHub Actions workflow
  • Adding a quality gate (coverage, lint, security scan) to a pipeline
  • Setting up CD with environment promotion from staging to production
  • Optimizing a slow CI pipeline with caching or parallelism
  • Publishing a Docker image, Python package, or npm package from CI
  • Configuring secrets and OIDC-based cloud authentication

Workflow Anatomy

Every GitHub Actions workflow is defined in .github/workflows/*.yml. Understanding the core building blocks is essential before composing pipelines.

Triggers
TriggerUse Case
pushRun on commits to specified branches or tags
pull_requestRun on PR open, sync, or reopen
workflow_dispatchManual trigger with optional input parameters
scheduleCron-based triggers (e.g., nightly security scans)
workflow_callReusable workflow called by another workflow
Jobs
  • Jobs run in parallel by default unless needs: is specified.
  • Use needs: [job-a, job-b] to declare dependencies; a job waits for all listed jobs to succeed.
  • Each job runs in a fresh virtual machine (or container).
Steps
  • uses: — invokes a reusable action from the marketplace or a local path.
  • run: — executes a shell command directly on the runner.
  • Steps within a job share the same filesystem and runner environment.
Key Contexts
ContextWhat It Provides
githubRepo name, SHA, ref, event name, actor, run ID
secretsEncrypted secret values; never printed in logs
envEnvironment variables set at workflow, job, or step level
matrixCurrent values from the strategy matrix
jobCurrent job status, container info
Expression Syntax

All dynamic values use ${{ expression }} syntax:

yaml
if: github.ref == 'refs/heads/main'
run: echo "SHA is ${{ github.sha }}"
env:
BRANCH: ${{ github.ref_name }}
Minimal Workflow Skeleton
yaml
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run tests
run: make test

Standard Pipeline Structure

The canonical stage sequence moves from fast feedback (lint) to slower gates (security), then publishing.

lint → test → build → security-scan → publish
Job Dependency Graph
yaml
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint
run: make lint
test:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test
run: make test
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: make build
security-scan:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Security scan
run: make scan
publish:
needs: [build, security-scan]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Publish
run: make publish
fail-fast Behavior
SettingWhen to Use
fail-fast: true (default)Sequential stage pipelines — stop early on first failure
fail-fast: falseMatrix builds — collect all results before deciding

Use fail-fast: false in matrix strategies so you see failures across all OS/version combinations rather than stopping at the first one.


Dependency Caching

Caching package manager dependencies is the single highest-impact optimization for CI speed. The key strategy: hash the lockfile so the cache automatically invalidates when dependencies change.

Cache Key Strategy
cache-key = runner-os + lockfile-hash
restore-key = runner-os (fallback to most recent cache)
Python
yaml
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip' # built-in caching, hashes requirements*.txt

For more control with pyproject.toml:

yaml
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
Node.js
yaml
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm' # hashes package-lock.json automatically

For pnpm or yarn, set cache: 'pnpm' or cache: 'yarn' respectively.

Go
yaml
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true # caches $GOPATH/pkg/mod and build cache
Cache Hit Rate Tips
  • Always commit lockfiles (package-lock.json, poetry.lock, go.sum) to the repository.
  • Use hashFiles('**/package-lock.json') to scope cache keys to the exact dependency set.
  • Restore keys act as fallbacks: a partial hit is better than no cache.

Matrix Builds

Matrix builds let a single job definition run across multiple configurations (language versions, operating systems) in parallel.

Matrix Strategy
yaml
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13']
os: [ubuntu-latest, windows-latest]
include:
- python-version: '3.12'
os: ubuntu-latest
publish: true # custom flag for conditional steps
exclude:
- python-version: '3.11'
os: windows-latest # skip known unsupported combo
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- run: pytest
- name: Publish (only from designated matrix entry)
if: matrix.publish == true
run: make publish
Matrix Reference
FeatureSyntaxPurpose
Access value${{ matrix.python-version }}Use current dimension value in steps
includeAdds extra key-value pairs to specific entriesInject flags or override runner for one combo
excludeRemoves specific combinationsSkip known broken or unnecessary combos
fail-fastfalse on matrixSee all failures, not just first

Quality Gates

Coverage Threshold

Fail the build if coverage drops below the required threshold.

yaml
- name: Run tests with coverage
run: pytest --cov=src --cov-report=xml --cov-fail-under=80
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: true

For Node.js with Jest:

yaml
- name: Run tests with coverage
run: jest --coverage --coverageThreshold='{"global":{"lines":80}}'
Inline Lint Annotations with reviewdog

reviewdog posts lint results as PR review comments, making issues visible without reading raw logs.

yaml
- uses: reviewdog/action-flake8@v3
with:
reporter: github-pr-review
level: warning
yaml
- uses: reviewdog/action-eslint@v1
with:
reporter: github-pr-review
eslint_flags: '--ext .js,.ts src/'
Branch Protection Rules

Configure these in GitHub Settings → Branches, not in workflow YAML:

  • Required status checks: list every CI job name that must pass before merge.
  • Required approvals: minimum 1 reviewer for main.
  • Dismiss stale approvals: re-approval required after new commits are pushed.
  • Require branches to be up to date: prevents merging outdated branches.
Security Scanning
yaml
- name: Python dependency audit
run: pip-audit
- name: Node audit
run: npm audit --audit-level=high
- name: Go vulnerability check
run: govulncheck ./...

For container scanning, integrate Trivy:

yaml
- uses: aquasecurity/trivy-action@master
with:
image-ref: ghcr.io/${{ github.repository }}:${{ github.sha }}
severity: 'CRITICAL,HIGH'
exit-code: '1'

Secrets and Environment Variables

Contexts
yaml
env:
APP_ENV: production # plain env var (visible in logs)
DB_HOST: ${{ vars.DB_HOST }} # repository variable (not secret, visible)
API_KEY: ${{ secrets.API_KEY }} # encrypted secret (masked in logs)
Variable Scoping
ScopeSet InAvailable To
WorkflowTop-level env: blockAll jobs and steps
Jobenv: under a specific jobAll steps in that job
Stepenv: under a specific stepThat step only
RepositoryGitHub Settings → Secrets and VariablesAll workflows in the repo
EnvironmentGitHub Settings → EnvironmentsJobs using that environment
$GITHUB_TOKEN Permissions

Declare only what the job requires (principle of least privilege):

yaml
permissions:
contents: read # read repo files
packages: write # push to GHCR
id-token: write # request OIDC token for cloud auth
pull-requests: write # post PR comments
checks: write # create check runs

Set permissions: {} at the workflow level, then grant specific permissions per job to minimize blast radius.

OIDC for Cloud Auth (No Long-Lived Credentials)

OIDC eliminates the need to store cloud credentials as GitHub secrets. The cloud provider verifies the workflow's identity token and grants temporary credentials.

AWS:

yaml
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::123456789:role/github-actions
aws-region: us-east-1

Requires an IAM role with a trust policy that allows token.actions.githubusercontent.com as an OIDC provider.

Google Cloud:

yaml
- uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/123/locations/global/workloadIdentityPools/my-pool/providers/github
service_account: deployer@my-project.iam.gserviceaccount.com

Requires a Workload Identity Pool configured in GCP with a GitHub OIDC provider binding.

Azure:

yaml
- uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

Uses federated credentials on the Azure App Registration — no client secret stored.


CD and Environment Promotion

The standard promotion pattern: build once, deploy to staging automatically, then gate production behind a manual approval.

Staging → Production Pipeline

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

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

Source

Popularity

Repository stars
186
Repository forks
15
7-day trend score
26

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

Extension points

  • hookPre/post lifecycle hooks

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/kid-sid/claude-spellbook/ci-cd/badge)](https://verified-skill.com/skills/kid-sid/claude-spellbook/ci-cd)

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