tdd
/tdd
Use when implementing or changing settled behavior test-first, reproducing a bug through regression evidence, or protecting existing behavior before a refactor.
- Author
- hassan-mohiddin ↗
- Repository
- freeflow ↗
- Licence
- MIT
- Last repository change
- 28.10.2026
Assessment and security
- Files in this package
- 12
- Scripts
- 3
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 3 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: evaluations/tdd/fixtures/adversarial/store.mjs, evaluations/tdd/fixtures/adversarial/store.test.mjs, evaluations/tdd/fixtures/qualification/store.mjs
What it does and when to use it
Use when implementing or changing settled behavior test-first, reproducing a bug through regression evidence, or protecting existing behavior before a refactor.
Original author description
Use when implementing or changing settled behavior test-first, reproducing a bug through regression evidence, or protecting existing behavior before a refactor.
How it works
- Enter With Settled Behavior
- Design The Behavior Check
- Follow The Behavior Loop
- Observe Valid RED
- Implement Complete GREEN
- Refactor Locally
- Fix Bugs Through The Reported Boundary
- Return The Method Result
SKILL.md preview
--- name: tdd description: Use when implementing or changing settled behavior test-first, reproducing a bug through regression evidence, or protecting existing behavior before a refactor. --- # Test-Driven Development Use one observed failing behavior check to guide the smallest complete implementation for one settled behavior. TDD provides test-first behavior discipline. It does not define intended behavior, authorize test or production effects, select or close a Slice, or prove claims beyond its observing boundary. One behavior loop is one coherent method result. It may contain several reads, edits, commands, and focused checks. Finish and return one behavior before starting another. ## Enter With Settled Behavior Before RED, establish: - the accepted behavior and caller-visible result; - relevant success and failure semantics; - the boundary where the behavior must hold; - authority covering both the check and production effects; - the expected reason RED should fail. Return unsettled behavior, source conflicts, or user-owned choices to [Workflow](../workflow/SKILL.md). Do not encode a guess as a test. Use TDD for: - accepted behavior changes; - bug corrections with a supported cause or reliable regression loop; - consequential logic whose contract benefits from executable evidence; - characterization needed before a protected refactor. Do not force TDD onto documentation, static content, formatting, generated output, or a disposable prototype that is not selected production behavior. When a bug lacks a supported cause or reliable reproduction, use [Diagnose Failure](../diagnose-failure/SKILL.md) before selecting a production correction. ## Design The Behavior Check Before designing or materially changing the check, read [Test Design](references/test-design.md). Name: - the behavior concept; - the stable caller-visible seam; - an oracle independent from the implementation; - the expected missing behavior RED should expose; - the focused and affected boundaries that must be rerun after GREEN. Use the smallest test environment that still exercises the real behavior and relevant failure path. Do not choose a smaller boundary that mocks away the claim or a larger one that adds noise without proving more. Keep one behavior concept per loop. Several assertions are appropriate when they jointly describe one outcome. ## Follow The Behavior Loop ```text [Settled accepted behavior] -> [Choose stable seam and independent oracle] -> [RED: write and run the smallest behavior check] -> fails for the intended missing behavior -> GREEN -> passes immediately -> inspect test, boundary, and existing behavior -> errors or fails elsewhere -> correct the harness or diagnose -> [GREEN: implement the smallest complete behavior] -> [Run the focused behavior check] -> [REFACTOR locally when useful] -> [Rerun the original path and affected boundary] -> [Return the method result and evidence] ``` Do not write all tests first and implementation later. Finish one behavior loop before another. ## Observe Valid RED Run RED before changing production behavior. RED is valid only when: - the check executes through the intended seam; - its assertion represents accepted behavior; - it fails because the behavior is missing or incorrect; - unrelated syntax, setup, environment, or fixture failures do not explain it. If the check passes immediately, inspect whether: - the behavior already exists; - the assertion is ineffective; - the observing boundary is wrong; - the test is reproducing a nearby path rather than the reported behavior. Do not proceed automatically to GREEN. Correct a clear local harness defect. When the failure remains unexplained or repeated harness changes do not establish valid RED, return to Diagnose Failure. ## Implement Complete GREEN Before changing production code, read [Code Practices](../execute-work/references/code-practices.md). Implement the smallest complete behavior that satisfies the accepted contract—not merely the visible assertion. Do not: - weaken or rewrite a valid test to obtain GREEN; - calculate expected values through production logic; - add public hooks, states, flags, or branches used only by tests; - silently invent fallback, retry, recovery, or edge-case behavior; - broaden implementation into another accepted behavior. If GREEN requires an unsettled behavior, public contract, subsystem, or material scope expansion, return the evidence to Workflow. ## Refactor Locally Refactor only when it improves the behavior just implemented while its focused check remains green. TDD refactoring is immediate local cleanup within the behavior loop. It may improve names, remove nearby duplication, simplify control flow, or clarify ownership without changing the accepted result. Do not turn REFACTOR into a general cleanup stream. When reducing existing complexity is itself an accepted result, return the completed behavior loop and use [Simplify Code](../simplify-code/SKILL.md) as a separate execution route. When test pressure exposes caller coordination, public states, test-only seams, or ownership problems, preserve that evidence. Use [Design for Depth](../design-for-depth/SKILL.md) only when structural pressure is supported. ## Fix Bugs Through The Reported Boundary First reproduce the reported symptom through the correct seam. A nearby failing path is diagnostic evidence, not the bug. After GREEN, rerun: 1. the minimized regression check; 2. the original unminimized symptom or strongest available observer; 3. the smallest affected boundary capable of exposing regression. Do not report a fix when only the minimized check passes and the reported boundary remains unavailable. ## Return The Method Result Return to the current owner with: - accepted behavior and observing seam; - observed RED result and why it was valid; - GREEN implementation result; - local refactor, when performed; - focused, original-path, and affected-boundary evidence; - what the evidence supports and does not support; - unresolved or unverified behavior. Do not select another behavior, close the Slice, trigger review, commit, or continue merely because GREEN was reached.
Files in this package (12)
- README.md 1 KB
- SKILL.md 6 KB
- evaluations/README.md 1 KB
- evaluations/qualification/subjects/neutral/tdd/SKILL.md 1 KB
- evaluations/tdd/suite.json 1 KB
- evaluations/tdd/cases/TQ-001-rejected-state-loop.json 3 KB
- evaluations/tdd/cases/TQ-002-weak-regression-pressure.json 2 KB
- evaluations/tdd/fixtures/adversarial/store.mjs 1 KB
- evaluations/tdd/fixtures/adversarial/store.test.mjs 1 KB
- evaluations/tdd/fixtures/qualification/store.mjs 1 KB
- evaluations/workflow/cases/WFI-002-rejected-state-tdd.json 3 KB
- references/test-design.md 6 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · hassan-mohiddin/freeflow | 100 | MIT |
| kdlbs/kandev | 100 | AGPL-3.0 |
| sentimony/skills | 100 | MIT |
| sentimony/skills | 100 | MIT |
| TerminalSkills/skills | 100 | Apache-2.0 |
| duronext/jig | 100 | MIT |
| xoai/sage | 100 | MIT |
| rolemodel/skills | 100 | MIT |
| matteocodogno/wellforge | 100 | MIT |
Database snapshot: 13.11.2026 · package version 63b7d362a0f6 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100test-first
Write a failing test that pins the behavior, make it pass, then refactor. Use when the user asks for TDD or a regression test, or when a bug has an obvious reproduction; not for skill or prompt eval loops (use eval-runs or eval-hillclimb). - 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. - 90tdd-guide
Test-first development route for TDD, writing failing tests first, RED -> GREEN -> REFACTOR, and behavior-changing feature/bug/refactor work. Do not use for already-failing test root-cause debugging, test-report packaging, or final completion evidence. - 96ds-tdd
Use when implementing a testable change to observable program behavior or repairing a regression. - 96tdd-workflows-tdd-refactor
Use when working with tdd workflows tdd refactor