| name | Generate Constitution |
| description | Derive technical development principles FROM user needs in product.md using evidence-based reasoning. Creates constitution.md with architecture decisions, tech stack choices, and development constraints - all traced back to specific user needs. Use when user mentions "technical principles", "constitution", "architecture decisions", or after creating product.md. |
@.claude/shared-imports/constitution.md
@.claude/shared-imports/CoD_ฮฃ.md
@.claude/templates/product-constitution-template.md
Generate Constitution Skill
Overview
This skill creates constitution.md by deriving technical principles FROM user needs documented in product.md. Every technical decision must trace back to a specific user pain point, differentiator, or journey requirement.
Core Derivation Pattern:
User Need (product.md) โซ Capability Required โ Technical Approach โซ Specific Constraint (constitution.md)
Announce at start: "I'm using the generate-constitution skill to derive technical principles from user needs in product.md."
Note: constitution.md CANNOT be created without product.md. All technical principles MUST derive from user needs. If product.md doesn't exist, use define-product skill first.
Quick Reference
| Workflow | Key Activities | Output |
|---|
| Derivation | Load product.md โ Map user needs โ Derive principles โ Organize โ Create derivation map | constitution.md (v1.0.0) |
| Amendment | Identify product.md changes โ Update Articles โ Bump version โ Add history | constitution.md (vX.Y.Z) |
| Validation | Check derivation chains โ Verify traceability โ Validate classifications | Quality report |
Workflow Files
Detailed Workflows:
- @.claude/skills/generate-constitution/workflows/derivation-workflow.md - Steps 1-6: Create new constitution
- @.claude/skills/generate-constitution/workflows/amendment-workflow.md - Update constitution when product.md changes
- @.claude/skills/generate-constitution/workflows/validation-checks.md - Quality gates and quick tests
References:
- @.claude/skills/generate-constitution/references/anti-patterns.md - Common mistakes to avoid
- @.claude/skills/generate-constitution/references/failure-modes.md - 12 failure modes with fixes
Workflow Decision Tree
User Request?
โโ Creating new constitution? โ Derivation Workflow
โโ Updating existing? โ Amendment Workflow
โโ Validating? โ Validation Checks
Derivation Workflow (Create New Constitution)
See: @.claude/skills/generate-constitution/workflows/derivation-workflow.md
Summary:
Step 1: Load Product Definition
Read product.md and extract:
- Persona pain points โ NON-NEGOTIABLE efficiency principles
- "Our Thing" differentiator โ NON-NEGOTIABLE core principles
- North Star metric โ Performance and usage principles
- User journeys โ Capability requirements
Step 2: Map User Needs to Technical Requirements
For each user need, apply derivation pattern:
User Need โซ Capability โ Technical Approach โซ Constraint
Example:
product.md:Persona1:Pain1:118: "Manual copying wastes 2hr/week"
โซ Automated sync required
โ API integrations with refresh
โซ <15 minute data latency
โ Constitution Article: Real-Time Sync (<15min, NON-NEGOTIABLE)
Step 3: Derive Technical Principles
For each user need, create an Article with:
- User Need Evidence - product.md quote with line reference
- Technical Derivation (CoD^ฮฃ) - Reasoning chain with operators
- Principle - Specific measurable constraint
- Rationale - Why this serves the user need
- Verification - How to validate compliance
Classification:
- NON-NEGOTIABLE - "Our Thing", core promises (breaks user promise if violated)
- SHOULD - Strong preferences (flexibility when justified)
- MAY - Options allowed (guidelines only)
Step 4: Organize by Category
Group principles into 7 standard Articles:
- Architecture Patterns (microservices, event-driven, etc.)
- Data & Integration (database, API, sync patterns)
- Performance & Reliability (SLAs, latency, uptime)
- Security & Privacy (auth, encryption, compliance)
- User Experience (UI constraints, accessibility)
- Development Process (testing, deployment, quality)
- Scalability (growth constraints, capacity)
Priority within each: NON-NEGOTIABLE โ SHOULD โ MAY
Step 5: Create Derivation Map
Document traceability:
## Appendix: Constitution Derivation Map
| Article | Product.md Source | User Need | Technical Principle |
|---------|-------------------|-----------|---------------------|
| Article II | Persona1:Pain1:118 | Manual copying | <15min sync latency |
| Article III | OurThing:283 | Instant visibility | <2s dashboard load |
Enables: Tracing principles back, identifying orphans, validating coverage.
Step 6: Version & Metadata
---
version: 1.0.0
ratified: YYYY-MM-DD
derived_from: product.md (v1.0)
---
# Development Constitution
**Purpose**: Technical principles derived FROM user needs
**Amendment Process**: See Article VIII
**Derivation Evidence**: See Appendix
Amendment Workflow (Update Existing Constitution)
See: @.claude/skills/generate-constitution/workflows/amendment-workflow.md
Summary:
Trigger: product.md changes โ constitution.md MUST update
Version Semantics:
- MAJOR (X.0.0): Article added/removed (architectural shift)
- MINOR (1.X.0): Article modified (principle change)
- PATCH (1.0.X): Formatting, typos, clarifications
Process:
- Identify which user needs changed in product.md
- Update affected Articles with new derivation chains
- Bump version number (MAJOR/MINOR/PATCH)
- Update ratified date
- Update derivation map
- Add amendment history entry with before/after
Amendment Entry Template:
### Version X.Y.Z - YYYY-MM-DD
**Changed**: Article III (Performance)
**Reason**: product.md North Star updated
**Before**: Dashboard <2s only
**After**: Dashboard <2s AND reports <10s
**Evidence**: product.md:NorthStar:line:15
Validation Checks
See: @.claude/skills/generate-constitution/workflows/validation-checks.md
Summary:
Quality Checklist (For Each Article)
Overall Validation
Quick Tests
-
"Can I delete this without breaking a user promise?"
- YES โ Might not be needed
- NO โ Should be NON-NEGOTIABLE
-
"Can I trace this to a specific user pain?"
- YES โ Good principle
- NO โ Remove it
-
"Does this enable 'Our Thing'?"
- YES โ Upgrade to NON-NEGOTIABLE
- NO โ Evaluate if needed
Anti-Patterns
See: @.claude/skills/generate-constitution/references/anti-patterns.md
Summary of Common Mistakes:
- Tech preferences without user justification - "Use React because popular" โ Derive from user need
- Over-constraining without evidence - "MUST use PostgreSQL only" โ Constrain capability (ACID), not product
- Vague principles - "System should be performant" โ Specific measurable criteria
- Missing derivation chains - State principle without CoD^ฮฃ โ Add full reasoning chain
- No verification method - Can't validate compliance โ Define specific checks
- Orphaned principles - No connection to product.md โ Remove or find user need
Failure Modes
See: @.claude/skills/generate-constitution/references/failure-modes.md
Summary of Top 12 Failures:
- Constitution created without product.md โ STOP, create product.md first
- Technical preferences without CoD^ฮฃ โ Add derivation chain
- Orphaned principles โ Trace to product.md or delete
- "Our Thing" not NON-NEGOTIABLE โ Upgrade classification
- Over-constraining tech stack โ Constrain capability, not product
- Missing verification methods โ Define checks
- Amendment without version bump โ Follow semantic versioning
- Derivation map incomplete โ Add all Articles to map
- User needs not addressed โ Add missing Articles
- Classification incorrect โ Run 3 quick tests
- No amendment history โ Add before/after entry
- Technical jargon in evidence โ Fix product.md (boundary violation)
Example
Complete Constitution: See examples/b2b-saas-constitution.md
Shows:
- Full derivation chains with CoD^ฮฃ reasoning
- 7 Articles (Architecture, Data, Performance, Security, UX, Development, Scalability)
- Complete derivation map tracing principles to product.md
- Amendment history example
- NON-NEGOTIABLE vs SHOULD classifications
Template: Use @.claude/templates/product-constitution-template.md
Key Reminders
- Every principle MUST trace to user need - No orphaned tech preferences
- "Our Thing" drives NON-NEGOTIABLE - Core differentiators are non-negotiable
- Use CoD^ฮฃ for all derivations - Evidence chain required
- Version amendments - Track why principles change
- Validate bidirectionally - Product โ Constitution AND Constitution โ Product
Prerequisites
Before using this skill:
- โ
product.md exists (REQUIRED - created by define-product skill)
- โ
product.md has personas with pain points
- โ
product.md has "Our Thing" (key differentiator)
- โ
product.md has North Star metric
- โ
product.md has user journeys
- โ ๏ธ Optional: Existing constitution.md to amend (will be versioned)
- โ ๏ธ Optional: @.claude/templates/product-constitution-template.md (for structure)
Note: constitution.md CANNOT be created without product.md. All technical principles MUST derive from user needs documented in product.md.
Dependencies
Depends On:
- define-product skill - MUST run before this skill (provides product.md)
- @.claude/shared-imports/CoD_ฮฃ.md - For derivation chains and evidence traces
- product.md - Source of ALL user needs (critical input)
Integrates With:
- create-implementation-plan skill - Uses constitution.md for architecture decisions
- specify-feature skill - References constitution.md constraints in features
- /generate-constitution command - User-facing command that invokes this skill
Tool Dependencies:
- Read tool (to load product.md)
- Write tool (to create constitution.md)
- CoD^ฮฃ operators (for derivation chains)
Next Steps
After constitution.md creation completes:
Main Development Flow:
generate-constitution (creates constitution.md)
โ (manual invocation)
specify-feature (user runs /feature with feature idea)
โ (references constitution.md constraints)
create-implementation-plan (tech stack FROM constitution)
โ (automatic)
generate-tasks โ /audit โ /implement
Amendment Flow (when product.md changes):
product.md updated (personas, pain points, or differentiators changed)
โ (manual invocation)
generate-constitution --amend (user runs /generate-constitution)
โ
constitution.md updated (version bumped, derivation map updated)
โ
Review affected features/plans for constitutional compliance
User Action Required:
- Review constitution.md for completeness and accuracy
- Validate all Articles have derivation chains to product.md
- Share constitution.md with team for alignment
- Use as guide for ALL technical decisions going forward
Outputs Modified:
constitution.md - Technical principles derived from user needs (project root)
- Version number incremented if amending existing constitution
- Derivation map updated with all product.md traces
Commands:
- /generate-constitution - Create or amend constitution.md
- /feature - After constitution exists, create features with constitutional constraints
- /plan - After constitution exists, plans must comply with principles
Related Skills & Commands
Direct Integration:
- define-product skill - MUST run before this skill (provides product.md input)
- create-implementation-plan skill - Uses constitution.md for architecture decisions (successor)
- specify-feature skill - References constitution.md constraints in specifications
- /generate-constitution command - User-facing command that invokes this skill
Workflow Context:
- Position: Phase 2 of product development (after product.md, before features)
- Triggers: User mentions "technical principles", "constitution", OR after product.md created
- Output: constitution.md with technical principles derived FROM user needs
Constitution Chain:
User Context (define-product: product.md)
โ (this skill derives technical principles)
Technical Principles (this skill: constitution.md)
โ (guides all technical decisions)
Feature Specifications (specify-feature: spec.md with constitutional constraints)
โ
Implementation Plans (create-implementation-plan: tech stack FROM constitution)
Core Principle: ALL technical decisions derive from user needs. constitution.md is the bridge between user-centric product.md and technical implementation.
Quality Gates:
- Traceability: Every Article MUST trace to product.md (file:section:line)
- CoD^ฮฃ Evidence: Every derivation MUST use Chain of Decisions operators
- Classification: NON-NEGOTIABLE for "Our Thing", SHOULD for preferences, MAY for flexibility
- Verification: Every Article MUST have verification method
- Derivation Map: Complete bidirectional traceability
Amendment Process: When product.md changes, re-run this skill to update constitution.md with version bump and amendment history.
Workflow Recommendation: Run this skill IMMEDIATELY after define-product to establish technical foundation before any feature development.
Version: 1.1.0
Last Updated: 2025-10-23
Change Log:
- v1.1.0 (2025-10-23): Refactored to progressive disclosure pattern (<500 lines)
- v1.0.0 (2025-10-22): Initial version