← ClaudeAtlas

test-provenance-guardlisted

Detects tests that pass by construction — tests that define a private copy of the function under test instead of importing the production module — and self-heals by extracting the inline logic to an exported function, updating production callers, and rewriting the test to import the export. Two checks: (1) static — the test file must import the SUT and must not shadow its exported names; (2) mutation — blanking the production function body re-runs the test and expects failure. Runs autonomously inside autonomous-workflow Phase 4 and as a slash command for human-driven PR review. Use when adding new tests for existing or refactored code, when CI is green but you are unsure whether the tests actually exercise production, or when reviewing a PR for tests-by-construction. Triggers on "test provenance", "tests by construction", "verify tests cover real code", "tests duplicate logic", "mutation sanity check", "are these tests fake", "/test-provenance-guard".
mthines/agent-skills · ★ 5 · Code & Development · score 83
Install: claude install-skill mthines/agent-skills
# Test Provenance Guard Catches the failure mode where a new test file *re-implements* the function it claims to test, then asserts against its own copy. The tests pass. The CI is green. The tests provide zero regression protection. This skill detects that pattern and, when invoked autonomously, fixes it without user intervention. > **This `SKILL.md` is a thin index.** > Detailed procedures live in `rules/*.md` and load on demand. > The case-study post-mortem and failure-mode taxonomy live in `references/*.md`. --- ## Contents - [Inputs](#inputs) - [Workflow](#workflow) - [Quick Decision Flow](#quick-decision-flow) - [Required Reading by Phase](#required-reading-by-phase) - [Output Contract](#output-contract) - [Core Principles](#core-principles) - [Anti-patterns](#anti-patterns) - [Definition of Done](#definition-of-done) - [Related Skills](#related-skills) --- ## Inputs Parse `$ARGUMENTS`: | Argument | Default | Meaning | | ---------------------------- | ------------------------------------------ | -------------------------------------------------------------------------------------- | | `--diff` | off | Discover changed test files via `git diff --name-only <base>...HEAD`. | | `--base <ref>` | `main` | Base r