design-tests

Designs and writes behavior-driven tests with mutation-verified red-green proof for .NET and React targets.

2|Updated Jul 18, 2026
One-click install
npx skills add https://github.com/Arasz/ai-badger --skill design-tests-arasz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: design-tests
Source: https://github.com/Arasz/ai-badger/tree/main/features/common/skills/design-tests
Command: npx skills add https://github.com/Arasz/ai-badger --skill design-tests-arasz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Writing tests that actually catch bugs is hard: suites often assert values mirrored from the implementation, never fail, and give false confidence. This Skill enforces a disciplined design workflow where every test must demonstrably fail under a plausible production bug before it counts. ## Core Features & Use Cases - Target discovery (Stage 0): When no target is named, it inspects git diffs, coverage artifacts, and untested production files, then ranks candidates by risk bands (auth, money, state machines, time, I/O) to pick what to test. - Mutation-verified RED: The red_proof.py script mutates one production line, runs the scoped test command, reverts, and prints both runs — proving the test catches the defect, with a crash-safe journal so a killed run never leaves mutated source behind. - Isolation auditing: scan_uncontrolled_resources.py scans C#/TS test files for uncontrolled time, network, filesystem, environment, randomness, and shared state, downgrading findings to mitigated when fakes (FakeTimeProvider, MSW, fake timers) are present. - Stack extensions: Bundled dotnet (xUnit v3, Shouldly, WebApplicationFactory) and React (bun test, RTL, happy-dom, Playwright) extensions supply runner commands and red-proof command shapes. - Use Case: Ask for tests for a pricing module; the Skill builds a target card, derives oracles independent of the implementation, writes one test at a time, proves each reddens via mutation, and reports a table of behaviors with red evidence. ## Quick Start Ask the agent to design and write tests for a specific file, behavior, or bug — or just say "write some tests" and let it identify the highest-risk untested target.

Frequently Asked Questions about design-tests

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

FAQPage Schema
How do I write tests that actually catch bugs?

Design each test from a failure mode, derive expected values from an independent oracle, and prove the test fails by mutating one production line with red_proof.py. A test that has never failed is an unproven claim.

How do I decide what to test first in a large codebase?

Check uncommitted changes first, then coverage artifacts, then production files with no test file. Rank candidates by risk: auth, money, state machines, time/retry logic, datastore writes, and external I/O before pure functions.

Does this test design workflow support .NET and React?

Yes. It ships stack extensions for dotnet (xUnit v3, Shouldly, FakeTimeProvider, WebApplicationFactory) and React (bun test, React Testing Library, happy-dom, MSW, Playwright), each with scoped runner and red-proof command shapes.

Why does my scoped dotnet test run pass with zero tests?

A dotnet test --filter or bun test path that matches nothing exits 0 and looks like success. Always check the pasted runner output shows a non-zero test count, not just a zero exit code.

When should I not use this test design skill?

Do not use it to judge tests that already exist — that is the review-tests skill's job — or to diagnose a single already-flaky failure, which belongs to flaky-test diagnosis. It designs and writes new coverage only.