test-provenance-guard

Solid

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".

Code & Development 8 stars 2 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 84/100

Stars 20%
32
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# 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...

Details

Author
mthines
Repository
mthines/agent-skills
Created
3 months ago
Last Updated
2 days ago
Language
TypeScript
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

analysis-provenance

Identify code ownership before modifying validators or linters. Checks file headers for provenance indicators, reviews documentation, and determines provenance as UPSTREAM, LOCAL, VENDOR, or UNKNOWN. Prevents accidental modification of upstream tools.

42 Updated today
rjmurillo
Testing & QA Solid

test-auto-fix

Diagnoses failing tests across any project, classifies each failure as a test-bug, prod-bug, or unsure, confidence-gates the fix (auto-apply at >=90%, 80-89 ask, <80 escalate), applies it, and re-runs until green. Surface-driven: reads per-project configuration from a surface file keyed by normalised git remote URL. Bootstrap auto-detects the stack on first run and proposes a surface diff for user approval. Hard-refuses to delete tests, add .skip/.only, or weaken assertions. Regression-detects after every fix: reverts on new failure instead of stacking. Triggers on "fix my failing tests", "tests are red", "auto-fix tests", "heal the tests", "/test-auto-fix".

8 Updated 2 days ago
mthines
Testing & QA Solid

tdd

Enforces strict Test-Driven Development with RED-GREEN-REFACTOR cycles. Writes one failing test at a time, implements minimal code to pass, then refactors. Delegates to the `test-provenance-guard` skill during REFACTOR to detect tests-by-construction (static + mutation checks). Pairs with the `code-quality` skill: invokes `Skill('code-quality')` during the REFACTOR phase to apply the full code-quality rule set against the GREEN output, and cites refactor recipes (R1–R20) by ID when reporting changes. Triggers on: "tdd", "write tests", "test this", "add test coverage", "test driven", "red green refactor", "/tdd".

8 Updated 2 days ago
mthines