PluginBench
Skill
Pass
Audit score 90

constitution

giuseppe-trisciuoglio/developer-kit

Define and validate project architecture, security rules, and domain language through shared constitution documents.

What is constitution?

The Constitution skill creates and maintains two shared documents—architecture.md (technology stack, rules, security constraints) and ontology.md (domain glossary)—that define a project's architectural DNA. Use it at project setup to establish guardrails, or at any point in the development lifecycle to validate specs and tasks against architecture principles.

  • Create architecture.md and ontology.md files to codify technology stack, infrastructure, security constraints, and AI guardrails
  • Update constitution sections surgically (security rules, library verification, domain terms) with automatic date tracking
  • Validate specs, tasks, and files against architectural rules, security constraints, and ontology terms via Constitution Check Reports
  • Display current architecture and ontology formatted for readability and team alignment
  • Prevent context rot by storing architectural decisions and domain language in version-controlled files rather than relying on session memory

How to install constitution

npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill constitution
Claude Code
Cursor
Windsurf
Cline

How to use constitution

  1. 1.Invoke the skill with 'create constitution' or 'setup project architecture' to initialize both documents
  2. 2.Choose which files to create (architecture.md, ontology.md, or both) and answer prompts about your technology stack, security constraints, and domain terms
  3. 3.For existing projects, use 'constitution check --target=<file>' to validate a spec or task against your architecture and ontology
  4. 4.Use 'update constitution --file=architecture --section=<name>' to surgically update specific sections when architecture changes
  5. 5.Run 'show constitution' to display current architecture and ontology for team review or context loading

Use cases

Good for
  • Set up a new project before the first brainstorm session to establish shared architectural principles and domain language
  • Validate a specification or task against security constraints and architectural rules to catch violations early
  • Update security rules or technology stack decisions when architecture changes mid-project
  • Review current architecture and ontology with the team to ensure alignment and consistency
  • Verify that external libraries are approved in the architecture before implementation begins
Who it's for
  • Project leads and architects defining project scope and constraints
  • Development teams implementing specs that must comply with architectural guardrails
  • AI agents (Claude Code, Cursor) executing tasks within established architectural boundaries
  • Teams practicing Specification-Driven Development (SDD) who need consistent architecture across phases

constitution FAQ

When should I create a constitution?

Create it before your first brainstorm session as a project setup step. This ensures all subsequent specs, tasks, and implementations align with your architecture and domain language from the start.

What's the difference between architecture.md and ontology.md?

architecture.md defines your technology stack, infrastructure, architectural rules, security constraints, and AI guardrails. ontology.md is your domain glossary (Ubiquitous Language)—shared terms, definitions, and bounded contexts used consistently across all specs.

How does constitution check work?

It reads your architecture and ontology files, then validates a target spec or task against your security rules, architectural patterns, library approvals, and domain terminology. It outputs a detailed report showing compliance status and any violations.

Can I update the constitution mid-project?

Yes. Use 'update constitution --file=architecture --section=<name>' to surgically update specific sections. The skill automatically updates the Last Updated date and preserves the rest of the document.

How does this prevent context rot?

By storing architecture and ontology in version-controlled files at docs/specs/, the constitution survives across sessions. The skill always reads from files rather than relying on session memory, ensuring decisions remain consistent even after long breaks.

Full instructions (SKILL.md)

Source of truth, from giuseppe-trisciuoglio/developer-kit.


name: constitution description: "Creates, updates, validates, and displays the architectural DNA of a project through two shared documents: docs/specs/architecture.md (technology stack, architectural rules, security constraints, AI guardrails) and docs/specs/ontology.md (domain glossary / Ubiquitous Language). Use BEFORE brainstorm as a project setup step, or at any point in the SDD lifecycle to validate specs/tasks against architecture principles. Triggers on 'create constitution', 'update constitution', 'constitution check', 'validate against constitution', 'project principles', 'architectural guardrails', 'setup project architecture', 'define ontology'." allowed-tools: Read, Write, Edit, Grep, Glob, Bash, AskUserQuestion, TodoWrite

Overview

The Constitution skill manages the architectural DNA of a project through two shared documents:

FilePurpose
docs/specs/architecture.mdTechnology stack, infrastructure, architectural rules, security constraints, AI guardrails
docs/specs/ontology.mdDomain glossary (Ubiquitous Language) — terms, definitions, bounded contexts

These files live at docs/specs/ and are shared across all specifications. Unlike a monolithic constitution.md, these are created/enriched by brainstorm (Phase 6.8.6) and spec-to-tasks (Phase 1.5).

Instructions

  1. Identify the operation from $ARGUMENTS or user intent: create, update, check, or show.
  2. For create: ask which files to create (architecture.md, ontology.md, or both), gather required information via AskUserQuestion, then write the files using the templates below.
  3. For update: identify the target file and section, apply the change surgically, update the Last Updated date.
  4. For check: read both constitution files, read the target file, validate against architectural rules and ontology terms, output a Constitution Check Report.
  5. For show: read and display both files formatted for readability.
  6. Always confirm with the user before writing or overwriting files.

Examples

# Create constitution before first brainstorm
/developer-kit-specs:constitution create

# Validate a spec against architecture and ontology
/developer-kit-specs:constitution check --target=docs/specs/001/2024-01-15--user-auth.md

# Update the security constraints section
/developer-kit-specs:constitution update --file=architecture --section=security

# Show current constitution
/developer-kit-specs:constitution show

When to Use

ScenarioOperation
New project — define stack and domain language before first brainstormcreate
Stack or security rules changedupdate
Validate a spec, task, or file against architecture and ontologycheck
Review current architecture and ontologyshow

Trigger phrases:

  • "Create constitution", "Setup project architecture", "Define ontology"
  • "Update constitution", "Update architecture", "Update ontology"
  • "Constitution check", "Validate against constitution"
  • "Show constitution", "Project principles", "Architectural guardrails"

Operations

create

  1. Ask which files to create: "Both" (recommended), "architecture.md only", "ontology.md only"
  2. Check if files exist → ask to overwrite or skip
  3. For architecture.md: gather via AskUserQuestion (domains, infrastructure, stack, data, style, rules)
  4. For ontology.md: ask for terms or create empty scaffold
  5. Confirm before writing each file

Template lookup order:

  • Primary: ${CLAUDE_PLUGIN_ROOT}/templates/architecture.md
  • Fallback: skills/constitution/references/architecture.md

update

  1. Parse --file=architecture|ontology and --section=<name>
  2. Read target file, apply change surgically
  3. Update Last Updated date
  4. Write file

check

  1. Read both constitution files
  2. Read target file (--target=<path>)
  3. Validate against architecture rules, security constraints, and ontology
  4. Output Constitution Check Report

show

  1. Read both docs/specs/architecture.md and docs/specs/ontology.md
  2. Display formatted for readability

Context Rot Prevention

The Constitution survives context rot through file-based storage:

  • Read at session start: Both docs/specs/architecture.md and docs/specs/ontology.md
  • Never assume in context: MUST be read from file before implementation
  • Validate work: Compare against constitution, not memory

For detailed scenarios and recovery protocols, see references/context-rot-prevention.md.

Constraints and Warnings

  • Does NOT modify source code — only creates/updates constitution files
  • CRITICAL violations MUST be resolved — WARNINGs are advisory
  • One architecture.md and one ontology.md per project — shared across all specs
  • Update Last Updated date on every change
  • Use ADRs for significant architectural decisions
  • Context rot risk: Files > 30 days old may have drifted

Best Practices

  • Create before brainstorm: Constitution established early ensures consistency
  • Library Verification: Before using ANY external library, verify it's in the architecture's Library Verification section
  • Spec Death Principle: Archive completed specs to archived/ — never let specs become stale
  • Ontology enrichment: Updated by brainstorm (Phase 6.8.6) and spec-to-tasks (Phase 1.5)
  • Report format: Security section first, then CWE compliance, architecture, library verification, ontology

Constitution Check Report Format

## Constitution Check Report
Target: <file path>
Date: YYYY-MM-DD

### Security Check (CWE/OWASP Compliance)
| Rule | Level | Status | Location | CWE/OWASP |
|------|-------|--------|----------|-----------|
| No SQL injection | CRITICAL | ✅ OK | - | CWE-89 |

### CWE Compliance Report
| CWE | OWASP | Status | Location |
|-----|-------|--------|----------|
| CWE-89 | A03 | ✅ OK | - |

### Architecture Check
| Rule | Status | Detail |
|------|--------|--------|
| Constructor injection | ✅ OK | - |

### Library Verification Check
| Library | Status | Detail |
|---------|--------|--------|
| bcrypt | ✅ OK | Using hash(password, 12) |

### Ontology Check
| Term | Status | Detail |
|------|--------|--------|
| "User" used consistently | ✅ OK | - |

### Summary
- CRITICAL violations: 0
- WARNING violations: 0
- Compliant rules: N

For detailed security patterns (CWE/OWASP mappings), see references/security-patterns.md.

Integration with SDD Workflow

[Session Start] → Read Constitution files
        ↓
[Optional] constitution create        ← this skill (pre-brainstorm setup)
        ↓
brainstorm                            ← Constitution loaded before brainstorming
        ↓
spec-to-tasks                         ← Constitution validates spec
        ↓
task-implementation                   ← Constitution guardrails active
        ↓
task-review                           ← Constitution check validates
        ↓
[Session End] → Constitution files updated if needed

Required loading before:

  • specs.brainstorm — Validate requirements align with architecture
  • specs.spec-to-tasks — Check stack compatibility
  • specs.task-implementation — Apply AI guardrails
  • specs.task-review — Constitution check

Reference Files

FilePurpose
references/architecture.mdFull architecture template
references/ontology.mdFull ontology template
references/security-patterns.mdCWE/OWASP patterns, verification format
references/context-rot-prevention.mdDetailed scenarios and recovery protocols
references/constitution-check-report.mdComplete report examples

For complete templates and detailed reference material, consult the references/ directory.