speckit-constitution
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 Actions section 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 Actions section.
Pre-Execution Checks
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, do not skip silently: tell the user that
.specify/extensions.yml could 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
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:
- If the hook has no
condition field, 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
- For 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.
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.yml does 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 --json from the repository root and parse TEMPLATE_CONTENT as 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.md exists, 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_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:
- 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 Actions section 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_constitution key
- If the YAML cannot be parsed or is invalid, do not skip silently: tell the user that
.specify/extensions.yml could 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
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:
- If the hook has no
condition field, 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
- For 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}
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.yml does not exist, skip silently
Constitution content
Create .specify/memory/constitution.md from .specify/templates/constitution-template.md: one page that links the organization constitution and standards by public URL and adds only principles specific to this repository. Run pipelines-hook spec-standard; its constitution check passes once the file exists.
Workspace conventions
- Feature artifacts live in tracked repository-root
specs/<stable-id>/, never under .specify/specs/ or agent_data/. .specify/ holds only project configuration, templates and .specify/memory/constitution.md.
- Route the feature first with the ecosystem boundaries standard (https://github.com/Knuckles-Team/pipelines/blob/main/reference/ecosystem-boundaries.md). Each behavior has one normative owner. Look up the owning spec and extend it before you add a new one.
- Keep every requirement row ID (
<PREFIX>-<AREA>-R012.4), every Spec: commit trailer and every test binding intact. The delivery state (SPECIFIED, LANDED, VERIFIED, RETIRED) is computed by pipelines-hook spec-status; never write a Status: line or status.json.
- Specs and prompts name no private repository, internal host, homelab inventory or local workspace path. A contributor with only public GitHub access must be able to complete the work.
- When
.specify/scripts/ is absent, derive the feature directory from the repository root and the stable ID instead of running a script.
1---2name: speckit-constitution3domain: development4skill_type: skill5description: "Create or update the project constitution from interactive or provided principle inputs. Use when a repository needs a new or updated constitution at .specify/memory/constitution.md."6license: MIT7tags: [spec-kit, sdd, upstream]8metadata:9 source: https://skillmd.com/skills/knuckles-team/speckit-constitution10 version: '1.6.0'11 author: GitHub Spec Kit contributors12 upstream: https://github.com/github/spec-kit13---1415# speckit-constitution1617## User Input1819```text20$ARGUMENTS21```2223You **MUST** consider the user input before proceeding (if not empty).2425## Scope Guard2627This command's own work is limited to updating the project constitution itself. Dependent templates28and commands read the constitution at runtime and are not modified here.2930- Classify every part of the user input as either constitution content or a separate,31 non-governance intent.32- If the input includes feature implementation, code generation, refactoring, building, or33 deployment requests, you **MUST NOT** execute them. Extract them as deferred intents instead.34- You **MUST NOT** create, modify, or delete application source files, feature routes,35 components, tests, deployment files, or other artifacts unrelated to the constitution36 workflow.37- If it is unclear whether an instruction is constitution content, ask for clarification before38 making changes.39- After completing the constitution update, include a `Next Actions` section for each deferred40 intent. List the original intent and suggest the appropriate follow-up Spec Kit command, such41 as `speckit-specify`, without invoking it.42- If there are no non-governance intents, omit the `Next Actions` section.4344## Pre-Execution Checks4546**Check for extension hooks (before constitution update)**:47- Check if `.specify/extensions.yml` exists in the project root.48- If it exists, read it and look for entries under the `hooks.before_constitution` key49- If the YAML cannot be parsed or is invalid, do not skip silently: tell the user that `.specify/extensions.yml` could not be read (include the parser error) and that no hooks were checked, including any mandatory (`optional: false`) hooks registered there, then continue normally50- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.51- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:52 - If the hook has no `condition` field, or it is null/empty, treat the hook as executable53 - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation54- For each executable hook, output the following based on its `optional` flag:55 - **Optional hook** (`optional: true`):56 ```57 ## Extension Hooks5859 **Optional Pre-Hook**: {extension}60 Command: `/{command}`61 Description: {description}6263 Prompt: {prompt}64 To execute: `/{command}`65 ```66 - **Mandatory hook** (`optional: false`):67 ```68 ## Extension Hooks6970 **Automatic Pre-Hook**: {extension}71 Executing: `/{command}`72 EXECUTE_COMMAND: {command}7374 Wait for the result of the hook command before proceeding to the Outline.75 ```76 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.77- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently7879## Outline8081You are updating the project constitution at `.specify/memory/constitution.md`. The active82constitution scaffold is resolved at command time from `constitution-template` through the Spec Kit83preset/template resolution stack.8485Follow this execution flow:86871. Run `.specify/scripts/bash/resolve-template.sh constitution-template --json` from the repository root and parse `TEMPLATE_CONTENT` as the active template.88 - The shared resolver applies project overrides, composing preset layers, and extension layers89 before the core template fallback. It MUST succeed before continuing.90 - If it fails, stop and report the resolution error; do not continue with only one contributing91 template layer.92 - If `.specify/memory/constitution.md` exists, load it as the source of current project-specific93 values and amendments. Preserve information that is still applicable when applying the newly94 resolved scaffold.95 - If it does not exist, use the resolved template as the initial document.96 - Do not write back to any versioned template layer.97 - Identify every placeholder token of the form `[ALL_CAPS_IDENTIFIER]`.98 **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.991002. Collect/derive values for placeholders:101 - If user input (conversation) supplies a value, use it.102 - Otherwise infer from existing repo context (README, docs, prior constitution versions if embedded).103 - 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, otherwise keep previous.104 - `CONSTITUTION_VERSION` must increment according to semantic versioning rules:105 - MAJOR: Backward incompatible governance/principle removals or redefinitions.106 - MINOR: New principle/section added or materially expanded guidance.107 - PATCH: Clarifications, wording, typo fixes, non-semantic refinements.108 - If version bump type ambiguous, propose reasoning before finalizing.1091103. Draft the updated constitution content using the resolved template as the required structure:111 - 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).112 - Preserve heading hierarchy and comments can be removed once replaced unless they still add clarifying guidance.113 - Ensure each Principle section: succinct name line, paragraph (or bullet list) capturing non‑negotiable rules, explicit rationale if not obvious.114 - Ensure Governance section lists amendment procedure, versioning policy, and compliance review expectations.1151164. Produce a Sync Impact Report as an HTML comment at the top of the constitution file after update.117 This report is temporary scratch material for human review of the amendment, not governance118 content; it is expected to be removed before the amended constitution file is committed.119 - Version change: old → new120 - List of modified principles (old title → new title if renamed)121 - Added sections122 - Removed sections123 - Follow-up TODOs if any placeholders intentionally deferred.1241255. Validation before final output:126 - No remaining unexplained bracket tokens.127 - Version line matches report.128 - Dates ISO format YYYY-MM-DD.129 - Principles are declarative, testable, and free of vague language ("should" → replace with MUST/SHOULD rationale where appropriate).1301316. Write the completed constitution back to `.specify/memory/constitution.md` (overwrite).1321337. Output a final summary to the user with:134 - New version and bump rationale.135 - Any TODO placeholders or deferred items requiring manual follow-up.136 - Suggested commit message (e.g., `docs: amend constitution to vX.Y.Z (principle additions + governance update)`).137 - A `Next Actions` section for any deferred non-governance intents.138139Formatting & Style Requirements:140141- Use Markdown headings exactly as in the template (do not demote/promote levels).142- Wrap long rationale lines to keep readability (<100 chars ideally) but do not hard enforce with awkward breaks.143- Keep a single blank line between sections.144- Avoid trailing whitespace.145146If the user supplies partial updates (e.g., only one principle revision), still perform validation and version decision steps.147148If critical info missing (e.g., ratification date truly unknown), insert `TODO(<FIELD_NAME>): explanation` and include in the Sync Impact Report under deferred items.149150Write only `.specify/memory/constitution.md`; do not create or modify template source files.151152## Post-Execution Checks153154**Check for extension hooks (after constitution update)**:155Check if `.specify/extensions.yml` exists in the project root.156- If it exists, read it and look for entries under the `hooks.after_constitution` key157- If the YAML cannot be parsed or is invalid, do not skip silently: tell the user that `.specify/extensions.yml` could not be read (include the parser error) and that no hooks were checked, including any mandatory (`optional: false`) hooks registered there, then continue normally158- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.159- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:160 - If the hook has no `condition` field, or it is null/empty, treat the hook as executable161 - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation162- For each executable hook, output the following based on its `optional` flag:163 - **Optional hook** (`optional: true`):164 ```165 ## Extension Hooks166167 **Optional Hook**: {extension}168 Command: `/{command}`169 Description: {description}170171 Prompt: {prompt}172 To execute: `/{command}`173 ```174 - **Mandatory hook** (`optional: false`):175 ```176 ## Extension Hooks177178 **Automatic Hook**: {extension}179 Executing: `/{command}`180 EXECUTE_COMMAND: {command}181 ```182 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.183- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently184185## Constitution content186187Create `.specify/memory/constitution.md` from `.specify/templates/constitution-template.md`: one page that links the organization constitution and standards by public URL and adds only principles specific to this repository. Run `pipelines-hook spec-standard`; its constitution check passes once the file exists.188189## Workspace conventions190191- Feature artifacts live in tracked repository-root `specs/<stable-id>/`, never under `.specify/specs/` or `agent_data/`. `.specify/` holds only project configuration, templates and `.specify/memory/constitution.md`.192- Route the feature first with the ecosystem boundaries standard (https://github.com/Knuckles-Team/pipelines/blob/main/reference/ecosystem-boundaries.md). Each behavior has one normative owner. Look up the owning spec and extend it before you add a new one.193- Keep every requirement row ID (`<PREFIX>-<AREA>-R012.4`), every `Spec:` commit trailer and every test binding intact. The delivery state (`SPECIFIED`, `LANDED`, `VERIFIED`, `RETIRED`) is computed by `pipelines-hook spec-status`; never write a `Status:` line or `status.json`.194- Specs and prompts name no private repository, internal host, homelab inventory or local workspace path. A contributor with only public GitHub access must be able to complete the work.195- When `.specify/scripts/` is absent, derive the feature directory from the repository root and the stable ID instead of running a script.