constitution-check

An automatic check that runs before a specification command. It verifies that required project principles are filled in and that the installed spec-kit version matches the project's pinned version.

In plain words
What is it for?
Checking constitution placeholders and spec-kit version compatibility before creating a specification.
Why use it?
It stops specification work when the project rules are incomplete or the tooling version has drifted.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/gaia-react/gaia/constitution-check
Clone the repo
git clone --depth 1 https://github.com/gaia-react/gaia
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 661 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00018 $0.00661
Opus 5 $0.00009 $0.00331
Sonnet 5 $0.00004 $0.00132
Haiku 4.5 $0.00002 $0.00066

Measured 2d ago against content hash 4d33b9e04cc6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

constitution-check scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.specify/extensions/gaia/commands/constitution-check.md · 52 lines

How it starts

The opening of the file, as written. The whole thing — 52 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Constitution + version-pin precondition check

Fired automatically by spec-kit on the before_specify event (mandatory hook). The agent reads this skill and runs the two checks below before /speckit-specify proceeds.

Inputs

  • $ARGUMENTS: the same arguments the user passed to /speckit-specify or /speckit-gaia-spec. Echoed through unchanged; this hook does not consume them.
  • Working directory, the project root (a spec-kit-initialized project containing .specify/memory/constitution.md and .specify/extensions/gaia/extension.yml).

Step 1: version-pin drift detection

Run the version-check helper using the Bash tool, and capture its result:

bash .specify/extensions/gaia/lib/version-check.sh

The helper reads requires.speckit_version from .specify/extensions/gaia/extension.yml, resolves the runtime spec-kit version, and exits 0 on match or non-zero on drift. On drift, surface the helper's stderr verbatim to the user, do not proceed, and announce:

before_specify blocked: spec-kit version drift detected. Align versions before continuing, see message above.

Step 2: constitution placeholder scan

Read .specify/memory/constitution.md. Match the bracketed-placeholder pattern \[[A-Z_0-9]+\] (e.g. [PROJECT_NAME], [PRINCIPLE_1_NAME], [CONSTITUTION_VERSION]). If any matches are present:

  • Report the count and the first three placeholder identifiers found.

  • Block proceed with the message:

    before_specify blocked: spec-kit constitution still contains placeholder values. Run /speckit-constitution to populate it before authoring a SPEC.

  • Do not proceed to /speckit-specify.

If the file is absent entirely, treat as the same block (constitution must exist).

Step 3: pass-through

If both checks pass, emit a single confirmation line and let /speckit-specify continue:

before_specify ok: constitution populated, spec-kit version matches pin.

This hook has no return value to spec-kit. After emitting the confirmation line, return control to the caller, end this hook's turn and let the running /speckit-specify (or /speckit-gaia-spec) skill continue. Do not call any further tool on the pass-through path.

Read the full file on GitHub · 52 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 52 lines · 18 tokens per session scan A 4d33b9e04cc6

Subscribe to this mod's changes

constitution-check is a command published in the GitHub repository gaia-react/gaia (22 stars, last pushed 2d ago), licensed MIT. It adds 18 tokens to every session and 661 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.