Skip to content
Back to skills

Test Driven Development

ASecurity

Build a change test-first in small red, green, refactor steps. Use when implementing a feature, a bug fix or a refactor whose behavior a code test can pin down.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
ai-agentsgit

Security analysis

A100/100

Scanned December 4, 2026

npx -y skills add prasadm1022/hades-vault --skill test-driven-development --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Test Driven Development?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Test Driven Development
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/prasadm1022-test-driven-development/badge)](https://www.skillsdirectory.com/skills/prasadm1022-test-driven-development)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: test-driven-development
description: Build a change test-first in small red, green, refactor steps. Use when implementing a feature, a bug fix or a refactor whose behavior a code test can pin down.
license: MIT
version: 0.1.0
requires:
  tools: [fs.read, fs.list, fs.search, fs.write, fs.edit, exec.run, git]
  hosts: []
  classes: [read, write-local]
task-types:
  - software-development.feature
  - software-development.bug-fix
  - software-development.tests
  - software-development.refactor
---

# Test-driven development

Write the test that fails for the right reason before the code that makes it pass.

## The loop

1. Pick one behavior from the plan, the smallest step toward done.
2. Red. Write a test for it and run only that test. Read the failure: it must fail because the behavior is missing, not because of a typo or a bad import. A test that passes at once checks nothing new, so fix the test.
3. Green. Write the least code that passes. Returning a constant is fine when the next test will force the general version.
4. Run the whole test file, then the whole suite. Everything that passed before must still pass.
5. Refactor while the suite is green: remove duplication, improve names, one small move at a time, running the suite after each.
6. Commit on the work branch with a message that says which behavior now holds.
7. Repeat until every acceptance criterion has a passing test.

## Bug fixes

Reproduce first: write a test that fails on the bug exactly as reported. Fix the cause, not the symptom. Keep that test as the regression test.

## Rules

- Tests are deterministic: no network, no real clock, no sleeping, no state shared between tests. Use fakes and fixed clocks.
- Test behavior through the public surface. Do not assert on details a refactor would change.
- Never weaken, disable or delete an existing test to get a pass. If a test is wrong, say why in the report and fix it in its own commit.
- Say a test passed only if you ran it and read the result. Give the command and the counts as evidence.
- Work on the ticket's branch. Never commit to the default branch.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.