collect-cli-fixtures

Capture real stream-json NDJSON traces from Claude or Gemini CLIs into sanitized JSONL fixtures.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill solves the problem of flaky or incomplete fixture data when validating and extending the Claude/Gemini stream-json protocol, by ensuring test inputs come from real CLI output rather than hand-written samples.

Core Features & Use Cases

  • CLI protocol fixture capture: Records real NDJSON lines from --output-format stream-json (including interactive/control_request flows) into versionable .jsonl fixtures.
  • Targeted sanitization & validation: Ensures every fixture line is valid JSON, normalizes sensitive fields like session IDs, and checks for leaked API-key-like tokens.
  • Fixture placement for Summoner tests: Writes real vs synthetic fixtures into apps/summoner/src/__fixtures__/claude/real/ and .../synthetic/ to support fixture-driven TDD.

Quick Start

Run scripts/capture-fixture.sh with the desired fixture name (and optional prompt) to generate a new real CLI .jsonl trace for your protocol scenario.

Frequently Asked Questions about collect-cli-fixtures

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

FAQPage Schema
How do I capture real NDJSON stream-json output from Claude or Gemini CLI for testing?

Capture real NDJSON stream-json output from Claude or Gemini CLI for testing by running the capture-fixture.sh script with a desired fixture name and optional prompt to generate a real .jsonl trace for your protocol scenario.

What is protocol fixture sanitization and why is it needed for CLI test data?

Protocol fixture sanitization normalizes sensitive fields like session IDs and validates every JSON line to ensure test inputs come from real CLI output rather than hand-written samples, preventing flaky or incomplete fixture data.

How do I store captured NDJSON fixtures for fixture-driven TDD?

Store captured NDJSON fixtures for fixture-driven TDD by writing real traces into the apps/summoner/src/__fixtures__/claude/real/ directory and synthetic traces into the corresponding synthetic subdirectory.

Does this fixture capture approach work with interactive and control_request CLI flows?

Yes, this fixture capture approach works with interactive and control_request CLI flows by recording real NDJSON lines from --output-format stream-json, including interactive control_request flows, into versionable .jsonl fixtures.

When should I update protocol regression fixtures after a CLI or provider change?

Update protocol regression fixtures after a CLI or provider change when you need to cover newly observed event types, apply targeted sanitization checks, and ensure your stream-json protocol validation remains reliable.