// 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.
| 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/shared-imports/memory-utils.md @.claude/templates/product-constitution.md
SDD Phase: Phase 2 (Foundation)
Command: /generate-constitution
Prerequisites: memory/product.md (created by Phase 1 - define-product)
Creates: memory/constitution.md
Predecessor: Phase 1 - /define-product โ memory/product.md
Successor: Phase 3 - /feature โ specs/$FEATURE/spec.md
Phase 1: /define-product โ memory/product.md
Phase 2: /generate-constitution โ memory/constitution.md (YOU ARE HERE)
Phase 3: /feature โ specs/$FEATURE/spec.md
Phase 4: /clarify (if needed) โ updated spec.md
Phase 5: /plan โ plan.md + research.md + data-model.md
Phase 6: /tasks (auto) โ tasks.md
Phase 7: /audit (auto) โ audit-report.md
Phase 8: /implement โ code + tests + verification
$FEATURE format: NNN-feature-name (e.g., 001-therapy-app)
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.
| 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 |
Detailed Workflows:
References:
User Request?
โโ Creating new constitution? โ Derivation Workflow
โโ Updating existing? โ Amendment Workflow
โโ Validating? โ Validation Checks
See: @.claude/skills/generate-constitution/workflows/derivation-workflow.md
Summary:
Read product.md and extract:
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)
For each user need, create an Article with:
Classification:
Group principles into 7 standard Articles:
Priority within each: NON-NEGOTIABLE โ SHOULD โ MAY
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.
---
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
See: @.claude/skills/generate-constitution/workflows/amendment-workflow.md
Summary:
Trigger: product.md changes โ constitution.md MUST update
Version Semantics:
Process:
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
See: @.claude/skills/generate-constitution/workflows/validation-checks.md
Summary:
"Can I delete this without breaking a user promise?"
"Can I trace this to a specific user pain?"
"Does this enable 'Our Thing'?"
See: @.claude/skills/generate-constitution/references/anti-patterns.md
Summary of Common Mistakes:
See: @.claude/skills/generate-constitution/references/failure-modes.md
Summary of Top 12 Failures:
Complete Constitution: See examples/b2b-saas-constitution.md
Shows:
Template: Use @.claude/templates/product-constitution.md
Before using this skill:
Note: constitution.md CANNOT be created without product.md. All technical principles MUST derive from user needs documented in product.md.
Depends On:
Integrates With:
Tool Dependencies:
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:
Outputs Modified:
constitution.md - Technical principles derived from user needs (project root)Commands:
Direct Integration:
Workflow Context:
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:
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.2.0 Last Updated: 2025-01-19 Change Log: