Skip to content
Skillpedia
Testing95k · #1315

test-driven-development

What it does

This skill guides the AI through test-driven development: writing a test that shows the problem first, then making a small fix. It is for developers who want proof that a change works.

When to use it

  • ✓When you want a new feature built with a test written first.
  • ✓When you need to fix a bug and prove the fix with a failing test first.
  • ✓When you are changing behavior and want to avoid breaking existing tests.

Skill link

https://github.com/odysseus-dev/odysseus/blob/dev/resources/skills/general/test-driven-development/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/odysseus-dev/odysseus/blob/dev/resources/skills/general/test-driven-development/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Fix the bug where empty search results crash the page. Write a failing test first, then fix it.”

5 new skills a week. 1 minute to read.

How it works

The AI reads the existing code and tests, writes the smallest test that shows the expected behavior, and confirms it fails. It then makes the smallest change that passes the test and reviews the diff.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

When to Use

Use when implementing a feature, fixing a bug, or changing behavior where a regression test can define the expected result. Prefer this workflow for parser, routing, agent-loop, and UI behavior changes.

Procedure

  1. Inspect the relevant code, existing tests, and local conventions before editing.
  2. Write the smallest regression test that demonstrates the requested behavior or reproduces the bug.
  3. Run that test and confirm it fails for the expected reason, not because the test setup is broken.
  4. Make the smallest production change that makes the test pass.
  5. Run the focused test again, then run the surrounding module suite.
  6. Review the diff for unrelated changes, brittle assertions, hidden state, and missing error paths.
  7. Report the tests run and any remaining coverage or environment limits.

Pitfalls

  • Do not write a test that only mirrors the implementation; assert the user-visible contract.
  • Do not weaken an assertion just to make a failing test pass.
  • Do not skip the focused failing-test step when the behavior is observable in a local test.
  • Keep network, filesystem, and model calls deterministic with fakes or fixtures unless the integration itself is under test.

Verification

  • The new regression test fails before the fix and passes after it.
  • The relevant focused suite passes.
  • The broader suite passes or its failure is explained with evidence.
  • The final diff contains the test and the production change needed for the same behavior.
FAQ

Why must the test fail first?

The skill says a failing test shows the test really checks the behavior, rather than passing by accident.

Can it weaken a test to make it pass?

No. The skill says not to weaken an assertion just to make a failing test pass.

How are network calls handled in tests?

The skill keeps them predictable with fakes or fixtures, unless the connection itself is what is being tested.

Details

Original description by the author

Build or fix software with a focused red-green-refactor loop

repo: odysseus-dev/odysseus

Popularity

GitHub stars
95k
Ranking position
#1315
License
AGPL-3.0
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills