tdd-refactor-coverage-audit

Audits newly added source files for paired tests during the TDD refactor phase.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/rubrical-works/idpf-praxis-skills --skill tdd-refactor-coverage-audit-rubrical-works
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdd-refactor-coverage-audit
Source: https://github.com/rubrical-works/idpf-praxis-skills/tree/main/Skills/tdd-refactor-coverage-audit
Command: npx skills add https://github.com/rubrical-works/idpf-praxis-skills --skill tdd-refactor-coverage-audit-rubrical-works

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? During a TDD cycle it is easy to add source files without writing their paired tests, and manual review of git diffs to catch this is slow and error-prone. This Skill automates that check across 13 languages and reports gaps without ever blocking the TDD gate. ## Core Features & Use Cases - Convention-driven pairing: Matches newly added source files (from git diff --diff-filter=A) against JSON-defined test patterns for TypeScript, JavaScript, Svelte, Vue, Python, Go, Rust, Ruby, Elixir, Java, Dart, GDScript, and C#, with project-level overrides via framework-config.json. - Three test classes: Distinguishes module tests (stem pairing), flow specs (@covers/@flow annotations), and contract tests (@subject declarations), each reported with its own denominator. - Advisory structured output: Emits JSON with missingTests, undetermined, coverage, and diagnostics such as unrecognizedExtensions, never exiting non-zero for missing tests. - Use Case: After the GREEN gate of a TDD cycle, run the audit against the cycle's starting commit to confirm every new source file has a paired test before refactoring proceeds. ## Quick Start Ask Claude to run the tdd-refactor-coverage-audit skill against the commit where this TDD cycle started and report any new source files missing paired tests.

Frequently Asked Questions about tdd-refactor-coverage-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check that new source files have paired tests in a TDD workflow?▼

Run the audit script with node test-coverage-audit.js --since-commit <sha> to compare HEAD against a reference commit. It lists added source files, reports which lack paired tests under missingTests, and outputs a coverage ratio as advisory JSON.

What languages does the test coverage audit support?▼

The bundled conventions cover TypeScript, JavaScript, Svelte, Vue, Python, Go, Rust, Ruby, Elixir, Java, Dart, GDScript, and C#. You can add languages by editing the conventions JSON or declaring additionalLanguages in framework-config.json without changing any code.

Can I customize test file patterns for my project layout?▼

Yes, add a testCoverageAudit block to framework-config.json at the project root with additionalLanguages, ignoredSourcePatterns, excludePaths, or minTestCoverageRatio. Override entries are consulted before bundled ones, and pattern lists are concatenated rather than replaced.

Does the audit work without Node.js installed?▼

Yes, it follows a no-runtime fallback pattern where Claude reads the conventions JSON and runs git diff via the Bash tool to perform the same pairing inline. The fallback produces structurally equivalent advisory output, though the Node script is the primary deterministic path.

Why does the audit report coverage of 1.0 when some files have no tests?▼

Coverage only counts files the audit understood; sources whose layout no test pattern can express go to undetermined and are excluded from the ratio. Check undeterminedCount and diagnostics.unrecognizedExtensions alongside coverage before trusting a perfect score.

Will the coverage audit fail my CI build or block the TDD gate?▼

No, the audit is advisory only and never exits non-zero for missing tests. Exit code 2 is reserved for schema validation failures and usage errors, so findings surface as warnings for the caller to review.