Skip to content
Agentmart
Submit a tool

test-driven-development

Test-driven development discipline - RED-GREEN-REFACTOR cycle with strict enforcement.

Skill by 5DLabsInc

IndexedAGPL-3.0
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/5dlabsinc-test-driven-development

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Test-driven development discipline - RED-GREEN-REFACTOR cycle with strict enforcement. Use when implementing any feature or bugfix, before writing implementation code.

Use cases: testing, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/test-driven-development

What's inside

Skill name
test-driven-development
Description
Test-driven development discipline - RED-GREEN-REFACTOR cycle with strict enforcement. Use when implementing any feature or bugfix, before writing implementation code.
License
AGPL-3.0
Instructions
370 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Test-Driven Development (TDD)

Write the test first. Watch it fail. Write minimal code to pass.

## When to Use

**Always:**

- New features
- Bug fixes
- Refactoring
- Behavior changes

**Exceptions (ask first):**

- Throwaway prototypes
- Generated code
- Configuration files

Thinking "skip TDD just this once"? Stop. That's rationalization.

---

## The Iron Law

```
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
```

Write code before the test? Delete it. Start over.

**No exceptions:**

- Don't keep it as "reference"
- Don't "adapt" it while writing tests
- Don't look at it
- Delete means delete

Implement fresh from tests. Period.

---

## Red-Green-Refactor Cycle

```
┌─────────────────────────────────────────────────────────────┐
│                                                              │
│   RED ──────────► GREEN ──────────► REFACTOR                │
│    │                │                   │                    │
│    │                │                   │                    │
│    ▼                ▼                   ▼                    │
│  Write           Minimal            Clean up                │
│  failing         code to            (tests stay             │
│  test            pass               green)                  │
│    │                │                   │                    │
│    └────────────────┴───────────────────┘                   │
│                     │                                        │
│                     ▼                                        │
│                   NEXT                                       │
│                   TEST                                       │
└─────────────────────────────────────────────────────────────┘
```

### RED - Write Failing Test

Write one minimal test showing what should happen.

**Good:**

```rust
#[test]
fn retries_failed_operations_3_times() {
    let attempts = AtomicUsize::new(0);
    let operation = || {
        let count = attempts.fetch_add(1, Ordering::SeqCst);
        if count < 2 {
            Err(anyhow!("fail"))
        } else {
            Ok("success")
        }
    };

    let result = retry_operation(operation, 3);

    assert_eq!(result.unwrap(), "success");
    assert_eq!(attempts.load(Ordering::SeqCst), 3);
}
```

Clear name, tests real behavior, one thing.

**Bad:**

```rust
#[test]
fn retry_works() {
    let mock = MockFn::new()
        .returning_err(anyhow!("fail"))
        .returning_err(anyhow!("fail"))
        .returning_ok("success");
    retry_operation(mock, 3);
    assert_eq!(mock.call_count(), 3);
}
```

Vague name, tests mock not code.

**Requirements:**

- One behavior
- Clear name
- Real code (no mocks unless unavoidable)

### Verify RED - Watch It Fail

**MANDATORY. Never skip.**

```bash
cargo test retry_operation -- --nocapture

From 5DLabsInc/cto, AGPL-3.0.

More from 5DLabsInc/cto

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Apr 26, 2026 (6 months ago)
Last release
May 31, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
AGPL-3.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from 5DLabsInc

Cite this page

test-driven-development skill. Agent Mart. https://agentmart.dev/skills/5dlabsinc-test-driven-development (last updated 2026-10-24)