TDG Test-Driven Generation

Automate Red-Green-Refactor loops with unit tests and code generation.

82|9|Updated May 5, 2025
One-click install
npx skills add https://github.com/chanwit/tdg --skill tdg-test-driven-generation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: TDG Test-Driven Generation
Source: https://github.com/chanwit/tdg/tree/main/skills/tdg
Command: npx skills add https://github.com/chanwit/tdg --skill tdg-test-driven-generation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates the rigorous Test-Driven Development (TDD) workflow, ensuring you consistently follow Red-Green-Refactor cycles. It eliminates the manual overhead of managing TDD phases, helping you write robust, well-tested code faster and with fewer errors.

Core Features & Use Cases

  • Guided TDD Workflow: Systematically guides you through the Red, Green, and Refactor phases of TDD.
  • Automated Test & Code Generation: Assists in generating failing tests (Red), implementing code to pass them (Green), and refactoring for optimal design.
  • Enforced Git Commit Standards: Automatically suggests and validates TDD-specific commit messages (e.g., "red:", "green:", "refactor:").
  • Use Case: You need to implement a new function. Activate TDG to generate the initial failing test, then the code to pass it, and finally refactor, all while maintaining a clear, TDD-compliant commit history.

Quick Start

Use TDG to start a new feature. Guide me through the Red-Green-Refactor process for a new user authentication module.

Frequently Asked Questions about TDG Test-Driven Generation

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

FAQPage Schema
How do I automate test-driven development workflows with Red-Green-Refactor cycles?

Test-Driven Generation automates Red-Green-Refactor cycles by guiding you through failing test creation, code implementation, and refactoring phases while enforcing TDD-compliant git commits. It eliminates manual phase tracking and ensures consistent adherence to TDD discipline across feature work and bug fixes.

Can TDG generate unit tests and scaffolding code automatically?

Yes. TDG assists in generating failing unit tests during the Red phase, implementing code to pass them in the Green phase, and refactoring for optimal design in the Refactor phase, all while maintaining a clear commit history with standardized TDD prefixes.

What commit message standards does TDG enforce for TDD workflows?

TDG enforces TDD-specific commit prefixes—"red:" for failing tests, "green:" for passing implementations, and "refactor:" for design improvements—and validates phase transitions via helper scripts to keep your git history aligned with TDD methodology.

How does TDG identify and work with existing testing frameworks and build commands?

TDG recognizes your project's testing framework and build/run commands, then runs single and full test suites, measures test coverage, and enforces phase checks to ensure every cycle follows the Red-Green-Refactor pattern consistently.

Does TDG support issue tracking integration in commits?

Yes. TDG handles issue numbers for commits, allowing you to link TDD phases and refactoring work directly to tracked issues while maintaining standardized commit prefixes and phase compliance.

What's the difference between TDG and manual TDD workflows?

TDG eliminates manual overhead by automating phase validation, commit standardization, and test/code scaffolding guidance, reducing errors and ensuring disciplined Red-Green-Refactor adherence, whereas manual TDD requires tracking phases and commit messages independently.