fixture-driven-tdd

Replay real Claude CLI JSON fixtures to validate parser and pipeline tests.

11|2|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/recca0120/code-quest --skill fixture-driven-tdd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fixture-driven-tdd
Source: https://github.com/recca0120/code-quest/tree/main/.claude/skills/fixture-driven-tdd
Command: npx skills add https://github.com/recca0120/code-quest --skill fixture-driven-tdd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Fixture-driven TDD prevents parser and pipeline tests from passing on guessed event shapes by forcing tests to use real Claude CLI JSON captured from the database or recordings.

Core Features & Use Cases

  • Uses real CLI output as the source of truth: loads and replays NDJSON/JSONL event lines from apps/summoner/src/__fixtures__/claude/real to validate parser behavior.
  • Supports synthetic events when real data can’t trigger: uses apps/summoner/src/__fixtures__/claude/synthetic for edge cases that are hard to reproduce while keeping them clearly marked.
  • Builds deterministic fake segments: adds segment builder functions in apps/summoner/src/test/fake-claude.ts so tests generate events consistently and without inline JSON.
  • Covers both parser and end-to-end pipeline: validates adapter parsing status and can assert end-to-end event flow via the fake summoner and channel emission.

Quick Start

Ask the skill to show you how to capture a new fixture from the real CLI output, add it to the correct real/ or synthetic/ fixture folder, extend the fake-claude.ts segment builders, and then write a RED-to-GREEN parser and pipeline test using those fixtures.

Frequently Asked Questions about fixture-driven-tdd

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

FAQPage Schema
Why do my CLI parser tests pass on guessed JSON event shapes but fail in production?

Fixture-driven TDD prevents parser tests from passing on guessed event shapes by replaying real Claude CLI JSON captured from database exports or recordings. It forces tests to use actual NDJSON event lines as the source of truth for validating parser behavior.

How do I test real CLI behavior with NDJSON fixtures?

Capture real Claude CLI output as NDJSON/JSONL event lines and place them in real fixture directories. Auto-load these fixtures via templates to validate adapter parsing status and assert end-to-end event flow through server pipeline tests.

When should I use synthetic fixtures versus real CLI recordings for test automation?

Use real CLI JSON from database exports or recordings as the primary source of truth. Use synthetic fixtures only for edge cases that are hard to reproduce in real data, keeping them clearly marked in separate synthetic directories to maintain test integrity.

How do I generate deterministic test events without writing inline JSON?

Use segment builder functions in fake-claude.ts to generate consistent events without inline JSON. These builders create deterministic fake segments that ensure tests produce reliable, repeatable results for parser and pipeline validation.

Does fixture-driven TDD work for end-to-end routing and emission behavior?

Yes, fixture-driven TDD covers both parser validation and end-to-end pipeline behavior. It validates adapter parsing status and asserts end-to-end event flow via fake summoner and channel emission, ensuring comprehensive protocol testing coverage.

What's the best way to add new protocol event types using TDD discipline?

Follow RED/Green/Refactor discipline: capture a new fixture from real CLI output, add it to the correct real or synthetic fixture folder, extend fake-claude.ts segment builders, then write RED-to-GREEN parser and pipeline tests using those fixtures.