agentleFS
harvatechsharvatechs/inthon/.agents/skills/speckit-constitution/SKILL.md

speckit-constitution

Skill2 starsChanged 4 months agoApache-2.0View on GitHub

Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.

130 other projects use a version of this, 127 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use speckit-agent-context-update, speckit-git-commit and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Microsoft AzureSkill

    speckit-agent-context-update

    Refresh the managed Spec Kit section in coding agent context file(s)

    Also in 13 projects that use this

  • Sorcha-PlatformSkill

    speckit-git-commit

    Auto-commit changes after a Spec Kit command completes

    Also in 35 projects that use this

  • Sorcha-PlatformSkill

    speckit-git-feature

    Create a feature branch with sequential or timestamp numbering

    Also in 35 projects that use this

  • patterson-agentsSkill

    speckit-baseline

    Generate feature specifications by analyzing existing source code.

    Also in 3 projects that use this

  • patterson-agentsSkill

    claude-command-converter

    Convert Claude Code commands (.claude/commands/*.md) to standard Agent Skills (skills/*/SKILL.md). Use when migrating slash commands to portable skill format, creating skills from existing commands, or standardizing command definitions across AI runtimes.

    Also in 3 projects that use this

  • Microsoft AzureSkill

    agentic-workflows

    Route gh-aw workflow design/create/debug/upgrade requests to the right prompts.

    Also in 3 projects that use this

  • +3 more from Sorcha-Platform

The file

Show its rules and text

We split this skill into the rules it gives an agent

29 rules. 11 are common, 2 are distinctive, and 16 are very specific to this project.

  • 11

    Common

    Most of the 128 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 16

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the input includes feature implementation, code generation, refactoring, building, or deployment requests, you MUST NOT execute them.

    line 26
  2. Distinctive:

    If it is unclear whether an instruction is constitution content, ask for clarification before making changes.

    line 31
  3. Very specific:

    After completing the constitution update, include a Next Actions section for each deferred intent.

    line 33
  4. Very specific:

    If there are no non-governance intents, omit the Next Actions section.

    line 36
  5. Very specific:

    Check if .specify/extensions.yml exists in the project root.

    line 41
  6. Very specific:

    If it exists, read it and look for entries under the hooks.before_constitution key

    line 42
  7. Common:

    If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally

    line 43
  8. Very specific:

    If the hook has no condition field, or it is null/empty, treat the hook as executable

    line 46
  9. Very specific:

    If the hook defines a non-empty condition, skip the hook and leave condition evaluation to the HookExecutor implementation

    line 47
  10. Very specific:

    When constructing slash commands from hook command names, replace dots (.) with hyphens (-).

    line 48
  11. Very specific:

    If no hooks are registered or .specify/extensions.yml does not exist, skip silently

    line 72
  12. Very specific:

    Note: If .specify/memory/constitution.md does not exist yet, it should have been initialized from …

    line 78
  13. Common:

    Follow this execution flow:

    line 80
  14. Common:

    If user input (conversation) supplies a value, use it.

    line 87
  15. Common:

    If version bump type ambiguous, propose reasoning before finalizing.

    line 94
  16. Common:

    Ensure each Principle section: succinct name line, paragraph (or bullet list) capturing non‑negotiable rules, explicit rationale if not …

    line 99
  17. Common:

    Ensure Governance section lists amendment procedure, versioning policy, and compliance review expectations.

    line 100
  18. Very specific:

    Read .specify/templates/plan-template.md and ensure any "Constitution Check" or rules align with updated principles.

    line 103
  19. Very specific:

    Read .specify/templates/spec-template.md for scope/requirements alignment—update if constitution adds/removes mandatory sections or …

    line 104
  20. Very specific:

    Read .specify/templates/tasks-template.md and ensure task categorization reflects new or removed principle-driven task types (e.g., …

    line 105
  21. Very specific:

    Read any runtime guidance docs (e.g., README.md, docs/quickstart.md, or agent-specific guidance files if present).

    line 107
  22. Common:

    Follow-up TODOs if any placeholders intentionally deferred.

    line 115
  23. Common:

    No remaining unexplained bracket tokens.

    line 118
  24. Very specific:

    Write the completed constitution back to .specify/memory/constitution.md (overwrite).

    line 123
  25. Common:

    Use Markdown headings exactly as in the template (do not demote/promote levels).

    line 133
  26. Common:

    Keep a single blank line between sections.

    line 135
  27. Common:

    If the user supplies partial updates (e.g., only one principle revision), still perform validation and version decision steps.

    line 138
  28. Very specific:

    If critical info missing (e.g., ratification date truly unknown), insert TODO(<FIELD_NAME>): explanation and include in the Sync Impact …

    line 140
  29. Very specific:

    Do not create a new template.

    line 142

“Common” is measured: kept by at least 6 in 10 of the 128 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 and propagating constitution-driven changes to the dependent artifacts identified in this command.

  • 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 and its required propagation.
  • 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, skip hook checking silently and 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
  • When constructing slash commands from hook command names, replace dots (.) with hyphens (-). For example, speckit.git.commit → /speckit-git-commit.
  • 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. 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 .specify/memory/constitution.md does not exist yet, it should have been initialized from .specify/templates/constitution-template.md during project setup. If it's missing, copy the template first.

Follow this execution flow:

  1. Load the existing constitution at .specify/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:
    • 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 .specify/templates/plan-template.md and ensure any "Constitution Check" or rules align with updated principles.
    • Read .specify/templates/spec-template.md for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints.
    • Read .specify/templates/tasks-template.md and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline).
    • Read each installed Spec Kit command file for your agent (including this one) — named speckit.* or speckit-* (dot or hyphen depending on the agent), or laid out as speckit-<name>/SKILL.md for skills-based integrations, e.g. in .github/agents/, .github/skills/, .claude/skills/, or your agent's equivalent commands directory — to verify no outdated references (CLAUDE-only or other agent-specific names) 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 .specify/memory/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)).
    • 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.

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

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, skip hook checking silently and 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
  • When constructing slash commands from hook command names, replace dots (.) with hyphens (-). For example, speckit.git.commit → /speckit-git-commit.
  • 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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.