/github-actions:yaml-anchorsfrom github-actions
Replaces repeated configuration in GitHub Actions workflows with YAML anchors and aliases. Identifies duplicate env, services, permissions, and path filters, then refactors them using anchors.
Ships in github-actions. 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.
GitHub Actions parses workflow YAML with anchors and aliases since
18 September 2025.
GitHub rejects the merge key (<<), so an alias overrides nothing: a copy that
differs by one key is out of an anchor's reach.
Read every workflow in .github/workflows/. Find the configuration written more
than once in the same file and record each copy's file, job, and key. These keys
hold most of the duplication.
env maps shared by jobsservices containers, such as a database or a cachepermissionspaths, paths-ignore, and branches filters under on.push and
on.pull_requestruns-on, when it names a set of self-hosted labelsCompare the copies of each block key by key and mark them identical or different. Done when every repeated block has a site list and that verdict.
Anchor a block of three lines or more that is identical across two or more sites in the same file.
Done when each candidate has a verdict: anchor or leave.
Copy each workflow before you change it, so step 4 compares against the file as
it stood. git show HEAD:<file> returns the committed file, which is a
different document whenever the working tree already carries an edit.
cp .github/workflows/ci.yml /tmp/before.yml
&name on the first copy in document order
and *name on each later copy.name, run-name, on, permissions, env, defaults,
concurrency, and jobs - so a workflow has nowhere to park a block of
definitions.&env_vars or &code_paths.${{ ... }}
as text, and the expression evaluates against the job that holds the alias, so
${{ matrix.node }} inside an anchor expands to nothing in a job that has no
matrix.Done when each anchor has at least one alias, and each alias resolves to an anchor written earlier in the file.
Run actionlint on each changed workflow.
actionlint .github/workflows/ci.yml
It reads anchors and aliases, and it reports a merge key by name:
GitHub Actions does not support YAML merge key "<<". A YAML library reports
nothing there, because PyYAML follows YAML 1.1 and expands << in silence.
Then prove the rewrite didn't change behavior.
python3 -c '
import sys, yaml
before, after = (yaml.safe_load(open(p)) for p in sys.argv[1:])
sys.exit(0 if before == after else "workflows differ")
' /tmp/before.yml .github/workflows/ci.yml
Where import yaml raises ModuleNotFoundError, run the same script through
uv run --with pyyaml python -c instead.
zizmor 1.29 audits every alias site and prints each finding at the anchor's
line. A finding repeated on one line describes a different job each time.
Report the blocks that an anchor cannot reach and the reason for each.
on:
push:
paths: &code_paths
- "src/**"
- "package.json"
pull_request:
paths: *code_paths
jobs:
test:
runs-on: ubuntu-latest
services: &postgres
db:
image: postgres:18
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
steps:
- uses: actions/checkout@v6
- run: npm test
integration:
runs-on: ubuntu-latest
services: *postgres
steps:
- uses: actions/checkout@v6
- run: npm run test:integration
Reusing workflow configurations is the source of truth for anchors. If a rule here disagrees with that page, obey the page.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub staticaland/skills --plugin github-actions3 skills in this plugin
/parallel-stepsMake GitHub Actions steps run in parallel with the background, wait, wait-all, cancel, and parallel keywords. Use when the user wants a faster job or asks for background or parallel steps, including a service that later steps use./workflow-namesCheck that every GitHub Actions workflow, job, and step has a name, and write the missing ones in imperative, sentence-case style. Use when the user wants workflow names added, reviewed, or tidied, when a run log shows raw run commands or job ids, or when writing a new workflow.