tdd-workflow

Guide Test-Driven Development with RED, GREEN, REFACTOR cycles and Bun test commands.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/iannil/code-coder --skill tdd-workflow-iannil
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/iannil/code-coder/tree/main/packages/ccode/src/skill/builtin/tdd-workflow
Command: npx skills add https://github.com/iannil/code-coder --skill tdd-workflow-iannil

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a comprehensive guide to implementing the Test-Driven Development (TDD) methodology, helping developers write cleaner, more robust, and maintainable code.

Core Features & Use Cases

  • TDD Cycle Guidance: Explains the RED -> GREEN -> REFACTOR cycle.
  • Test Structure Examples: Demonstrates the Arrange-Act-Assert pattern.
  • Test Categories: Differentiates between Unit, Integration, and E2E tests.
  • Best Practices: Offers practical advice on writing effective tests.
  • Running Tests: Provides commands for executing tests with Bun.
  • Coverage Requirements: Outlines recommended code coverage targets.
  • Use Case: A developer new to TDD can use this Skill to understand the core principles and immediately apply them to their next coding task.

Quick Start

Follow the TDD cycle to write a new test for the user service.

Frequently Asked Questions about tdd-workflow

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

FAQPage Schema
How do I implement the Test-Driven Development cycle correctly?

To implement the Test-Driven Development cycle, follow the RED -> GREEN -> REFACTOR methodology: write a failing test, write the minimum code to pass it, then refactor while keeping tests green. This ensures cleaner, robust code.

What is the Arrange-Act-Assert pattern for structuring tests?

The Arrange-Act-Assert test pattern structures tests into three phases: set up your objects and data, act by executing the method under test, and assert the results. This pattern clarifies test logic and isolates execution steps.

How do I run unit and integration tests using Bun?

You can run unit and integration tests using Bun by executing the provided test commands specific to the framework. This enables fast execution of your test suite while validating code logic across different test categories.

What code coverage requirements should I target for different code types?

Code coverage requirements vary by code type, with specific targets outlined for different categories to ensure robust testing. Following these coverage guidelines helps maintain high code quality and validates that critical paths are fully tested.

When should I write unit tests versus integration or E2E tests?

Write unit tests for isolated logic, integration tests for component interactions, and E2E tests for full system workflows. The methodology differentiates these categories to ensure each test level validates its specific scope effectively.

Can I apply Test-Driven Development to an existing development workflow?

Yes, you can apply Test-Driven Development to an existing workflow by adopting the RED -> GREEN -> REFACTOR cycle for new features and bug fixes. This helps developers incrementally improve code quality and maintainability.