/crucible:test-coveragefrom crucible
Audits existing tests for staleness, needed updates, or removal after code changes. Use after any code modification to verify test suite alignment.
Ships in crucible. 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.
All subagent dispatches use disk-mediated dispatch. See shared/dispatch-convention.md for the full protocol.
Audits whether existing tests need updating, removal, or modification after code changes. Distinct from test-gap-writer (which adds NEW tests for missing coverage) — this skill reviews the EXISTING test suite's alignment with changed code.
Announce at start: "Running test alignment audit on [scope description]."
Skill type: Rigid -- follow exactly, no shortcuts.
Execution model: When this skill is running, YOU are the orchestrator. You dispatch the audit and fix agents, handle conditional logic, and return results to the caller. All references to "the orchestrator" in this document refer to you.
Technology-agnostic: This skill works with any programming language and test framework. Examples use generic patterns. The audit agent adapts its checks to whatever language and testing conventions are present in the project.
Models: Test audit and fix agents request high. The Claude Code examples use the current reference alias model: opus; other harnesses map supported profiles or omit unsupported model fields per shared/model-tier-policy.md.
Code changes create three categories of test debt that pass silently:
Test-gap-writer handles a fourth category (missing tests for new behavior). This skill handles categories 1-3 (existing tests misaligned with changed behavior).
The skill receives from the caller:
git diff <base-sha>..<head-sha> or equivalent)high) using ./test-audit-prompt.mdhigh) using ./test-fix-prompt.md. If the audit was split (step 1), dispatch one fix agent per audit batch sequentially (not in parallel) to isolate revert scope. Sequential execution prevents file clobber when multiple batches have findings in shared test utilities (helpers, fixtures, conftest). Each fix agent checks git status before starting to confirm the tree is in the expected state. A failure in one batch does not discard successful fixes from other batches.test: batch N alignment fixes) before dispatching the next batch. This ensures clean revert targets for subsequent batches and prevents revert clobber of prior successes. The caller may squash these commits per its own protocol.Dispatch: Agent tool (subagent_type: "general-purpose", model: opus)
The audit agent receives the code diff, affected test files (full source), and optional context. It checks three categories:
Category 1 — Tests to Update:
Category 2 — Tests to Delete:
Category 3 — Coincidence Tests (flag only, do not fix):
Evidence requirement: Every finding must reference specific test file, test name, and the line(s) in the diff that make the test problematic. No speculation.
If the audit agent reports findings in categories 1-2, dispatch a fix agent (Opus) that receives:
The fix agent has tool access to read current source files — it needs the actual current behavior (not just the diff) to write correct updated assertions.
The fix agent:
On success: Reports changes made (tests updated, tests deleted, all passing).
On failure: Reverts its own changes using git checkout + git clean (see test-fix-prompt.md), then verifies clean working tree with git status. Reports: "Attempted fix for [finding], reverted because [test failure details]. Manual intervention needed." This prevents broken test modifications from polluting the working tree. The caller decides next steps per its own protocol.
Precondition: The working tree must be clean when this skill starts. The caller should commit before invoking test-coverage (debugging's commit strategy handles this). In multi-batch mode, the orchestrator commits each successful batch before dispatching the next, maintaining the clean-tree invariant throughout. If uncommitted changes are detected, the fix agent reports this and does not proceed.
The skill returns a structured report to the caller:
## Test Alignment Audit Report
### Summary
- Tests audited: N
- Tests updated: N
- Tests deleted: N
- Coincidence tests flagged: N (require caller judgment)
- All modified tests passing: yes/no
- Fix agent reverts: N (if any fixes failed)
### Findings
#### Tests Updated
- `test_file::test_name` — assertion on line N expected OLD_VALUE, updated to NEW_VALUE. Diff ref: [changed line]
[repeat]
#### Tests Deleted
- `test_file::test_name` — tested removed code path [description]. Diff ref: [removed lines]
[repeat]
#### Coincidence Tests (flagged, not modified)
- `test_file::test_name` — exercises changed code but asserts on [unrelated property]. Consider updating assertion to verify [changed behavior].
[repeat]
#### Fix Failures (reverted)
- `test_file::test_name` — attempted [change], reverted because [failure reason]. Manual intervention needed.
[repeat]
### Test Run Results
- [PASS/FAIL] per modified test file
Invoke crucible:test-coverage with:
- Code diff: git diff <pre-debug-sha>..HEAD
- Affected test files: test files in subsystem identified during investigation
- Context: "Debugging fix for [hypothesis summary]"
Invoke crucible:test-coverage with:
- Code diff: git diff <pre-task-sha>..HEAD
- Affected test files: test files touched or related to task
- Context: "Build task N: [task description]"
Build's reviewer Pass 2 focuses on test quality (independence, determinism, edge cases, test level). Staleness detection is delegated to this skill, dispatched after the implementer addresses Pass 2 findings.
Invoke crucible:test-coverage with:
- Code diff: git diff <base-branch>..HEAD
- Affected test files: test files in the diff or test files that import changed modules
- Context: "Finish pre-merge audit for [branch description]"
When finish is called by build, build tells finish to skip Step 2.5 (test-coverage already ran per-task in Phase 3). This step only runs when finish is invoked standalone.
Invoke crucible:test-coverage with:
- Code diff: git diff <base>..HEAD
- Context: [description of changes]
Standalone top-level invocation ONLY. Emit a ledger row IFF test-coverage was invoked as its own top-level run (a user /test-coverage, or the Standalone caller-integration path above). When dispatched inline by a host skill (debugging Phase 5, build Phase 3, finish Step 2.5), emit nothing — that host owns its own ledger row. The terminal "Test Alignment Audit Report" is the single emit point; emit once there, not mid-audit.
When (and only when) running standalone, emit ONE Tier B STUB JSONL line to the central ledger (~/.claude/crucible/ledger/runs.jsonl) via the emit CLI per skills/shared/ledger-append.md — resolve scripts/ledger_append.py by absolute path from the plugin root and run python3 <script> emit - '<json>'.
scripts/uuid7.py) at the start of the standalone run and reuse it for the single emit. (run_id, skill="test-coverage") dedup (L-2) guarantees idempotency.emit CLI owns the mechanics: graceful skip on CRUCIBLE_CALIBRATION_DISABLED=1 (L-6), and auto-fill of repo + schema_version. If the script can't be resolved, warn to stderr and skip — a missing emit must never block the skill.schema_version: 2, run_id, skill: "test-coverage", tier: "B", verdict (all affected tests pass post-alignment with no coincidence flags and no fix failures → PASS; coincidence tests flagged or fix failures needing caller judgment → ESCALATED), timestamp (ISO-8601 UTC), gated_files (the audited test files, repo-relative), artifact_type: "code".severity_histogram, highest_finding, would_have_shipped_without_gate, findings_count, confidence, chunk_hash, rounds, predicted_falsifier — all null. Also gated_files_truncated: 0, comment: null, backfilled: false, falsified: null, falsified_by: null.The audit agent must NOT:
The fix agent must NOT:
./test-audit-prompt.md — Test audit agent dispatch./test-fix-prompt.md — Test fix agent dispatch (revert-on-failure, source file access)crucible:debugging (Phase 5 Step 2.5), crucible:build (Phase 3, after test quality review), crucible:finish (Step 2.5, pre-merge audit), standalone invocationcrucible:test-driven-development (writes tests during implementation), test-gap-writer (adds missing coverage for new behavior)crucible:quality-gate (this is a single-pass audit, not an iterative loop)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (raddue/crucible) — no native marketplace selected
npx claudepluginhub p/raddue-crucible51 skills in this plugin
/adrWrite, supersede, and maintain Architecture Decision Records (docs/decisions/) for technical choices that had real, seriously-considered alternatives and would be costly to reverse. Use on "write an ADR", "record this decision", or when recording a choice that a design or PR already settled. Matches the target repo's existing ADR convention before imposing one, and declines with a reason when a decision does not meet the bar — not for routine design docs, implementation plans, session handoffs, the pre-push/merge wrap-up itself (that belongs to `finish` / `merge-pr`), or answering "why did we choose X" from an ADR that already exists (that's a read, owned by `recall` / `recon`)./adversarial-testerUse after completing an implementation to find unknown failure modes. Reads the implementation diff and writes up to 5 tests designed to make it break — per-task, scoped to that single implementation (for a fully-assembled multi-component feature, use inquisitor to hunt cross-component bugs). Triggers on 'break it', 'adversarial test', 'stress test implementation', 'find weaknesses', or any task seeking to expose unknown failure modes in a single implementation./assayRecon-informed approach evaluator. Weighs competing options against codebase constraints and returns structured recommendations with confidence scoring, kill criteria, and evidence grounding. Consumes recon briefs or caller context. Used by design, spec, migrate. Triggers on /assay, 'evaluate approaches', 'which option', 'compare alternatives'./auditAdversarial review of code subsystems or non-code artifacts (design docs, plans, concepts) through parallel analytical lenses. Triggers on 'audit', 'review subsystem', 'audit this design', 'review this plan', 'audit concept', 'check the save system', 'examine the UI code', or any task requesting adversarial review of existing artifacts./buildUse when starting any feature development, building new functionality, implementing a design, or going from idea to working code. Triggers on "build", "implement", "add feature", or any task requiring design-through-execution./cartographer-skillUse when exploring unfamiliar code and want to persist what you learn, when starting a task and want to consult known codebase structure, or when collaborators need module-specific context for implementation or reviewOther plugins' skills for the same job