Skip to content
Back to skills

Maestro Tdd

ASecurity

Use when writing or fixing code that has logic, such as a business rule, a calculation, a price, a date or validation helper, an access check, a parser, or any bug fix, before writing the implementation. Not for templates, styling, config, wiring or generated code.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
ai-agentsrustgotesting

Security analysis

A100/100

Scanned December 4, 2026

npx -y skills add ddtcorex/maestro-skills --skill maestro-tdd --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Maestro Tdd?

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

Security grade badge for Maestro Tdd
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ddtcorex-maestro-tdd/badge)](https://www.skillsdirectory.com/skills/ddtcorex-maestro-tdd)

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: maestro-tdd
description: Use when writing or fixing code that has logic, such as a business rule, a calculation, a price, a date or validation helper, an access check, a parser, or any bug fix, before writing the implementation. Not for templates, styling, config, wiring or generated code.
compatibility: claude, codex, opencode, copilot, dsh
---

# Test-driven development

Write the test first, watch it fail, write the minimum code to pass. If you did not watch the test fail, you do not know it tests the right thing.

## When not to use

- Templates, styling, config, wiring and generated code: check instead (the page renders, lint passes, the console is clean).
- A throwaway prototype the user agreed is throwaway.
- A bug you cannot reproduce in a test (display only, browser only): say so and write the manual steps that reproduce it.

## The rule

No production code for logic without a failing test first. Code written before its test is deleted and rewritten from the test: not kept as reference, not adapted.

## The cycle

1. **Red.** One test, one behaviour, named after the behaviour, real code and no mocks unless unavoidable.
2. **Watch it fail.** Run it with the project's own test command. It must fail because the behaviour is missing, not because of a typo or an error. A test that passes immediately tests existing behaviour: fix the test.
3. **Green.** The simplest code that passes. No options, no extra features, no cleanup of other code.
4. **Watch it pass.** The test passes, the output has no errors or warnings, and the other tests still pass.
5. **Refactor** only while green: remove duplication, improve names, add no behaviour.

Before calling the change done, run the project's whole test suite, not just your file, even when the task named one file. Report every failure by name, including ones you did not cause. A red test you watched scroll past and did not mention is a false report.

When you cannot run the tests (no approval for the command, no runner installed), do not leave the code unwritten. Write the test and then the implementation, say plainly that the red and the green were not watched, and give the exact command that runs them. Unverified is a statement you make, never a reason to stop.

## Bug fixes

Write the test that reproduces the bug first, watch it fail for that reason, then fix. Never fix a bug without a test.

## What a good test looks like

- It names the production change that would make it fail, before you write it.
- It asserts on real behaviour, never on what a mock was called with.
- Test-only code stays in test helpers, out of production classes.
- Edge cases of the rule are covered: empty, limits, invalid input, unauthorised.

## Rationalizations

| Excuse | Reality |
|---|---|
| "Too simple to test" | Simple code breaks, and the test takes seconds. |
| "I will test after" | Tests written after pass immediately, which proves nothing: you never saw them fail, and they are biased toward the cases you already remembered. |
| "I already tested it by hand" | Manual testing leaves no record and cannot be re-run when the code changes. |
| "Deleting this code is wasteful" | The time is spent either way. Keeping code you cannot trust is the waste. |
| "I need to explore first" | Fine. Throw the exploration away and start from the test. |
| "The test is hard to write" | Hard to test means hard to use. Simplify the interface. |

## Red flags: stop and start over

Code before its test. A test that passes immediately. A failure you cannot explain. Tests "added later". "Just this once". "It is about the spirit, not the ritual".

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.