/gavel-skills:gavel-ci-migratorfrom gavel-skills
Migrate a repo's GitHub Actions lint and test workflows onto the flanksource/gavel composite action — discover existing golangci-lint / go test / make lint|test jobs, ask the user per-workflow whether to replace, add alongside, or skip, rewrite YAML with the right permissions and checkout depth, and verify with actionlint without auto-committing
Ships in gavel-skills. 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.
None: SKILL.md is the whole skill.
Switch a repository's GitHub Actions lint/test pipelines to call the flanksource/gavel composite action instead of running golangci-lint / go test / make lint directly. The action runs gavel test --lint, uploads a JSON+HTML+log artifact bundle, and posts a sticky PR comment with a markdown summary.
For running gavel locally, defer to gavel-runner. For writing fixture tests, defer to gavel-fixture-tester. This skill is exclusively about migrating CI pipelines.
The skill is read-only until the user explicitly picks a disposition for each workflow. It never auto-commits.
.gavel.yaml to a repo that still runs lint/test the old way.github/workflows/ directory — nothing to migrate.flanksource/gavel@… — instead, offer to pin or bump the version, not re-migrate.README.md "GitHub Action" section; this skill is for moving off existing lint/test jobs.Inventory CI before proposing anything.
List workflow files:
.github/workflows/*.yml and .github/workflows/*.yaml.For each file, classify every step in every job. Detection cues:
Lint cues (any of these → step is a lint step):
golangci-lint run, golangci/golangci-lint-actionstaticcheck, revive, errcheckgofmt -l, gofumpt -l, goimports -lgo vetmake lint, task lint, mage lintTest cues (any of these → step is a test step):
go test, gotestsum, ginkgo run, ginkgo -rmake test, task test, mage testname: matches /test|coverage|spec/i and runs GoAlready-gavel cues (skip — see "When NOT to Use"):
uses: flanksource/gavel@…gavel test, gavel lint, gavel test --lint in a run: blockFor each workflow, record:
on: push, on: pull_request, …)runs-on:actions/setup-go version source (go-version-file: or pinned go-version:)actions/checkout fetch-depth: (gavel needs 0 for --changed and PR diff)permissions: blockSummarize findings to the user before asking anything. Example (do not paraphrase — show real values):
Found 3 workflows:
- .github/workflows/lint.yml → 1 lint job (golangci-lint-action v9), no PR comment
- .github/workflows/test.yml → 1 test job (go test ./...), uploads coverage.out
- .github/workflows/release.yml → release-only, no lint/test (will skip)
Use AskUserQuestion with structured options. Two questions, asked together (single AskUserQuestion call, two entries in questions):
Multi-select. One option per detected lint/test workflow. Labels:
lint.yml: Replace with gavel args:"lint"lint.yml: Add gavel alongside (keep current job)lint.yml: Skiptest.yml: Replace with gavel args:"test"test.yml: Add gavel alongside (keep current job)test.yml: SkipIf a single workflow contains both a lint job and a test job, collapse to a Replace with gavel args:"test --lint" option instead of offering two replacements.
Single-select:
@main — track latest (good for the gavel repo's own self-test and for early adopters)@v<latest-tag> — pinned to the most recent release tag (recommended for downstream repos; fetch the latest tag with gh release view -R flanksource/gavel --json tagName -q .tagName)source — use a pre-installed gavel binary on $PATH; only relevant when the calling workflow builds gavel from source first (this is what the gavel repo's own .github/workflows/gavel-action.yml does)For each workflow the user might replace, render the proposed before/after directly in the message — not a summary. Use the canonical invocation from gavel's action.yml and README.md as the template. Example output to the user:
# .github/workflows/lint.yml — proposed replacement
# BEFORE
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.11.4
args: --timeout=10m --tests=false
# AFTER
- uses: flanksource/gavel@v<TAG>
with:
args: lint
fail-on-error: "true"
Once the user has picked, rewrite the workflow files. Use Edit (preferred) or Write. Never use heredoc / cat <<EOF.
actions/checkout@v4 precedes the gavel step with fetch-depth: 0. Add or update if needed.permissions:
contents: read
pull-requests: write # only when comment: "true"
Never widen beyond what's needed. If comment: "false" is chosen, drop pull-requests: write.actions/setup-go: remove only if no remaining step in the same job uses the Go toolchain directly. The gavel action handles its own binary; it does not need an explicit Go toolchain step. If the job still has a non-gavel Go step, keep setup-go.actions/upload-artifact for coverage.out / lint output that gavel now produces, remove those steps. Keep uploads for unrelated outputs.make lint / make test invocations in CI. Do not touch the Makefile itself — local developers still use those targets.Lint-only job (golangci-lint-action → gavel):
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: flanksource/gavel@v<TAG>
with:
args: lint
fail-on-error: "true"
Test-only job (go test ./... → gavel):
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: flanksource/gavel@v<TAG>
with:
args: test
fail-on-error: "true"
Combined lint + test (preferred when both exist):
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: flanksource/gavel@v<TAG>
with:
args: test --lint
fail-on-error: "true"
Self-hosted / build-from-source (mirrors gavel's own .github/workflows/gavel-action.yml):
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Build gavel from source
run: |
go install ./cmd/gavel
- uses: flanksource/gavel@v<TAG>
with:
args: test --lint
version: source
continue-on-error: true added to silence gavel failures. If a user asks for that, push back — the right fix is to fix the failure, not hide it..gavel.yaml edits to suppress violations as part of this migration.After the rewrites:
YAML lint: if actionlint is on $PATH, run it on changed files. If it's not, say so explicitly — do not silently skip.
command -v actionlint && actionlint .github/workflows/*.yml
Show the final diff:
git diff -- .github/workflows/
Suggest validation:
act -j <jobname> locally if act is installed (note: act doesn't perfectly replicate GitHub-hosted runners; treat as a smoke test).Do not commit. Leave the changes in the working tree. The human reviews and commits.
strategy.matrix: { os: [ubuntu, macos, windows] } → single Ubuntu, surface the loss to the user before applying. Some teams genuinely need multi-OS test coverage; the right answer there is "skip migration of this workflow" until gavel supports matrices natively.working-directory:. Distinct comment-header: per module so each module gets its own sticky PR comment instead of one overwriting the other.go test -coverprofile=coverage.out followed by codecov/codecov-action, keep the test step and add gavel alongside, or wait until coverage is part of gavel's artifact set before replacing.actions/setup-go with cache: true: dropping setup-go also drops Go-module caching. If the existing job had cache: true and you're removing setup-go, note that the first gavel run will be slower until the runner warms its own cache. Not a blocker, but worth flagging.golangci-lint-action@v9 with version: v2.11.4, capture that pin in the migration diff so the user knows they're switching to gavel's bundled lint config (gavel reads .golangci.yml if present — confirm it exists before replacing).action.yml — composite action definition (inputs, outputs)README.md "GitHub Action" section — canonical minimal + full example.github/workflows/gavel-action.yml — the version: source self-test pattern.github/workflows/lint.yml, .github/workflows/test.yml — pre-migration baseline shapesWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub flanksource/gavel --plugin gavel-skills6 skills in this plugin
/gavel-fixture-testerCreate and run Gavel fixture-based tests and TODO executable definitions of done using Markdown command blocks, tables, test/lint steps, acceptance checklists, and CEL assertions. Use when authoring standalone fixtures or persisted TODO Verification content./gavel-gitUse gavel instead of gh/git for pull requests, CI status, and commits — check a PR's checks with gavel pr status, open PRs with AI-generated content, and commit with gavel commit/gavel-runnerRun gavel test and lint, focus on a subset, re-run only failures (defaults to .gavel/last.json), filter noise with baselines, and pull JSON/markdown results from finished or live runs/gavel-todosCreate, inspect, review, verify, and maintain PostgreSQL-backed Gavel TODOs without starting implementation runs. Use for creating or syncing TODOs, attaching durable plans, authoring fixture-backed executable definitions of done, reviewing plans, running gavel todos check, inspecting history, or importing and exporting portable .todos Markdown./gavel-triageTriage a Gavel TODO backlog by sorting work into keep, shape, investigate, retire, merge, or duplicate; detecting completed or duplicate work; setting priority, labels and status; and preparing survivors for external execution with scope, acceptance criteria, and an executable definition of done. Use for backlog cleanup, choosing the next task, shaping raw TODOs, or investigating stuck work.