/shipwright:repo-configfrom shipwright
Specifies GitHub repository configuration for a test-readiness pipeline: branch protection requiring CI, required secrets, environments, deploy hooks, and PR templates. Referenced by test-design and test-roadmap skills.
Ships in shipwright. 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.
Capture the repository-level configuration that turns CI into an actual gate. The audit's verification commands are only meaningful if main cannot be merged unless they pass.
test-design (Phase 2) — emits the Repo Configuration section of the blueprinttest-roadmap (Phase 4) — applies the pairing rule (a human-only settings task when a repo first sets up, or switches to, the required CI check)test-fix (Phase 5) — the task's acceptanceCriteria array is the task-store equivalent of a Closing ChecklistA complete repo-config plan covers four concerns:
For each protected branch (default: main):
This is the standard recommendation for every shipwright repo — one flat default, not a
choice between options. Shipwright repos are moving toward shipwright-merge (agent
merges via gh pr merge --squash, deferring to native branch protection with the merging
account configured as a ruleset bypass_actor) across the board, so recommend the settings
below regardless of where a given repo currently is in that rollout.
CI, the aggregate job of test.yml (see "One required check: CI" below). This is the real gate: CI must be green on the branch that lands. merge.md now defers to this natively rather than bypassing it outright, so it's a live merge-gate for the merge phase too, not just a signal for merges that skip merge.md (e.g. a human merging via the GitHub UI) — though a bypass_actor merging account can still push past it if a status check regresses after the pre-flight check ran.check-patch.ts's hasUnaddressedFindings() only checks for unresolved threads when a qualifying review exists at the current HEAD commit — if a later commit lands without a fresh qualifying review at that commit (e.g. a CI-only fix), stale unresolved threads from an earlier review are never revisited, and nothing in the pipeline resolves them. The merging account is configured as a ruleset bypass_actor, which bypasses this setting regardless of whether merge.md force-merges or defers natively, so the theoretical "free safety net for manual merges" benefit doesn't hold up against the risk of a PR getting stuck with orphaned unresolved threads no automated process will ever clean up. Not worth the effort to fix the gap for a benefit this narrow.bypass_actor status on the ruleset bypasses this regardless of whether merge.md's merge step goes through natively or hits the branch-protection-block backstop. It also has a concrete, independent cost: GitHub's strict status checks go stale whenever the base branch moves, and with multiple agents merging PRs in parallel, every merge into main invalidates the "up to date" status of every other open PR — forcing a rebase and a full CI re-run on each sibling PR just to become mergeable again. Real Action-minutes burned for no benefit, on top of being redundant with the required-status-check gate above.review.md Step 10 force-downgrades an agent's review of its own PR to COMMENT with a Verdict: APPROVE marker — a required-review count can never be satisfied by the pipeline itself. merge.md now defers to this setting natively for identities that are not a ruleset bypass_actor, treating a missing required review as a branch-protection-block: the PR is marked blocked rather than force-merged, and a human must add a real approval or configure the identity as a bypass_actor.bypass_actor to merge self-reviewed PRs — merge.md no longer force-bypasses branch protection outright, but the merge model still depends on that bypass existing for the common case. enforce_admins: true would either block every automated merge for accounts without a real second approval, or require the merging account to be a permanent bypass_actor anyway, which is enforcement in name only.CIRecommend exactly one required check, named CI. Other checks (e.g. secret scanning) may stay separate only if they report on every PR. Later test jobs join CI by being added to its needs, so adding a job never needs a branch-protection settings change.
Safe skips. The workflow starts on every PR and on every default-branch push, with no workflow-level path filter. A change-detection job decides which tests are affected; optional jobs use a job-level if:. The CI job uses if: always(), needs change detection and every test and coverage job, and fails when change detection does not succeed or does not give valid choices, or when any needed job fails or is cancelled. Only intentional skips pass. Require CI, not the optional jobs: a job skipped because an earlier job failed reports as skipped (which counts as passing), so requiring the optional job itself would let a PR through.
on:
push:
branches: [main] # the default branch
pull_request: # no workflow-level paths filter
jobs:
changes:
runs-on: ubuntu-latest
outputs:
run_tests: ${{ steps.detect.outputs.run_tests }}
steps:
- uses: actions/checkout@v4
- id: detect
run: echo "run_tests=true" >> "$GITHUB_OUTPUT" # replace with real change detection; emit true or false
test:
needs: changes
if: needs.changes.outputs.run_tests == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# ... unit, integration and smoke tests ...
coverage-check:
needs: [changes, test]
if: always() && needs.changes.outputs.run_tests == 'true'
runs-on: ubuntu-latest
steps:
- run: echo "publish shipwright-coverage, then check the rising minimum on the combined all-layer report; a missing or failed report fails this job"
CI:
needs: [changes, test, coverage-check]
if: always()
runs-on: ubuntu-latest
steps:
- name: Fail unless every needed job passed or was intentionally skipped
env:
CHANGES: ${{ needs.changes.result }}
RUN_TESTS: ${{ needs.changes.outputs.run_tests }}
RESULTS: ${{ join(needs.*.result, ' ') }}
run: |
[ "$CHANGES" = success ] || { echo "change detection did not succeed"; exit 1; }
case "$RUN_TESTS" in true|false) ;; *) echo "invalid change-detection output"; exit 1;; esac
case " $RESULTS " in *" failure "*|*" cancelled "*) echo "a needed job failed or was cancelled"; exit 1;; esac
if [ "$RUN_TESTS" = true ]; then
case " $RESULTS " in *" skipped "*) echo "a job that should have run was skipped"; exit 1;; esac
fi
Rules that follow from this:
paths: / branches: filters), its required check stays pending forever and blocks the PR. This is why CI lives in a workflow that starts on every PR.CI reports after the jobs it needs. Custom automation that watches checks and merges with --admin must wait for the whole workflow run to finish first, not act on the first green check (scripts/platform-bump-gate.sh is an example).For each external integration named in the inventory, list the GitHub secret needed to authenticate against it in CI and canary mode. For each deployment target, list the GitHub Environment.
Minimum set for the test pipeline:
TEST_CANARY_API_KEY — scoped canary auth tokenTEST_TARGET_URL per environment (often set in the workflow, not as a secret)<SERVICE>_API_KEY (used only if recording new fixtures)staging, production) with required reviewers if promotion is gatedworkflow_run on the deploy workflow's completed event filtered to successTEST_TARGET_URLSee references/deploy-canary-promote.md for a full reference contract covering the three critical wiring details: non-empty-tag guard, skipped-job-counts-as-success hole, and staging-vs-prod TEST_TARGET_URL.
Closes #N or Fixes #N in the bodyVerification command (or a CI run link that shows the same)A PR template (.github/pull_request_template.md) can enforce the verification-output convention via a checklist.
Recorded fixture doubles (msw handlers, nock recordings, hand-authored JSON) capture the shape of third-party API responses at a point in time. Without scheduled re-recording, recorded fixtures go stale silently — the test suite stays green while the live integration is broken. A maintenance loop catches this before production does.
Status: deferred — not implemented. The auto-recording GitHub Actions pattern below is a target design, not built tooling. Do not wire it up until the manual, hand-authored-fixture workflow is running and tuned.
A repo can permanently opt out of this pattern via a ## Recorded-fixture automation
declaration in its root CLAUDE.md (same mechanism as ## Deploy model — see
test-roadmap/SKILL.md Process step 1 and step 5). When declared not planned,
test-roadmap emits zero recorded-fixture-refresh tasks regardless of what the migration
phase flags as a gap — do not treat "deferred" in this doc as "eventually mandatory" for
a repo that has explicitly opted out.
See the full recorded-fixture maintenance loop pattern below for implementation details (deferred).
When generating the task list, a repo-settings task is emitted only when a repo first sets up, or switches to, the required CI check. Adding later jobs to CI (via needs) emits no settings task, because the required check does not change.
Pattern:
| Workflow task | Paired branch-protection task |
|---|---|
Create / update test.yml that first sets up, or switches to, the required CI check | Enable branch protection on main requiring the single CI check (see below) |
Add later test jobs to CI | None — no settings change |
| Add canary workflow | Wire as deploy-gate (NOT as merge-gate) |
| Add deploy workflow | Add staging / production GitHub Environments with required reviewers |
Branch-protection settings task shape. It is a human-only dev task: hitl: true, status: pending, no coding. Its description has a ## Human steps section: (1) confirm CI passed on main, then (2) change the required checks in the repo's branch protection or ruleset to require CI. It depends_on the task that adds CI. Only work that needs the new rule depends on it; unrelated tasks do not.
Why hitl: true and not blocked: a blocked review task is unblocked into the agent queue, where an agent that may lack permission to read or change branch protection would pick it up. A human-only task is never handed to an agent. Land the workflow first, confirm green on main, then the human enables protection, which avoids the chicken-and-egg block.
CI)The coverage check is not a separate branch-protection setting. It runs as a job that CI already needs, so it is enforced by the one required CI check and emits no settings task, no never-decrease task and no promotion task.
Order. Publish coverage first (the shipwright-coverage artifact, per plugins/shipwright/references/coverage-output.md), then add tests until line coverage reaches the 90% target. The check below is added once a complete report exists.
Rising minimum. The minimum starts at the repo's current line coverage and the check fails below it. Any task that adds coverage raises the minimum to the new figure in the same PR, until it reaches 90%. The minimum then stays at 90%. Store it in a file in the repo (for example .shipwright/coverage-minimum) so raising it is a normal reviewed change.
Where it is checked. Check it where all layer reports come together:
coverage-check job that downloads every layer's report. It runs on PRs and on the default branch, and CI lists it in needs.What it measures. Follow plugins/shipwright/references/coverage-output.md: every layer, lcov reports combined by (file, line) rather than summed, and the same .shipwright/coverage.json exclusions as the published figure.
Never compare partial coverage.
CI treats that skip as intentional).Every task-store task test-fix queues must carry closing-checklist concerns in its
acceptanceCriteria array (a flat list of strings — see test-fix/SKILL.md's field-building
section). This converts the verification command from a suggestion into a mergeable gate:
"acceptanceCriteria": [
"All acceptance-criteria items above are satisfied",
"Verification command `{verify}` run; output captured in the closing PR description",
"CI is green on the PR (assuming branch protection is enabled)",
"No source files outside `Files to touch` were modified, or the deviation is justified in the PR description"
]
The third item only becomes a hard gate once branch protection is on. Until then, it's still good hygiene.
test-system.md (Phase 2 output)A ## Repo configuration section with the four concerns filled in for the target repo:
test-readiness-plan.md (Phase 4 output)A ## Repo configuration tasks block listed alongside the test tasks. By default these go in M1 (infrastructure baseline) with depends_on pointing at the corresponding workflow task.
A ## Closing checklist section at the bottom.
Deferred — not implemented. This section documents the target auto-recording design (a scheduled GitHub Actions workflow). None of this tooling — the workflow, the environment, the re-record scripting — has been built yet. Defer implementation until the manual, hand-authored-fixture workflow is running and tuned. If a repo has never actually exercised a real live-recording flow (i.e.
RECORD=1-style capture against a real third-party API with real credentials, not just hand-authored recorded fixture double JSON), that precondition is not met — building the automated loop first, with no proven recording step to automate, is the failure mode this note exists to prevent. A repo in that position should declare## Recorded-fixture automation→not plannedin itsCLAUDE.mdrather than accept a bundled "build recording + automate it" task; see the opt-out note above.
Recorded fixture doubles (msw handlers, nock recordings, hand-authored JSON) capture the shape of third-party API responses at a point in time. Without scheduled re-recording, recorded fixtures go stale silently — the test suite passes while the integration is broken in production. A recorded-fixture maintenance loop catches drift weekly before it becomes a production incident.
A dedicated GitHub Actions workflow .github/workflows/recorded-fixture-refresh.yml (not yet created) on a weekly schedule (e.g., cron: '0 9 * * 1' — Mondays at 09:00 UTC). The job:
RECORD_MODE=all bun test or the msw/nock equivalent)git diff for any changed fixture fileschore: refresh recorded fixtures (auto) via gh pr create, with a git diff --stat summary and one expanded hunk in the body| Trigger | When to use |
|---|---|
| Scheduled cron | Weekly (always) |
Manual workflow_dispatch | When a third-party publishes a breaking-change notice |
| Feature-branch CI | Never — recorded fixtures are not re-recorded on PRs (avoids network flake) |
The re-record job authenticates against the real third-party APIs using credentials stored in a dedicated recorded-fixture-refresh GitHub Environment. This environment has narrower permissions than production and is not shared with integration test runs.
| Scenario | Outcome |
|---|---|
| No diff | Silent pass — no PR, no noise |
| Diff detected | PR opened, tagged recorded-fixture-refresh, body includes diff stat + one expanded hunk |
| API call fails during re-record | Workflow fails; GitHub sends default failure notification to repo watchers |
| Open refresh PR already exists | Skip creation — check for existing open PR with same title before calling gh pr create |
Do not auto-merge. The diff is a signal, not a safe auto-apply. A human must verify whether the response shape change is a breaking change, a non-breaking evolution, or a transient fluke before merging.
Include in the Required secrets and environments section of the test-system.md artifact:
recorded-fixture-refresh — no required reviewers (cron runs unattended), restricted to the recorded-fixture-refresh.yml workflowSTRIPE_TEST_API_KEY, SENDGRID_API_KEY, etc.)recorded-fixture-refresh workflow runs on main and submits PRs — it is safe to enable before branch protection is configuredInclude in the test-readiness-plan.md task list (M1):
<service>"recorded-fixture-refresh GitHub Environment + secrets"These tasks depend on the same-layer "record fixtures for <service>" task, not on branch protection.
bypass_actor status (see merge.md, which now defers to native branch protection rather than force-bypassing with --admin) is the merge model's real bypass mechanism, not an emergency exemption, and it bypasses all four of these settings wholesale regardless of whether the merge command itself carries a bypass flag. Requiring ≥1 approval doesn't add a review — self-APPROVE is blocked by GitHub's API — "up to date" burns real CI minutes on every sibling PR each time main advances, and conversation resolution can leave a PR permanently stuck (see check-patch.ts's hasUnaddressedFindings() gap above) for a benefit (a "safety net" for manual merges that also get bypassed) not worth the maintenance cost. Stricter-looking, not actually stricter.${{ secrets.X }}, never literal values.recorded-fixture-refresh environment.What SKILL.md sets; muted values are Claude Code's defaults
27 skills in this plugin
/agent-readinessScore one repo against the agent-readiness catalogue (docs/readiness.md) with the deterministic scorer, post one ReadinessSnapshot and record one run. Requires --repo org/repo. No model judgment, no task creation, no repo files./canary-executionCross-cutting contract for the test-readiness pipeline. Defines how canary-eligible test code runs in two modes — `local` (boot dependencies inline, hit localhost) and `canary` (skip the boot, hit a deployed `TEST_TARGET_URL`) — via a dedicated entry point separate from the local smoke runner. Specifies eligibility rules (read-only or self-cleaning, smoke/E2E only, critical/high tier only, zero DB-dependent tests) and the deploy-gate budget (<60s wall time). Referenced by the inventory, system-design, migration, and roadmap skills.
/duplication-fixRead a repo's ready_to_propose duplication patterns from the task store (PatrolFinding) and queue them as routed task-store tasks (auto, review or plan), one task per pattern, each carrying a strangler-fig (build -> coexist -> eliminate) execution plan. Requires --repo org/repo and duplication-scan to have run first./duplication-scanDiscover emerging duplicate/similar code patterns in one repo via judgment-driven comparison, track them across runs in the task store's PatrolFinding ledger, and list only stabilized open patterns in docs/patrols/duplication.md. Requires --repo org/repo. Report only — no code changes./entropy-fixRead the entropy-scan handoff for one repo and route PR-worthy violations as task-store tasks (auto / review / plan), one task per rule. Requires --repo org/repo and /entropy-scan to have run first./entropy-scanScan one repo for principle deviations and write docs/patrols/entropy.md. Requires --repo org/repo. Report only — no code changes.npx claudepluginhub app-vitals/shipwright --plugin shipwrightOther plugins' skills for the same job