# Tdd

> Enforce strict RED-GREEN-REFACTOR test-driven development cycle

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

## Install

```sh
agentstack add skill-sakhilchawla-skillkit-tdd
```

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

## About

# Test-Driven Development

Implement $ARGUMENTS using strict RED-GREEN-REFACTOR discipline.

## Phase 1: RED — Write a failing test

1. Understand the requirement from $ARGUMENTS
2. Write ONE test that describes the desired behavior
3. Run the test — it MUST fail
4. Verify it fails for the RIGHT reason (not syntax/import errors)
   - If it fails for the wrong reason, fix the test setup first
5. Do NOT write any production code yet

## Phase 2: GREEN — Make it pass

1. Write the MINIMUM code to make the failing test pass
2. Do not add features beyond what the test requires
3. Run ALL tests (not just the new one) — they must ALL pass
4. If existing tests break, fix them before continuing

## Phase 3: REFACTOR — Clean up

1. Look for duplication, unclear names, overly complex logic
2. Refactor while keeping ALL tests green
3. Run tests after each refactoring step
4. If any test breaks during refactor, undo the last change

## Cycle

Repeat Phase 1-3 for each behavior. One test at a time. Never write production code without a failing test.

## Rules

- Never skip RED. Every behavior needs a failing test first.
- Never write more code than the test demands in GREEN.
- Never break existing tests.
- Remove all debug artifacts (console.log, .only, .skip) before completing.
- Detect the test framework from project config (jest, vitest, pytest, go test, cargo test, etc.)

## Source & license

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

- **Author:** [sakhilchawla](https://github.com/sakhilchawla)
- **Source:** [sakhilchawla/skillkit](https://github.com/sakhilchawla/skillkit)
- **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-sakhilchawla-skillkit-tdd
- Seller: https://agentstack.voostack.com/s/sakhilchawla
- 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%.
