Spec-Kit: Analyze
Run a non-destructive, read-only cross-artifact consistency and quality check across spec.md, plan.md, and tasks.md before implementation. This is the final quality gate. Invoked as /speckit-analyze.
Lifecycle position — step 5 of the chain:
[[speckit-specify]] → [[speckit-clarify]] → [[speckit-plan]] → [[speckit-tasks]] → /speckit-analyze → implement.
Runs only after [[speckit-tasks]] has produced a complete tasks.md. It validates the trio of artifacts and clears the path to implementation — it does not modify them.
When to use
- All three artifacts exist (
spec.md, plan.md, tasks.md).
- Immediately before starting implementation, to catch gaps, contradictions, and uncovered requirements.
Operating constraints
- Strictly read-only. Never modify any file. Output a structured report and, optionally, a remediation plan the user must explicitly approve.
- Constitution is authority. Any conflict with a MUST principle in
.specify/memory/constitution.md is automatically CRITICAL and resolved by fixing the spec/plan/tasks — never by diluting the principle.
Flow
- Load artifacts (minimal, progressive disclosure):
- From
spec.md: overview, Functional Requirements, Success Criteria, user stories, edge cases.
- From
plan.md: architecture/stack, data-model references, phases, technical constraints.
- From
tasks.md: task IDs, descriptions, phase grouping, [P] markers, referenced file paths.
- From
.specify/memory/constitution.md: principle names and MUST/SHOULD statements.
- Abort if any required file is missing — tell the user which prerequisite command to run.
- Build semantic models (internal, not echoed): requirements inventory keyed by
FR-### / SC-###; user-story/action inventory; task→requirement coverage mapping; constitution rule set. Include only Success Criteria that require buildable work — exclude post-launch KPIs.
- Run detection passes (high-signal; cap at 50 findings, summarize overflow):
- Duplication — near-duplicate requirements; flag the weaker phrasing for consolidation.
- Ambiguity — vague adjectives (fast, scalable, secure, robust) without measurable criteria; unresolved placeholders (TODO, ???,
<placeholder>).
- Underspecification — requirements missing object/measurable outcome; stories missing acceptance criteria; tasks referencing undefined components.
- Constitution alignment — any element conflicting with a MUST principle, or a missing mandated gate.
- Coverage gaps — requirements with zero tasks; tasks with no mapped requirement; buildable Success Criteria not reflected in tasks.
- Inconsistency — terminology drift; entities in plan but absent from spec (or vice versa); task-ordering contradictions; directly conflicting requirements.
- Assign severity: CRITICAL (constitution MUST violation, missing core artifact, zero-coverage requirement blocking baseline) · HIGH (conflicting/duplicate requirement, untestable security/performance attribute) · MEDIUM (terminology drift, missing non-functional coverage, underspecified edge case) · LOW (wording/redundancy not affecting execution).
- Emit a compact report (see below).
- Offer remediation — ask whether to suggest concrete edits for the top issues. Never apply them automatically.
Report structure
- A findings table:
| ID | Category | Severity | Location(s) | Summary | Recommendation | (one row per finding; stable IDs prefixed by category initial, e.g. A1, D2).
- A Coverage Summary table:
| Requirement Key | Has Task? | Task IDs | Notes |.
- Constitution Alignment Issues and Unmapped Tasks sections (if any).
- Metrics: total requirements, total tasks, coverage % (requirements with ≥1 task), ambiguity count, duplication count, critical-issue count.
- Next Actions: if CRITICAL issues exist, recommend resolving before implement; otherwise the user may proceed. Suggest explicit follow-ups (re-run [[speckit-specify]] to refine, [[speckit-plan]] to adjust architecture, or hand-edit
tasks.md to close a coverage gap).
Quality criteria
- Deterministic — rerunning without changes yields consistent IDs and counts.
- High-signal — cite specific instances, not generic patterns; never hallucinate missing sections.
- Constitution violations always surface as CRITICAL.
- Zero-issue runs still emit a success report with coverage statistics.
Don'ts
- Don't modify any file — this is read-only analysis.
- Don't apply remediation edits without explicit user approval.
- Don't dilute, reinterpret, or silently ignore a constitution principle.
- Don't hallucinate sections that are absent — report them as missing.
- Don't exceed 50 findings in the table; aggregate the rest in an overflow summary.
Done when
- All three artifacts (plus constitution, if present) loaded and cross-analyzed.
- A structured report emitted with findings, coverage summary, metrics, and next actions.
- Remediation offered but not auto-applied; the user knows whether it's safe to implement.
Going deeper
Previous: [[speckit-tasks]]. Next: implementation (execute tasks.md once this gate is clear). Full chain: [[speckit-specify]] · [[speckit-clarify]] · [[speckit-plan]] · [[speckit-tasks]].
1---2name: speckit-analyze3description: Spec-Kit: Analyze4---5# Spec-Kit: Analyze67Run a non-destructive, **read-only** cross-artifact consistency and quality check across `spec.md`, `plan.md`, and `tasks.md` before implementation. This is the final quality gate. Invoked as `/speckit-analyze`.89**Lifecycle position** — step 5 of the chain:10[[speckit-specify]] → [[speckit-clarify]] → [[speckit-plan]] → [[speckit-tasks]] → `/speckit-analyze` → implement.1112Runs only after [[speckit-tasks]] has produced a complete `tasks.md`. It validates the trio of artifacts and clears the path to implementation — it does **not** modify them.1314## When to use1516- All three artifacts exist (`spec.md`, `plan.md`, `tasks.md`).17- Immediately before starting implementation, to catch gaps, contradictions, and uncovered requirements.1819## Operating constraints2021- **Strictly read-only.** Never modify any file. Output a structured report and, optionally, a remediation plan the user must explicitly approve.22- **Constitution is authority.** Any conflict with a MUST principle in `.specify/memory/constitution.md` is automatically CRITICAL and resolved by fixing the spec/plan/tasks — never by diluting the principle.2324## Flow25261. **Load artifacts** (minimal, progressive disclosure):27 - From `spec.md`: overview, Functional Requirements, Success Criteria, user stories, edge cases.28 - From `plan.md`: architecture/stack, data-model references, phases, technical constraints.29 - From `tasks.md`: task IDs, descriptions, phase grouping, `[P]` markers, referenced file paths.30 - From `.specify/memory/constitution.md`: principle names and MUST/SHOULD statements.31 - Abort if any required file is missing — tell the user which prerequisite command to run.322. **Build semantic models** (internal, not echoed): requirements inventory keyed by `FR-###` / `SC-###`; user-story/action inventory; task→requirement coverage mapping; constitution rule set. Include only Success Criteria that require buildable work — exclude post-launch KPIs.333. **Run detection passes** (high-signal; cap at 50 findings, summarize overflow):34 - **Duplication** — near-duplicate requirements; flag the weaker phrasing for consolidation.35 - **Ambiguity** — vague adjectives (fast, scalable, secure, robust) without measurable criteria; unresolved placeholders (TODO, ???, `<placeholder>`).36 - **Underspecification** — requirements missing object/measurable outcome; stories missing acceptance criteria; tasks referencing undefined components.37 - **Constitution alignment** — any element conflicting with a MUST principle, or a missing mandated gate.38 - **Coverage gaps** — requirements with zero tasks; tasks with no mapped requirement; buildable Success Criteria not reflected in tasks.39 - **Inconsistency** — terminology drift; entities in plan but absent from spec (or vice versa); task-ordering contradictions; directly conflicting requirements.404. **Assign severity:** CRITICAL (constitution MUST violation, missing core artifact, zero-coverage requirement blocking baseline) · HIGH (conflicting/duplicate requirement, untestable security/performance attribute) · MEDIUM (terminology drift, missing non-functional coverage, underspecified edge case) · LOW (wording/redundancy not affecting execution).415. **Emit a compact report** (see below).426. **Offer remediation** — ask whether to suggest concrete edits for the top issues. Never apply them automatically.4344## Report structure4546- A findings table: `| ID | Category | Severity | Location(s) | Summary | Recommendation |` (one row per finding; stable IDs prefixed by category initial, e.g. `A1`, `D2`).47- A **Coverage Summary** table: `| Requirement Key | Has Task? | Task IDs | Notes |`.48- **Constitution Alignment Issues** and **Unmapped Tasks** sections (if any).49- **Metrics**: total requirements, total tasks, coverage % (requirements with ≥1 task), ambiguity count, duplication count, critical-issue count.50- **Next Actions**: if CRITICAL issues exist, recommend resolving before implement; otherwise the user may proceed. Suggest explicit follow-ups (re-run [[speckit-specify]] to refine, [[speckit-plan]] to adjust architecture, or hand-edit `tasks.md` to close a coverage gap).5152## Quality criteria5354- Deterministic — rerunning without changes yields consistent IDs and counts.55- High-signal — cite specific instances, not generic patterns; never hallucinate missing sections.56- Constitution violations always surface as CRITICAL.57- Zero-issue runs still emit a success report with coverage statistics.5859## Don'ts6061- Don't modify any file — this is read-only analysis.62- Don't apply remediation edits without explicit user approval.63- Don't dilute, reinterpret, or silently ignore a constitution principle.64- Don't hallucinate sections that are absent — report them as missing.65- Don't exceed 50 findings in the table; aggregate the rest in an overflow summary.6667## Done when6869- All three artifacts (plus constitution, if present) loaded and cross-analyzed.70- A structured report emitted with findings, coverage summary, metrics, and next actions.71- Remediation offered but not auto-applied; the user knows whether it's safe to implement.7273## Going deeper7475Previous: [[speckit-tasks]]. Next: implementation (execute `tasks.md` once this gate is clear). Full chain: [[speckit-specify]] · [[speckit-clarify]] · [[speckit-plan]] · [[speckit-tasks]].