Skip to content

Commit 2f043ef

Browse files
committed
Update constitution command
1 parent d90cc16 commit 2f043ef

File tree

2 files changed

+68
-85
lines changed

2 files changed

+68
-85
lines changed

memory/constitution_update_checklist.md

Lines changed: 0 additions & 85 deletions
This file was deleted.

templates/commands/constitution.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
description: Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.
3+
# (No scripts section: constitution edits are manual authoring assisted by the agent)
4+
---
5+
6+
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.
7+
8+
Follow this execution flow:
9+
10+
1. Load the existing constitution template at `.specify/memory/constitution.md`.
11+
- Identify every placeholder token of the form `[ALL_CAPS_IDENTIFIER]`.
12+
- List them in a table with columns: Placeholder | Description In Comments (if present) | Current Value (if any) | Required?
13+
14+
2. Collect/derive values for placeholders:
15+
- If user input (conversation) supplies a value, use it.
16+
- Otherwise infer from existing repo context (README, docs, prior constitution versions if embedded).
17+
- 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.
18+
- `CONSTITUTION_VERSION` must increment according to semantic versioning rules:
19+
* MAJOR: Backward incompatible governance/principle removals or redefinitions.
20+
* MINOR: New principle/section added or materially expanded guidance.
21+
* PATCH: Clarifications, wording, typo fixes, non-semantic refinements.
22+
- If version bump type ambiguous, propose reasoning before finalizing.
23+
24+
3. Draft the updated constitution content:
25+
- 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).
26+
- Preserve heading hierarchy and comments can be removed once replaced unless they still add clarifying guidance.
27+
- Ensure each Principle section: succinct name line, paragraph (or bullet list) capturing non‑negotiable rules, explicit rationale if not obvious.
28+
- Ensure Governance section lists amendment procedure, versioning policy, and compliance review expectations.
29+
30+
4. Consistency propagation checklist (convert prior checklist into active validations):
31+
- Read `.specify/templates/plan-template.md` and ensure any "Constitution Check" or rules align with updated principles.
32+
- Read `.specify/templates/spec-template.md` for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints.
33+
- Read `.specify/templates/tasks-template.md` and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline).
34+
- Read each command file in `.specify/templates/commands/*.md` (including this one) to verify no outdated references (agent-specific names like CLAUDE only) remain when generic guidance is required.
35+
- Read any runtime guidance docs (e.g., `README.md`, `docs/quickstart.md`, or agent-specific guidance files if present). Update references to principles changed.
36+
37+
5. Produce a Sync Impact Report (prepend as an HTML comment at top of the constitution file after update):
38+
- Version change: old → new
39+
- List of modified principles (old title → new title if renamed)
40+
- Added sections
41+
- Removed sections
42+
- Templates requiring updates (✅ updated / ⚠ pending) with file paths
43+
- Follow-up TODOs if any placeholders intentionally deferred.
44+
45+
6. Validation before final output:
46+
- No remaining unexplained bracket tokens.
47+
- Version line matches report.
48+
- Dates ISO format YYYY-MM-DD.
49+
- Principles are declarative, testable, and free of vague language ("should" → replace with MUST/SHOULD rationale where appropriate).
50+
51+
7. Write the completed constitution back to `.specify/memory/constitution.md` (overwrite).
52+
53+
8. Output a final summary to the user with:
54+
- New version and bump rationale.
55+
- Any files flagged for manual follow-up.
56+
- Suggested commit message (e.g., `docs: amend constitution to vX.Y.Z (principle additions + governance update)`).
57+
58+
Formatting & Style Requirements:
59+
- Use Markdown headings exactly as in the template (do not demote/promote levels).
60+
- Wrap long rationale lines to keep readability (<100 chars ideally) but do not hard enforce with awkward breaks.
61+
- Keep a single blank line between sections.
62+
- Avoid trailing whitespace.
63+
64+
If the user supplies partial updates (e.g., only one principle revision), still perform validation and version decision steps.
65+
66+
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.
67+
68+
Do not create a new template; always operate on the existing `.specify/memory/constitution.md` file.

0 commit comments

Comments
 (0)