Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,16 @@ uvx --from git+https://github.com/github/spec-kit.git specify init <PROJECT_NAME

Launch your AI assistant in the project directory. The `/speckit.*` commands are available in the assistant.

Use the **`/speckit.constitution`** command to create your project's governing principles and development guidelines that will guide all subsequent development.
For enterprise or multi-team environments, you can first define an **organization-wide constitution** using **`/speckit.enterprise-constitution`**. This higher-level document captures non-negotiable guiding principles that ALL projects must obey.

```bash
/speckit.constitution Create principles focused on code quality, testing standards, user experience consistency, and performance requirements
/speckit.enterprise-constitution Define organization-wide principles for security, compliance, reliability, and data governance that every project MUST follow
```

Then, use the **`/speckit.constitution`** command to create your **project's** governing principles and development guidelines, ensuring they align with the enterprise constitution where it exists.

```bash
/speckit.constitution Create principles focused on code quality, testing standards, user experience consistency, and performance requirements that comply with the enterprise constitution
```

### 3. Create the spec
Expand Down Expand Up @@ -250,13 +256,14 @@ After running `specify init`, your AI coding agent will have access to these sla

Essential commands for the Spec-Driven Development workflow:

| Command | Description |
| ----------------------- | ------------------------------------------------------------------------ |
| `/speckit.constitution` | Create or update project governing principles and development guidelines |
| `/speckit.specify` | Define what you want to build (requirements and user stories) |
| `/speckit.plan` | Create technical implementation plans with your chosen tech stack |
| `/speckit.tasks` | Generate actionable task lists for implementation |
| `/speckit.implement` | Execute all tasks to build the feature according to the plan |
| Command | Description |
| --------------------------------- | -------------------------------------------------------------------------------------------- |
| `/speckit.enterprise-constitution` | Create or update the higher-level enterprise constitution that governs all project constitutions |
| `/speckit.constitution` | Create or update project governing principles and development guidelines |
| `/speckit.specify` | Define what you want to build (requirements and user stories) |
| `/speckit.plan` | Create technical implementation plans with your chosen tech stack |
| `/speckit.tasks` | Generate actionable task lists for implementation |
| `/speckit.implement` | Execute all tasks to build the feature according to the plan |

#### Optional Commands

Expand Down
15 changes: 13 additions & 2 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,21 @@ uvx --from git+https://github.com/github/spec-kit.git specify init <PROJECT_NAME

### Step 2: Define Your Constitution

**In your AI Agent's chat interface**, use the `/speckit.constitution` slash command to establish the core rules and principles for your project. You should provide your project's specific principles as arguments.
**In your AI Agent's chat interface**, you can define constitutions at two levels:

- **Enterprise constitution** (optional, recommended for organizations): Use `/speckit.enterprise-constitution` to capture organization-wide principles that ALL projects must follow.
- **Project constitution**: Use `/speckit.constitution` to establish the core rules and principles for this specific project, ensuring they comply with the enterprise constitution when it exists.

Example enterprise constitution:

```markdown
/speckit.enterprise-constitution Our organization is "Security-First" and "Reliability-First". All products MUST meet strict security, compliance, observability, and SLO requirements. We prioritize long-term maintainability over short-term speed.
```

Example project constitution:

```markdown
/speckit.constitution This project follows a "Library-First" approach. All features must be implemented as standalone libraries first. We use TDD strictly. We prefer functional programming patterns.
/speckit.constitution This project follows a "Library-First" approach. All features must be implemented as standalone libraries first. We use TDD strictly. We prefer functional programming patterns. All rules MUST comply with the enterprise constitution.
```

### Step 3: Create the Spec
Expand Down
4 changes: 3 additions & 1 deletion spec-driven.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ The templates transform the LLM from a creative writer into a disciplined specif

## The Constitutional Foundation: Enforcing Architectural Discipline

At the heart of SDD lies a constitution—a set of immutable principles that govern how specifications become code. The constitution (`memory/constitution.md`) acts as the architectural DNA of the system, ensuring that every generated implementation maintains consistency, simplicity, and quality.
At the heart of SDD lies a constitution—a set of immutable principles that govern how specifications become code. The primary project constitution (`memory/constitution.md`) acts as the architectural DNA of the system, ensuring that every generated implementation maintains consistency, simplicity, and quality.

In enterprise environments, a higher-level **enterprise constitution** (`memory/enterprise-constitution.md`) can define organization-wide, non-negotiable principles. Each project constitution is subordinate to this enterprise constitution and MUST NOT contradict it; projects may only narrow or strengthen those higher-level rules.

### The Nine Articles of Development

Expand Down
41 changes: 31 additions & 10 deletions templates/commands/constitution.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
description: Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.
description: Create or update the project constitution from interactive or provided principle inputs, ensuring it aligns with the higher-level enterprise constitution and all dependent templates stay in sync.
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The YAML frontmatter is missing its opening delimiter. Markdown files with YAML frontmatter require both opening and closing --- delimiters. The opening --- should precede the description: field.

Copilot uses AI. Check for mistakes.
handoffs:
- label: Build Specification
agent: speckit.specify
Expand All @@ -18,13 +17,25 @@ You **MUST** consider the user input before proceeding (if not empty).

You are updating the project constitution at `/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.

This project-level constitution is **subordinate to the higher-level enterprise constitution**, which is maintained in a **separate, canonical repository** (for example, an organization-wide governance repo). In this project, `/memory/enterprise-constitution.md` is treated as a **cached mirror** of that source of truth.

The project constitution MUST NOT contradict the enterprise constitution. When in doubt, prefer the higher-level rules and explicitly call out any potential tensions or conflicts.

Follow this execution flow:

1. Load the existing constitution template at `/memory/constitution.md`.
1. Retrieve the higher-level enterprise constitution from its canonical repository.
- Use user input first if it specifies where the enterprise constitution lives (e.g., Git repo URL + file path, or a direct HTTP/HTTPS URL to the Markdown file).
- Otherwise, infer the location from existing documentation (e.g., organization docs, onboarding guides, or configuration files in the repo) and propose a best-guess location; if uncertain, ask the user to confirm.
- Fetch the latest version of the enterprise constitution from that remote source. You MAY use tools such as raw file URLs, GitHub/GitLab web UIs, or a local checkout of the canonical repo if available in the workspace.
- After retrieval, you MAY write or update `/memory/enterprise-constitution.md` as a **read-only cached copy** for this project, including a brief HTML comment at the top with the source repository, path, and commit/last-updated reference if known.
- Understand the enterprise constitution's overarching principles, constraints, and non-negotiable rules.
- If remote retrieval is not possible in this run, but the user input clearly describes enterprise-wide principles, treat those as effective higher-level rules for this run and propose creating or updating the central enterprise constitution in its own repository as a follow-up TODO. In this case, only create `/memory/enterprise-constitution.md` as a clearly marked temporary mirror, if at all.

2. Load the existing project constitution template at `/memory/constitution.md`.
- 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.

2. Collect/derive values for placeholders:
3. 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.
Expand All @@ -33,37 +44,47 @@ Follow this execution flow:
- 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.
- Ensure every project-level principle and governance rule you propose is checked against the enterprise constitution:
- If fully compatible, proceed.
- If it narrows or strengthens an enterprise rule, explicitly document that narrowing or strengthening in the project constitution text.
- If it appears to conflict, either adjust the project rule to comply or insert a `TODO(CONFLICT_<ID>): explanation` marker and list it in the Sync Impact Report.

3. Draft the updated constitution content:
4. Draft the updated constitution content:
- 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.

4. Consistency propagation checklist (convert prior checklist into active validations):
5. Consistency propagation checklist (convert prior checklist into active validations):
- Read `/templates/plan-template.md` and ensure any "Constitution Check" or rules align with updated principles.
- Read `/templates/spec-template.md` for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints.
- Read `/templates/tasks-template.md` and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline).
- Read each command file in `/templates/commands/*.md` (including this one) to verify no outdated references (agent-specific names like CLAUDE only) remain when generic guidance is required.
- Read any runtime guidance docs (e.g., `README.md`, `docs/quickstart.md`, or agent-specific guidance files if present). Update references to principles changed.
- If `/memory/enterprise-constitution.md` exists and has been updated outside this command, ensure that any project-level references to enterprise principles still point to valid sections or concepts.
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation in the bullet list. Line 64 has 5 spaces of indentation while other sub-bullets in step 5 have 6 spaces. This breaks the visual hierarchy and may affect Markdown rendering.

Suggested change
- If `/memory/enterprise-constitution.md` exists and has been updated outside this command, ensure that any project-level references to enterprise principles still point to valid sections or concepts.
- If `/memory/enterprise-constitution.md` exists and has been updated outside this command, ensure that any project-level references to enterprise principles still point to valid sections or concepts.

Copilot uses AI. Check for mistakes.

5. Produce a Sync Impact Report (prepend as an HTML comment at top of the constitution file after update):
6. Produce a Sync Impact Report (prepend as an HTML comment at top of the constitution file after update):
- Version change: old → new
- List of modified principles (old title → new title if renamed)
- Added sections
- Removed sections
- Templates requiring updates (✅ updated / ⚠ pending) with file paths
- Enterprise alignment summary:
- Whether the enterprise constitution was successfully retrieved from its canonical repository and whether `/memory/enterprise-constitution.md` was present/updated as a cache.
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation in the bullet list. Line 73 has 8 spaces of indentation while the sibling bullet on line 74 has 6 spaces. This creates visual inconsistency and may affect Markdown rendering.

Suggested change
- Whether the enterprise constitution was successfully retrieved from its canonical repository and whether `/memory/enterprise-constitution.md` was present/updated as a cache.
- Whether the enterprise constitution was successfully retrieved from its canonical repository and whether `/memory/enterprise-constitution.md` was present/updated as a cache.

Copilot uses AI. Check for mistakes.
- Any project-level principles that narrow or extend enterprise rules.
- Any `TODO(CONFLICT_*)` items, with a short description.
- Follow-up TODOs if any placeholders intentionally deferred.

6. Validation before final output:
7. 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).
- No project-level rule silently contradicts the enterprise constitution; any suspected conflict is explicitly marked with a TODO and called out in the Sync Impact Report.

7. Write the completed constitution back to `/memory/constitution.md` (overwrite).
8. Write the completed constitution back to `/memory/constitution.md` (overwrite).

8. Output a final summary to the user with:
9. Output a final summary to the user with:
- New version and bump rationale.
- Any files flagged for manual follow-up.
- Suggested commit message (e.g., `docs: amend constitution to vX.Y.Z (principle additions + governance update)`).
Expand Down
Loading
Loading