# Compound V Tdd

> Applies tests-first discipline (red/green/refactor) and adds regression tests for bugs. Use when implementing features, fixing bugs, or refactoring. Use when this capability is needed.

- Skill: `tomevault-io/compound-v-tdd` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/compound-v-tdd`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/compound-v-tdd/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/compound-v-tdd

---


# TDD Skill

**Announce at start:** "Using TDD: writing test first for [behavior]."

## When to use this skill

- new features that can be unit tested
- bug fixes (always add a regression test if practical)
- refactors (protect behavior with tests first)

## Research

Before writing tests, do research **in parallel** (invoke multiple tool calls in the same response):

- Search the web for the project's testing framework best practices and latest patterns (scope to `stack.md` versions).
- Search the web for assertion styles and testing utilities available in the framework.

## Rules

- Prefer **red -> green -> refactor**.
- If tests are hard, still add **verification**: minimal repro script, integration test, or clear manual steps.
- Keep tests focused: one behavior per test where possible.
- Name tests by behavior, not implementation details.

## Process

1. Define the behavior change (what should be true after).
2. Write/adjust a test to capture it (make it fail first if possible).
3. Implement the minimal change to pass.
4. Refactor if needed (keep passing).
5. Run the relevant test suite + any linters **in parallel** where they are independent.

## Output requirements

When you change code, include:

- what tests you added/changed
- how to run them
- what they prove

## Bite-sized granularity

Each step should be one action (2-5 minutes):

1. Write the failing test — step
2. Run it to confirm it fails — step
3. Implement the minimal code to make it pass — step
4. Run tests to confirm they pass — step
5. Commit — step

Don't combine these. Each step is independently verifiable.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/shermanhuman) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-14 -->

