Skip to content

Reading

Appearance

Text size

Bookmarks

    No bookmarks yet. Use “Bookmark chapter” or “Bookmark this section” while reading.

    Your data

    Saved only in this browser on this device. It is not synced to other devices or sent anywhere.

    Chapter 15 of 22 · about 1 min

    15. Step 7: analyze (optional but recommended)

    What it is

    It's a read-only consistency check across spec.md, plan.md and tasks.md, measured against the constitution. You created these documents at different times, and maybe edited some by hand, so they can drift apart. analyze finds where they disagree.

    How to run it

    /speckit-analyze

    What it looks for

    • Coverage gaps: a requirement (e.g. FR-004) with no task that implements it
    • Conflicts: the spec says "case-insensitive email" but the plan says "exact match"
    • Ambiguity: words like "fast" or "secure" with no measurable definition
    • Duplication: the same requirement stated twice in different ways
    • Constitution violations: these are always treated as CRITICAL
    • Orphan tasks: tasks that don't map to any requirement

    What the report looks like

    • A findings table: ID, category, severity (CRITICAL / HIGH / MEDIUM / LOW), location, summary, recommendation
    • A coverage summary: each requirement, whether it has tasks (yes/no), and which ones
    • Next actions: e.g. "No critical blockers; fix HIGH/MEDIUM before implementing"
    Learning aid · IllustrationAn example report, illustrated

    analyze never edits files. You decide what to fix, then run analyze again.

    Illustrative analyze report findings
    IDCategorySeverityLocationSummaryFix at the source
    A1Coverage gap—not set in this examplespec.md · tasks.mdFR-004 has no task that implements it→ tasks.md (edit or regenerate)
    A2Conflict—not set in this examplespec.md · plan.mdspec says "case-insensitive email", plan says "exact match"→ plan.md (design problem)
    A3Ambiguity—not set in this examplespec.md"fast" with no measurable definition→ spec.md or clarify
    A4Constitution violation▲ CRITICALplan.mda plan step that logs plain-text passwords (illustrative) breaks "never store or log plain-text passwords"→ plan.md (design problem)
    A5Orphan task—not set in this exampletasks.mda task that maps to no requirement (illustrative)→ tasks.md
    Illustrative, not real Spec Kit output. Findings are built from the guide's own examples. Only the constitution violation has a severity here, because the guide says those are always CRITICAL; the other severities are left unset rather than invented.

    It never edits files

    You decide what to fix, and fix it at the source:

    • requirement problem → edit spec.md (or clarify)
    • design problem → edit plan.md (or re-run plan)
    • missing task → edit or regenerate tasks.md

    Then run analyze again until it's clean enough.

    Optional reviewCheck yourself
    1. analyze reports that the plan conflicts with the spec. What does analyze change?
    2. A requirement has no task. Where do you fix it?