askill
tdd

tddSafety 95Repository

Test-Driven Development enforcement skill - write tests first, always

0 stars
1.2k downloads
Updated 3/18/2026

Package Files

Loading files...
SKILL.md

TDD Mode

[TDD MODE ACTIVATED]

The Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Write code before test? DELETE IT. Start over. No exceptions.

Red-Green-Refactor Cycle

1. RED: Write Failing Test

  • Write test for the NEXT piece of functionality
  • Run test - MUST FAIL
  • If it passes, your test is wrong

2. GREEN: Minimal Implementation

  • Write ONLY enough code to pass the test
  • No extras. No "while I'm here."
  • Run test - MUST PASS

3. REFACTOR: Clean Up

  • Improve code quality
  • Run tests after EVERY change
  • Must stay green

4. REPEAT

  • Next failing test
  • Continue cycle

Enforcement Rules

If You SeeAction
Code written before testSTOP. Delete code. Write test first.
Test passes on first runTest is wrong. Fix it to fail first.
Multiple features in one cycleSTOP. One test, one feature.
Skipping refactorGo back. Clean up before next feature.

Commands

Before each implementation:

# Run the project's test command - should have ONE new failure

After implementation:

# Run the project's test command - new test should pass, all others still pass

Output Format

When guiding TDD:

## TDD Cycle: [Feature Name]

### RED Phase
Test: [test code]
Expected failure: [what error you expect]
Actual: [run result showing failure]

### GREEN Phase
Implementation: [minimal code]
Result: [run result showing pass]

### REFACTOR Phase
Changes: [what was cleaned up]
Result: [tests still pass]

External Model Consultation (Preferred)

The tdd-guide agent SHOULD consult Codex for test strategy validation.

Protocol

  1. Form your OWN test strategy FIRST - Design tests independently
  2. Consult for validation - Cross-check test coverage strategy
  3. Critically evaluate - Never blindly adopt external suggestions
  4. Graceful fallback - Never block if tools unavailable

When to Consult

  • Complex domain logic requiring comprehensive test coverage
  • Edge case identification for critical paths
  • Test architecture for large features
  • Unfamiliar testing patterns

When to Skip

  • Simple unit tests
  • Well-understood testing patterns
  • Time-critical TDD cycles
  • Small, isolated functionality

Tool Usage

Before first MCP tool use, call ToolSearch("mcp") to discover deferred MCP tools. Use mcp__x__ask_codex with agent_role: "tdd-guide". If ToolSearch finds no MCP tools, fall back to the test-engineer agent.

Remember: The discipline IS the value. Shortcuts destroy the benefit.

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

82/100Analyzed 3/29/2026

High-quality TDD methodology skill with clear structure, enforcement rules, and output format. Contains internal agent references but core content is reusable and well-organized. Framework-agnostic guidance with actionable phases and decision criteria for external consultation.

95
85
82
80
78

Metadata

Licenseunknown
Version-
Updated3/18/2026
Publisherabanoub-ashraf

Tags

testing