red-green-refactor

Guide Kotlin/JVM developers through TDD Red-Green-Refactor cycles with Kotest DescribeSpec.

Updated Jan 16, 2026
One-click install
npx skills add https://github.com/hyxklee/AI-DEV-ToolKit --skill red-green-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: red-green-refactor
Source: https://github.com/hyxklee/AI-DEV-ToolKit/tree/main/claude/skills/tdd-workflow
Command: npx skills add https://github.com/hyxklee/AI-DEV-ToolKit --skill red-green-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide helps Kotlin/JVM developers adopt the Red-Green-Refactor TDD cycle, reducing debugging time by enforcing failing tests first, minimal production code, and safe refactors.

Core Features & Use Cases

  • Red Phase guidance: Write a failing test first to capture intended behavior.
  • Green Phase guidance: Implement the simplest code to make tests pass.
  • Refactor Phase guidance: Improve structure and readability while keeping tests green and behavior intact.
  • Use Cases: When building Kotlin applications with Kotest DescribeSpec, this workflow accelerates reliable delivery.

Quick Start

Try a full TDD cycle: write a failing test first, implement the simplest code to pass, then refactor while keeping tests green.

Frequently Asked Questions about red-green-refactor

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

FAQPage Schema
How do I practice Red-Green-Refactor TDD with Kotlin and Kotest?

To practice Red-Green-Refactor TDD with Kotlin and Kotest, write a failing test first, implement minimal code to pass it, then refactor while keeping tests green. This enforces test-first discipline and incremental development.

What is the Red-Green-Refactor cycle in JVM development?

The Red-Green-Refactor cycle in JVM development is a TDD workflow where you write a failing test, implement the simplest code to make it pass, then improve structure while preserving behavior to ensure reliable delivery.

Can I use DescribeSpec for test-first development in Kotlin?

Yes, you can use Kotest DescribeSpec for test-first development in Kotlin. This workflow guides the Red-Green-Refactor cycle specifically within DescribeSpec-driven projects to enforce failing tests and minimal production code.

How to write minimal production code during the Green phase of TDD?

To write minimal production code during the Green phase of TDD, implement only the simplest logic required to make the failing test pass. This ensures incremental development and reduces debugging time.

Why does refactoring require keeping tests green in TDD?

Refactoring requires keeping tests green in TDD to ensure behavior remains intact while you improve code structure and readability. This safe cleanup step is crucial for maintaining reliable Kotlin applications.

When do I need a TDD workflow for Kotlin applications?

You need a TDD workflow for Kotlin applications when you want to reduce debugging time and enforce test-first discipline. It accelerates reliable delivery by capturing intended behavior with failing tests before implementation.