test-provenance-guard

test-provenance-guard is a skill for Claude Code from mthines/agent-skills. It costs 207 tokens per session (2,597 once invoked), scanned A, original, MIT.

A test checker that finds tests which copy the function they claim to test instead of importing the real production code.

In plain words
What is it for?
Use it to inspect changed tests or selected test files for this pattern. It can run static checks, mutation checks, or both, and can apply the described repair when fix mode is enabled.
Why use it?
Such tests can pass while providing no protection against regressions because they only verify their own copy. When instructed to fix the issue, it moves the shared logic into an exported function and updates the callers and test.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Part of the mthines-agent-skills plugin — 55 skills, 4 agents shipped together

Good fit Use it to inspect changed tests or selected test files for this pattern. It can run static checks, mutation checks, or both, and can apply the described repair when fix mode is enabled.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mthines/agent-skills/test-provenance-guard
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mthines/agent-skills --skill test-provenance-guard
Clone the repo
git clone --depth 1 https://github.com/mthines/agent-skills

Made for: Claude Code.

Or install mthines-agent-skills, the plugin that ships this one along with the rest of its 55 skills, 4 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for test-provenance-guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/mthines/agent-skills/test-provenance-guard/github.svg)](https://agentmods.dev/skills/mthines/agent-skills/test-provenance-guard)
Your own site
<a href="https://agentmods.dev/skills/mthines/agent-skills/test-provenance-guard"><img src="https://agentmods.dev/badge/skills/mthines/agent-skills/test-provenance-guard/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for test-provenance-guard

Your own site · 80×15
<a href="https://agentmods.dev/skills/mthines/agent-skills/test-provenance-guard"><img src="https://agentmods.dev/badge/skills/mthines/agent-skills/test-provenance-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 207 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,597 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Prompt Injection · line 70
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00207 $0.02597
Opus 5 $0.00103 $0.01299
Sonnet 5 $0.00041 $0.00519
Haiku 4.5 $0.00021 $0.00260

Measured 11d ago against content hash f93d665a8368, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

test-provenance-guard scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/quality/test-provenance-guard/SKILL.md · 235 lines

How it starts

The opening of the file, as written. The whole thing — 235 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

Parse $ARGUMENTS:

Argument Default Meaning
--diff off Discover changed test files via git diff --name-only <base>...HEAD.
--base <ref> main Base ref for --diff.
<positional paths> Explicit test files to check (overrides --diff).
--mode static|mutate|both both Which checks to run.
--fix on when called from autonomous-workflow; off for slash invocation Apply self-heal: extract logic, rewrite tests, re-verify. Gated by confidence(code) ≥ 90 % unless --no-confidence-gate is passed.
--report-only off Force off --fix even when called from autonomous-workflow.
--no-confidence-gate off Manual override — skip the pre-heal confidence gate. Reserved for human-driven slash invocations; never set inside the autonomous loop.

Read the full file on GitHub · 235 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 235 lines · 207 tokens per session scan A f93d665a8368

Subscribe to this mod's changes

test-provenance-guard is a skill published in the GitHub repository mthines/agent-skills (13 stars, last pushed yesterday), licensed MIT. It adds 207 tokens to every session and 2,597 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

raw-sql-querybuilder-testing-patterns

Guides Go services that use database/sql directly with a lightweight in-house query builder (not an ORM like GORM or a codegen tool like sqlc), including how to make repositories unit-testable via mock-generated interfaces. Use when writing or reviewing a repository method built on database/sql, adding a new…

shennawardana23/skillme · 87 tokens

tdd-workflow

Runs the full TDD workflow for a TypeScript/JavaScript feature — user journeys to test cases, unit tests (Jest/Vitest + Testing Library), API/integration tests, Playwright E2E, and a coverage gate wired into CI. Use when building a Next.js/React/Node feature end to end, not just a single unit test, or when asked to…

shennawardana23/skillme · 92 tokens

test-generation

Generates comprehensive unit, table-driven, and concurrency tests for a given function or module — happy paths, error paths, boundary values, and mocked dependencies — following Go and TypeScript idioms. Use when a function or file needs test coverage, a bug fix needs a regression test, or existing tests only cover…

shennawardana23/skillme · 69 tokens

testing-setup

Analyze and create a testing strategy for native Android apps - install testing libraries, set up test infrastructure, create harnesses for unit tests, UI tests, screenshot tests, and end-to-end tests.

android/skills · 43 tokens

migrate-xunit-to-xunit-v3

Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest…

managedcode/dotnet-skills · 149 tokens

crap-score

Calculates CRAP (Change Risk Anti-Patterns) for a named .NET method, class, or file. USE FOR: explicit CRAP calculation or coverage-and-complexity risk within that named target, including which tests to prioritize. DO NOT USE FOR: project-wide coverage/CRAP, plateaus, or project-wide blockers/priorities…

managedcode/dotnet-skills · 99 tokens