v0.5.1 · MIT · pure markdown · full + lite

Your AI wrote a test.
Did it ever fail? Now it counts.

coder-tdd-qa is a portable rulebook that makes AI coding agents prove their work — test-first, with verbatim evidence — instead of declaring "done, it works."

View on GitHub Read the rules

The problem, in plain English

AI coding assistants have a bad habit: they write code, say it works, and move on — without proving it. Worse, a rule like "always write tests" is easy to satisfy dishonestly: an agent can write a test that asserts nothing, exercises a mock, or passes whether or not the feature works. And when asked for test results, the agents most likely to be wrong are the ones most likely to summarize the output — which is exactly where hidden failures go to die.

This rulebook closes those loopholes with one core idea: a test only counts once the agent has watched it fail. Write the test, watch it fail on its assertion, then write the code that turns it green — and paste the raw output at each step, counts verbatim, failures in full. Before sign-off, the agent must also try to break its own change and report what happened.

You don't need to understand the rules to benefit. Install the file; your agent follows them.

Quick start

Claude Code

# personal (all projects)
mkdir -p ~/.claude/skills/coder-tdd-qa
curl -o ~/.claude/skills/coder-tdd-qa/SKILL.md \
  https://raw.githubusercontent.com/scottconverse/coder-tdd-qa/main/SKILL.md

Codex / any other agent

Paste everything below the YAML frontmatter of SKILL.md into your repo's AGENTS.md or the agent's system prompt. The body is harness-agnostic by construction — no tool names, no loader features, no file-layout assumptions.

Lite — for small tasks

SKILL-LITE.md is the condensed contract: the same non-negotiable rules, evidence format, and TDD loop (kept identical to the full document by a CI-enforced sync check), minus workflow and release ceremony. Built-in tripwire escalates back to the full standards when a change outgrows one file, touches untrusted input, auth, or secrets, or is being pushed.

The TDD loop

BASELINE run suite first RED watch it fail GREEN minimum code REFACTOR tests as a net WIDEN + FALSIFY try to break it next behavior — small cycles, minutes not hours every step: exact command + verbatim counts + failures in full
Bug fixes start at RED with a failing reproduction test — it proves the diagnosis, proves the fix, and prevents the regression forever.

What's in the rulebook

9 hard rules

Read before write, baseline before change, run before done, TDD for logic, no secrets — non-negotiable. Four more overridable with acknowledged risk.

Anti-fabrication evidence

Exact command, verbatim counts line, every failure in full. Only per-test PASS spam may collapse. Summarized output counts as no output.

Falsification pass

Before sign-off the agent attacks its own change — edge cases and hostile inputs it's least confident about — and reports what happened.

Baseline & checkpoints

Suite state recorded before any change; a commit or stash exists before risky refactors, so "revert to known-good" is always real.

Security with teeth

Five concrete per-change questions — trust boundaries, authn/authz, secrets, unsafe eval, dep vulns. Blanket "N/A" disallowed.

Honest escape hatches

Spikes, untestable surfaces, generated code — allowed, but declared. The rules bend where reality bends, never silently.

Release gate — ceremony scales with stakes

A push to a public remote is a release event, not a build step. But a weekend utility shouldn't get flagship ceremony:

Tier 1Every public repo — secrets scan, LICENSE / README / CHANGELOG / .gitignore, full suite green with evidence.
Tier 2Published packages (PyPI/npm) — semver in every location, accurate metadata, clean package build, constrained deps, stranger-runnable tests.
Tier 3Flagship projects, on request — plain-language user manual, landing page with real architecture diagrams, genuine welcome post + maintainer-authored FAQ (never fake community threads).

Technical notes

Zero dependencies. One markdown file, ~450 lines. No build, no runtime, nothing to install beyond copying the file.

Portability is a hard constraint. The rule body never references a specific harness, tool, or loader — that's enforced in CONTRIBUTING.md, along with a five-question adversarial read-through that every change must survive: can an agent satisfy the new rule with a test that asserts nothing? By summarizing output? When the suite starts red? In autonomous no-confirmation mode? On a project too small for the ceremony?

Designed for autonomy. No blocking "are you sure?" steps — the agent states scope in a line and proceeds, stopping only when ambiguity genuinely forks the implementation.

Written for the weakest agent that might read it. The rulebook assumes the host harness provides no other guidance — numbered checklists over prose, reporting hooks on every rule, communication standards included. A bare 7B local model gets the same scaffolding a flagship model does.