tdd

Guide developers through the RED-GREEN-REFACTOR cycle with Speclj.

Updated Mar 6, 2026
One-click install
npx skills add https://github.com/slagyr/agent-lib --skill tdd-slagyr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/slagyr/agent-lib/tree/main/skills/tdd
Command: npx skills add https://github.com/slagyr/agent-lib --skill tdd-slagyr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write higher-quality, more robust code by enforcing the Test-Driven Development (TDD) methodology, ensuring that code is always driven by failing tests.

Core Features & Use Cases

  • Enforces TDD Cycle: Guides the RED -> GREEN -> REFACTOR loop.
  • Test Structure Guidance: Provides patterns for writing effective tests (Arrange-Act-Assert).
  • Use Case: When developing a new feature, use this skill to write a failing test first, then implement the minimal code to pass, and finally refactor. This ensures every piece of code has a corresponding test.

Quick Start

Use the tdd skill to write a failing test for a new function, make it pass, and then refactor.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I start writing code with test-driven development in Clojure?

Test-driven development in Clojure starts by writing a failing test with Speclj, then implementing the minimal code to pass it, and finally refactoring. This enforces the RED-GREEN-REFACTOR cycle for robust code.

What is the RED-GREEN-REFACTOR cycle and how does it improve code quality?

The RED-GREEN-REFACTOR cycle means writing a failing test, making it pass with minimal code, then refactoring. This ensures every feature has corresponding test coverage, resulting in higher-quality, maintainable code.

How do I structure behavior-driven tests using Speclj?

Speclj tests should use behavior-driven naming and the Arrange-Act-Assert pattern. This provides clear test structure guidance for writing effective tests within the test-driven development workflow.

Can I use this test-driven development approach for refactoring existing code?

Yes, you can use test-driven development for refactoring existing code. You write failing tests to verify the current behavior, make minimal changes to pass the tests, and then safely refactor to improve code quality.

When should I not use the test-driven development process?

Test-driven development may not suit exploratory programming or throwaway prototypes. It enforces strict RED-GREEN-REFACTOR discipline, which requires writing failing tests before production code, potentially slowing down rapid experimentation.