Adds a TDD gate to OpenSpec — a new opsx:tdd command that sits between opsx:propose and opsx:apply. OpenSpec generates BDD scenarios in specs/**/*.md but jumps straight to implementation — no test-first step exists. This plugin adds one.
FAQ
openspec-tdd is a Claude Code plugin with 1 hand-picked skill for testing work, indexed on Flowy. Install it with the command on its page. It includes opsx-tdd. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
> /plugin marketplace add yuritoledo/openspec-tdd> /plugin install openspec-tdd@yuritoledo
Repo: yuritoledo/openspec-tdd
Adds a TDD gate to OpenSpec — a new opsx:tdd
command that sits between opsx:propose and opsx:apply.
OpenSpec generates BDD scenarios in specs/**/*.md but jumps straight to implementation — no
test-first step exists. This plugin adds one. And it does it with real failing tests, not
expect.fail("TDD Red Phase") placeholders.
A naive TDD gate writes placeholder tests:
it("renders the cast button when the ability is in range", () => {
expect.fail("TDD Red Phase: Implementation missing")
})
This is a false red. It proves nothing, gets fully rewritten at green, and — if anyone forgets to come back — leaves the feature with zero real coverage.
openspec-tdd writes a solid red instead:
import { AbilityCard } from "./ability-card" // ← does not exist yet → import = RED
it("renders the cast button when the ability is in range", () => {
vi.mocked(usePartyAtom).mockReturnValue({ ap: 3, range: 2 } as never)
const { screen } = render(<AbilityCard id="fireball" distance={1} />)
expect(screen.getByTestId("ability-cast-btn")).toBeInTheDocument()
})
This fails for the right reason (the component / testid doesn't exist yet), defines the
data-testid contract opsx:apply must satisfy, and turns green by implementing — no test
rewrite. It guards against regressions from the very first commit.
A new opsx:tdd skill that:
specs/**/*.md — source of truth, not a parsed summary#### Scenario: THEN clause into a real failing assertiondata-testid contract for the apply phaseit.skip gaps, never forced failsOption 1: Let your agent do it (Recommended)
Copy and paste this prompt to your LLM agent (Claude Code, OpenCode, Cursor, etc.):
Install openspec-tdd by following the instructions here:
https://raw.githubusercontent.com/yuritoledo/openspec-tdd/main/README.md
Option 2: Manual Installation
/plugin marketplace add yuritoledo/openspec-tdd
/plugin install openspec-tdd@yuritoledo
git clone https://github.com/yuritoledo/openspec-tdd.git
cp -r openspec-tdd/plugins/openspec-tdd/skills/opsx-tdd ~/.config/opencode/skills/opsx-tdd
The skill is picked up automatically on the next OpenCode session.
Option A: With Claude Plugins (recommended if you use Claude Code):
pi install npm:pi-claude-plugins
Then install the plugin once in Claude Code:
/plugin install openspec-tdd@yuritoledo
Pi imports it automatically on subsequent runs.
Option B: Direct copy (no Claude Plugins required):
git clone https://github.com/yuritoledo/openspec-tdd.git
cp -r openspec-tdd/plugins/openspec-tdd/skills/opsx-tdd .pi/skills/opsx-tdd
rm -rf openspec-tdd
The skill is loaded automatically on the next session.
Add skills: ["opsx-tdd"] to .pi/config.yaml if Pi doesn't pick it up.
The skill is named opsx:tdd in all three environments.
If you are an AI agent tasked with installing this plugin, follow these steps:
IMPORTANT: Do NOT run npm install or any package manager. This is a skill, not a package.
Claude Code — Instruct the user to run these slash commands in-chat:
/plugin marketplace add yuritoledo/openspec-tdd
/plugin install openspec-tdd@yuritoledo
OpenCode — Clone the repo and copy the skill to OpenCode's skill directory:
git clone https://github.com/yuritoledo/openspec-tdd.git
cp -r openspec-tdd/plugins/openspec-tdd/skills/opsx-tdd ~/.config/opencode/skills/opsx-tdd
rm -rf openspec-tdd
Pi — Two options:
Option A: With Claude Plugins
pi install npm:pi-claude-plugins
Then ask the user to run \/plugin install openspec-tdd@yuritoledo` in Claude Code once.
Pi imports it automatically on subsequent runs.
Option B: Direct copy (no Claude Plugins) Clone and copy the skill directory:
git clone https://github.com/yuritoledo/openspec-tdd.git
cp -r openspec-tdd/plugins/openspec-tdd/skills/opsx-tdd .pi/skills/opsx-tdd
rm -rf openspec-tdd
Verify — The skill is named opsx:tdd in all environments. Inform the user that opsx:tdd has been installed and is ready to use.
opsx:propose → opsx:tdd (this — solid red) → opsx:apply (green) → opsx:verify
Zero config by default — the skill detects your test runner and conventions from
CLAUDE.md/AGENTS.md and package.json (vitest, jest, bun test, or node:test). To pin them,
drop a .openspec-tdd.json at your repo root (see examples/.openspec-tdd.json):
{
"testRunner": "npx vitest run",
"renderHelper": "@/test/render",
"canonicalTest": "src/components/example.test.tsx",
"testIdQuery": "getByTestId"
}
examples/before-after.md — spec input → generated test → reportreferences/See CONTRIBUTING.md. Core rule: keep it solid-RED, never hardcode a stack.
.claude-plugin/
marketplace.json
.github/
ISSUE_TEMPLATE/
bug_report.yml
feature_request.yml
workflows/
ci.yml
.markdownlint-cli2.jsonc
assets/
demo.svg
CHANGELOG.md
CONTRIBUTING.md
examples/
.openspec-tdd.json
before-after.md
LICENSE
package.json
plugins/
openspec-tdd/
.claude-plugin/
plugin.json
skills/
opsx-tdd/
references/
e2e.md
frameworks.md
non-react.md
SKILL.md
README.md
tests/
contract.test.mjs© 2026 Flowy · Free and open source
Built for Claude Code · Not affiliated with Anthropic