
tdd-test-writer
Writes failing tests first for test-driven development and hands off a strict implementation contract that requires agents to make those tests pass without weakening the tests. Use when users ask for test-first workflows, RED/GREEN cycles, or behavior-gating tasks with automated tests.
- Installs
- 857
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/am-will/codex-skills --skill tdd-test-writer- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads tdd-test-writer automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
TDD Test Writer
Use this skill to complete the RED phase of TDD: define behavior with tests first, verify they fail for the right reason, then hand off implementation with objective pass criteria.
When To Use
Use this skill when the user asks for:
- test-first development
- TDD / RED-GREEN-REFACTOR workflow
- writing tests that implementation agents must satisfy
- bugfixes that need regression tests before code changes
Required Rules
- Do not modify production code while running this skill.
- Use subagent role
tdd_test_writerfor RED-phase test authoring whenever available. - Write behavior-focused tests, not placeholders.
- Every new/updated test must fail before handoff.
- Failures must come from missing or incorrect production behavior, not broken tests.
- Prefer deterministic, targeted test commands over full-suite runs when possible.
- For bugfix tasks, add a regression test that captures the reported failure mode.
Workflow
1. Define Behavior Contract
- Convert user request into explicit acceptance criteria.
- Identify happy path, edge cases, and negative-path expectations.
- If requirements are ambiguous, record
ASSUMPTION:lines in output.
2. Delegate Test Authoring To tdd_test_writer
- Spawn a
tdd_test_writersubagent with task scope, target files, and acceptance criteria. - Require the subagent to write/update tests only (no production code changes).
- Require command output proving RED-state failure for the new tests.
- If
tdd_test_writeris unavailable, continue directly and noteFALLBACK: tdd_test_writer unavailable.
3. Discover Existing Test Conventions
- Detect framework and runner from the repo (for example
vitest,jest,pytest,go test,cargo test). - Follow existing directory, naming, and fixture conventions.
- Reuse existing helpers instead of introducing duplicate test utilities.
4. Author RED-Phase Tests
- Create or update test files that encode the behavior contract.
- Keep tests small and intention-revealing (clear names and assertions).
- Include at least one negative-path assertion where applicable.
- Avoid network/time randomness; mock or fixture external systems.
5. Verify RED State
- Run the narrowest command that executes the new tests.
- Confirm they fail for the expected behavioral gap.
- If failure is caused by test syntax/setup, fix tests and rerun.
6. Produce Implementation Handoff
Return a block that implementation agents must follow. The handoff must include:
- subagent used (
tdd_test_writer) or explicit fallback reason - exact test files created/updated
- exact verification command(s)
- short failure summary proving RED state
- immutable test constraint (do not edit tests unless requirement changes)
- pass criteria that define task completion
Required Output Format
TDD RED PHASE COMPLETE
## Authoring Mode
- Subagent: tdd_test_writer
- Fallback: [only if subagent unavailable]
## Test Files
- [path]
## Verification
- Command: [exact command]
- Result: FAIL (expected)
- Failure reason: [1-2 lines tied to missing behavior]
## Implementation Contract (for next agent)
1. Do not modify these tests: [paths]
2. Implement production changes only in: [paths or modules]
3. Completion gate: [exact command] passes with no test weakening.
4. Run broader safety check: [secondary command]
5. Return evidence: changed files + command output summary.
## Assumptions
- ASSUMPTION: [only if needed]
Quality Bar
- Tests fail before implementation and are reproducible locally.
- Assertions are specific enough to prevent false positives.
- Regression coverage is present for bugfix-driven tasks.
- Handoff is precise enough that another agent can execute without clarifications.
FAQ
What does the tdd-test-writer skill do?
Writes failing tests first for test-driven development and hands off a strict implementation contract that requires agents to make those tests pass without weakening the tests. Use when users ask for test-first workflows, RED/GREEN cycles, or behavior-gating tasks with automated tests.
How do I install tdd-test-writer?
Run npx skills add https://github.com/am-will/codex-skills --skill tdd-test-writer in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/tdd-test-writer/ (personal) or .claude/skills/tdd-test-writer/ (project).
Which AI agents can use tdd-test-writer?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is tdd-test-writer safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains tdd-test-writer?
It is published by am-will in am-will/codex-skills. It has 857 recorded installs.
More from am-will/codex-skills
frontend-design
am-will/codex-skills
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
frontend responsive design standards
am-will/codex-skills
Build responsive, mobile-first layouts using fluid containers, flexible units, media queries, and touch-friendly design that works across all screen sizes. Use this skill when creating or modifying UI layouts, responsive grids, breakpoint styles, mobile navigation, or any interface that needs to adapt to different screen sizes. Apply when working with responsive CSS, media queries, viewport settings, flexbox/grid layouts, mobile-first styling, breakpoint definitions (mobile, tablet, desktop), touch target sizing, relative units (rem, em, %), image optimization for different screens, or testing layouts across multiple devices. Use for any task involving multi-device support, responsive design patterns, or adaptive layouts.
context7
am-will/codex-skills
Fetch up-to-date library documentation via Context7 CLI. Use PROACTIVELY when: (1) Working with ANY external library (React, Next.js, Supabase, etc.) (2) User asks about library APIs, patterns, or best practices (3) Implementing features that rely on third-party packages (4) Debugging library-specific issues (5) Need current documentation beyond training data cutoff (6) AND MOST IMPORTANTLY, when you are installing dependencies, libraries, or frameworks you should ALWAYS check the docs to see what the latest versions are. Do not rely on outdated knowledge. Always prefer this over guessing library APIs or using outdated knowledge.
planner
am-will/codex-skills
Create comprehensive, phased implementation plans with sprints and atomic tasks. Use when user says: "make a plan", "create a plan", "plan this out", "plan the implementation", "help me plan", "design a plan", "draft a plan", "write a plan", "outline the steps", "break this down into tasks", "what's the plan for", or any similar planning request. Also triggers on explicit "/planner" or "/plan" commands.
read-github
am-will/codex-skills
Read and search GitHub repository documentation via gitmcp.io MCP service. WHEN TO USE: - User provides a GitHub URL - User mentions a specific repo in owner/repo format - User asks "what does this repo do?", "read the docs for X repo", or similar - User wants to search code or docs within a repo
parallel-task
am-will/codex-skills
Only to be triggered by explicit /parallel-task commands.
Popular testing & qa skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
grilling
mattpocock/skills
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
migrate-to-shoehorn
mattpocock/skills
Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.
run-train
lllllllama/rigorpilot-skills
Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.
test-driven-development
obra/superpowers
Use when implementing any feature or bugfix, before writing implementation code
finishing-a-development-branch
obra/superpowers
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work