tdd-test-writer

am-will/codex-skills · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/am-will/codex-skills --skill tdd-test-writer
0 commentsdiscussion
summary

Writes failing tests first, establishing a strict implementation contract for test-driven development.

  • Completes the RED phase of TDD by authoring behavior-focused tests that fail for the right reason, then hands off to implementation agents with objective pass criteria
  • Delegates test authoring to a tdd_test_writer subagent when available, ensuring tests remain unmodified during implementation
  • Detects existing test frameworks and conventions (pytest, jest, vitest, go test, cargo test
skill.md

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

  1. Do not modify production code while running this skill.
  2. Use subagent role tdd_test_writer for RED-phase test authoring whenever available.
  3. Write behavior-focused tests, not placeholders.
  4. Every new/updated test must fail before handoff.
  5. Failures must come from missing or incorrect production behavior, not broken tests.
  6. Prefer deterministic, targeted test commands over full-suite runs when possible.
  7. 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_writer subagent 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_writer is unavailable, continue directly and note FALLBACK: 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.
how to use tdd-test-writer

How to use tdd-test-writer on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add tdd-test-writer
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/am-will/codex-skills --skill tdd-test-writer

The skills CLI fetches tdd-test-writer from GitHub repository am-will/codex-skills and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/tdd-test-writer

Reload or restart Cursor to activate tdd-test-writer. Access the skill through slash commands (e.g., /tdd-test-writer) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.850 reviews
  • Dhruvi Jain· Dec 16, 2024

    Solid pick for teams standardizing on skills: tdd-test-writer is focused, and the summary matches what you get after install.

  • Alexander Abbas· Dec 16, 2024

    Registry listing for tdd-test-writer matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Aanya Flores· Dec 8, 2024

    Useful defaults in tdd-test-writer — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Aanya Farah· Nov 27, 2024

    Registry listing for tdd-test-writer matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Oshnikdeep· Nov 7, 2024

    We added tdd-test-writer from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Amelia Abebe· Nov 7, 2024

    Useful defaults in tdd-test-writer — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Ganesh Mohane· Oct 26, 2024

    tdd-test-writer fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Hassan Yang· Oct 26, 2024

    I recommend tdd-test-writer for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Charlotte Choi· Oct 18, 2024

    tdd-test-writer reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Hassan Brown· Sep 25, 2024

    Useful defaults in tdd-test-writer — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

showing 1-10 of 50

1 / 5