project-constitution

A project constitution document that records the principles, quality checks, limits, and major technical decisions for a project. It can be created, updated, or displayed.

In plain words
What is it for?
Use it to define or revise project principles, measurable quality gates, technical constraints, and architecture decisions.
Why use it?
It gives development work a shared set of written rules, so important standards and constraints are not left implicit.

Command for Claude Code

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/rand/mnemosyne/project-constitution
Clone the repo
git clone --depth 1 https://github.com/rand/mnemosyne

Made for: Claude Code.

Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,049 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.00014 $0.01049
Opus 5 $0.00007 $0.00524
Sonnet 5 $0.00003 $0.00210
Haiku 4.5 $0.00001 $0.00105

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

Security

Grade A, and why

project-constitution 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.

.claude/commands/project-constitution.md · 125 lines

How it starts

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

I will help you create or update your project's constitution. This establishes the core principles, quality gates, and constraints that guide all development work.

Usage:

  • /project-constitution - Create new or update existing constitution
  • /project-constitution --show - Display current constitution

Instructions for me:

  1. Check for existing constitution:

    • Look for .mnemosyne/artifacts/constitution/project-constitution.md
    • If exists, parse YAML frontmatter to get current version
    • If updating, increment version appropriately (major for breaking changes, minor for additions, patch for fixes)
  2. Gather constitution content (if creating new):

    • Ask the user about:
      • Core Principles: 3-7 fundamental principles (e.g., "Performance First", "Type Safety", "Developer Experience")
      • Quality Gates: Specific, measurable standards (e.g., "90%+ test coverage on critical path", "Sub-200ms p95 latency")
      • Constraints: Technical or business constraints (e.g., "Rust-only for performance-critical code", "No external API dependencies")
      • Architecture Decisions: Key technical choices (e.g., "Event-sourced for audit trail", "PostgreSQL for primary storage")
  3. Format constitution as markdown:

    ---
    type: constitution
    id: constitution
    name: Project Constitution
    version: <semver>
    created_at: <ISO 8601 timestamp>
    updated_at: <ISO 8601 timestamp>
    memory_id: <will be filled after storage>
    references: []
    ---
    
    # Project Constitution
    
    ## Core Principles
    
    1. **[Principle Name]**: [Description]
    2. **[Principle Name]**: [Description]
    ...
    
    ## Quality Gates
    
    ### Testing
    - [ ] Critical path: 90%+ coverage
    - [ ] Integration tests for all public APIs
    - [ ] E2E tests for user workflows
    
    ### Performance
    - [ ] Sub-200ms p95 latency for queries
    - [ ] Memory usage under 100MB baseline
    
    ### Code Quality
    - [ ] All compiler warnings addressed
    - [ ] No TODO/FIXME in committed code
    - [ ] Type-safe error handling
    
    ## Constraints
    
    - **[Constraint Category]**: [Description]
    ...
    
    ## Architecture Decisions
    
    - **[Decision Area]**: [Choice and rationale]
    ...
    
  4. Write constitution file:

    • Create/update .mnemosyne/artifacts/constitution/project-constitution.md
    • Ensure .mnemosyne/artifacts/constitution/ directory exists
  5. Store memory entry:

    • Use Mnemosyne CLI: mnemosyne remember
    • Arguments:
      • Content: First 500 chars of constitution + "...see .mnemosyne/artifacts/constitution/project-constitution.md for full text"
      • Namespace: project:<project-name> (detect from git root directory name)
      • Importance: 9 (constitutions are critical)
      • Type: constitution
      • Tags: constitution,principles,quality-gates
      • Context: "Project constitution defining core principles and quality gates"
    • Capture memory_id from output
  6. Update artifact with memory_id:

    • Read the artifact file
    • Update memory_id field in YAML frontmatter
    • Write back to file
  7. Display confirmation:

    ✓ Constitution created/updated successfully
    
    Version: <version>
    Location: .mnemosyne/artifacts/constitution/project-constitution.md
    Memory ID: <memory_id>
    
    Core Principles: <count>
    Quality Gates: <count>
    Constraints: <count>
    Architecture Decisions: <count>
    
    Next steps:
    - Review with team: cat .mnemosyne/artifacts/constitution/project-constitution.md
    - Create feature spec: /feature-specify <description>
    - Update constitution: /project-constitution
    
  8. Error handling:

    • If .mnemosyne/artifacts/ doesn't exist: "Error: Artifact directory not initialized. Run 'mnemosyne artifact init' first"
    • If user cancels: "Constitution creation cancelled"
    • If Mnemosyne not available: "Error: Mnemosyne not available. Check installation."

Special behaviors:

  • If --show flag: Display current constitution from file (if exists) or "No constitution found"
  • Interactive mode: Ask questions one at a time to build constitution
  • Validation: Ensure at least 3 principles, 3 quality gates before saving
  • Version bumping: Explain what changed and why version was incremented

Read the full file on GitHub · 125 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 · 125 lines · 14 tokens per session scan A 08b84533a464

Subscribe to this mod's changes

project-constitution is a command published in the GitHub repository rand/mnemosyne (84 stars, last pushed 9mo ago), licensed MIT. It adds 14 tokens to every session and 1,049 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.

Related

Other commands, from other repositories