Enforces red-green-refactor TDD discipline by dispatching implementation to Codex with a TDD-specific prompt template. Useful when the user explicitly requests a strict test-driven workflow.
How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers-cc-to-codex:test-driven-development-codexThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
<!--
Keep Claude in the main thread for user interaction and task acceptance.
Call the codex_implement MCP tool with promptTemplate: "tdd" for TDD-disciplined implementation. Use codex_resume for fix loops if TDD discipline is violated.
Reference testing-anti-patterns.md when reviewing Codex output for testing quality.
Tests written after code prove nothing — passing tests don't confirm they test the right thing.
Core principle: NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST.
Announce at start: "I'm using the test-driven-development skill to implement this with strict red-green-refactor discipline."
If you didn't watch the test fail, you don't know if it tests the right thing.
If Codex returns implementation without red-green evidence, reject it and resume with TDD enforcement.
If acceptance criteria are unclear, ask the user before dispatching.
codex_implement with TDD Prompt TemplateCall the codex_implement MCP tool with promptTemplate: "tdd":
{
"tool": "codex_implement",
"arguments": {
"taskId": "task-17",
"promptTemplate": "tdd",
"prompt": "Implement the requested behavior with strict red-green-refactor discipline. Write the failing test first, then the minimal production change, then refactor only if the tests still pass.",
"workspaceRoot": "/absolute/path/to/your/repo"
}
}
The tdd prompt template routes through skills/test-driven-development-codex/prompts/tdd-implement-task.md.
When Codex returns, check:
tests array is non-emptytesting-anti-patterns.md)| Status | Action |
|---|---|
DONE | Verify tests pass, accept implementation |
DONE_WITH_CONCERNS | Review concerns, check if TDD was followed despite issues |
BLOCKED | Surface blocker to user, do not attempt workarounds |
NEEDS_CONTEXT | Answer Codex's questions, resume with fix prompt |
If the tests array is empty or implementation lacks red-green evidence, call codex_resume with promptTemplate: "tdd":
{
"tool": "codex_resume",
"arguments": {
"taskId": "task-17",
"sessionId": "<sessionId-from-previous-run>",
"promptTemplate": "tdd",
"prompt": "Tests must be written BEFORE implementation. Delete any production code written without a failing test. Start the red-green-refactor cycle from scratch. Fix the failing test: <describe what needs fixing>",
"workspaceRoot": "/absolute/path/to/your/repo"
}
}
Never:
Always:
testing-anti-patterns.mdCan be used standalone or as a methodology enforcer within subagent-driven-development by swapping the prompt file from implement-task.md to tdd-implement-task.md.
Pairs with:
subagent-driven-development — TDD prompt can replace the standard implement promptrequesting-code-review — Review should verify TDD discipline was followedGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub mzored/superpowers-cc-to-codex --plugin superpowers-cc-to-codex