github-actions
Skill0 starsChanged 2 days agoApache-2.0View on GitHub
GitHub Actions workflow authoring for AI coding agents. Analyzes a repo's project type, language, and deployment targets, then generates production-grade CI/CD workflows with security hardening, caching, and optimization. Handles greenfield, brownfield, and audits. Use when the user requests GitHub Actions workflows: CI pipelines, CD deployments, release automation, or scheduled jobs, or when existing workflows need auditing, optimizing, or hardening. Triggers on phrases like "set up CI", "add CI/CD", "deploy on tag", "publish to npm/PyPI", "harden this pipeline", "pin actions to SHA", "OIDC", or "audit my workflows", and when creating or editing files under `.github/workflows/`, `action.yml`/`action.yaml`, or `.github/dependabot.yml`. Also triggers when migrating from GitLab CI, CircleCI, Travis, Jenkins, or Drone to GitHub Actions. Do NOT use for non-GitHub CI systems unless migrating TO GitHub Actions, or for general bash scripting, Makefiles, or local build config.
- Reads credentials
- Installs packages
57 other projects use a version of this.
Adopted by
Most recently taken up by
- AtulPurohit/Antigravity-Awesome-Skillstheir own version, first seen Nov 29, 2026
- anmolnagpal/devops-skillstheir own version, first seen Nov 29, 2026
- Ghost7802/awesome-api-skillstheir own version, first seen Nov 29, 2026
- dhruvanbhalara/skillstheir own version, first seen Nov 29, 2026
- amutaal122/ai-engineer-mastertheir own version, first seen Nov 29, 2026
- jayavibhavnk/claude-skillstheir own version, first seen Nov 29, 2026
Used with
Projects with it also use gitlab-ci, react-native-brownfield-migration and 10 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.
jcsaaddupuySkillgitlab-ci
GitLab CI/CD configuration guide
Also in 6 projects that use this
maikotrindadeSkillreact-native-brownfield-migration
Provides an incremental adoption strategy to migrate native iOS or Android apps to React Native or Expo using @callstack/react-native-brownfield for initial setup. Use when planning migration steps, packaging XCFramework/AAR artifacts, and integrating them into host apps.
Also in 4 projects that use this
ffsshhttiikkSkillnodejs
JavaScript runtime built on Chrome's V8 JavaScript engine
Also in 4 projects that use this
ihiteshguptaSkillterraform
Expert in Infrastructure as Code with Terraform. Use for creating, managing, and versioning infrastructure across cloud providers.
Also in 8 projects that use this
maikotrindadeSkillupgrading-react-native
Upgrades React Native apps to newer versions by applying rn-diff-purge template diffs, updating package.json dependencies, migrating native iOS and Android configuration, resolving CocoaPods and Gradle changes, and handling breaking API updates. Use when upgrading React Native, bumping RN version, updating from RN 0.x to 0.y, or migrating Expo SDK alongside a React Native upgrade.
Also in 3 projects that use this
Sorcha-PlatformSkillgrpc
Build or review gRPC services and clients in .NET. USE FOR: ASP.NET Core gRPC, protobuf contracts, unary or streaming RPC, gRPC client factory, interceptors, deadlines, cancellation, channel reuse, backend service integration. DO NOT USE FOR: broad browser-facing APIs without gRPC-Web tradeoff review, SignalR realtime hubs, plain REST APIs. INVOKES: dotnet build/test and focused service or client smoke checks when code changes.
Also in 3 projects that use this
Other versions57 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 57
- JabRef/jabref★ 4.9ksame name
- callstackincubator/agent-skills★ 1.7ksame name
- tddworks/ClaudeBar★ 1.6ksame name
- OpenHands/extensions★ 167same name
- microsoft/scope★ 93same name
- nitinjain999/platform-skills★ 71same name
- wendylabsinc/claude-skills★ 62same name
- nahid-sparktales/agent-dispatcher★ 59same name
- mujez/claude-skills★ 47same name
- dhruvanbhalara/skills★ 30same name
47 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- doc-authoringSkill
- eli5Skill
- production-readinessSkill
- spec-driven-tddSkill
- text-humanizerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
49 rules. 0 are common, 39 are distinctive, and 10 are very specific to this project.
0
Common
Most of the 44 edited versions we read keep these.
39
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 87
Always run this phase: Before writing any workflow, build a complete picture of the project.
- Distinctive: line 94
Read README.md/CLAUDE.md and manifest files first, then work through the deterministic 12-step detection sequence in …
- Distinctive: line 126
Before planning or writing anything, understand what workflows already exist and assess their state.
- Distinctive: line 185
Match existing conventions: Do NOT impose new conventions on a brownfield project unless the user explicitly requests a style change.
- Distinctive: line 198
Every project needs at minimum:
- Distinctive: line 276
Use the workflow inventory from Phase 1: Do NOT plan from scratch. Plan only what changes.
- Distinctive: line 281
When adding a new workflow to an existing set:
- Distinctive: line 297
When auditing existing workflows for security/performance:
- Distinctive: line 302
DELETE (remove dead workflow)
- Distinctive: line 320
When the user asks to rewrite a specific workflow:
- Distinctive: line 322
Read the existing workflow fully (done in Phase 1)
- Distinctive: line 340
When migrating from another CI system:
- Very specific: line 342
Read the source CI config (.circleci/config.yml, Jenkinsfile, .gitlab-ci.yml)
- Distinctive: line 363
Write each planned workflow using the appropriate template and security rules.
- Distinctive: line 373
Write workflows in this order:
- Very specific: line 388
Apply security hardening: Follow every rule in references/security-hardening.md:
- Distinctive: line 392
Use OIDC for cloud auth where possible
- Distinctive: line 396
Add dependency caching (use setup action's built-in cache where available)
- Distinctive: line 397
Add concurrency groups to cancel stale runs
- Distinctive: line 398
Use matrix strategy for multi-version testing
- Distinctive: line 399
Add path filters to avoid unnecessary runs
- Distinctive: line 400
Verify YAML syntax: Ensure valid YAML, proper indentation, correct GitHub Actions syntax.
- Distinctive: line 415
Apply only planned changes: Follow the delta plan from Phase 2.
- Distinctive: line 416
Do NOT restructure, restyle, or "improve" sections outside scope.
- Distinctive: line 417
Match existing conventions: Use the same naming style, comment style, and patterns discovered in Phase 1.
- Very specific: line 432
Match existing style: If existing workflows use name: Build and Test for jobs, continue that pattern.
- Distinctive: line 435
Preserve structure: Keep the existing job ordering unless it's part of the planned changes.
- Distinctive: line 437
Never silently remove steps: If a step needs removal, note it in your plan and confirm with the user.
- Distinctive: line 440
Refactor only what you're asked to change: Do NOT improve adjacent workflows, fix unrelated issues, or add features not in the plan.
- Distinctive: line 445
When rewriting a specific workflow (user explicitly requested):
- Very specific: line 447
Create from the approved plan: Write the new version using the PRESERVE/REPLACE/ADD breakdown from Phase 2.
- Distinctive: line 451
For preserved content: Keep trigger logic, secrets, and custom scripts intact.
- Distinctive: line 453
For replaced content: Write fresh from repository analysis.
- Distinctive: line 454
For added content: Follow greenfield per-workflow process.
- Distinctive: line 455
Present the full new workflow for review: before replacing.
- Very specific: line 459
Every workflow file follows the same skeleton: explicit name, explicit on: triggers (never defaults), a least-privilege permissions: block, …
- Very specific: line 495
Always recommend adding .github/dependabot.yml to keep both the github-actions ecosystem and project dependencies updated.
- Distinctive: line 504
After writing, verify every workflow against the codebase and GitHub Actions best practices.
- Very specific: line 579
Version workflows alongside code: All workflows live in .github/workflows/.
- Very specific: line 580
Review workflow changes in PRs: Use CODEOWNERS on .github/ to require review for workflow changes.
- Distinctive: line 582
Keep actions updated: Use Dependabot for GitHub Actions ecosystem updates.
- Distinctive: line 602
Dependabot: Keep actions and dependencies updated
- Distinctive: line 603
actionlint: Add as a CI step or pre-commit hook
- Very specific: line 650
Never fabricate action names: If you're unsure an action exists, use a raw run: command instead.
- Very specific: line 653
Never hardcode secrets: Always reference ${{ secrets.* }}.
- Distinctive: line 655
Never write workflows you haven't verified: Check every command, path, and action reference against the actual repository.
- Distinctive: line 675
Missing path filters: Every push triggers every workflow regardless of changes
- Distinctive: line 686
Treating first draft as final: Always verify against the codebase
- Distinctive: line 687
Ignoring existing workflows: Not reading current workflows before modifying
“Common” is measured: kept by at least 6 in 10 of the 44 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.
Files
GitHub Actions Workflow Authoring
Generate production-grade GitHub Actions workflows from systematic repository analysis. Every workflow is security-hardened, performance-optimized, and verified against the codebase.
Workflow Router
Determine the workflow type before starting. This drives which phases apply, which templates to use, and whether to write from scratch or edit existing workflows.
Do any GitHub Actions workflows already exist?
(.github/workflows/*.yml or .github/workflows/*.yaml)
|
NO --> GREENFIELD (no workflows exist)
| Phases: Discover -> Plan -> Write -> Verify
|
YES --> What type of change?
|
+-> New feature/service needs a pipeline
| --> WORKFLOW ENHANCEMENT (brownfield)
| Phases: Discover -> Audit Existing -> Plan (delta) -> Write -> Verify
|
+-> Existing workflow needs fixing/updating
| --> WORKFLOW UPDATE (brownfield)
| Phases: Discover -> Audit Existing -> Plan (delta) -> Write (edit) -> Verify
|
+-> Workflows exist but have security/performance issues
| --> WORKFLOW AUDIT (brownfield)
| Phases: Discover -> Audit Existing -> Plan (assessment) -> Write (edit) -> Verify
|
+-> User wants a specific workflow rewritten
| --> TARGETED REWRITE (brownfield)
| Phases: Discover -> Audit Existing (single workflow) -> Write (replace) -> Verify
|
+-> User wants a specific new workflow type
| --> TARGETED NEW WORKFLOW
| Phases: Discover -> Write (specific) -> Verify
|
+-> Migrating from another CI system
--> CI MIGRATION
Phases: Discover -> Audit Source CI -> Plan -> Write -> VerifySignal detection:
| Signal in request | Likely type |
| "Add CI", "add GitHub Actions", "set up CI/CD" (no workflows exist) | Greenfield |
| "Add CI", "add pipeline" (workflows already exist) | Workflow Enhancement |
| "Fix the CI", "workflow is broken", "build fails" | Workflow Update |
| "Workflow is slow", "optimize CI", "reduce build time" | Workflow Audit |
| "Security audit", "harden workflows", "pin actions" | Workflow Audit |
| "Rewrite the CI", "redo the pipeline" | Targeted Rewrite |
| "Add deploy workflow", "add release pipeline" | Targeted New Workflow |
| "Add Docker build", "publish to npm/PyPI" | Targeted New Workflow |
| "Migrate from Jenkins/CircleCI/GitLab" | CI Migration |
| "Add a cron job", "scheduled workflow" | Targeted New Workflow |
Phase 0: Discover Repository
Always run this phase. Before writing any workflow, build a complete picture of the project. See references/repo-discovery.md for the full discovery method.
What to detect
Read README.md/CLAUDE.md and manifest files first, then work through the deterministic 12-step detection sequence in references/repo-discovery.md (with its file→tool lookup tables) to establish:
- Language and ecosystem and package manager (from manifests and lockfiles: package.json, pyproject.toml, go.mod, Cargo.toml, pom.xml, etc.)
- Framework (Next.js, Django, Spring Boot, Rails, …)
- Build system (Webpack, Vite, Turborepo, Nx, Gradle, Maven, Make, …)
- Test setup and lint/format tools (framework, runner command, config)
- Containerization (Dockerfile, docker-compose, Kubernetes manifests)
- Infrastructure as Code (Terraform, Pulumi, CloudFormation, CDK)
- Monorepo signals (workspace configs, Nx/Turborepo/Lerna)
- Deployment targets (cloud/serverless/Vercel/Netlify/Kubernetes config)
- Existing CI (
.github/workflows/*.yml, plus other systems:.circleci/, Jenkinsfile,.gitlab-ci.yml,.travis.yml) - Branch and release strategy (default branch, protected/release branches, tags, GitHub Releases, changelogs, version files)
Output: Repository Profile
Compile the detected attributes into a mental model (do not write a file unless requested) using the Composite Profile format in references/repo-discovery.md. This profile drives every subsequent phase.
Phase 1: Audit Existing Workflows (Brownfield Only)
Skip this phase for greenfield projects.
Before planning or writing anything, understand what workflows already exist and assess their state.
Read every existing workflow
For each .github/workflows/*.yml file found in Phase 0:
- Read it fully. Parse the YAML structure: triggers, permissions, jobs, steps, secrets usage, caching, matrix strategies.
- Classify its purpose: CI (test/lint/build), CD (deploy), Release (publish/tag), Maintenance (dependabot, stale issues), Scheduled (cron jobs).
- Note its conventions: naming style, job naming, step naming, comment style, environment variable patterns.
- Assess security posture: permissions declared? Actions pinned by SHA? Secrets handling? Fork protections? OIDC usage?
- Assess performance: caching used? Unnecessary steps? Job parallelism? Matrix strategy? Concurrency groups?
Existing workflow inventory
Build a mental inventory:
Existing Workflow Inventory
[file path] | [purpose] | [triggers] | [security: good/fair/poor] | [performance: good/fair/poor]
ci.yml | CI | push, PR | fair (unpinned actions) | fair (no caching)
deploy.yml | CD | push main | good (OIDC, pinned) | good
...What to preserve in brownfield
| Content Type | Example | Preserve? |
| Working trigger logic | Path filters, branch filters | Always |
| Environment-specific secrets | AWS credentials, deploy tokens | Always |
| Custom scripts/steps | Project-specific build logic | Always |
| Concurrency groups | Existing cancel-in-progress logic | Always |
| Job dependencies | Established needs: chains | Default yes |
| Unpinned actions | uses: actions/checkout@v4 | Replace with SHA pin |
| Overly broad permissions | permissions: write-all | Replace with least privilege |
| Duplicated logic | Same steps in multiple workflows | Refactor to reusable |
| Dead workflows | Workflows for removed features | Remove |
Rule: Working workflows are valuable. A workflow that runs correctly is better than a theoretically perfect one that breaks. Preserve working logic and improve incrementally.
Brownfield conventions contract
Extract the workflow conventions from existing files and follow them:
- File naming: kebab-case? snake_case? What prefix/suffix patterns?
- Job naming: How are jobs named? Descriptive or terse?
- Step naming: Named steps or anonymous? Style of names?
- Comment style: Are inline comments used? YAML comments?
- Secret naming: Convention for secret names (SCREAMING_SNAKE, etc.)?
- Environment patterns: How environments are used (if at all)?
Match existing conventions. Do NOT impose new conventions on a brownfield project unless the user explicitly requests a style change.
Phase 2: Plan Workflows
Greenfield planning
Derive a complete CI/CD plan from the repository discovery.
Pipeline architecture
Every project needs at minimum:
- CI workflow (pull request validation):
- Lint/format check
- Type check (if applicable)
- Unit tests
- Build verification
- CI workflow (main branch):
- Everything in PR CI, plus:
- Integration tests (if applicable)
- Artifact building
- Trigger CD (if applicable)
- CD workflow (if deployment target exists):
- Build artifacts/containers
- Deploy to environments (staging, production)
- Environment protection rules
- Release workflow (if library or publishable):
- Version bumping
- Package publishing (npm, PyPI, Maven, crates.io)
- GitHub Release creation
- Maintenance workflows (recommended):
- Dependabot configuration
- Stale issue/PR management
- Scheduled security scans
Workflow plan algorithm
Based on the repository profile from Phase 0:
FOR EACH detected language:
-> Add CI job: setup + install + lint + test + build
-> Select template from references/workflow-templates.md
IF Dockerfile exists:
-> Add Docker build/push job
-> Select registry (GHCR by default)
IF IaC files exist:
-> Add infrastructure validation job (plan on PR, apply on merge)
IF monorepo detected:
-> Add change detection job
-> Make CI jobs conditional on changed paths
-> See references/pipeline-patterns.md for monorepo patterns
IF deployment target detected:
-> Add CD workflow with environment protection
-> See references/pipeline-patterns.md for deployment patterns
IF library (not service):
-> Add release/publish workflow triggered by tags
ALWAYS:
-> Apply security hardening (references/security-hardening.md)
-> Add concurrency groups
-> Add caching for dependencies
-> Set explicit permissions (least privilege)Plan output
Workflow Plan
- .github/workflows/ci.yml — CI pipeline (lint, test, build) on PR + push main
- .github/workflows/deploy.yml — Deploy to staging/prod with environment protection
- .github/workflows/release.yml — Publish package on tag push
- .github/dependabot.yml — Dependency update automationPresent the plan to the user for approval before writing.
Brownfield planning
Use the workflow inventory from Phase 1. Do NOT plan from scratch. Plan only what changes.
Workflow Enhancement: Delta plan
When adding a new workflow to an existing set:
- Identify which EXISTING workflows might be affected (shared secrets, concurrency groups, deployment targets)
- Identify the NEW workflow to create
- For existing workflows, specify ONLY what changes (if anything)
Workflow Delta Plan
- .github/workflows/ci.yml — KEEP (no changes needed)
- .github/workflows/deploy.yml — MODIFY: add staging environment before prod
- .github/workflows/docker.yml — CREATE: Docker build + push to GHCRWorkflow Audit: Assessment plan
When auditing existing workflows for security/performance:
- List all issues found in Phase 1 with severity
- Propose fixes grouped by category (Security > Performance > Maintenance)
- For each workflow: KEEP (as-is), EDIT (fix issues), REWRITE (replace), DELETE (remove dead workflow)
- Present to user for approval
Audit Findings & Plan
ci.yml:
- [Critical] Actions not pinned to SHA → EDIT: pin all actions
- [High] No permissions declared → EDIT: add least-privilege permissions
- [Medium] No dependency caching → EDIT: add cache configuration
deploy.yml:
- [High] Uses long-lived AWS keys → EDIT: migrate to OIDC
- [Low] No concurrency group → EDIT: add concurrency
old-ci.yml:
- [Low] Duplicate of ci.yml → DELETETargeted Rewrite: Single-workflow plan
When the user asks to rewrite a specific workflow:
- Read the existing workflow fully (done in Phase 1)
- Identify what to PRESERVE (working trigger logic, secrets, custom scripts)
- Identify what to REPLACE (insecure patterns, poor performance, outdated actions)
- Identify what to ADD (missing security, caching, concurrency)
- Present the plan
Rewrite Plan: ci.yml
PRESERVE: Trigger logic (push/PR), test matrix (Node 18/20), deploy job dependency
REPLACE: Unpinned actions (pin to SHA), npm install (use npm ci + caching),
missing permissions (add least-privilege)
ADD: Concurrency group, artifact upload for test reports, type checking stepGet user approval before rewriting.
CI Migration plan
When migrating from another CI system:
- Read the source CI config (.circleci/config.yml, Jenkinsfile, .gitlab-ci.yml)
- Map each job/stage to a GitHub Actions equivalent
- Identify feature gaps (some CI features don't map 1:1)
- Plan the migration as a set of new workflows
Migration Plan: CircleCI → GitHub Actions
CircleCI build job → .github/workflows/ci.yml (lint + test + build)
CircleCI deploy job → .github/workflows/deploy.yml (with environment protection)
CircleCI scheduled scan → .github/workflows/security.yml (cron schedule)
Gap: CircleCI orbs used → Replace with equivalent GitHub ActionsPresent the plan to the user for approval before writing.
Phase 3: Write Workflows
Greenfield: Write from scratch
Write each planned workflow using the appropriate template and security rules. See references/workflow-templates.md for ecosystem-specific templates. See references/security-hardening.md for security rules. See references/pipeline-patterns.md for CI/CD patterns.
Writing sequence
Write workflows in this order:
- CI workflow first (validates that the build/test pipeline works)
- CD workflow (deployment depends on CI)
- Release workflow (publishing depends on build)
- Maintenance workflows (dependabot, security scans)
Per-workflow process (greenfield)
For each workflow:
- Select template: Choose from references/workflow-templates.md based on language/ecosystem detected in Phase 0.
- Customize for project: Replace template placeholders with actual commands, paths, versions from the repository profile.
- Apply security hardening: Follow every rule in
references/security-hardening.md:
- Set explicit
permissions:(least privilege) - Pin all actions to full SHA
- Use OIDC for cloud auth where possible
- Protect secrets from fork exposure
- Guard against script injection
- Set explicit
- Add performance optimization:
- Add dependency caching (use setup action's built-in cache where available)
- Add concurrency groups to cancel stale runs
- Use matrix strategy for multi-version testing
- Add path filters to avoid unnecessary runs
- Verify YAML syntax: Ensure valid YAML, proper indentation, correct GitHub Actions syntax.
- Add inline comments: Explain non-obvious choices (why a specific SHA, why a particular cache key, why a permission).
Brownfield: Edit existing workflows
Read before writing. For every workflow you modify, read it fully first (already done in Phase 1). Never modify a workflow you haven't read.
Per-workflow process (brownfield)
For each workflow being modified:
- Re-read the workflow. Confirm your understanding from Phase 1.
- Apply only planned changes. Follow the delta plan from Phase 2. Do NOT restructure, restyle, or "improve" sections outside scope.
- Match existing conventions. Use the same naming style, comment style, and patterns discovered in Phase 1.
- Preserve working logic. Trigger conditions, environment variables, secrets references, and custom scripts survive unless explicitly marked for change.
- Verify every edit. Each changed action version, command, or path must be verified against the codebase.
- Minimize diff. Change only what needs changing. Smaller diffs are easier to review.
Brownfield-specific rules
- Edit, don't rewrite. Unless the user requests a rewrite, modify the existing workflow surgically. Fix the specific issues; leave working steps alone.
- Match existing style. If existing workflows use
name: Build and Testfor jobs, continue that pattern. Do NOT switch toname: build-and-testbecause you prefer it. - Preserve structure. Keep the existing job ordering unless it's part of the planned changes.
- Never silently remove steps. If a step needs removal, note it in your plan and confirm with the user. A step that looks unnecessary may have a non-obvious purpose.
- Refactor only what you're asked to change. Do NOT improve adjacent workflows, fix unrelated issues, or add features not in the plan.
Targeted Rewrite process
When rewriting a specific workflow (user explicitly requested):
- Create from the approved plan. Write the new version using the PRESERVE/REPLACE/ADD breakdown from Phase 2.
- Start from the template in references/workflow-templates.md, then transplant preserved logic into the new structure.
- For preserved content: Keep trigger logic, secrets, and custom scripts intact.
- For replaced content: Write fresh from repository analysis.
- For added content: Follow greenfield per-workflow process.
- Present the full new workflow for review before replacing.
Shared: Workflow structure conventions
Every workflow file follows the same skeleton: explicit name, explicit
on: triggers (never defaults), a least-privilege permissions: block, a
concurrency: group (cancel-in-progress: true, except deploy/release/IaC
workflows — see references/pipeline-patterns.md),
then jobs: whose first step is a SHA-pinned actions/checkout. The CI
templates in references/workflow-templates.md
share this exact header (factored into its "Shared CI header" section); start
from a template rather than reconstructing the skeleton by hand.
Shared: Action version pinning
Always pin actions to full commit SHA (with the version tag as an inline comment); never use tags or branches. See references/security-hardening.md for the rule, rationale, and how to find SHAs.
Shared: Caching strategy
Prefer setup-action caching over raw actions/cache where available —
setup actions handle cache paths and keys automatically from the lockfile:
| Ecosystem | Cache Method |
| Node.js | actions/setup-node with cache: 'npm' (or pnpm/yarn) |
| Python | actions/setup-python with cache: 'pip' (or pipenv/poetry) |
| Go | actions/setup-go (cache on by default) |
| Rust | Swatinem/rust-cache (Cargo.lock + rustc version) |
| Java | actions/setup-java with cache: 'gradle' or 'maven' |
| Ruby | ruby/setup-ruby with bundler-cache: true |
| Generic | actions/cache with a custom lockfile-hash key |
See references/pipeline-patterns.md for cache-key design, Docker layer caching, and the .NET NuGet approach.
Shared: Dependabot configuration
Always recommend adding .github/dependabot.yml to keep both the
github-actions ecosystem and project dependencies updated. Use the canonical
example (with the per-ecosystem id mapping) in
references/workflow-templates.md.
Phase 4: Verify Workflows
After writing, verify every workflow against the codebase and GitHub Actions best practices.
Verification checklist (all workflows)
Each item pairs a requirement with how to detect a violation:
- Valid YAML: proper indentation, no syntax errors
- Triggers correct: events match intent; watch for
on: pushwithout a branch filter (runs on every push) - Permissions declared: explicit
permissions:at workflow or job level — a missing block defaults to overly broad access - Least privilege: no unnecessary write permissions
- Actions pinned: every
uses:is a full SHA — flag any@vNor branch ref - Commands exist: every
run:references valid scripts/tools/paths, and matches the project's actual tooling (e.g. notnpm testwhen the project usespnpm) - Secrets referenced correctly: all
${{ secrets.* }}names exist; no hardcoded credentials in the file - Caching configured: dependencies cached where possible — flag a setup
action used without its
cache:parameter - Concurrency set: a
concurrency:group is present (missing → queue buildup) - Branch filters correct: triggers reference the real default branch (e.g.
not
masterwhen default ismain) - Path filters appropriate:
paths:reference directories that actually exist - Matrix strategy sensible: tested versions current; language/tool versions come from the matrix or config, not hardcoded
- Artifact handling correct: upload/download artifact names are consistent
- Environment protection: deploy jobs reference proper environments
- No script injection: untrusted
${{ github.event.* }}input is never used directly inrun:blocks
Additional brownfield verification
- Preserved logic intact: Trigger conditions, secrets, and custom scripts from existing workflows were not lost
- Conventions maintained: Naming, commenting, and structure style match the rest of the existing workflows
- No unplanned changes: Only the sections identified in the delta plan were modified
- No steps silently removed: Every removal was in the approved plan
- Diff is minimal: Changes are surgical, not a full rewrite (unless Targeted Rewrite was the chosen workflow type)
Verification method
For each workflow:
- Validate YAML syntax by reading it carefully for indentation and structure issues
- Check all referenced paths exist in the repository (scripts, config files, directories)
- Verify action references are valid (action exists, SHA is real)
- Verify commands match the project's actual tools and scripts (check package.json scripts, Makefile targets, etc.)
- Check secret names match what the project expects (documented in README or existing workflows)
- Simulate trigger scenarios mentally: what happens on PR, push to main, tag push, schedule?
- (Brownfield) Compare against original to confirm only planned changes were made
The "how to detect" hint on each verification checklist item above names the common errors to look for (unpinned actions, missing permissions, wrong branch names, dead path filters, wrong commands, missing cache/concurrency, script injection, hardcoded versions).
Phase 5: Maintenance Strategy
Workflows rot when they fall behind ecosystem changes. Embed maintenance practices.
Workflow-as-code principles
- Version workflows alongside code. All workflows live in
.github/workflows/. - Review workflow changes in PRs. Use CODEOWNERS on
.github/to require review for workflow changes. - Keep actions updated. Use Dependabot for GitHub Actions ecosystem updates.
- Delete dead workflows. Unused workflows create confusion and security risk.
- Document non-obvious choices. Inline comments explain WHY, not WHAT.
Automated maintenance (recommend to user)
| Tool | Purpose |
| Dependabot (github-actions ecosystem) | Auto-update action versions |
| actionlint | Lint workflow files for syntax and best practice issues |
CODEOWNERS on .github/ | Require review for workflow changes |
| OpenSSF Scorecard | Automated security assessment of CI/CD practices |
| GitHub branch protection | Require status checks to pass before merge |
Recommend to user
Suggest adding these where relevant:
- Branch protection rules: Require CI to pass before merge
- CODEOWNERS: Protect
.github/directory - Dependabot: Keep actions and dependencies updated
- actionlint: Add as a CI step or pre-commit hook
- Environment protection rules: Require approval for production deploys
Failure Recovery
Workflow issue
|
+-> Can't determine project type
| +-> Read more source files and config
| +-> Check build scripts in package.json/Makefile
| +-> Ask user for clarification
|
+-> Conflicting CI config (multiple systems)
| +-> Ask user which system is canonical
| +-> Treat GitHub Actions as target; other as reference
|
+-> Unsure which actions to use
| +-> Prefer official actions (actions/*, github/*)
| +-> For ecosystem tools, use most-adopted community action
| +-> Check references/workflow-templates.md for recommendations
| +-> When in doubt, use raw `run:` commands instead of actions
|
+-> Existing workflows are complex but fragile (brownfield)
| +-> Preserve working logic first
| +-> Never rewrite from scratch unless user requests it
| +-> Fix one issue at a time, verify between changes
|
+-> Monorepo with unclear service boundaries
| +-> Look for workspace configs (package.json workspaces, nx.json, turbo.json)
| +-> Check for independent package.json/go.mod files in subdirectories
| +-> Ask user to confirm service/package boundaries
|
+-> Migration from another CI system
| +-> Map concepts: jobs->jobs, stages->jobs with needs, orbs->reusable workflows
| +-> Not everything maps 1:1 — document gaps
| +-> Prioritize: get CI working first, optimize later
|
+-> Conventions in existing workflows conflict with best practices (brownfield)
+-> Follow existing conventions (consistency > correctness)
+-> Only change conventions if user explicitly requests it
+-> Exception: always fix critical security issues (unpinned actions,
missing permissions, script injection) regardless of conventionNever fabricate action names. If you're unsure an action exists, use a
raw run: command instead. Verify action names against known actions.
Never hardcode secrets. Always reference ${{ secrets.* }}.
Never write workflows you haven't verified. Check every command, path, and action reference against the actual repository.
Anti-Patterns
Security anti-patterns
- Unpinned actions: Using
@v4instead of@sha— supply chain attack vector - Missing permissions: No
permissions:block — defaults to overly broad access - Script injection: Using
${{ github.event.* }}directly inrun:blocks - Long-lived credentials: Storing AWS/GCP keys as secrets instead of using OIDC
- Fork secret exposure: Running
pull_request_targetwith checkout of PR code - Overly broad
GITHUB_TOKEN: Granting write permissions when read suffices
Performance anti-patterns
- No caching: Reinstalling dependencies from scratch every run
- No concurrency groups: Queue buildup on rapid pushes
- Monolithic workflows: One huge workflow instead of parallel jobs
- Unnecessary triggers: Running full CI on docs-only changes
- Missing path filters: Every push triggers every workflow regardless of changes
- Excessive matrix: Testing on 12 OS/version combos when 4 would suffice
Architecture anti-patterns
- Workflow sprawl: 20 small workflow files with overlapping triggers
- Duplicate logic: Same steps copy-pasted across workflows (use reusable workflows)
- Missing
needs:: Jobs that should be sequential running in parallel - No environment protection: Deploy to production without approval gates
- No Dependabot: Actions and dependencies never updated
Process anti-patterns
- Treating first draft as final: Always verify against the codebase
- Ignoring existing workflows: Not reading current workflows before modifying
- Over-engineering: Adding complex matrix builds for a single-language project
- Premature optimization: Adding self-hosted runners before measuring need
Reference Files
- Repository discovery: See references/repo-discovery.md for deterministic repository analysis: language detection, ecosystem identification, deployment target detection, and monorepo discovery
- Workflow templates: See references/workflow-templates.md for complete YAML templates per ecosystem: Node.js, Python, Go, Rust, Java, Docker, Terraform, and monorepo configurations
- Security hardening: See references/security-hardening.md for permissions model, action pinning with current SHAs, OIDC configuration, secret management, fork protection, and script injection prevention
- Pipeline patterns: See references/pipeline-patterns.md for CI/CD patterns: caching strategies, matrix builds, concurrency groups, reusable workflows, monorepo change detection, deployment strategies, release automation, and scheduled pipelines
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
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.

