Get the FREE Ultimate OpenClaw Setup Guide →

speckit-constitution

npx machina-cli add skill h3y6e/speckit-skills/speckit-constitution --openclaw
Files (1)
SKILL.md
5.2 KB

Speckit Constitution Skill

Outline

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

Note: If specs/constitution.md does not exist yet, it should have been initialized from references/constitution-template.md during project setup. If it's missing, copy the template first.

Follow this execution flow:

  1. Load the existing constitution at specs/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:

    • 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.
  3. 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):

    • Read ../speckit-plan/references/plan-template.md and ensure any "Constitution Check" or rules align with updated principles.
    • Read ../speckit-specify/references/spec-template.md for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints.
    • Read ../speckit-tasks/references/tasks-template.md and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline).
    • Review all other speckit skill definitions (SKILL.md files in sibling speckit-* directories) 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.
  5. 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
    • Follow-up TODOs if any placeholders intentionally deferred.
  6. 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).
  7. Write the completed constitution back to specs/constitution.md (overwrite).

  8. 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)).

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.

Do not create a new template; always operate on the existing specs/constitution.md file.

Source

git clone https://github.com/h3y6e/speckit-skills/blob/main/skills/speckit-constitution/SKILL.mdView on GitHub

Overview

Speckit-constitution helps you create or update your project's governance by filling in template placeholders in specs/constitution.md. It establishes non-negotiable rules for code quality, testing, and architectural constraints, and governs versioning and changes across dependent artifacts.

How This Skill Works

It loads the existing constitution, identifies placeholders like [ALL_CAPS_IDENTIFIER], fills them with concrete values (from input or inferred), increments CONSTITUTION_VERSION according to semantic versioning rules, and drafts the updated content. It also produces a Sync Impact Report to prepend as an HTML comment at the top of the file.

When to Use It

  • At project kickoff to establish governance and development guidelines
  • When a placeholder is detected or a template needs concrete values
  • Before major releases that redefine principles or add new ones
  • When governance dates (RATIFICATION_DATE, LAST_AMENDED_DATE) need updating
  • During compliance checks or audits of the constitution and related templates

Quick Start

  1. Step 1: Load specs/constitution.md and locate all [ALL_CAPS_IDENTIFIER] placeholders
  2. Step 2: Provide values or infer them from the repo context, then replace tokens
  3. Step 3: Commit updated constitution and review the generated Sync Impact Report

Best Practices

  • Collect concrete values for every placeholder from repo context or explicit input
  • Follow semantic versioning: MAJOR for backward-incompatible changes, MINOR for new/expanded principles, PATCH for clarifications
  • Preserve clear rationale for each principle and amendment
  • Run cross-checks against plan-template and spec-template for consistency
  • Generate and attach a Sync Impact Report detailing changes and templates touched

Example Use Cases

  • Add a new principle on testing standards and update LAST_AMENDED_DATE and version
  • Replace a placeholder with a concrete PROJECT_NAME and fill RATIFICATION_DATE
  • Increment version from 1.2.0 to 1.3.0 after adding a new principle
  • Propagate updates to plan-template and spec-template for alignment
  • Generate a Sync Impact Report and prepend the HTML comment

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers