Home / thoughtbot / rails-consultant · skills/test-driven-development/SKILL.md · GitHub

test-driven-development skillA

test-driven-development is agent-read markdown (skill) from thoughtbot/rails-consultant: Strict red-green-refactor TDD workflow for implementing features, fixing bugs, or changing behavior in Rails applications. Enforces the discipline of writing a failing test before any production code. Use whenever you want to implement with TDD — whether a new feature, a bugfix, a refactor, or any behavior change..

Indexed from public GitHub and served as immutable, content-addressed versions. Install it pinned to an exact SHA-256 with the mdr CLI, and every file is verified against the hash recorded here before it reaches your agent. The deterministic audit below grades the latest version, and the same file always earns the same grade.

What the file says

# Test-Driven Development (TDD)

## Overview

Write the test first. Watch it fail. Write minimal code to pass.

**Core principle:** If you didn't watch the test fail, you don't know if it tests the right thing.

**Violating the letter of the rules is violating the spirit of the rules.**

## The Iron Law

```
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
```

Write code before the test? Delete it. Start over.

**No exceptions:**

- Don't keep it as "reference"
- Don't "adapt" it while writing tests
- Don't look at it
- Delete means delete

Implement fresh from tests. Period.

## Outside-In Development

Start every feature with a high-level test that describes behavior from the user's perspective. Run it, read the failure, and let that failure dictate your next move. As failures push you down the stack, write a new failing test at each layer you drop into — never write code for a layer without a failing test at that layer demanding it.

Read `examples/outside-in-testing.md` for a walkthrough of the philosophy and `examples/testing-pyramid.md` for how test types combine into an optimal suite.

### One Change, One Run
…

Read the whole file at its exact version.

How to install

Latest version
mdr add thoughtbot/rails-consultant/test-driven-development@git:20260612.60eb9ca
Exact content
mdr add thoughtbot/rails-consultant/test-driven-development@sha256:03dcf33a19b910d7

Pin to a label to follow the author's releases, or to a sha256 to freeze the exact bytes forever. Either way the resolved hash is written to mdr.lock, and mdr install reproduces it on any machine.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_j7lkikzu3rkug2q2.svg)](https://markdownregistry.com/a/art_j7lkikzu3rkug2q2)

1 badge views in 30 days

Versions

versioncommittedcommitsizeaudit
git:20260612.60eb9ca latest2026-06-12 60eb9ca 17,851 BA view · diff
git:20260320.7db3a612026-03-20 7db3a61 14,506 BA view

Audit of the latest version

A  17 of 17 checks passed. Deterministic, no model, same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (17851 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

thoughtbot/rails-consultant · 26 stars · license MIT · pushed 2026-09-18 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_j7lkikzu3rkug2q2
GET https://markdownregistry.com/api/v1/resolve?ref=thoughtbot/rails-consultant/test-driven-development
GET https://markdownregistry.com/api/v1/blob/03dcf33a19b910d73c7e4e21c6ae70958dfe7f847404cc0340d595af5ce20507

Your agent does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

More from thoughtbot/rails-consultant

challenge skill
thoughtbot/rails-consultant · skills/challenge/SKILL.md · Pressure-test an assumption, decision, or inherited constraint — Socratic cross-examination that forces you to defend…
git:20260320.c372a42 · audit A · 26 stars
explain skill
thoughtbot/rails-consultant · skills/explain/SKILL.md · Explain what a piece of code does — a specific file, class, or method in close detail, or a user-facing flow as a…
git:20260320.c9c920e · audit A · 26 stars
feature-dev skill
thoughtbot/rails-consultant · skills/feature-dev/SKILL.md · Take one new feature slice from idea to reviewed, committed code in a single guided pass — scope it into the smallest…
git:20260730.4e2addb · audit A · 26 stars
git-commit skill
thoughtbot/rails-consultant · skills/git-commit/SKILL.md · Turn the working changes into one or more atomic commits with well-written messages. Use whenever the user runs…
git:20260717.8fbb8df · audit A · 26 stars
hard-news skill
thoughtbot/rails-consultant · skills/hard-news/SKILL.md · Prepare to deliver difficult technical news to a client — a conversational prep session before the hard conversation…
git:20260313.e9f2976 · audit A · 26 stars
offboard skill
thoughtbot/rails-consultant · skills/offboard/SKILL.md · Walk through the Designer/Developer wrap-up checklist for offboarding a client engagement — conversationally, one item…
git:20260320.0cc9cbc · audit A · 26 stars
prior-art skill
thoughtbot/rails-consultant · skills/prior-art/SKILL.md · Discover how a codebase already handles a specific concern — search broadly, find every instance, and assess…
git:20260313.e2ed4a0 · audit A · 26 stars
rubber-duck skill
thoughtbot/rails-consultant · skills/rubber-duck/SKILL.md · Think out loud about a problem, decision, or approach — Socratic friction to help you find clarity, not sympathy
git:20260325.3769383 · audit A · 26 stars
slice skill
thoughtbot/rails-consultant · skills/slice/SKILL.md · Turn a feature into well-defined, independently shippable slices — whether it's an epic that needs breaking apart or a…
git:20260730.9807306 · audit A · 26 stars
socratic-review skill
thoughtbot/rails-consultant · skills/socratic-review/SKILL.md · Socratic code review and refactoring session — whether it's your own code, a teammate's PR, or something you inherited…
git:20260729.47262f4 · audit A · 26 stars
standup skill
thoughtbot/rails-consultant · skills/standup/SKILL.md · Write a client update — identify what was done, what's next, and surface risks before they become surprises. End of…
git:20260313.e2ed4a0 · audit A · 26 stars

Every file in thoughtbot/rails-consultant

Other files named test-driven-development

test-driven-development skill
obra/superpowers · skills/test-driven-development/SKILL.md · Use when implementing any feature or bugfix, before writing implementation code
git:20260919.5bf4e78 · audit A · 291,204 stars
test-driven-development skill
addyosmani/agent-skills · skills/test-driven-development/SKILL.md · Drives development with tests using the red-green-refactor loop. Use when implementing any logic, fixing any bug, or…
git:20260907.cda4542 · audit A · 98,554 stars
test-driven-development skill
jnmetacode/superpowers-zh · skills/test-driven-development/SKILL.md · 在实现任何功能或修复 bug 时使用,在编写实现代码之前
v1.0.0 · audit A · 8,203 stars
test-driven-development skill
a5c-ai/babysitter · library/methodologies/superpowers/skills/test-driven-development/SKILL.md · Use when implementing any feature or bugfix, before writing implementation code. Enforces RED-GREEN-REFACTOR cycle.
git:20260601.da7723a · audit A · 1,809 stars
test-driven-development skill
a5c-ai/babysitter · library/methodologies/rpikit/skills/test-driven-development/SKILL.md · Test-first development practice where test specifications are written before production code, integrated into plan…
git:20260601.da7723a · audit A · 1,809 stars
test-driven-development skill
a5c-ai/babysitter · library/methodologies/cc10x/skills/test-driven-development/SKILL.md · Strict RED-GREEN-REFACTOR cycle enforcement. Tests are never skipped or deferred. Run mode only, never watch mode. Exit…
git:20260601.da7723a · audit A · 1,809 stars
test-driven-development skill
ganyuanran/aegis · skills/test-driven-development/SKILL.md · Use when the user explicitly requests strict or test-first TDD, or when the current conversation already contains an…
git:20260723.88b8ec9 · audit A · 1,280 stars
test-driven-development skill
mateaix/mateclaw · mateclaw-server/src/main/resources/skills/test-driven-development/SKILL.md · TDD: enforce RED-GREEN-REFACTOR, tests before code.
v1.1.0 · audit A · 1,127 stars

Browse by kind, by grade A, or by owner.