This document describes the /speckit.analyze command, an optional quality assurance command in the Spec-Driven Development workflow that performs cross-artifact validation and consistency checking. This command analyzes relationships between specifications, plans, and tasks to identify gaps, inconsistencies, and coverage issues before implementation begins.
For information about generating specifications, see /speckit.specify Command. For information about creating implementation plans, see /speckit.plan Command. For information about generating tasks, see /speckit.tasks Command. For information about quality checklists, see /speckit.checklist Command.
The /speckit.analyze command provides static analysis of the specification artifacts produced during the SDD workflow. It acts as a validation gate between task generation and implementation, ensuring that all artifacts are internally consistent, complete, and ready for execution. This reduces the risk of discovering architectural gaps or requirement mismatches during implementation.
Key Capabilities:
Sources: README.md268-269
The /speckit.analyze command is positioned strategically in the SDD workflow to catch issues before they become expensive to fix. It should be executed after task generation but before implementation begins.
Recommended Usage Pattern:
| Stage | Command | Analysis Role |
|---|---|---|
After /speckit.tasks | Run /speckit.analyze | Validate all artifacts before implementation |
Before /speckit.implement | Review analysis output | Address any identified issues |
| Optional: After plan changes | Re-run /speckit.analyze | Verify consistency after modifications |
Sources: README.md268-269
The command operates on the current feature branch's specification directory, analyzing all artifacts within the active feature scope.
The command requires the following context to operate correctly:
| Requirement | Source | Purpose |
|---|---|---|
| Active feature branch | Git branch or SPECIFY_FEATURE env var | Identifies which specification to analyze |
spec.md | .specify/specs/NNN-feature-name/ | Requirements baseline |
plan.md | .specify/specs/NNN-feature-name/ | Technical implementation baseline |
tasks.md | .specify/specs/NNN-feature-name/ | Task breakdown baseline |
constitution.md | .specify/memory/ | Architectural principles for validation |
Sources: README.md275-276
The command analyzes relationships between specification artifacts to ensure end-to-end consistency and completeness.
Sources: README.md268-269 Inferred from SDD workflow architecture
The /speckit.analyze command performs multiple categories of validation, each targeting a specific consistency dimension.
Validates that every user story in spec.md has corresponding implementation coverage in plan.md and tasks.md.
Checks Performed:
Example Issue:
Ensures that all technical components declared in the plan have corresponding tasks and that all contracts are tested.
Checks Performed:
data-model.md have creation taskscontracts/*.json have implementation tasksExample Issue:
Validates internal consistency within and across artifacts.
Checks Performed:
Example Issue:
Validates that the plan adheres to architectural principles defined in constitution.md.
Checks Performed:
Example Issue:
Validates task ordering and parallelization markers.
Checks Performed:
[P] (parallel) have no dependencies between themExample Issue:
Sources: Inferred from constitutional enforcement system (Diagram 6) and SDD methodology
The command generates an analysis report in the feature specification directory:
The analysis-report.md file follows this structure:
The analysis report is automatically added to the agent's context for the /speckit.implement command, allowing the agent to be aware of identified issues during implementation.
Sources: Inferred from SDD workflow and template system architecture
The /speckit.analyze command is defined using the command template system and deployed to agent-specific directories during project initialization.
File Path Mapping:
| Component | Path | Purpose |
|---|---|---|
| Command Template | templates/commands/analyze.md | Source template for all agents |
| Claude Code | .claude/commands/analyze.md | Claude-specific Markdown format |
| Gemini CLI | .gemini/commands/analyze.toml | Gemini-specific TOML format |
| GitHub Copilot | .github/agents/analyze.md | Copilot-specific Markdown format |
| Cursor | .cursor/commands/analyze.md | Cursor-specific Markdown format |
| Windsurf | .windsurf/workflows/analyze.md | Windsurf-specific Markdown format |
Sources: Inferred from Diagram 3 and Diagram 4 (Multi-Agent Integration Architecture), README.md268-269
The /speckit.analyze command integrates with other workflow commands to provide a comprehensive validation pipeline.
| Analysis Result | Recommended Action | Command to Re-run |
|---|---|---|
| ✅ All checks pass | Proceed to implementation | /speckit.implement |
| ⚠️ Warnings only | Review and optionally refine | None (discretionary) |
| ❌ Traceability failures | Update specification or plan | /speckit.clarify then /speckit.plan |
| ❌ Coverage gaps | Add missing implementation details | /speckit.plan then /speckit.tasks |
| ❌ Constitutional violations | Justify complexity or simplify | /speckit.plan |
| ❌ Dependency issues | Reorder tasks | /speckit.tasks |
Sources: Inferred from SDD workflow (Diagram 2), README.md268-269
Scenario: Before beginning implementation, validate that all artifacts are consistent and complete.
Workflow:
/speckit.specify and /speckit.clarify/speckit.plan/speckit.tasks/speckit.analyze to validate/speckit.implementBenefit: Catches issues before implementation begins, reducing costly rework.
Scenario: After making manual changes to plan.md based on research or clarifications, verify that the changes maintain consistency.
Workflow:
plan.md to add technical details/speckit.analyze to verify consistency/speckit.analyze to confirm/speckit.tasks if neededBenefit: Ensures manual changes don't introduce inconsistencies or gaps.
Scenario: Validate that tasks are ordered correctly and parallelization markers are safe.
Workflow:
/speckit.tasks/speckit.analyze focusing on dependency analysistasks.md if needed/speckit.analyze to confirm correctnessBenefit: Prevents implementation failures due to incorrect task ordering.
Scenario: Ensure that the implementation plan adheres to architectural principles before investing time in implementation.
Workflow:
/speckit.plan/speckit.analyze with focus on constitutional compliance/speckit.analyze to confirm complianceBenefit: Enforces architectural discipline early in the workflow.
Scenario: Identify missing implementation coverage for user stories or technical components.
Workflow:
/speckit.tasks/speckit.analyze with focus on coverage analysisplan.md and/or tasks.md to add missing items/speckit.analyze to confirm full coverageBenefit: Ensures no requirements are accidentally omitted during implementation.
Sources: Inferred from SDD methodology and constitutional enforcement patterns
When working with multiple related features, the analysis command can help identify cross-feature dependencies and conflicts.
Example:
For iterative enhancement scenarios, the analysis validates that new specifications don't conflict with existing implementations.
Considerations:
Beyond correctness, the command can validate architectural decisions for performance implications.
Example Checks:
Sources: Inferred from experimental goals in README.md294-319
The /speckit.analyze command complements but does not replace other quality assurance mechanisms in the SDD workflow.
| Command | Focus | When to Use | Relationship to /speckit.analyze |
|---|---|---|---|
/speckit.clarify | Specification completeness | After /speckit.specify | Prevents ambiguous specs that would fail analysis |
/speckit.analyze | Cross-artifact consistency | After /speckit.tasks | Main validation gate before implementation |
/speckit.checklist | Custom quality criteria | Any phase | Complements analysis with domain-specific checks |
Sources: README.md262-269
The command likely implements the following algorithm:
spec.md, plan.md, tasks.md, constitution.mdanalysis-report.md to feature directoryThe analysis framework could be extended through:
Sources: Inferred from system architecture and SDD workflow patterns
The /speckit.analyze command provides critical quality assurance by validating consistency and completeness across specification artifacts before implementation begins. As an optional but highly recommended step in the SDD workflow, it acts as a validation gate that reduces implementation risk and rework costs.
Key Takeaways:
/speckit.tasks, before /speckit.implementanalysis-report.md with actionable findingsSources: README.md268-269 Inferred from SDD workflow and system architecture
Refresh this wiki