Skip to main content

scripts/worktree-feature/: Zod Output Schemas

Ghost doc. Real schema files live in .worktrees/*/scripts/worktree-feature/components/ (per-worktree); the scripts/worktree-feature/ directory does not exist on main.

Discover Schema

Implement Schema

Validate Schema

Review Schema

ReviewFix Schema

Report Schema

Registration

All schemas register in one createSmithers call:
Use tables.discover, tables.review, etc. to access the auto-generated SQLite tables for each stage.

Key Patterns

  • Dual export — each file exports the Zod schema and its inferred type, giving runtime validation and compile-time types from one source.
  • .describe() annotations — Smithers passes these to the LLM as field-level instructions in the structured output schema.
  • .nullable() — ensures optional fields are always present in output JSON (e.g., dependencies, failingSummary).
  • z.enum() — constrains agent output to valid values (severity levels, status codes, quality ratings).
  • Schema compositionTicket defined once, reused in DiscoverOutput.tickets and as a prop type throughout the pipeline.
  • Single registrationcreateSmithers auto-generates SQLite tables and accepts an optional second argument for dbPath and journalMode; tables provides typed references to each stage’s table.