Skip to content
Skills Library
Programming · Testing

tdd

/tdd

Implements features using strict test-driven development — red-green-refactor cycle. Writes a failing test first, then minimal code to pass, then refactors. Use when building features that need high reliability.

Licence
MIT
Last repository change
02.05.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 02.05.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Implements features using strict test-driven development — red-green-refactor cycle. Writes a failing test first, then minimal code to pass, then refactors. Use when building features that need high reliability.

Arguments

/tdd [feature or function to implement]
Original author description

Implements features using strict test-driven development — red-green-refactor cycle. Writes a failing test first, then minimal code to pass, then refactors. Use when building features that need high reliability.

How it works

  1. Detect Test Environment
  2. The TDD Cycle
  3. Test Progression
  4. Output
  5. Rules
Original SKILL.md headings · 52 lines, 326 words
SKILL.md preview
---
name: tdd
description: "Implements features using strict test-driven development — red-green-refactor cycle. Writes a failing test first, then minimal code to pass, then refactors. Use when building features that need high reliability."
argument-hint: "[feature or function to implement]"
allowed-tools: Read, Grep, Glob, Bash, Write, Edit
---

# Test-Driven Development

## Detect Test Environment
!`ls package.json pytest.ini pyproject.toml go.mod Cargo.toml *.csproj Gemfile mix.exs 2>/dev/null`
!`find . -type f \( -name "*.test.*" -o -name "*.spec.*" -o -name "test_*" -o -name "*_test.*" \) -not -path "*/node_modules/*" -not -path "*/.git/*" 2>/dev/null | head -5`

---

## The TDD Cycle

For the requested feature, repeat this cycle until complete:

### RED — Write a Failing Test
1. Write the smallest possible test that describes the next piece of behavior
2. The test must import/reference the function or module (even if it doesn't exist yet)
3. Run the test — it MUST fail
4. Verify the failure message is meaningful (not just a compilation error)

### GREEN — Make It Pass
1. Write the absolute minimum code to make the test pass
2. Hardcoding is acceptable at this stage — it will be cleaned up in refactor
3. Don't add functionality the test doesn't require
4. Run the test — it MUST pass
5. Run all related tests — nothing else should break

### REFACTOR — Clean Up
1. Remove duplication in both production and test code
2. Improve naming, extract methods, simplify logic
3. Run tests after every refactoring step — they must stay green
4. Stop when the code is clean

## Test Progression
Start simple, add complexity gradually:
1. Null/empty/zero case
2. Single item / simplest valid input
3. Multiple items / typical case
4. Edge cases / boundary values
5. Error cases / invalid input
6. Async / concurrent behavior (if applicable)

## Output
- Show each cycle clearly: RED (test code + failure), GREEN (impl + pass), REFACTOR
- Display test runner output at each step
- Final summary: all tests, coverage of the feature

## Rules
- NEVER write implementation before a failing test
- NEVER skip the refactor step
- One behavior per cycle — don't batch multiple features
- If the test framework isn't set up, set it up first

Versions

RepositoryScoreLicence
This page · viknesh20-20/claude-code-tool-kit90MIT
kdlbs/kandev100AGPL-3.0
sentimony/skills100MIT
sentimony/skills100MIT
TerminalSkills/skills100Apache-2.0
duronext/jig100MIT
xoai/sage100MIT
rolemodel/skills100MIT
matteocodogno/wellforge100MIT

Database snapshot: 13.11.2026 · package version ba2213e87ab0 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 3 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100red-green-refactor
    Guides the red-green-refactor TDD workflow: write a failing test first, implement the minimum code to make it pass, then refactor while keeping tests green. Use when a user asks to practice TDD, write tests first, follow red-green-refactor, do test-driven development, write…
  • 90test-driven-development
    Use when implementing any feature or bugfix in code — guides the strict RED-GREEN-REFACTOR cycle: write one failing test, confirm it fails for the right reason, write the minimal code to pass, refactor while the context is fresh.
  • 100tdd-expert
    Drive development with strict Red-Green-Refactor discipline - write one failing test, write the minimum code to pass it, refactor on green - including test-list planning and a worked kata cycle. Use when someone asks "write this test-first", "do TDD on this feature", "help me…
  • 100tdd-feature
    Red-green-refactor scaffold for building new features with TDD. Write failing tests first, then implement to pass. Use when building new features test-first.
  • 100test-driven-development-tdd-workflow
    Use this skill when developing software iteratively following the strict Red-Green-Refactor development cycle.
  • 100sdlc-tdd
    Test-driven development in vertical slices: agree the test seam, then one failing test, minimal code, refactor, repeat. Use whenever changing behaviour (features, fixes, T2 changes), when writing tests, or when the user says 'TDD' or 'red-green'.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.