tdd

Enforces test-driven development workflow with minimum 80 percent test coverage.

1|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/hafidzlvm/opencode --skill tdd-hafidzlvm
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/hafidzlvm/opencode/tree/main/.dsh/skills/tdd
Command: npx skills add https://github.com/hafidzlvm/opencode --skill tdd-hafidzlvm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers often skip writing tests or add them after implementation, leading to fragile code and low coverage. This Skill enforces a disciplined test-driven development workflow so tests are written before code and coverage stays above 80 percent. ## Core Features & Use Cases - TDD Workflow Enforcement: Guides the AI to follow the red-green-refactor cycle, writing failing tests before implementation code. - Coverage Threshold: Requires at least 80 percent test coverage for the code being developed. - Use Case: When implementing a new feature or fixing a bug, invoke the Skill so the AI first writes unit tests that define the expected behavior, then implements the minimal code to make them pass, and finally refactors while keeping tests green. ## Quick Start Invoke the tdd skill with a description of the feature or bug fix you want implemented using test-driven development.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I enforce test-driven development with an AI coding assistant?▼

Invoke the tdd skill with your feature description as arguments. The AI will follow the red-green-refactor cycle, writing failing tests first, then implementing code to pass them, and finally refactoring while keeping tests green.

What test coverage does the tdd skill require?▼

The tdd skill requires a minimum of 80 percent test coverage for the code it produces. This threshold ensures the implementation is meaningfully exercised by tests rather than only superficially covered.

Can I use TDD for bug fixes instead of new features?▼

Yes, TDD works well for bug fixes. You first write a failing test that reproduces the bug, then implement the fix until the test passes, which also prevents future regressions of the same issue.

When is test-driven development not a good fit?▼

TDD is less suitable for exploratory prototyping, throwaway scripts, or UI work where behavior is hard to specify upfront. In those cases, writing tests after the design stabilizes is often more practical.