test-driven-development

Enforce the RED-GREEN-REFACTOR test cycle across software projects.

Updated Nov 17, 2025
One-click install
npx skills add https://github.com/craigtkhill/atui-tools --skill test-driven-development-craigtkhill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/craigtkhill/atui-tools/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/craigtkhill/atui-tools --skill test-driven-development-craigtkhill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill eliminates the common pitfalls of manual Test-Driven Development (TDD) by providing a disciplined, AI-guided workflow. It ensures you consistently follow the RED-GREEN-REFACTOR cycle, preventing regressions, improving code quality, and making sure no critical step is missed.

Core Features & Use Cases

  • Guided TDD Workflow: Enforces the strict RED-GREEN-REFACTOR cycle, ensuring disciplined development and preventing shortcuts.
  • Test Isolation & Verification: Guides you to run single tests for immediate feedback and all tests for comprehensive regression prevention.
  • Refactoring Safety: Promotes safe code improvements by ensuring refactoring only occurs when all tests pass, protecting code integrity.
  • Use Case: When developing a new feature, use this skill to guide you through writing a failing test, implementing minimal code, verifying all tests pass, and safely refactoring, ensuring robust and high-quality code with minimal effort.

Quick Start

Start a new feature. Use the test-driven-development skill to guide you through writing your first failing test.

Frequently Asked Questions about test-driven-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement test-driven development in my Python or Rust project?

Test-driven development enforces writing a failing test first, then implementing minimal code to pass it, then refactoring safely. This Skill guides you through the RED-GREEN-REFACTOR cycle using pytest for Python or cargo test for Rust, ensuring disciplined development and preventing shortcuts that lead to regressions.

What is the RED-GREEN-REFACTOR cycle and why does it matter?

The RED-GREEN-REFACTOR cycle is a TDD workflow: write a failing test (RED), implement minimal code to pass it (GREEN), then improve code quality without breaking tests (REFACTOR). This approach reduces bugs, improves code quality, and ensures every line of code has test coverage before it ships.

How do I ensure my refactoring doesn't break existing tests?

Refactoring safely requires running all tests after every change to catch regressions immediately. This Skill enforces running single tests for immediate feedback during development and comprehensive test suites before refactoring, protecting code integrity throughout the improvement process.

Can I use test-driven development with pytest and cargo test?

Yes. This Skill provides language-specific test workflow guidance for both Python pytest and Rust cargo test, enforcing the same RED-GREEN-REFACTOR discipline and test isolation practices across different project types while guiding you through writing tests and updating SPEC markers.

What's the difference between running a single test versus all tests?

Running a single test gives immediate feedback while developing a feature; running all tests catches regressions across the entire codebase. This Skill guides you to use single tests for rapid iteration and comprehensive test runs before refactoring to ensure no existing functionality breaks.

Why should I write the test before implementing the code?

Writing tests first clarifies what code should do before you write it, prevents over-engineering, and guarantees test coverage from day one. Test-driven development reduces the likelihood of untested edge cases and makes refactoring safer because you know immediately if changes break intended behavior.