test-safety-net

Writes proven-failing-first characterization tests into untested Python, Node, Go, and Rust codebases.

1|Updated May 28, 2026
One-click install
npx skills add https://github.com/dhanesh/agent-skills --skill test-safety-net-dhanesh
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-safety-net
Source: https://github.com/dhanesh/agent-skills/tree/main/test-safety-net
Command: npx skills add https://github.com/dhanesh/agent-skills --skill test-safety-net-dhanesh

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Repositories with no test suite cannot be changed safely by an agent or a person, because nothing detects unintended behaviour change. This Skill fills that gap by ranking the riskiest units and writing real tests that pin current behaviour, each proved able to fail before it is kept. ## Core Features & Use Cases - Risk-ranked test authoring: A bundled offline ranker scores units by churn and blast radius across Python, node/TypeScript, Go, and Rust, then triages each into four testability tiers. - Red-to-green proof loop: Every test is written with a deliberately wrong assertion, required to fail, corrected, and required to pass, so the assertion provably binds to real output. - Runtime I/O guards: Per-stack guards (pytest plugin, node --require preload, go test -overlay wrapper, cargo preload hook) enforce that no generated test performs real I/O, with tier-aware allow lists for controlled boundaries. - Honest reporting: Suspected bugs are pinned and reported rather than blessed, and untestable code becomes a ranked seam list handed to clean-code. - Use Case: Before a migration on a legacy Go module with no _test.go files, run the ranker, confirm the top 10 units, and let the agent build a safety net of characterization tests one unit at a time. ## Quick Start Ask the agent to add a safety net to this repository before we refactor it, then confirm the ranked list of units it proposes to test.

Frequently Asked Questions about test-safety-net

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

FAQPage Schema
How do I add tests to a legacy codebase that has none?▼

Run the bundled ranker to score units by churn and blast radius, confirm the top candidates, then write characterization tests one unit at a time. Each test is proved able to fail before it is kept, so the suite actually detects behaviour change.

What is a characterization test versus a specification test?▼

A characterization test pins what the code does now, while a specification test asserts what it should do based on docs, types, or an issue. Where they disagree, current behaviour is still pinned and the disagreement is reported as a suspected bug.

Which languages and test frameworks are supported?▼

Python 3.10-3.14 with pytest or unittest, node/TypeScript LTS lines 18-26 with node --test, Go 1.22-1.26 with go test, and Rust 1.82-1.98 with cargo test. No pip, npm, or network access is required.

Does it work with jest, vitest, or mocha repositories?▼

A JS/TS repo already configured with jest, vitest, or mocha is treated as rank-and-report only in this version. The skill writes node:test tests proven under node --require, which a jest suite would not collect correctly.

How does it prevent generated tests from performing real I/O?▼

Each stack ships a runtime guard loaded on the single-test invocation: a pytest plugin for Python, a node --require preload, a go test -overlay wrapper, and a preloaded libc hook for Rust. A guard trip means the unit is reclassified and the test discarded.

When should I not use this test generation approach?▼

Do not use it to chase a coverage percentage, to bless current behaviour as correct, or to refactor code for testability. Untestable code is reported as a ranked seam list for clean-code rather than modified here.