
constitution
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'.
- Installs
- 1.4K
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill constitution- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads constitution automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Overview
The Constitution skill manages the architectural DNA of a project through two shared documents:
| File | Purpose |
|---|---|
docs/specs/architecture.md | Technology stack, infrastructure, architectural rules, security constraints, AI guardrails |
docs/specs/ontology.md | Domain 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
- Identify the operation from
$ARGUMENTSor user intent:create,update,check, orshow. - 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. - For update: identify the target file and section, apply the change surgically, update the
Last Updateddate. - For check: read both constitution files, read the target file, validate against architectural rules and ontology terms, output a Constitution Check Report.
- For show: read and display both files formatted for readability.
- 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
| Scenario | Operation |
|---|---|
| New project — define stack and domain language before first brainstorm | create |
| Stack or security rules changed | update |
| Validate a spec, task, or file against architecture and ontology | check |
| Review current architecture and ontology | show |
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
- Ask which files to create: "Both" (recommended), "architecture.md only", "ontology.md only"
- Check if files exist → ask to overwrite or skip
- For architecture.md: gather via
AskUserQuestion(domains, infrastructure, stack, data, style, rules) - For ontology.md: ask for terms or create empty scaffold
- Confirm before writing each file
Template lookup order:
- Primary:
${CLAUDE_PLUGIN_ROOT}/templates/architecture.md - Fallback:
skills/constitution/references/architecture.md
update
- Parse
--file=architecture|ontologyand--section=<name> - Read target file, apply change surgically
- Update
Last Updateddate - Write file
check
- Read both constitution files
- Read target file (
--target=<path>) - Validate against architecture rules, security constraints, and ontology
- Output Constitution Check Report
show
- Read both
docs/specs/architecture.mdanddocs/specs/ontology.md - Display formatted for readability
Context Rot Prevention
The Constitution survives context rot through file-based storage:
- Read at session start: Both
docs/specs/architecture.mdanddocs/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 Updateddate 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) andspec-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 architecturespecs.spec-to-tasks— Check stack compatibilityspecs.task-implementation— Apply AI guardrailsspecs.task-review— Constitution check
Reference Files
| File | Purpose |
|---|---|
references/architecture.md | Full architecture template |
references/ontology.md | Full ontology template |
references/security-patterns.md | CWE/OWASP patterns, verification format |
references/context-rot-prevention.md | Detailed scenarios and recovery protocols |
references/constitution-check-report.md | Complete report examples |
For complete templates and detailed reference material, consult the references/ directory.
FAQ
What does the constitution skill do?
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'.
How do I install constitution?
Run npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill constitution in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/constitution/ (personal) or .claude/skills/constitution/ (project).
Which AI agents can use constitution?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is constitution safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains constitution?
It is published by giuseppe-trisciuoglio in giuseppe-trisciuoglio/developer-kit. It has 1,425 recorded installs.
More from giuseppe-trisciuoglio/developer-kit
shadcn-ui
giuseppe-trisciuoglio/developer-kit
Provides complete shadcn/ui component library patterns including installation, configuration, and implementation of accessible React components. Use when setting up shadcn/ui, installing components, building forms with React Hook Form and Zod, customizing themes with Tailwind CSS, or implementing UI patterns like buttons, dialogs, dropdowns, tables, and complex form layouts.
tailwind-css-patterns
giuseppe-trisciuoglio/developer-kit
Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing design systems, or optimizing CSS workflow.
drizzle-orm-patterns
giuseppe-trisciuoglio/developer-kit
Provides comprehensive Drizzle ORM patterns for schema definition, CRUD operations, relations, queries, transactions, and migrations. Proactively use for any Drizzle ORM development including defining database schemas, writing type-safe queries, implementing relations, managing transactions, and setting up migrations with Drizzle Kit. Supports PostgreSQL, MySQL, SQLite, MSSQL, and CockroachDB.
unit-test-bean-validation
giuseppe-trisciuoglio/developer-kit
Provides patterns for unit testing Jakarta Bean Validation (JSR-380), including @Valid, @NotNull, @Min, @Max, @Email constraints with Hibernate Validator. Generates custom validator tests, constraint violation assertions, validation groups, and parameterized validation tests. Validates data integrity logic without Spring context. Use when writing validation tests, bean validation tests, or testing custom constraint validators.
nextjs-performance
giuseppe-trisciuoglio/developer-kit
Expert Next.js performance optimization skill covering Core Web Vitals, image/font optimization, caching strategies, streaming, bundle optimization, and Server Components best practices. Use when optimizing Next.js applications for Core Web Vitals (LCP, INP, CLS), implementing next/image and next/font, configuring caching with unstablecache and revalidateTag, converting Client Components to Server Components, implementing Suspense streaming, or analyzing and reducing bundle size. Supports Next.js 16 + React 19 patterns.
react-patterns
giuseppe-trisciuoglio/developer-kit
Provides comprehensive React 19 patterns for Server Components, Server Actions, useOptimistic, useActionState, useTransition, concurrent features, Suspense boundaries, and TypeScript integration. Generates executable code patterns, validates security for public endpoints, and optimizes performance with React Compiler or manual memoization. Proactively use when building React 19 applications with Next.js App Router, implementing optimistic UI, or optimizing concurrent rendering.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.