/speckit.constitution command creates and updates your project’s constitution - a living document that defines core principles, constraints, and governance rules.
Purpose
The constitution serves as the single source of truth for project-wide decisions:- Non-negotiable technical principles
- Complexity constraints and limitations
- Quality standards and testing requirements
- Architectural patterns and anti-patterns
- Governance and amendment procedures
The constitution is referenced by all other commands. Plan validation, task generation, and implementation all check against constitutional principles.
Usage
How It Works
Load Existing Constitution
Reads
.specify/memory/constitution.md and identifies all placeholder tokens like [PROJECT_NAME], [PRINCIPLE_1_NAME]Collect Values
Gathers values from:
- User input (your command arguments)
- Repository context (README, existing docs)
- Previous constitution versions
- Reasonable defaults for governance dates
Fill Template
Replaces all placeholders with concrete values:
- Project name and description
- Principle definitions with rationales
- Governance procedures
- Version information
Propagate Changes
Updates dependent templates:
plan-template.md(Constitution Check section)spec-template.md(alignment requirements)tasks-template.md(principle-driven task types)- Agent command files (if using specific AI assistants)
Constitution Structure
Metadata Section
Core Principles
Each principle includes:- Name: Short, memorable identifier
- Rule: Non-negotiable MUST/SHOULD statements
- Rationale: Why this principle exists
Governance Section
Versioning
The constitution uses semantic versioning:MAJOR.MINOR.PATCH
- MAJOR: Backward incompatible changes (principle removals, redefinitions)
- MINOR: New principles or expanded guidance
- PATCH: Clarifications, typo fixes, wording improvements
Version Examples
1.0.0 → 2.0.0: Removed “Microservices First” principle1.0.0 → 1.1.0: Added “API Versioning” principle1.1.0 → 1.1.1: Clarified wording in Principle 2
Consistency Propagation
When the constitution changes, the command updates:Templates
- plan-template.md: Updates Constitution Check gates
- spec-template.md: Aligns requirement sections
- tasks-template.md: Updates task categorization
- commands/*.md: Removes agent-specific references
Documentation
- README.md: Updates principle references
- docs/quickstart.md: Reflects new constraints
- Agent context files (if applicable)
Validation
Before finalizing, the command validates:Real-World Example
Common Principles
Technical Constraints
- Complexity Limits: “Maximum 3 microservices”
- Technology Stack: “Python 3.11+ only, no version mixing”
- Performance: “API responses < 200ms p95”
- Dependencies: “Only well-maintained libraries (updated in last 6 months)“
Quality Standards
- Testing: “80% code coverage minimum”
- Documentation: “All public APIs documented with examples”
- Code Review: “No direct commits to main, all changes via PR”
- Security: “OWASP Top 10 compliance required”
Architectural Patterns
- Separation of Concerns: “Controllers → Services → Repositories”
- Error Handling: “Centralized error handler, no silent failures”
- Configuration: “Environment-based config, no hardcoded values”
- Observability: “Structured logging, metrics, and tracing required”
Handoffs
After updating the constitution:Build Specification
Create a feature spec that aligns with updated principles
Technical Plan
Plan will validate against the new constitution
Best Practices
Keep Principles Testable
Document Rationale
Every principle should explain why it exists:- What problem does it solve?
- What pain does it prevent?
- What trade-offs does it accept?
Version Thoughtfully
Only increment MAJOR version when absolutely necessary:- Removing a principle is MAJOR
- Relaxing a constraint is MINOR
- Adding clarification is PATCH
Review Regularly
Schedule periodic reviews:- Quarterly: Check if principles still serve the project
- After major features: Validate no violations occurred
- When pain points emerge: Consider if constitution needs updating
File Location
Next Steps
Specify
Create feature specifications that align with your constitution