Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.
Updates your project's constitution by filling template placeholders with concrete values from user input or repo context. Use when establishing governance rules, adding principles, or amending existing ones to keep all dependent templates synchronized.
/plugin marketplace add nprbst/speck-market/plugin install nprbst-speck-speck@nprbst/speck-market$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
You are updating the project-local constitution at .speck/memory/constitution.md (in the project root, NOT the plugin). If this file doesn't exist yet, copy it from the plugin template at .speck/memory/constitution.md first. 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.
Follow this execution flow:
Get template directory: Run speck check-prerequisites --json --skip-feature-check and extract TEMPLATE_DIR from the JSON output.
Check if .speck/memory/constitution.md exists in the project root:
{TEMPLATE_DIR}/constitution-template.md using Read tool, then Write to .speck/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 (use Read tool for all template files):
{TEMPLATE_DIR}/plan-template.md and ensure any "Constitution Check" or rules align with updated principles.{TEMPLATE_DIR}/spec-template.md for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints.{TEMPLATE_DIR}/tasks-template.md and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline).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 .speck/memory/constitution.md (overwrite).
Output a final summary to the user with:
docs: amend constitution to vX.Y.Z (principle additions + governance update)).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 .speck/memory/constitution.md file.