brainstorming-and-plan…
Use before ANY creative work — creating features, building components, adding functionality, modifying behavior, or starting a…
Enforces strict test-driven development. Use when implementing ANY feature, bugfix, or refactor — before writing implementation code. Also use when someone says 'add tests', 'write tests', 'test this', 'TDD', or when you're about to write production code of any kind. If you're
Claude Code
$ npx -y skills add burhankhatri/e2e-testing --skill tdd --agent claude-code
Codex
$ npx skills add burhankhatri/e2e-testing --skill tdd -a codex -y
Cursor
$ npx skills add burhankhatri/e2e-testing --skill tdd -a cursor -y
Gemini CLI
$ npx skills add burhankhatri/e2e-testing --skill tdd -a gemini-cli -y
GitHub Copilot
$ npx skills add burhankhatri/e2e-testing --skill tdd -a github-copilot -y
OpenCode
$ npx skills add burhankhatri/e2e-testing --skill tdd -a opencode -y
Windsurf
$ npx skills add burhankhatri/e2e-testing --skill tdd -a windsurf -y
name: tdd description: "Enforces strict test-driven development. Use when implementing ANY feature, bugfix, or refactor — before writing implementation code. Also use when someone says 'add tests', 'write tests', 'test this', 'TDD', or when you're about to write production code of any kind. If you're about to write code and there isn't a failing test for it yet, STOP and use this skill."
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Write code before the test? Delete it. Start over.
**No exceptions:**
Implement fresh from tests. Period.
The agent optimizes for green. These rules make green mean true. Every one of them closes a loophole that was actually exploited in real projects using this skill (a July 2026 audit found 18 of 25 E2E tests in one repo permanently `test.skip`-guarded — they had never run once — and Anthropic, METR, and Kent Beck all document agents disabling or deleting tests to pass).
1. EVIDENCE THE RED Run the new test and SHOW its failing output before
writing any implementation. It must fail for the
right reason — the missing behavior, not an import
error or typo. No observed red = the cycle never
happened.
2. FIX CODE, NOT TESTS Never delete, weaken, .skip, or loosen a test to
reach green. If you believe the test itself is
wrong, STOP, say so explicitly, and get the user's
agreement before changing it.
3. SKIPPED = FAILING "7 passed, 18 skipped" is a red suite. Always
report full counts (passed / failed / skipped).
A test that has never executed proves nothing.
4. CAN'T MAKE IT REAL? Missing test user, credentials, test DB, seed
STOP AND ASK. data — that one-time setup is the user's call.
Ask for it. Do not mock around it. Do not skip.**Core principle**: Tests should verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't.
**Good tests** are integration-style: they exercise real code paths through public APIs. They describe _what_ the system does, not _how_ it does it. A good test reads like a specification - "user can checkout with valid cart" tells you exactly what capability exists. These tests survive refactors because they don't care about internal structure.
**Bad tests** are coupled to implementation. They mock internal collaborators, test private methods, or verify through external means (like querying a database directly instead of using the interface). The warning sign: your test breaks when you refactor, but behavior hasn't changed. If you rename an internal function and tests fail, those tests were testing implementation, not behavior.
See [tests.md](tests.md) for examples, [mocking.md](mocking.md) for mocking guidelines, and [deep-modules.md](deep-modules.md) / [interface-design.md](interface-design.md) for designing testable interfaces.
**DO NOT write all tests first, then all implementation.** This is "horizontal slicing" - treating RED as "write all tests" and GREEN as "write all code."
This produces **crap tests**:
**Correct approach**: Vertical slices via tracer bullets. One test → one implementation → repeat. Each test responds to what you learned from the previous cycle.
WRONG (horizontal): RED: test1, test2, test3, test4, test5 GREEN: impl1, impl2, impl3, impl4, impl5 RIGHT (vertical): RED→GREEN: test1→impl1 RED→GREEN: test2→impl2 RED→GREEN: test3→impl3 ...
Write ONE minimal test showing what should happen.
**Requirements:**
<Good>
test('retries failed operations 3 times', async () => {
let attempts = 0;
const operation = () => {
attempts++;
if (attempts < 3) throw new Error('fail');
return 'success';
};
const result = await retryOperation(operation);
expect(result).toBe('success');
expect(attempts).toBe(3);
});Clear name, tests real behavior, one thing </Good>
<Bad>
test('retry works', async () => {
const mock = jest.fn()
.mockRejectedValueOnce(new Error())
.mockResolvedValueOnce('success');
await retryOperation(mock);
expect(mock).toHaveBeenCalledTimes(2);
});Vague name, tests mock not code </Bad>
npm test path/to/test.test.ts
**Show the failing output in your message.** Then confirm:
**Test passes?** You're testing existing behavior. Fix the test. **Test errors?** Fix the error, re-run until it fails correctly.
Best practice: commit the failing test on its own (`test: ...`) before implementing. The red phase becomes provable in git history.
Write the SIMPLEST code to pass the test. Nothing more.
Don't add features, refactor other code, or "improve" beyond what the test requires.
npm test path/to/test.test.ts
Confirm: Test passes, othe
A set of 8 global skills for Claude Code that enforce disciplined, test-driven agentic development. Install once, use in any project.
Use before ANY creative work — creating features, building components, adding functionality, modifying behavior, or starting a…
Use when a major project step has been completed and needs review against the plan and coding standards. Also use when someone…
Battle-tested Playwright E2E testing patterns for Next.js/React apps. Use when writing, running, debugging, or fixing Playwright…
Master orchestrator skill that kicks off the full development pipeline. Routes tasks through the correct skill chain (brainstorm,…
Use when encountering ANY bug, test failure, unexpected behavior, or error — before proposing fixes. Also use when someone says…
Use when you need to autonomously iterate through test-fix cycles without human intervention. Use when someone says 'make it…
Produce the "Playwright 1.xx API Review" artifact for a range of commits - the public API additions and the breaking or behavior…
Write, refine, run, and QA promptfoo evaluation suites: promptfooconfig.yaml, prompts, providers, vars, tests, assertions,…
DeepEval evaluation workflow for AI agents and LLM applications. TRIGGER when the user wants to evaluate or improve an AI agent,…