openspec-plus-tdd

Enforces strict RED-GREEN-REFACTOR test-driven development for OpenSpec change implementation.

1|Updated Oct 27, 2025
One-click install
npx skills add https://github.com/WndDnz/modelo-relatorio-unifei-ict --skill openspec-plus-tdd-wnddnz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openspec-plus-tdd
Source: https://github.com/WndDnz/modelo-relatorio-unifei-ict/tree/main/.opencode/skills/openspec-plus-tdd
Command: npx skills add https://github.com/WndDnz/modelo-relatorio-unifei-ict --skill openspec-plus-tdd-wnddnz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementing tasks from an OpenSpec change, AI agents tend to batch-write tests, write production code before tests fail, or skip refactoring — producing code that looks tested but lacks real TDD discipline. This Skill enforces an atomic per-test RED-GREEN-REFACTOR cycle so every line of production code traces back to a previously failing test. ## Core Features & Use Cases - Iron Law Enforcement: No production code may be written without first observing a test fail for the right reason, with explicit red-flag phrases that halt violations. - Mandatory Gherkin Coverage: Every scenario in the change's spec.md must become at least one passing acceptance test before the slice can ship. - Per-Test State Machine: Each test (acceptance, unit, edge case, helper, error path) traverses RED, VERIFY-RED, GREEN, VERIFY-GREEN, and a mandatory REFACTOR assessment before the next test begins. - Use Case: While an implementer subagent works through tasks.md for an OpenSpec change, it loads this Skill first, translates each Gherkin scenario into a failing acceptance test, writes minimal code to pass it, assesses refactoring, and only then moves to the next test. ## Quick Start Ask the agent to implement the tasks of an OpenSpec change using strict TDD, covering every Gherkin scenario in spec.md with at least one test.

Frequently Asked Questions about openspec-plus-tdd

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

FAQPage Schema
How do I enforce TDD when an AI agent implements OpenSpec change tasks?

Load this Skill before any production code is written for the change. It forces a per-test RED-GREEN-REFACTOR cycle: one failing test, minimal code to pass it, then a mandatory refactor assessment before the next test begins.

How do Gherkin scenarios in spec.md become acceptance tests?

Each Gherkin scenario relevant to the slice is translated directly into one minimal acceptance test asserting the scenario's THEN outcomes. A slice cannot ship until every scenario has at least one passing test.

Can I write all the tests first and then implement them together?

No. Batching tests is explicitly forbidden because tests may pass immediately without proving anything. Each test must be observed failing in isolation, then made green, then assessed for refactoring before the next test starts.

When should I add unit or edge-case tests beyond the Gherkin scenarios?

Add granular tests for non-trivial branches, null or empty inputs, boundary values, and error paths that acceptance tests do not cover. These follow the same RED-GREEN-REFACTOR cycle as scenario-derived tests.

What happens if a test passes immediately without failing first?

An immediately passing test means the feature already exists or the test is wrong. The Skill requires investigating and rewriting the test until it fails for the expected reason before any production code is written.

Does this Skill allow skipping the refactor step for simple changes?

The refactor action is conditional, but the refactor assessment is mandatory after every green test. You must explicitly record whether refactoring is needed, with a one-sentence reason, before moving to the next test.