# test driven development

> Enforce Red-Green-Refactor and Prove-It bug fixing workflows to ensure every code change is verified by tests.

test driven development is a free AI agent skill on Agensi by 郭睿桓（Richard）, in Testing & Debugging. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [郭睿桓（Richard）](https://www.agensi.io/creators/richard-3)
- Category: [Testing & Debugging](https://www.agensi.io/skills/testing-debugging)
- Rating: 5.0 out of 5 from 2 reviews
- Uses: 6
- Version: 1.0
- Last updated: 2026-10-18
- Security: scan passed (2026-10-18); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/test-driven-development
- Tags: testing, tdd, typescript, pytest, jest, code-review

## About this skill

Logic is brittle without verification. Manual testing fails to scale and provides no regression safety. This skill enforces a strict test-driven development workflow to ensure code behaves as expected before it is even written. It shifts the focus from writing code that seems to work to writing code that is proven to work.

### What it does
- **Red-Green-Refactor enforcement** drives every code change through a cycle of failure, minimal implementation, and cleanup.
- **Prove-It bug fixing** requires a failing reproduction test before any fix is attempted, preventing phantom fixes.
- **Project stack discovery** automatically identifies build tools, test frameworks, and local wrappers like `./gradlew` or `pytest`.
- **Test pyramid alignment** prioritizes fast unit tests over heavy integration and E2E flows to maintain suite performance.
- **State-based assertion** focuses on outcomes rather than internal method calls to keep tests resilient during refactoring.

### How it works
1. **Discover** the repository's specific testing commands, file conventions, and existing patterns.
2. **RED** step involves writing a test that demonstrates the desired behavior or reproduces a reported bug.
3. **GREEN** step implements the minimum code necessary to satisfy the failing test.
4. **REFACTOR** step cleans up the implementation while using the new test as a safety net.

### Frameworks & tools
The skill works with any language ecosystem including Node.js (Jest, Vitest), Python (pytest), Java (JUnit, Gradle), Go, and Rust. It integrates with Chrome DevTools MCP for runtime browser verification.

### Why this beats prompting it yourself
Generic prompts often lead to tests written after the code, which only verify what the code already does rather than what it should do. This skill embeds the Red-Green-Refactor loop into the agent's core decision logic, ensuring that reproduction tests for bugs are never skipped.

### Use cases
- Implementing new business logic with built-in documentation and safety.
- Fixing reported bugs by first proving they exist with a test case.
- Refactoring legacy codebases where existing behavior must be preserved.
- Verifying complex browser interactions using runtime DOM and console inspection.

### Known limitations
This skill focuses on behavioral logic and excludes pure configuration, documentation, or static content changes. High-level E2E tests are limited to critical paths to avoid suite bloat.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the test driven development skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill differ from simply asking an AI to 'write tests for this code'?

This skill forces the AI agent to follow a strict Red-Green-Refactor cycle, preventing it from writing implementation code until a failing test exists. This ensures 100% test coverage for new features and prevents 'phantom fixes' where a bug appears solved but persists in edge cases.

### Which AI agents and programming languages are compatible with this skill?

The skill is designed for any agent capable of file system access and terminal execution. It works across all major languages and frameworks, including Node.js, Python, Java, Go, and Rust, by automatically discovering your specific build tools and test runners.

### What is included in the purchase of the Test Driven Development skill?

Upon purchase, you receive the specialized skill logic, configuration templates for various environments, and documentation on how to integrate the TDD workflow into your agent's task lifecycle.

### Do I need to manually tell the agent which testing framework I am using?

No manual configuration is required; the skill performs 'Project Stack Discovery' to identify your existing test frameworks (like Jest or pytest) and local wrappers (like ./gradlew) to ensure it uses your project's specific conventions.

### Are there any specific types of tasks where this skill should not be used?

The skill focuses on behavioral logic and code reliability; it is not intended for pure documentation updates, static content changes, or UI/UX styling that doesn't involve functional logic.

### Will using this skill significantly slow down my agent's development speed or test suite?

By prioritizing the 'Test Pyramid,' the skill favors fast-executing unit tests over slow integration or E2E tests. This ensures that while your code is fully verified, your CI/CD pipeline and local test suite remain performant and responsive.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
