test-driven-development

Enforces Red-Green-Refactor cycle for test-first development with pytest integration.

Updated Jul 6, 2026
One-click install
npx skills add https://github.com/ghufronbagaskara/agent-im --skill test-driven-development-ghufronbagaskara
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/ghufronbagaskara/agent-im/tree/main/hermes-home/skills/software-development/test-driven-development
Command: npx skills add https://github.com/ghufronbagaskara/agent-im --skill test-driven-development-ghufronbagaskara

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the common pitfalls of ad-hoc development, such as brittle code, missing edge cases, and the inability to refactor safely, by enforcing a strict Test-Driven Development (TDD) cycle.

Core Features & Use Cases

  • Red-Green-Refactor Enforcement: Guides the agent through the mandatory cycle of writing a failing test, implementing minimal code, and refactoring.
  • Regression Prevention: Ensures that every new feature or bug fix is backed by an automated test, preventing future regressions.
  • Use Case: When implementing a new feature, the agent will refuse to write production code until a specific, failing test case is defined, ensuring the implementation is driven by requirements rather than assumptions.

Quick Start

Use the test-driven-development skill to guide the implementation of the new user authentication module by writing the failing test first.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I enforce test-driven development when implementing new features?

To enforce test-driven development, you must follow the Red-Green-Refactor cycle by writing a failing test first, implementing minimal code to pass it, and then refactoring. This ensures implementation is driven by requirements.

What is the Red-Green-Refactor cycle in TDD?

The Red-Green-Refactor cycle is a test-driven development process where you write a failing test, implement the minimal production code to make it pass, and then refactor the code safely. It ensures high-quality, testable code.

Can I use pytest to validate code behavior in a TDD workflow?

Yes, you can use pytest as a terminal-based test runner to validate code behavior against defined specifications during test-driven development. It executes the tests required to complete the Red-Green-Refactor cycle.

How do I prevent regressions when fixing bugs or refactoring code?

You prevent regressions during bug fixing and refactoring by backing every change with an automated test written before the production code. This test-first approach ensures existing functionality remains intact when modifying code.

Why write failing tests before writing production code?

Writing failing tests before production code ensures your implementation is driven by defined specifications rather than assumptions. It enforces the test-driven development cycle, preventing brittle code and missing edge cases.

Does test-driven development work for refactoring existing code?

Yes, test-driven development works for refactoring by ensuring every modification is backed by automated tests. This prevents future regressions and allows you to refactor code safely within the software development lifecycle.