Skip to content

Feature: Headless Doctorow Gate for CI/automation environments #5

@mellanon

Description

@mellanon

Problem

The Doctorow Gate in specflow complete uses interactive readline prompts ([Y/n/s(kip)]) which blocks usage in:

  • Background agents (Claude Code Task tool)
  • CI/CD pipelines
  • Headless automation workflows
  • Any non-TTY environment

Currently the only workaround is --skip-doctorow, which bypasses the quality gate entirely.

Proposal

Add automatic headless mode that evaluates the Doctorow checks programmatically instead of skipping them.

Detection

  • process.stdin.isTTY === false → automatic headless mode
  • SPECFLOW_HEADLESS=true env var → explicit opt-in
  • Interactive terminal → existing human prompts (no change)

Evaluator Interface

interface DoctorowEvaluator {
  evaluate(check: DoctorowCheck, artifacts: FeatureArtifacts): Promise<DoctorowCheckResult>;
}

Two built-in implementations:

  1. AI Evaluator (recommended default): Uses claude -p or an inference API to read spec.md, plan.md, tasks.md, verify.md and the source code, then evaluates each Doctorow question against the actual artifacts. Returns pass/fail with reasoning.

  2. Static Evaluator (fallback): Pattern-matches artifacts for evidence:

    • Failure Test → checks for error handling tests, try/catch patterns
    • Assumption Test → checks spec.md has ## Assumptions section
    • Rollback Test → checks for reversible patterns
    • Debt Recorded → checks for TODO/FIXME documentation

Results Format

Same DoctorowCheckResult structure, appended to verify.md with [AI-evaluated] or [Static-evaluated] tag.

Configuration

# .specflow/config.yaml
doctorow:
  headless: auto       # auto | always-interactive | always-headless
  evaluator: ai        # ai | static
  ai_command: "claude -p"  # or custom inference command

Why This Matters

SpecFlow's value proposition includes agent-driven development workflows. The Doctorow Gate is a great quality check, but it currently forces a choice between quality (interactive) and automation (skip). This proposal preserves quality in automated environments.

Current Workaround

specflow complete F-1 --skip-doctorow — bypasses the gate entirely.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions