How SPECTRA’s two subsystems work together, as of the v2 (Claude Code) migration.

Related: the v2 migration (history: the GitHub Copilot SDK runtime was removed) | How Test Case Generation Works


Two Independent Subsystems

Subsystem Purpose Can be used independently
Authoring (generate/update/analyze) Generate, update, and analyze test cases from documentation, driven by Claude Code skills over a deterministic CLI seam Yes, test cases are useful even without the execution engine
Execution (spectra run) Execute test cases through a deterministic state machine over SQLite Yes, works with any Markdown test cases, not just AI-generated ones

Neither subsystem runs its own AI session anymore. There is no MCP server (removed) and no in-process model runtime (the GitHub Copilot SDK is gone), so every model call, on either side, is a turn (or subagent call) inside your interactive Claude Code session.

System Flow

  1. Your docs

    Markdown files in docs/, the source of every test case.

  2. Docs index

    spectra docs index summarises the docs in docs/_index/, so prompts stay small.

  3. Skill

    A skill in your AI agent, for example spectra-generate, runs the steps in order.

  4. Prompt

    spectra ai compile-… builds a prompt from your docs and criteria. No model is called.

  5. Your agent answers

    A turn or a subagent in your own session (analyst, generator, updater) answers it.

  6. Validate and save

    spectra ai ingest-… checks the answer and writes the test files.

  7. Critic

    The spectra-critic subagent checks each test against the doc sections it cites.

  8. Run

    spectra run and the browser console record results in .execution/spectra.db.

  9. Dashboard

    spectra dashboard builds a static site with suites, coverage and runs.

How a request flows through SPECTRA

Bugs found during a run are logged through other tools’ own integrations (for example Azure DevOps or Jira MCP servers), not through SPECTRA.

Tech Stack

  • Language: C# 12, .NET 8+
  • AI Runtime: Claude Code (the user’s interactive session). SPECTRA makes no model calls of its own; authoring orchestration ships as .claude/skills/ + .claude/agents/. spectra init --agent installs the same skills and subagents for eight other AI agents, adapted at install time (src/Spectra.CLI/Install/; see AI Agents)
  • CLI Framework: System.CommandLine + Spectre.Console
  • Serialization: System.Text.Json (data), YamlDotNet (frontmatter)
  • Execution store: Microsoft.Data.Sqlite, WAL mode (.execution/spectra.db), CLI-only with no server process
  • Storage: file system (test cases, docs, reports)

Project Structure

src/
├── Spectra.CLI/        # CLI: authoring commands (compile-*/ingest-* seam) + spectra run
├── Spectra.Core/       # Shared library (parsing, validation, models, coverage)
├── Spectra.Execution/  # Transport-neutral execution engine, driven solely by spectra run
└── Spectra.GitHub/     # GitHub integration (future)

What to commit

Commit the files that record results; the rest is scratch that spectra init (new workspaces) and spectra update-skills (existing ones) add to .gitignore:

Path Committed?
test-cases/<suite>/*.md, _index.json, _source-baseline.json yes
docs/criteria/** (incl. _criteria_index.yaml), docs/_index/** yes
.spectra/source-snapshots/ (lets triage show word diffs) yes
.spectra/update-triage.json no (scratch)
.spectra/updates/, .spectra/repairs/ no (scratch)
.spectra/verdicts/, .spectra/dropped-tests.json no (scratch)
.spectra/generation-plan/ no (scratch)
.spectra/baseline.lock, .spectra/criteria.lock no (scratch)
.execution/spectra.db (run state) no

Keep the # spectra-offered: … lines in .gitignore when you commit it: they record which patterns SPECTRA already offered, so one your team removed stays removed in every clone.

Key Design Decisions

  • SPECTRA has no in-process AI runtime: every model-touching flow (generation, analysis, criteria extraction, updates, grounding verification) is a deterministic compile-* → in-session turn → ingest-* seam, and SPECTRA never opens a model session itself.
  • Test case storage is file-based: test cases are Markdown files with YAML frontmatter, and there’s no database for test case definitions.
  • Execution is deterministic: spectra run drives a state machine over SQLite, and the AI orchestrator (or the browser console) doesn’t hold execution state itself.
  • Coverage spans three dimensions: Documentation, Acceptance Criteria, and Automation coverage are analyzed independently and reported together.
  • Critic verification is isolated: the spectra-critic subagent runs in a fresh, forked context per test, so it sees only the artifact and its source docs, never the generator’s reasoning.

For the full history of how this replaced the pre-v2 architecture, see Claude Code v2 vs. the GitHub Copilot SDK v1.