/shippable-skills:fix-tests [--e2e] [--from-log <path>] [--reconfigure] [--dry-run] [--state-dir <path>]from Shippable Skills
Discovers how a project runs tests, runs the suite, clusters failures by error signature, fixes root causes without weakening tests, and reports results. Use when tests are failing or CI pasted a failure log.
Ships in Shippable 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.
Read when SKILL.md points to them; scripts run unread.
Find out how this repo runs its tests (once), run the suite, and fix failures by root cause: source first, never by weakening a test.
This skill is host-neutral. It runs on Cursor, Copilot, Codex, Claude Code,
and any other Agent Skills host. It needs git and whatever runner the project
already uses. It installs nothing.
Never block on I/O. A denied or failed write of the profile block or the cache never stops the run: print the profile in the report instead. Do not retry a denied call or guess an alternate path.
You are running fix-tests right now. These instructions are in your context because the skill was invoked, so run the steps in this reply.
End every run with ## Fix-tests report, at most 14 lines, containing:
profile: where it came from (block, cache, or discovered) and the unit
command.counts: baseline and final total / passed / failed / skipped.<signature> | <verdict> | <fix or reason>, with the
verdict exactly one of source-bug, test-bug, env-config, flaky,
pre-existing.ledger: one line per edited test file with its reason, or none.status: green, red, reverted, or stopped (<why>).uncommitted: the edits are in the working tree and nothing was committed.| Argument | Meaning |
|---|---|
| (none) | Resolve the profile, run the unit suite, fix what is red |
--e2e | Also run the e2e command. Reported on failure, never fixed. |
--from-log <path> | Use an existing failure log as the first clustering evidence |
--reconfigure | Ignore the stored profile, rediscover, rewrite it |
--dry-run | Cluster and diagnose only. Change no source or test file. |
--state-dir <path> | Override the state directory (see step 0) |
Natural language works ("the suite is red", "make CI green from this log").
Restated from the collection's shared conventions. Use these rules as written.
AGENTS.md, CLAUDE.md,
.github/copilot-instructions.md. A line shippable-state-dir: <path> in it
overrides the state directory. Ignore a value that is absolute or contains .., and say so.--state-dir) or named in the
request, else the instruction-file
override, else .claude/ when it exists, else .agents/.<!-- BEGIN shippable:checks --> to
<!-- END shippable:checks --> in the instruction file. It is authoritative:
a human edit wins. Create it in AGENTS.md when no instruction file exists.
You may write inside this fence without asking, and you name the write in the
report. You never edit outside it.<state-dir>/testing/profile.json, a mirror of the block. Write
only fields you looked for, preserve unknown keys, and rewrite from the block
if they disagree.Resolve in this order and stop at the first that gives a unit command:
When a profile with a unit command exists, ask nothing and go on.
Discovery inspects, in order: package.json scripts, pyproject.toml,
tox.ini, pytest.ini, go.mod, Cargo.toml, pom.xml, build.gradle,
*.csproj, Gemfile, a Makefile test target, runner config files, and CI
workflow files. The full ladder with the command each file implies, and the
profile field list, null rules, and block layout, are in
references/check-profile.md. Propose, do not ask:
a pom.xml alone yields mvn test.
Nothing discoverable. Only then ask, at most four questions, once: unit command, working directory, how to run one file, any required service. Persist the answers. Only this skill interviews the user about test setup.
Persist. Write the block and the cache after discovery, idempotently: when
discovery finds exactly what is recorded, both stay byte-identical. A check that
was looked for and not found is null in the cache with a notes.<field> line,
and reads none found (<where it looked>) in the block. An absent key means not
looked for.
Stale cached command. If the profile's command no longer exists (a test
script that package.json no longer defines, a path that is gone), rediscover
without asking, rewrite the block and the cache, and say in the report that the
old command was stale.
Missing runner binary. After choosing the unit command, check its first word
is on PATH. If it is not (for example mvn is absent), record the command in
the profile anyway, classify the run env-config, install nothing, and stop
with stopped (missing binary: <name>).
Record the working tree without changing it:
git stash create
It prints a commit object for the dirty tree and touches neither tree, index,
nor stash list. If it prints nothing the tree is clean: use HEAD. Call this
the snapshot. From here on, "this run's edits" means the difference between
the snapshot and the working tree, so edits that were uncommitted before the run
are never reported or reverted as yours. If the directory is not a git
repository, say the ledger and revert are unavailable and continue without
them.
Untracked files are outside the snapshot. Neither git stash create nor the
ledger script sees them. Record git ls-files --others --exclude-standard. Before
editing a file on that list, copy it to the system temp directory. The revert
restores it from that copy, and the ledger for it is manual: run
diff -u <copy> <file> and write a ledger line for every removed assertion or
added skip marker.
Unless --from-log supplies the evidence, run the full unit command from the
profile (respect its working directory and timeout). Record before editing:
total, passed, failed, skipped, duration.
A --from-log that does not carry a full total and skipped (a partial run,
a single file, a cropped paste) cannot anchor the step 6 assert. Run the full
unit command once for the baseline anyway, before any edit, and use the log only
as the first clustering evidence.
If the suite is green, report the counts and make no edit.
With --e2e and an e2e command in the profile, record a separate e2e baseline.
Red e2e is reported and the run stops there for e2e: do not retry or debug it.
--e2e with no e2e command: say so, do not invent one.
For each failing test, re-run it on the default branch in a temporary worktree outside the repo:
origin/HEAD itself, falling back to main, then
master (the first that git rev-parse --verify --quiet accepts). Pass the
ref, never a branch name read from git symbolic-ref: a repository can name
a branch $(...).git worktree add --detach <system-temp-dir>/fix-tests-<id> <ref>.git worktree remove --force the worktree, always, even on error.A failure that fails the same way there is pre-existing: leave it unfixed and
out of scope. If the worktree cannot be created, the failure stays in scope
and the report says the pre-existing check was skipped and why. Never touch the
user's tree or index for this check.
Re-run only the remaining failing tests once. A test that passes on re-run is
flaky: report its signature, add it to the profile's known flaky list, and
leave it out of the fix loop.
Group failures by error signature (same missing import, same type error, same
missing fixture, same environment error, same assertion pattern). Give each
cluster exactly one verdict from source-bug, test-bug, env-config,
flaky, pre-existing.
iterations = 0
WHILE failures remain AND iterations < 5 AND not --dry-run:
pick the cluster with the most failures
choose ONE fix, source first
apply it
re-run ONLY the affected tests
iterations += 1
test-bug.--dry-run stops after clustering and prints diagnoses and proposed fixes.env-config clusters (missing service, bad env var) are reported with what to
set, not worked around in code.The forbidden moves list and the verdict definitions are in references/forbidden-moves.md. In short, never weaken a test: no skip or only markers, no deleted or commented-out assertions, no deleted tests, no narrowed globs, no raised timeouts hiding a race, no blanket snapshot updates, no swallowed errors, and no rewriting an expected value to the observed one without a one-line justification.
Run the full unit command again. Then assert both:
total >= baseline totalskipped <= baseline skippedIf either fails: stop, print which count moved and by how much, revert only
the edits made since the snapshot (restore each file you changed to its snapshot
content, leaving earlier uncommitted edits alone), and do not call the suite
green. A lower total always reverts: deleting a test is a forbidden move, and
no ledger line excuses it. A test that looks duplicate or obsolete goes under
Test quality notes, never into the diff.
When bash is available, run scripts/test-ledger.sh with the snapshot as its base, before writing the report:
bash <skill-dir>/scripts/test-ledger.sh <snapshot>
It lists removed assertions, added skip or only markers, and the net test-line
delta, and exits non-zero on a new marker. A non-zero exit means a forbidden
move got in: undo it, or report reverted. Exit 0 does not clear a listed
removed assertion: each one needs a ledger line (file, reason, verdict
test-bug) or is restored. A commented-out assertion lists here and exits 0.
The script only sees changes after the snapshot, so a marker that predates the
run is never flagged. It cannot see untracked files (step 1).
Print ## Fix-tests report per the output contract. Optional Test quality notes, at most three bullets, observation only, never acted on here.
CHANGELOG.md (opens in a new tab)README.md (opens in a new tab)agents/openai.yaml (opens in a new tab)evals/cases/dry-run-diagnoses.yaml (opens in a new tab)evals/cases/from-ci-log.yaml (opens in a new tab)evals/cases/maven-discovery.yaml (opens in a new tab)evals/cases/not-a-test-failure.yaml (opens in a new tab)evals/cases/red-suite-fix-source.yaml (opens in a new tab)evals/cases/refuse-skip-to-green.yaml (opens in a new tab)evals/eval.yaml (opens in a new tab)references/check-profile.md (opens in a new tab)references/forbidden-moves.md (opens in a new tab)scripts/test-ledger.sh (opens in a new tab)scripts/test-ledger.test.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub renzrollon/shippable-skills --plugin shippable-skills9 skills in this plugin
/bump-releaseBump the project's version in every manifest at once, then commit, tag, push, and cut a release, so no manifest keeps a stale version./exploreDeep read-only reconnaissance before a change is designed. Fans out parallel investigators when a question spans several subsystems, compares options, needs cross-file tracing, or changes what a shared value means, then synthesizes one picture and, in an autonomous run, writes a durable brief. Use when asked how something works end to end, what breaks if a shared value changes, which of several approaches fits, or to explore, map, trace, or investigate before building. Skips single-file questions, never writes code, and is not for interviewing the user./gitlab-issueTurn a one-line request into a GitLab issue that carries the project's own OpenSpec and docs context, written in plain language with technical notes collapsed at the end. Use when someone explicitly asks to "create a gitlab issue", "file a ticket", "raise a bug on GitLab", "open an issue for this", "log a bug", or "draft an issue". Does not run on a passing mention such as "we should track this", on questions about existing issues such as "what issues are open?", on commenting on, closing, or editing an existing issue, or for GitHub, Jira, or Linear issues./product-spineHelp an engineer act as product owner: suggest parallel work threads (features, improvements, fixes) from the repo, then draft, review, and capability-check the one-pager, epics, and briefs that land them. Writes artefacts, never code. Answers "can the platform do X?" from the project's own primer./readme-pitchRewrite this repository's README into a first-screen pitch. Hero above the fold, pitch done before the first heading, technical detail moved into docs with links, every test pin and anchor kept./session-handoffSave where this session stands to a handoff file before a context reset, so the next session or agent resumes without re-deriving decisions. Lists stranded work, redacts secrets, and proposes reusable rules for your instruction file.