Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Check for extension hooks (before constitution update):
Check if .specify/extensions.yml exists in the project root.
If it exists, read it and look for entries under the hooks.before_constitution key
If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
Filter out hooks where enabled is explicitly false. Treat hooks without an enabled field as enabled by default.
For each remaining hook, do not attempt to interpret or evaluate hook condition expressions:
condition field, or it is null/empty, treat the hook as executablecondition, skip the hook and leave condition evaluation to the HookExecutor implementationFor each executable hook, output the following based on its optional flag:
Optional hook (optional: true):
## Extension Hooks
**Optional Pre-Hook**: {extension}
Command: `/{command}`
Description: {description}
Prompt: {prompt}
To execute: `/{command}`
Mandatory hook (optional: false):
## Extension Hooks
**Automatic Pre-Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}
Wait for the result of the hook command before proceeding to the Outline.
If no hooks are registered or .specify/extensions.yml does not exist, skip silently
You are updating the project constitution at .specify/memory/constitution.md. This file is a TEMPLATE containing placeholder tokens in square brackets (e.g. [PROJECT_NAME], [PRINCIPLE_1_NAME]). Your job is to (a) collect/derive concrete values, (b) fill the template precisely, and (c) propagate any amendments across dependent artifacts.
Note: If .specify/memory/constitution.md does not exist yet, it should have been initialized from .specify/templates/constitution-template.md during project setup. If it's missing, copy the template first.
Follow this execution flow:
Load the existing constitution at .specify/memory/constitution.md.
[ALL_CAPS_IDENTIFIER].
IMPORTANT: The user might require less or more principles than the ones used in the template. If a number is specified, respect that - follow the general template. You will update the doc accordingly.Collect/derive values for placeholders:
RATIFICATION_DATE is the original adoption date (if unknown ask or mark TODO), LAST_AMENDED_DATE is today if changes are made, otherwise keep previous.CONSTITUTION_VERSION must increment according to semantic versioning rules:
Draft the updated constitution content:
Consistency propagation checklist (convert prior checklist into active validations):
.specify/templates/plan-template.md and ensure any "Constitution Check" or rules align with updated principles..specify/templates/spec-template.md for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints..specify/templates/tasks-template.md and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline)..specify/templates/commands/*.md (including this one) to verify no outdated references (agent-specific names like CLAUDE only) remain when generic guidance is required.Formatting & Style Requirements:
If the user supplies partial updates (e.g., only one principle revision), still perform validation and version decision steps.
If critical info missing (e.g., ratification date truly unknown), insert TODO(<FIELD_NAME>): explanation and include in the Sync Impact Report under deferred items.
Do not create a new template; always operate on the existing .specify/memory/constitution.md file.
Check for extension hooks (after constitution update):
Check if .specify/extensions.yml exists in the project root.
If it exists, read it and look for entries under the hooks.after_constitution key
If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
Filter out hooks where enabled is explicitly false. Treat hooks without an enabled field as enabled by default.
For each remaining hook, do not attempt to interpret or evaluate hook condition expressions:
condition field, or it is null/empty, treat the hook as executablecondition, skip the hook and leave condition evaluation to the HookExecutor implementationFor each executable hook, output the following based on its optional flag:
Optional hook (optional: true):
## Extension Hooks
**Optional Hook**: {extension}
Command: `/{command}`
Description: {description}
Prompt: {prompt}
To execute: `/{command}`
Mandatory hook (optional: false):
## Extension Hooks
**Automatic Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}
If no hooks are registered or .specify/extensions.yml does not exist, skip silently
README.md, docs/quickstart.md, or agent-specific guidance files if present). Update references to principles changed.Produce a Sync Impact Report (prepend as an HTML comment at top of the constitution file after update):
Validation before final output:
Write the completed constitution back to .specify/memory/constitution.md (overwrite).
Output a final summary to the user with:
docs: amend constitution to vX.Y.Z (principle additions + governance update)).