Spec-Kit Constitution
Create or update the project constitution at .specify/memory/constitution.md. This file defines the governing principles, constraints, and governance rules for specification-driven development.
Scope - What Constitution Contains
MUST contain:
- Project governance principles (high-level, technology-agnostic)
- Non-negotiable development rules
- Quality standards and expectations
- Amendment procedures and versioning policy
- Compliance review expectations
MUST NOT contain:
- Technology stack (languages, frameworks, databases) - belongs in
/speckit-03-plan
- Implementation details - belongs in
/speckit-03-plan
- Specific tools or versions - belongs in
/speckit-03-plan
- API designs or data models - belongs in
/speckit-03-plan
The constitution defines the "laws" of the project. The plan defines how to implement features within those laws.
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Prerequisites Check
Check if constitution already exists:
cat .specify/memory/constitution.md 2>/dev/null || echo "NO_CONSTITUTION"
If constitution doesn't exist, copy from constitution-template.md:
cp .claude/skills/speckit-core/templates/constitution-template.md .specify/memory/constitution.md
Execution Flow
Load the existing constitution at .specify/memory/constitution.md.
- Identify every placeholder token of the form
[ALL_CAPS_IDENTIFIER].
- IMPORTANT: The user might require fewer or more principles than the template. Adapt accordingly.
Collect/derive values for placeholders:
- If user input supplies a value, use it.
- Otherwise infer from existing repo context (README, docs, prior constitution versions).
- For governance dates:
RATIFICATION_DATE is the original adoption date (if unknown, ask or mark TODO)
LAST_AMENDED_DATE is today if changes are made
CONSTITUTION_VERSION must increment according to semantic versioning:
- MAJOR: Backward incompatible governance/principle removals or redefinitions
- MINOR: New principle/section added or materially expanded guidance
- PATCH: Clarifications, wording, typo fixes, non-semantic refinements
Draft the updated constitution content:
- Replace every placeholder with concrete text (no bracketed tokens left)
- Preserve heading hierarchy
- Ensure each Principle section has: succinct name, paragraph or bullet list capturing non-negotiable rules, explicit rationale
- Ensure Governance section lists amendment procedure, versioning policy, and compliance review expectations
Consistency propagation (validate against templates if they exist):
- Check plan-template.md for constitution alignment
- Check spec-template.md for scope/requirements alignment
- Check tasks-template.md for task categorization alignment
Produce a Sync Impact Report (prepend as HTML comment at top of constitution file):
- Version change: old -> new
- List of modified principles
- Added/removed sections
- Templates requiring updates
- Follow-up TODOs if any placeholders deferred
Validation before final output:
- No remaining unexplained bracket tokens
- Version line matches report
- Dates in ISO format YYYY-MM-DD
- Principles are declarative, testable, and free of vague language
Phase Separation Validation (REQUIRED):
Before writing, scan the draft constitution for technology-specific content that belongs in /speckit-03-plan:
Check for violations - constitution MUST NOT mention:
- Programming languages (Python, JavaScript, TypeScript, Go, Rust, Java, C#, etc.)
- Frameworks (React, Django, Express, Spring, Rails, FastAPI, etc.)
- Databases (PostgreSQL, MySQL, MongoDB, SQLite, Redis, etc.)
- Infrastructure (Docker, Kubernetes, AWS, GCP, Azure, etc.)
- Specific libraries or packages
- Version numbers of tools
- File extensions tied to languages (.py, .js, .ts, etc.)
- API specifications (REST, GraphQL, gRPC)
If violations found:
╭─────────────────────────────────────────────────────────────────╮
│ PHASE SEPARATION VIOLATION DETECTED │
├─────────────────────────────────────────────────────────────────┤
│ Constitution contains technology-specific content: │
│ - [list each violation] │
│ │
│ Technology decisions belong in /speckit-03-plan, not here. │
│ Constitution must be technology-agnostic to survive tech │
│ stack changes. │
├─────────────────────────────────────────────────────────────────┤
│ ACTION: Removing technology references and generalizing... │
╰─────────────────────────────────────────────────────────────────╯
Auto-fix: Rewrite the violating sections to be technology-agnostic:
- "Use Python" → "Use appropriate language for the domain"
- "Store in PostgreSQL" → "Use persistent storage"
- "Deploy with Docker" → "Use containerization when appropriate"
Re-validate after fixes until no violations remain.
Write the completed constitution back to .specify/memory/constitution.md
Initialize Git Repository (REQUIRED)
A spec-kit project MUST be a git repository to ensure proper project isolation.
# Check if git repo exists, initialize if not
if [ ! -d ".git" ]; then
git init
echo "[specify] Git repository initialized"
fi
Why this is required: Without git init, scripts like create-new-feature.sh may
find a parent git repository and create files in the wrong location.
Commit Constitution to Git
After writing the constitution, commit it to establish the project baseline:
git add .specify/memory/constitution.md
# Also add README if it exists
[ -f README.md ] && git add README.md
git commit -m "Initialize spec-kit project with constitution"
This creates the initial commit with the project's governing document.
Output final summary to the user with:
- New version and bump rationale
- Git initialization status
- Any files flagged for manual follow-up
- Suggested next steps
Formatting Requirements
- Use Markdown headings exactly as in the template
- Wrap long rationale lines for readability (<100 chars)
- Keep a single blank line between sections
- Avoid trailing whitespace
Next Steps
After creating the constitution, you can:
- Run
/speckit-01-specify to create a feature specification
The constitution will be loaded and validated by all other speckit skills.
1---2name: speckit-00-constitution3description: Create or update project governance principles and constitution4---56# Spec-Kit Constitution78Create or update the project constitution at `.specify/memory/constitution.md`. This file defines the governing principles, constraints, and governance rules for specification-driven development.910## Scope - What Constitution Contains1112**MUST contain:**13- Project governance principles (high-level, technology-agnostic)14- Non-negotiable development rules15- Quality standards and expectations16- Amendment procedures and versioning policy17- Compliance review expectations1819**MUST NOT contain:**20- Technology stack (languages, frameworks, databases) - belongs in `/speckit-03-plan`21- Implementation details - belongs in `/speckit-03-plan`22- Specific tools or versions - belongs in `/speckit-03-plan`23- API designs or data models - belongs in `/speckit-03-plan`2425The constitution defines the "laws" of the project. The plan defines how to implement features within those laws.2627## User Input2829```text30$ARGUMENTS31```3233You **MUST** consider the user input before proceeding (if not empty).3435## Prerequisites Check36371. Check if constitution already exists:38 ```bash39 cat .specify/memory/constitution.md 2>/dev/null || echo "NO_CONSTITUTION"40 ```41422. If constitution doesn't exist, copy from [constitution-template.md](.claude/skills/speckit-core/templates/constitution-template.md):43 ```bash44 cp .claude/skills/speckit-core/templates/constitution-template.md .specify/memory/constitution.md45 ```4647## Execution Flow48491. **Load the existing constitution** at `.specify/memory/constitution.md`.50 - Identify every placeholder token of the form `[ALL_CAPS_IDENTIFIER]`.51 - **IMPORTANT**: The user might require fewer or more principles than the template. Adapt accordingly.52532. **Collect/derive values for placeholders**:54 - If user input supplies a value, use it.55 - Otherwise infer from existing repo context (README, docs, prior constitution versions).56 - For governance dates:57 - `RATIFICATION_DATE` is the original adoption date (if unknown, ask or mark TODO)58 - `LAST_AMENDED_DATE` is today if changes are made59 - `CONSTITUTION_VERSION` must increment according to semantic versioning:60 - MAJOR: Backward incompatible governance/principle removals or redefinitions61 - MINOR: New principle/section added or materially expanded guidance62 - PATCH: Clarifications, wording, typo fixes, non-semantic refinements63643. **Draft the updated constitution content**:65 - Replace every placeholder with concrete text (no bracketed tokens left)66 - Preserve heading hierarchy67 - Ensure each Principle section has: succinct name, paragraph or bullet list capturing non-negotiable rules, explicit rationale68 - Ensure Governance section lists amendment procedure, versioning policy, and compliance review expectations69704. **Consistency propagation** (validate against templates if they exist):71 - Check [plan-template.md](.claude/skills/speckit-core/templates/plan-template.md) for constitution alignment72 - Check [spec-template.md](.claude/skills/speckit-core/templates/spec-template.md) for scope/requirements alignment73 - Check [tasks-template.md](.claude/skills/speckit-core/templates/tasks-template.md) for task categorization alignment74755. **Produce a Sync Impact Report** (prepend as HTML comment at top of constitution file):76 - Version change: old -> new77 - List of modified principles78 - Added/removed sections79 - Templates requiring updates80 - Follow-up TODOs if any placeholders deferred81826. **Validation before final output**:83 - No remaining unexplained bracket tokens84 - Version line matches report85 - Dates in ISO format YYYY-MM-DD86 - Principles are declarative, testable, and free of vague language87887. **Phase Separation Validation (REQUIRED)**:8990 Before writing, scan the draft constitution for technology-specific content that belongs in `/speckit-03-plan`:9192 **Check for violations - constitution MUST NOT mention:**93 - Programming languages (Python, JavaScript, TypeScript, Go, Rust, Java, C#, etc.)94 - Frameworks (React, Django, Express, Spring, Rails, FastAPI, etc.)95 - Databases (PostgreSQL, MySQL, MongoDB, SQLite, Redis, etc.)96 - Infrastructure (Docker, Kubernetes, AWS, GCP, Azure, etc.)97 - Specific libraries or packages98 - Version numbers of tools99 - File extensions tied to languages (.py, .js, .ts, etc.)100 - API specifications (REST, GraphQL, gRPC)101102 **If violations found:**103 ```104 ╭─────────────────────────────────────────────────────────────────╮105 │ PHASE SEPARATION VIOLATION DETECTED │106 ├─────────────────────────────────────────────────────────────────┤107 │ Constitution contains technology-specific content: │108 │ - [list each violation] │109 │ │110 │ Technology decisions belong in /speckit-03-plan, not here. │111 │ Constitution must be technology-agnostic to survive tech │112 │ stack changes. │113 ├─────────────────────────────────────────────────────────────────┤114 │ ACTION: Removing technology references and generalizing... │115 ╰─────────────────────────────────────────────────────────────────╯116 ```117118 **Auto-fix:** Rewrite the violating sections to be technology-agnostic:119 - "Use Python" → "Use appropriate language for the domain"120 - "Store in PostgreSQL" → "Use persistent storage"121 - "Deploy with Docker" → "Use containerization when appropriate"122123 Re-validate after fixes until no violations remain.1241258. **Write the completed constitution** back to `.specify/memory/constitution.md`1261279. **Initialize Git Repository (REQUIRED)**128129 A spec-kit project MUST be a git repository to ensure proper project isolation.130131 ```bash132 # Check if git repo exists, initialize if not133 if [ ! -d ".git" ]; then134 git init135 echo "[specify] Git repository initialized"136 fi137 ```138139 **Why this is required**: Without git init, scripts like `create-new-feature.sh` may140 find a parent git repository and create files in the wrong location.14114210. **Commit Constitution to Git**143144 After writing the constitution, commit it to establish the project baseline:145146 ```bash147 git add .specify/memory/constitution.md148 # Also add README if it exists149 [ -f README.md ] && git add README.md150 git commit -m "Initialize spec-kit project with constitution"151 ```152153 This creates the initial commit with the project's governing document.15415511. **Output final summary** to the user with:156 - New version and bump rationale157 - Git initialization status158 - Any files flagged for manual follow-up159 - Suggested next steps160161## Formatting Requirements162163- Use Markdown headings exactly as in the template164- Wrap long rationale lines for readability (<100 chars)165- Keep a single blank line between sections166- Avoid trailing whitespace167168## Next Steps169170After creating the constitution, you can:171- Run `/speckit-01-specify` to create a feature specification172173The constitution will be loaded and validated by all other speckit skills.