test-driven-development

Enforce the Red-Green-Refactor cycle with pytest for test-backed code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the common issue of brittle, untested, or bug-prone code by enforcing a strict Test-Driven Development (TDD) workflow that ensures every feature is verified by a failing test before implementation.

Core Features & Use Cases

  • RED-GREEN-REFACTOR Cycle: Guides the agent through the mandatory sequence of writing a failing test, implementing minimal code, and refactoring.
  • Regression Prevention: Ensures that all new code is covered by tests, preventing future regressions.
  • Use Case: When building a new API endpoint, the agent will first write a test that asserts the expected response, watch it fail, implement the endpoint logic, and then refactor the code while keeping the test green.

Quick Start

Use the test-driven-development skill to implement the new user authentication feature 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 the RED-GREEN-REFACTOR cycle when implementing new features?

To enforce the RED-GREEN-REFACTOR cycle, you must first write a failing test for the new feature, implement the minimal code required to pass it, and then refactor while keeping the test green. This strict Test-Driven Development workflow ensures high-quality, test-backed software production.

What is the best way to prevent code regressions during bug fixing and refactoring?

The best way to prevent code regressions during bug fixing and refactoring is to apply a strict Test-Driven Development workflow that ensures all new code is covered by failing tests before implementation, verifying every feature and preventing future issues.

Does test-driven development work with pytest in a terminal-based environment?

Yes, test-driven development works with pytest in a terminal-based environment. The workflow requires the presence of a test runner like pytest to execute tests and apply the vertical tracer bullet methodology for new feature implementation and bug fixing.

How do I write tests first for a new API endpoint using TDD?

To write tests first for a new API endpoint using TDD, you write a test asserting the expected response, watch it fail, implement the endpoint logic to make it pass, and then refactor the code while keeping the test green.

When should I not use the RED-GREEN-REFACTOR cycle for development?

You should not use the RED-GREEN-REFACTOR cycle if your terminal-based development environment lacks a test runner like pytest, as the workflow strictly requires one to verify failing tests and guide the minimal code implementation process.