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.mdCopy 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
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
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
- Inspect the relevant code, existing tests, and local conventions before editing.
- Write the smallest regression test that demonstrates the requested behavior or reproduces the bug.
- Run that test and confirm it fails for the expected reason, not because the test setup is broken.
- Make the smallest production change that makes the test pass.
- Run the focused test again, then run the surrounding module suite.
- Review the diff for unrelated changes, brittle assertions, hidden state, and missing error paths.
- 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
Comments
- …
More skills from this repository
odysseus
95kLets your agent read and update your Odysseus data, such as to-dos, email, calendar, memory and documents, through a scoped token.
odysseus
95kLets your agent read and update your Odysseus data, such as to-dos, email, calendar, memory and documents, through a Codex Agent token.
artifact-completion
95kHelps your agent produce a requested file or document early, refine it from real output, and check it before saying it is finished.
terminal-recovery
95kHelps your agent recover from failed terminal commands by reading the error, finding the likely cause and trying one targeted fix.
Similar skills
test-driven-development
311kTeaches your agent to write a failing test first, watch it fail, then write the smallest code that passes, before building any feature or fix.
verification-before-completion
311kTeaches your agent to run real checks and read their output before claiming that a task, fix, or build is complete or passing.
migrate-to-shoehorn
310kReplaces risky type casts in your test files with the shoehorn library, so tests can use partial data and still pass type checks.