Skip to content
Skills Library
Programming · Testing

tdd

/tdd

Drive a fix with /tdd when the user asks for a failing test or a regression test, or when a cheap local test path exists. Write the failing test, confirm the intended failure, apply the smallest fix, and rerun.

Repository
egm-stack ↗
Licence
Apache-2.0
Last repository change
11.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 11.11.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Drive a fix with /tdd when the user asks for a failing test or a regression test, or when a cheap local test path exists. Write the failing test, confirm the intended failure, apply the smallest fix, and rerun.

Original author description

Drive a fix with /tdd when the user asks for a failing test or a regression test, or when a cheap local test path exists. Write the failing test, confirm the intended failure, apply the smallest fix, and rerun.

How it works

  1. Workflow
  2. When a test is impractical
  3. Guardrails
  4. Construction rules
  5. Report
Original SKILL.md headings · 49 lines, 522 words
SKILL.md preview
---
name: tdd
description: Drive a fix with /tdd when the user asks for a failing test or a regression test, or when a cheap local test path exists. Write the failing test, confirm the intended failure, apply the smallest fix, and rerun.
license: Apache-2.0
---

# TDD

Use this skill only when the user asks for TDD or a regression test, or when the bug has an obvious cheap local test target. Skip it when the test path is unclear, expensive, integration-heavy, or not requested.

Make the broken behavior executable before you change production code. The goal is one focused regression test that fails before the fix and passes after it.

## Workflow

1. **Understand the bug.** State the intended behavior, the current behavior, the affected path, and the smallest observable reproduction.
2. **Choose the narrowest executable check.** Prefer the closest unit, component, or regression test that already covers the path. Do not create a new harness to satisfy the workflow.
3. **Write the failing test first.** Add the smallest test that would have caught the bug. The test states the intended behavior. It does not copy the current implementation.
4. **Run the test before the fix.** Confirm that it fails for the intended reason. When it passes, or fails for an unrelated reason, correct the test or the reproduction before you edit the implementation.
5. **Fix the bug.** Make the smallest production change that satisfies the intended behavior and keeps nearby contracts.
6. **Rerun the test and the nearby checks.** Confirm that the test passes and that the change did not break the path around it.

## When a test is impractical

Use the closest executable regression check instead. A targeted script, a manual reproduction, a snapshot, a log assertion, or a focused integration check all count.

Prefer no new test over a bad test. A bad test mostly tests mocks, encodes implementation details, depends on timing or global state, needs expensive infrastructure for a small fix, or would be deleted after it proves the fix.

## Guardrails

- Do not change a test to match a wrong implementation.
- Do not weaken an existing assertion unless the expected behavior really changed and the reason is clear.
- Keep the regression test on the bug. Avoid broad fixture churn and unrelated coverage.
- Make a flaky test deterministic where you can. Document the signal that the test locks down.
- When the bug exposes a wider class of failures, land the focused regression first and then consider sibling coverage.

## Construction rules

- Build the innermost layer first. Add each next layer only after the layers
  inside it exist, and connect them last.
- Define a layer's interface by what its caller needs, not what it owns.
- Prefer a fake you write by hand to a mocking library.
- Do not write a test that sleeps or depends on a time window. Freeze the
  clock and fix the seed instead.
- Run the new suite three times with a different seed each run, once in
  serial. A failure in any run is a finding, not bad luck.

## Report

Report the evidence, not just the outcome.

- Name the failing-before test or check and the failure it produced.
- Name the passing-after run and the nearby validation.
- When you cannot show the failing-before evidence, say why and name the closest regression check you used.
Files in this package (2)
  • CHANGELOG.md 1 KB
  • SKILL.md 3 KB

Versions

RepositoryScoreLicence
This page · jirayusueb/egm-stack100Apache-2.0
kdlbs/kandev100AGPL-3.0
sentimony/skills100MIT
sentimony/skills100MIT
TerminalSkills/skills100Apache-2.0
duronext/jig100MIT
xoai/sage100MIT
rolemodel/skills100MIT
matteocodogno/wellforge100MIT

Database snapshot: 13.11.2026 · package version 287c2867015e (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100eng-tdd
    Fix a bug test-first when there is a clear, cheap regression test path. Use when the user asks for TDD, a failing test, or a regression test, or when the bug has an obvious cheap local test target.
  • 100tdd-fix
    Use when fixing a bug test-first: write a failing test to reproduce it, find the root cause, fix, and add a regression test.
  • 100st-tdd
    Fix a bug by first writing a focused test that fails for the right reason, then making the smallest change that makes it pass. Use when the user asks for TDD or a regression test, when a bug has a cheap local test target, or for /st-tdd.
  • 100ds-tdd
    Fix a bug by first writing a focused test that fails for the right reason, then making the smallest change that makes it pass. Use when the user asks for TDD or a regression test, when a bug has a cheap local test target, or for /ds-tdd.
  • 100ds-tdd
    Fix a bug by first writing a focused test that fails for the right reason, then making the smallest change that makes it pass. Use when the user asks for TDD or a regression test, when a bug has a cheap local test target, or for /ds-tdd.
  • 100tdd-pstack
    TDD bug fix: write the failing regression test before the fix. Use only when the user explicitly asks for TDD or a failing/regression test, or when a bug has an obvious cheap local test target; use the full tdd workflow for feature TDD. Skip when the test path is unclear,…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.