test-driven-development

Enforce the RED-GREEN-REFACTOR cycle with pytest for test-first development.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill implements a test-driven development (TDD) process to enforce the RED-GREEN-REFACTOR cycle, ensuring that every new feature, bug fix, or code change is accompanied by a failing test.

Core Features & Use Cases

  • Test-Driven Development Process: Follows the TDD cycle: RED (write failing test), GREEN (write code to pass test), and REFACTOR (improve code structure).
  • Real Code Testing: Uses real code instead of mocks, ensuring that tests truly reflect the behavior of the code.
  • Error Handling and Safety: Implements robust error handling and ensures that code changes are safe and do not break existing functionality.
  • Use Case: For software developers who want to enforce a strict TDD process to improve code quality and reduce bugs.

Quick Start

Install the skill and run the tests with the following command: pytest tests/

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 during test-driven development?

Test-driven development enforces the RED-GREEN-REFACTOR cycle by requiring a failing test before writing production code, ensuring code is written with tests first. This methodology guarantees every feature or bug fix is accompanied by a failing test that validates behavior.

Can I use real code instead of mocks for test-driven development with pytest?

Yes, you can use real code instead of mocks during test-driven development. This approach ensures that tests truly reflect the actual behavior of the code, providing robust error handling and verifying that code changes do not break existing functionality.

How do I start test-driven development to improve code quality and maintainability?

You start test-driven development by installing the skill and running tests using the command `pytest tests/`. This initiates the automated TDD process, which enforces writing tests first to ensure code quality and maintainability across your software engineering projects.

Does test-driven development require specific testing frameworks to work?

Test-driven development requires testing frameworks like pytest to support writing test cases before production code. You need this dependency installed to execute the test suite and validate that your code changes adhere to strict TDD methodology practices.

What is the best way to ensure code changes do not break existing functionality?

The best way to ensure code changes do not break existing functionality is implementing test-driven development. By enforcing the RED-GREEN-REFACTOR cycle and using real code instead of mocks, you implement robust error handling and maintain safe code changes.

When should I not use mocks in my test-driven development workflow?

You should avoid using mocks in your test-driven development workflow when you need tests to truly reflect the behavior of the code. The methodology implements real code testing to ensure robust error handling and verify that code changes are safe and maintainable.