kid-sid/claude-spellbook/ci-cd
Claude Code and agent skill by kid-sid/claude-spellbook
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
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-cdSemi-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
| Trigger | Use Case | |
|---|---|---|
push | Run on commits to specified branches or tags | |
pull_request | Run on PR open, sync, or reopen | |
workflow_dispatch | Manual trigger with optional input parameters | |
schedule | Cron-based triggers (e.g., nightly security scans) | |
workflow_call | Reusable 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
| Context | What It Provides | |
|---|---|---|
github | Repo name, SHA, ref, event name, actor, run ID | |
secrets | Encrypted secret values; never printed in logs | |
env | Environment variables set at workflow, job, or step level | |
matrix | Current values from the strategy matrix | |
job | Current job status, container info |
Expression Syntax
All dynamic values use ${{ expression }} syntax:
Minimal Workflow Skeleton
Standard Pipeline Structure
The canonical stage sequence moves from fast feedback (lint) to slower gates (security), then publishing.
Job Dependency Graph
fail-fast Behavior
| Setting | When to Use | |
|---|---|---|
fail-fast: true (default) | Sequential stage pipelines — stop early on first failure | |
fail-fast: false | Matrix 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
Python
For more control with pyproject.toml:
Node.js
For pnpm or yarn, set cache: 'pnpm' or cache: 'yarn' respectively.
Go
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
Matrix Reference
| Feature | Syntax | Purpose | |
|---|---|---|---|
| Access value | ${{ matrix.python-version }} | Use current dimension value in steps | |
include | Adds extra key-value pairs to specific entries | Inject flags or override runner for one combo | |
exclude | Removes specific combinations | Skip known broken or unnecessary combos | |
fail-fast | false on matrix | See all failures, not just first |
Quality Gates
Coverage Threshold
Fail the build if coverage drops below the required threshold.
For Node.js with Jest:
Inline Lint Annotations with reviewdog
reviewdog posts lint results as PR review comments, making issues visible without reading raw logs.
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
For container scanning, integrate Trivy:
Secrets and Environment Variables
Contexts
Variable Scoping
| Scope | Set In | Available To | |
|---|---|---|---|
| Workflow | Top-level env: block | All jobs and steps | |
| Job | env: under a specific job | All steps in that job | |
| Step | env: under a specific step | That step only | |
| Repository | GitHub Settings → Secrets and Variables | All workflows in the repo | |
| Environment | GitHub Settings → Environments | Jobs using that environment |
$GITHUB_TOKEN Permissions
Declare only what the job requires (principle of least privilege):
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:
Requires an IAM role with a trust policy that allows token.actions.githubusercontent.com as an OIDC provider.
Google Cloud:
Requires a Workload Identity Pool configured in GCP with a GitHub OIDC provider binding.
Azure:
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
- SKILL.md in the repositoryCheckingskills/ci-cd/skill.md
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
[](https://verified-skill.com/skills/kid-sid/claude-spellbook/ci-cd)