# Test Driven Development

> Use when implementing non-trivial code changes that should follow TDD (write a failing test first, make the smallest passing change, then refactor safely).

- **Type:** Skill
- **Install:** `agentstack add skill-narumiruna-skills-test-driven-development`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [narumiruna](https://agentstack.voostack.com/s/narumiruna)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [narumiruna](https://github.com/narumiruna)
- **Source:** https://github.com/narumiruna/skills/tree/main/skills/deprecated/test-driven-development

## Install

```sh
agentstack add skill-narumiruna-skills-test-driven-development
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# TDD Policy

- Non-trivial changes SHOULD begin with a test.
- A test SHOULD fail before implementation begins whenever practical (red → green → refactor).
- Implementation SHOULD follow the red → green → refactor cycle.
- Implement the smallest change required to make the test pass.
- Refactoring MUST happen only after tests pass and MUST NOT change behavior.
- Tests MUST act as executable specifications of behavior, not merely coverage.
- Tests MUST assert observable behavior, not implementation details.
- Bug fixes SHOULD include a regression test when feasible.
- Code changes SHOULD include corresponding test updates when behavior changes.
- Tests MUST be deterministic and isolated from uncontrolled inputs (for example network, time, or randomness).
- Tests SHOULD avoid reliance on external systems unless explicitly intended.
- External dependencies SHOULD be controlled appropriately.
- Tests SHOULD target the lowest meaningful level.
- Integration and end-to-end tests SHOULD complement lower-level tests where needed.
- Tests MUST NOT be weakened or removed to satisfy incorrect implementations.
- Tests SHOULD fail for a single clear reason.
- When tests cannot be added, this MUST be rare and explicitly justified, including:
  - why testing is not feasible
  - what risk remains
  - how the change was validated
- Skipping TDD for non-trivial changes REQUIRES explicit justification.

## Scope

- Non-trivial changes include:
  - Bug fixes
  - New features
  - Behavior changes
  - Data transformations
  - Business logic or query changes

- Excluded:
  - Pure formatting changes
  - Renames without behavior change
  - Comment or documentation updates

### Exceptions

- TDD MAY be relaxed for:
  - Rapid prototyping or spike solutions
  - Exploratory coding where requirements are unclear
  - Pure UI layout or styling changes

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [narumiruna](https://github.com/narumiruna)
- **Source:** [narumiruna/skills](https://github.com/narumiruna/skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-narumiruna-skills-test-driven-development
- Seller: https://agentstack.voostack.com/s/narumiruna
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
