Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Lets Test First?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/sidereal-io-lets-test-first)
---
name: lets-test-first
description: "Use when implementing a change with test-driven development (TDD): work test-first through focused red-green cycles."
---
# Test-Driven Development
Use the repository's existing test tooling and conventions. Work through
one behavior at a time: first show a test failing because that behavior is
missing (red), then make it pass (green), then improve the code while tests
still pass (refactor).
One test, one behavior, one reason to fail. A test name describes that one
behavior; never use joiners such as "and", "or", or "etc." to combine
independent outcomes. Use several assertions only when together they
establish that one behavior.
Read [Plain language](../lets-shape/references/plain-language.md) before writing.
Use it for test names and failure reports: name the observable behavior and
explain what failed.
## Red
- Select one observable behavior from the requirement.
- Write one test before changing implementation code.
- Run the test and confirm it fails because the behavior is missing, not because the test is broken.
## Green
- Write only enough implementation code to pass the failing test.
- Run the test, then run the relevant suite.
- Do not add behavior without first seeing its test fail.
## Refactor
- Refactor only while the relevant suite is green, after completing a red-green slice.
- Refactor either the tests or the implementation in one pass, not both.
- Reuse shared setup, teardown, helpers, and parameterized structure when they clarify intent without combining behaviors.
- Rerun the relevant suite after each refactor pass.
## Patterns and anti-patterns
Read [patterns and anti-patterns](references/best-practices.md) when choosing a test shape, writing examples, or deciding whether cases belong together.
## Collaborators
Read [collaborators](references/collaborators.md) before replacing a dependency
with a test substitute. Mock system boundaries, not code owned by the
application: the reference explains where a substitute is appropriate.