speckit-constitution
dceoy/speckit-agent-skills
Create or update project governance documents from principle inputs.
What is speckit-constitution?
Generates or amends a project constitution that codifies principles, values, and governance rules. Use this when establishing or evolving project governance, defining non-negotiable rules, or formalizing decision-making procedures. The skill integrates with Spec Kit's template resolution and extension hooks.
- Create a new constitution from interactive or provided principle inputs
- Update existing constitution while preserving applicable project-specific values
- Resolve constitution templates through Spec Kit's preset/override composition stack
- Validate placeholder tokens and enforce semantic versioning for governance changes
- Generate sync impact reports documenting principle additions, removals, and amendments
- Support extension hooks for pre-constitution checks and custom governance workflows
How to install speckit-constitution
npx skills add https://github.com/dceoy/speckit-agent-skills --skill speckit-constitution- Spec Kit project structure with .specify/ directory
- Resolved constitution template via .specify/scripts/bash/resolve-template.sh
- Optional: .specify/extensions.yml for pre-constitution hooks
How to use speckit-constitution
- 1.Provide principles, values, or governance amendments as input or respond to interactive prompts
- 2.The skill resolves the active constitution template from Spec Kit's preset/override stack
- 3.Existing constitution values are preserved and merged with new inputs
- 4.Placeholders are replaced with concrete text; version is bumped per semantic versioning rules
- 5.A sync impact report documents all changes before the constitution is written to .specify/memory/constitution.md
- 6.Review the summary and suggested commit message, then commit the updated constitution
Use cases
- Establish initial project governance when starting a new Spec Kit project
- Add new principles or governance rules as project scope evolves
- Amend existing constitution with clarifications or policy updates
- Formalize decision-making procedures and compliance review expectations
- Integrate custom governance checks via extension hooks before constitution updates
- Project leads defining or updating governance frameworks
- Teams using Spec Kit for structured project management
- Organizations formalizing principles and non-negotiable rules
- Developers managing multi-layer template composition for governance documents
speckit-constitution FAQ
The skill classifies non-governance intents separately and defers them. It updates only the constitution itself and lists deferred intents in a 'Next Actions' section with suggested follow-up Spec Kit commands.
If .specify/memory/constitution.md exists, it is loaded as the source of current project-specific values and amendments. Applicable information is preserved when the newly resolved template is applied.
MAJOR for backward-incompatible removals or redefinitions, MINOR for new principles or expanded guidance, PATCH for clarifications and wording fixes. The skill proposes reasoning if the bump type is ambiguous.
Yes. If .specify/extensions.yml exists with hooks.before_constitution entries, the skill executes enabled hooks before updating the constitution. Mandatory hooks block the update until they complete.
The skill stops and reports the resolution error. It requires successful template resolution before proceeding, and does not fall back to a single template layer.
Full instructions (SKILL.md)
Source of truth, from dceoy/speckit-agent-skills.
name: "speckit-constitution" description: "Create or update the project constitution from interactive or provided principle inputs." argument-hint: "Principles or values for the project constitution" compatibility: "Requires spec-kit project structure with .specify/ directory" metadata: author: "github-spec-kit" source: "templates/commands/constitution.md" user-invocable: true disable-model-invocation: false
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Scope Guard
This command's own work is limited to updating the project constitution itself. Dependent templates and commands read the constitution at runtime and are not modified here.
- Classify every part of the user input as either constitution content or a separate, non-governance intent.
- If the input includes feature implementation, code generation, refactoring, building, or deployment requests, you MUST NOT execute them. Extract them as deferred intents instead.
- You MUST NOT create, modify, or delete application source files, feature routes, components, tests, deployment files, or other artifacts unrelated to the constitution workflow.
- If it is unclear whether an instruction is constitution content, ask for clarification before making changes.
- After completing the constitution update, include a
Next Actionssection for each deferred intent. List the original intent and suggest the appropriate follow-up Spec Kit command, such as/speckit-specify, without invoking it. - If there are no non-governance intents, omit the
Next Actionssection.
Pre-Execution Checks
Check for extension hooks (before constitution update):
- Check if
.specify/extensions.ymlexists in the project root. - If it exists, read it and look for entries under the
hooks.before_constitutionkey - If the YAML cannot be parsed or is invalid, do not skip silently: tell the user that
.specify/extensions.ymlcould not be read (include the parser error) and that no hooks were checked, including any mandatory (optional: false) hooks registered there, then continue normally - Filter out hooks where
enabledis explicitlyfalse. Treat hooks without anenabledfield as enabled by default. - For each remaining hook, do not attempt to interpret or evaluate hook
conditionexpressions:- If the hook has no
conditionfield, or it is null/empty, treat the hook as executable - If the hook defines a non-empty
condition, skip the hook and leave condition evaluation to the HookExecutor implementation
- If the hook has no
- When constructing command invocations from hook command names, replace dots (
.) with hyphens (-). For example,speckit.git.commit→/speckit-git-commit. - For each executable hook, output the following based on its
optionalflag:-
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.After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal
{command}id shown above, e.g. a skills-mode agent runs it as/skill:speckit-...or$speckit-...). Emitting the block alone does not run the hook.
-
- If no hooks are registered or
.specify/extensions.ymldoes not exist, skip silently
Outline
You are updating the project constitution at .specify/memory/constitution.md. The active
constitution scaffold is resolved at command time from constitution-template through the Spec Kit
preset/template resolution stack.
Follow this execution flow:
-
Run
.specify/scripts/bash/resolve-template.sh constitution-template --jsonfrom the repository root and parseTEMPLATE_CONTENTas the active template.- The shared resolver applies project overrides, composing preset layers, and extension layers before the core template fallback. It MUST succeed before continuing.
- If it fails, stop and report the resolution error; do not continue with only one contributing template layer.
- If
.specify/memory/constitution.mdexists, load it as the source of current project-specific values and amendments. Preserve information that is still applicable when applying the newly resolved scaffold. - If it does not exist, use the resolved template as the initial document.
- Do not write back to any versioned template layer.
- Identify every placeholder token of the form
[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:
- If user input (conversation) supplies a value, use it.
- Otherwise infer from existing repo context (README, docs, prior constitution versions if embedded).
- For governance dates:
RATIFICATION_DATEis the original adoption date (if unknown ask or mark TODO),LAST_AMENDED_DATEis today if changes are made, otherwise keep previous. CONSTITUTION_VERSIONmust increment according to semantic versioning rules:- 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.
- If version bump type ambiguous, propose reasoning before finalizing.
-
Draft the updated constitution content using the resolved template as the required structure:
- Replace every placeholder with concrete text (no bracketed tokens left except intentionally retained template slots that the project has chosen not to define yet—explicitly justify any left).
- Preserve heading hierarchy and comments can be removed once replaced unless they still add clarifying guidance.
- Ensure each Principle section: succinct name line, paragraph (or bullet list) capturing non‑negotiable rules, explicit rationale if not obvious.
- Ensure Governance section lists amendment procedure, versioning policy, and compliance review expectations.
-
Produce a Sync Impact Report as an HTML comment at the top of the constitution file after update. This report is temporary scratch material for human review of the amendment, not governance content; it is expected to be removed before the amended constitution file is committed.
- Version change: old → new
- List of modified principles (old title → new title if renamed)
- Added sections
- Removed sections
- Follow-up TODOs if any placeholders intentionally deferred.
-
Validation before final output:
- No remaining unexplained bracket tokens.
- Version line matches report.
- Dates ISO format YYYY-MM-DD.
- Principles are declarative, testable, and free of vague language ("should" → replace with MUST/SHOULD rationale where appropriate).
-
Write the completed constitution back to
.specify/memory/constitution.md(overwrite). -
Output a final summary to the user with:
- New version and bump rationale.
- Any TODO placeholders or deferred items requiring manual follow-up.
- Suggested commit message (e.g.,
docs: amend constitution to vX.Y.Z (principle additions + governance update)). - A
Next Actionssection for any deferred non-governance intents.
Formatting & Style Requirements:
- Use Markdown headings exactly as in the template (do not demote/promote levels).
- Wrap long rationale lines to keep readability (<100 chars ideally) but do not hard enforce with awkward breaks.
- Keep a single blank line between sections.
- Avoid trailing whitespace.
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.
Write only .specify/memory/constitution.md; do not create or modify template source files.
Post-Execution Checks
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_constitutionkey - If the YAML cannot be parsed or is invalid, do not skip silently: tell the user that
.specify/extensions.ymlcould not be read (include the parser error) and that no hooks were checked, including any mandatory (optional: false) hooks registered there, then continue normally - Filter out hooks where
enabledis explicitlyfalse. Treat hooks without anenabledfield as enabled by default. - For each remaining hook, do not attempt to interpret or evaluate hook
conditionexpressions:- If the hook has no
conditionfield, or it is null/empty, treat the hook as executable - If the hook defines a non-empty
condition, skip the hook and leave condition evaluation to the HookExecutor implementation
- If the hook has no
- When constructing command invocations from hook command names, replace dots (
.) with hyphens (-). For example,speckit.git.commit→/speckit-git-commit. - For each executable hook, output the following based on its
optionalflag:-
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}After emitting the block above you MUST actually invoke the hook and wait for it to finish before continuing. Run it the same way you would run the command yourself in this agent/session (the invocation may differ from the literal
{command}id shown above, e.g. a skills-mode agent runs it as/skill:speckit-...or$speckit-...). Emitting the block alone does not run the hook.
-
- If no hooks are registered or
.specify/extensions.ymldoes not exist, skip silently
Related skills
More from dceoy/speckit-agent-skills and the wider catalog.

speckit-implement
Execute implementation tasks from tasks.md in a spec-kit project structure.

speckit-plan
Execute implementation planning workflows to generate design artifacts from feature specifications.

speckit-specify
Generate feature specifications from natural language descriptions using Spec Kit project structure.

speckit-tasks
Generate dependency-ordered, actionable tasks.md from design artifacts in spec-kit projects.

speckit-taskstoissues
Convert tasks into dependency-ordered GitHub issues from design artifacts.
dex
Manage tasks via dex CLI. Use when breaking down complex work, tracking implementation items, or persisting context across sessions.