tdd-workflow

Guide red-green-refactor TDD cycles across Python, JavaScript, and Next.js.

4|4|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/darellchua2/opencode-config-template --skill tdd-workflow-darellchua2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/darellchua2/opencode-config-template/tree/main/skills/tdd-workflow
Command: npx skills add https://github.com/darellchua2/opencode-config-template --skill tdd-workflow-darellchua2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams adopt Test Driven Development by guiding the red-green-refactor workflow across multiple languages and frameworks, improving test coverage and development discipline.

Core Features & Use Cases

  • Step-by-step TDD workflows for Python (pytest), JavaScript (Jest/Vitest), and Next.js, including writing tests before production code and incremental refactoring.
  • Coaching and mentoring prompts for onboarding developers, QA engineers, and teams to establish consistent testing standards and practices.
  • Real-world scenarios such as feature implementation, bug fixes, and refactoring with safety nets like tests and parametrized cases.

Quick Start

To start, define a new feature with a failing test, run the tests to observe the RED phase, implement the minimal production code to pass the test (GREEN), and then refactor for readability and reliability. Repeat by adding new tests for additional behaviors and edge cases, following the same RED-GREEN-REFACTOR cycle. You can adapt the steps for Python (pytest), JavaScript (Jest/Vitest), or Next.js, depending on your project language.

Frequently Asked Questions about tdd-workflow

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

FAQPage Schema
How do I start a Test Driven Development workflow for feature implementation?

To start a Test Driven Development workflow, define a new feature with a failing test, run it to observe the RED phase, implement minimal production code to pass (GREEN), and then refactor for readability and reliability.

Does this TDD workflow support both Python and JavaScript testing frameworks?

Yes, this TDD workflow supports both Python and JavaScript testing. It provides step-by-step guidance and practical examples tailored for pytest in Python, as well as Jest and Vitest for JavaScript and Next.js projects.

What is the red-green-refactor cycle and how does it improve code coverage?

The red-green-refactor cycle is a TDD technique where you write a failing test (red), write minimal code to pass it (green), and refactor safely. This test-first approach improves test coverage and development discipline incrementally.

Can I use this TDD workflow to mentor and onboard QA engineers?

Yes, you can use this TDD workflow to mentor and onboard QA engineers. It includes coaching and mentoring prompts designed to help teams establish consistent testing standards, practices, and development discipline across multiple languages.

What's the best way to handle refactoring legacy code using TDD?

The best way to handle refactoring with TDD is to use tests as safety nets. Write parametrized test cases for existing behaviors, verify the RED and GREEN phases, and then iterate safely by refactoring the production code for readability and reliability.