Skip to content
Skills Library
Programming · Building & coding

test-driven-development-codex

/test-driven-development-codex

Enforce strict test-driven development via Codex-backed implementation. Use only when the user explicitly asks for the Codex-backed TDD workflow.

Licence
MIT
Last repository change
01.05.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
0
HTML comments
1
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 01.05.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • SKILL.md zawiera komentarze HTML (1). Nie widać ich w podglądzie Markdown, a model je czyta.

What it does and when to use it

Enforce strict test-driven development via Codex-backed implementation. Use only when the user explicitly asks for the Codex-backed TDD workflow.

Original author description

Enforce strict test-driven development via Codex-backed implementation. Use only when the user explicitly asks for the Codex-backed TDD workflow.

How it works

  1. Overview
  2. The Iron Law
  3. When to Use
  4. Workflow
  5. Red Flags
  6. Integration
Original SKILL.md headings · 125 lines, 599 words
SKILL.md preview
---
name: test-driven-development-codex
description: Enforce strict test-driven development via Codex-backed implementation. Use only when the user explicitly asks for the Codex-backed TDD workflow.
disable-model-invocation: true
---
<!--
Upstream source: obra/superpowers skills/test-driven-development/SKILL.md
Last synced: 2026-04-03
Divergence: Codex-backed implementation via codex-implementer with TDD-specific prompt, explicit invocation only, plugin-local prompt/schema references
-->

# Test-Driven Development

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.

<HARD-GATE>
You MUST call codex_implement with promptTemplate: "tdd" (Step 2).
You cannot implement with TDD yourself. Codex enforces red-green-refactor discipline.
No MCP call = cannot proceed.
</HARD-GATE>

## Overview

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."

## The Iron Law

```
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.

## When to Use

- Any implementation task where test coverage is critical
- New features, bug fixes, refactors where behavior must be verified
- When the user explicitly requests TDD methodology

## Workflow

### Step 1: Verify Task Readiness

- [ ] Task has clear acceptance criteria
- [ ] Test framework is identified (check existing test files)
- [ ] Codex CLI is available

If acceptance criteria are unclear, ask the user before dispatching.

### Step 2: Call `codex_implement` with TDD Prompt Template

Call the `codex_implement` MCP tool with `promptTemplate: "tdd"`:

```json
{
  "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`.

### Step 3: Verify TDD Evidence in Results

When Codex returns, check:

- [ ] `tests` array is non-empty
- [ ] Tests were written before implementation (red-green-refactor order)
- [ ] Each test has a clear, descriptive name covering one behavior
- [ ] No testing anti-patterns (see `testing-anti-patterns.md`)

### Step 4: Handle Status

| 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 |

### Step 5: Resume if TDD Violated

If the `tests` array is empty or implementation lacks red-green evidence, call `codex_resume` with `promptTemplate: "tdd"`:

```json
{
  "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"
  }
}
```

## Red Flags

**Never:**
- Accept implementation without corresponding tests
- Skip the red-green-refactor cycle "just this once"
- Allow mocks to replace real behavior verification
- Let Codex write tests after implementation

**Always:**
- Verify test failure evidence before accepting
- Check for anti-patterns from `testing-anti-patterns.md`
- Ensure minimal implementation matching test requirements
- Run the full test suite after accepting

## Integration

**Can 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 prompt
- `requesting-code-review` — Review should verify TDD discipline was followed
Files in this package (3)
  • SKILL.md 5 KB
  • testing-anti-patterns.md 3 KB
  • prompts/tdd-implement-task.md 4 KB

Versions

The database has no other skills named test-driven-development-codex.

Database snapshot: 13.11.2026 · package version b9586a74eb75 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100test-driven-development
    Explicit `/test-driven-development` reference for a strict test-first workflow. Use only when the user explicitly requests TDD, "test first", or "테스트 먼저"; do not auto-apply during routine implementation.
  • 86test-driven-development
    Use only when the user explicitly requests TDD, test-first development, or a red-green-refactor workflow for executable behavior.
  • 100tdd-workflow
    Test-Driven Development workflow enforcement with RED-GREEN-REFACTOR cycle. Use only when the user explicitly asks for test-first work or improved test coverage.
  • 100tdd
    Test-Driven Development enforcement skill. Activates full TDD mode. Activate when: TDD, test-driven, test first, red-green-refactor, write tests first.
  • 96sr-test-driven-development
    Use when implementing any feature or bugfix, before writing implementation code
  • 96test-driven-development
    Use when implementing any feature or bugfix, before writing implementation code

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.