Help us improve
Share bugs, ideas, or general feedback.
From claude-resources
Author and maintain a project constitution at docs/constitution.md — the list of invariants that reviewer and critic enforce on every spec and every diff. Load this skill whenever you're creating a new constitution from scratch or from EXAMPLE_CONSTITUTION.md, proposing candidate invariants via /constitution-propose, adding or editing an invariant, sunsetting an obsolete rule, or promoting a recurring "don't do X" review comment into an enforced invariant. Also use when a post-incident review surfaces a rule that should have been caught mechanically. Reviewer and critic consume the registered invariants automatically via the project_constitution session-start field — you do not need this skill for enforcement, only for authoring.
npx claudepluginhub deandum/claude-resources --plugin go-skillsHow this skill is triggered — by the user, by Claude, or both
Slash command
/claude-resources:constitutionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A constitution is the list of invariants that must hold across every spec, every group, every review. Skills teach patterns; the constitution enforces outcomes.
Authors enforceable project constitutions for greenfield projects with testable principles, enforcement mechanisms, rationale, and amendment processes.
Creates, updates, or validates .constitution.md file for Spec Kit workflow, defining project mission, principles, constraints, quality standards, and checking codebase alignment.
Creates or updates a project constitution from interactive or provided principle inputs, ensuring dependent templates stay in sync.
Share bugs, ideas, or general feedback.
A constitution is the list of invariants that must hold across every spec, every group, every review. Skills teach patterns; the constitution enforces outcomes.
core/styleCLAUDE.md of the consumer projectEXAMPLE_CONSTITUTION.md to docs/constitution.md. This framework's own constitution lives at docs/constitution.md.critical = reviewer blocks advancement. important = reviewer flags but does not block. If you would accept exceptions, it is important.{id, severity} to the YAML invariants: list. hooks/session-start.sh reads this list and emits project_constitution into session context./review, confirm reviewer flags it at the expected severity.Every invariant has two parts: a frontmatter entry that agents read from session context, and a body section with the human-readable detail.
Frontmatter entry (registered in docs/constitution.md YAML):
---
title: Project Constitution
invariants:
- id: no-silent-failures
severity: critical
- id: public-function-tested
severity: important
---
Body section (one per invariant, six fields):
kebab-case-id, short, memorable, grep-able in reviewer output. Matches the frontmatter entry.critical or important. No third tier.reviewer, critic, or both. Reviewer inspects diffs; critic inspects specs. Pick the agent that actually has the relevant context.| Level | Reviewer Behavior | Critic Behavior |
|---|---|---|
critical | Violation forces a Critical finding; status becomes needs-input; group cannot advance without explicit user acceptance | Violation becomes a Blocker: yes clarifying question — the spec cannot be synthesized as written |
important | Violation contributes to Important findings; status becomes needs-input; user must accept before advance | Violation becomes a suggested scope hazard to fold into Out of Scope or Ask first |
Authoring an initial constitution from a blank page is the hard case. Running /constitution-propose has main Claude spawn critic + scout in parallel to survey the codebase and propose 3–10 candidate invariants grounded in concrete evidence. The user then accepts, edits, or rejects each one. This section is the discipline the agents apply.
Trigger: /constitution-propose [optional focus]. Focus narrows the survey to one area (security, observability, error handling, …). Empty = full checklist.
Directory: docs/specs/constitution-proposal/ — a reserved, non-feature slug. Only two files live there: discovery.md (scout) and candidates.md (critic). No spec.md — this is not spec generation, and session-start's active-spec scanner requires a spec.md to include a slug in active_specs, so this directory is correctly ignored.
Scout's brief — survey the codebase per the checklist below and write docs/specs/constitution-proposal/discovery.md. Every claim cites file:line. If $ARGUMENTS is non-empty, narrow the checklist to that focus only.
Discovery checklist (language-conditional):
_ = err, panic(, return nil after a non-nil err check. Python: bare except:, pass inside an except block. JS/TS: empty catch {}, unawaited promises inside async callers.api_key, password, TOKEN=, BEGIN RSA PRIVATE KEY, hardcoded bearer tokens. .env referenced with no committed .env.example.internal/, pkg/, or the language equivalent with no matching test file.%w vs %s, wrapped vs swallowed), presence or absence of correlation-id plumbing across request boundaries.Critic's brief — read scout's discovery.md, apply the quality bar below, propose 3–10 candidates. Write docs/specs/constitution-proposal/candidates.md.
Candidate quality bar (reject anything that fails all of these):
file:line of evidence from scout's discovery.Detection clause — not "reviewer judges."project_constitution — note existing invariants in candidates.md as "already invariant" rather than re-proposing.candidates.md with status: rejected from a prior run — a rejection is permanent until the user clears it.Candidate file format — YAML frontmatter mirroring EXAMPLE_CONSTITUTION.md plus a per-invariant status field, and body sections that add Evidence: and Status: on top of the standard six-field anatomy:
---
title: Constitution Candidates
generated: 2026-04-16
candidates:
- id: no-silent-failures
severity: critical
status: proposed
---
## no-silent-failures
- **Severity**: critical
- **Enforced by**: reviewer
- **Scope**: all code under `internal/` and `cmd/`
- **Rationale**: A caught error that is not logged, wrapped, or returned becomes invisible in prod.
- **Detection**: `_ = err`, `return nil` after a non-nil err check, `catch {}` without body.
- **Evidence**: `internal/ingest/worker.go:142`, `cmd/api/handler.go:88`
- **Status**: proposed
User review protocol — main Claude prints the candidate summary, then waits for a reply of the form:
accept: [id1, id2, ...]
edit: <id>: <new-rationale-or-detection>
reject: [id3, ...]
stop
Main Claude mutates the status: field in candidates.md for every reviewed candidate (accepted / edited / rejected) so re-runs can skip them.
Promotion rule — on accept or edit, main Claude appends the accepted body section to docs/constitution.md AND adds the {id, severity} entry to the frontmatter invariants: list. If docs/constitution.md does not exist, main Claude creates it first using the frontmatter and heading shape from EXAMPLE_CONSTITUTION.md. Rejected candidates stay in candidates.md with status: rejected — the record prevents re-proposal on the next run.
core/code-review — reviewer loads the constitution as a sixth check after the five axescore/spec-generation — main Claude mirrors critical invariants into the spec's Never do tier verbatim during spec synthesiscore/skill-discovery — routes "authoring or modifying project invariants" to this skill| Shortcut | Reality |
|---|---|
| "Everyone knows this rule; no need to codify" | Unwritten rules are only enforced by whoever remembers them. Reviewer and critic have no memory between sessions. |
| "Style nits should be here too" | Mixing invariants with style creates noise. Reviewers stop reading long lists. Lint the style; constitutionalize the invariants. |
| "Severity doesn't matter, I'll mark everything critical" | Reviewer blocks every PR on every item. Authors route around by marking as "exception." Severity loses meaning. |
| "We can leave obsolete invariants in place; they just won't fire" | Dead rules poison the list — readers treat active rules with the same scrutiny as inactive ones. Sunset or delete. |
Scope: all code on most invariants — suggests the rule is actually narrowerDetection clause, or detection is "reviewer judges" — reviewer has no reliable signalcritical severity on more than half the list — severity is no longer discriminatingdocs/constitution.md exists at project roottitle: and invariants: list with {id, severity} per itemhooks/session-start.sh emits project_constitution field when the file is present