From sdd-workflow
Define and manage non-negotiable project principles (Constitution) and verify synchronization with other documents
How this skill is triggered — by the user, by Claude, or both
Slash command
/sdd-workflow:constitution <subcommand> [arguments]<subcommand> [arguments]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Define the project's non-negotiable principles (Constitution)
examples/constitution_as_code.mdexamples/constitution_file_structure.mdexamples/principle_template.mdexamples/sync_report.mdexamples/update_interactive_session.mdexamples/validation_report.mdreferences/best_practices.mdreferences/prerequisites_directory_paths.mdreferences/prerequisites_plugin_update.mdreferences/prerequisites_principles.mdscripts/validate-files.pytemplates/en/constitution_output.mdtemplates/en/constitution_template.mdtemplates/ja/constitution_output.mdtemplates/ja/constitution_template.mdDefine the project's non-negotiable principles (Constitution) and verify that all specifications and design documents comply with them.
Read the following prerequisite references before execution:
references/prerequisites_plugin_update.md - Check for plugin updatesreferences/prerequisites_principles.md - Read AI-SDD principles documentreferences/prerequisites_directory_paths.md - Resolve directory paths using SDD_* environment variablesOutput templates are located under templates/${SDD_LANG:-en}/ within this skill directory.
The SDD_LANG environment variable determines the language (default: en).
A Project Constitution defines non-negotiable principles that form the foundation of all design decisions.
| Characteristic | Description |
|---|---|
| Non-negotiable | Not open to debate. Changes require careful consideration |
| Persistent | Consistently applied across the entire project |
| Hierarchical | Higher principles take precedence over lower ones |
| Verifiable | Can automatically verify spec/design compliance with principles |
| Principle Category | Example Principles |
|---|---|
| Architecture | Library-First, Clean Architecture |
| Development | Test-First, Specification-Driven |
| Quality | Test Coverage > 80%, Zero Runtime Errors |
| Technical | TypeScript Only, No Any Types |
| Business | Privacy by Design, Accessibility First |
$ARGUMENTS
| Subcommand | Description | Additional Arguments |
|---|---|---|
init | Initialize constitution file | [context] (optional) |
validate | Validate constitution compliance | - |
add | Add new principle | "principle-name" |
bump-version | Version bump | major|minor|patch |
| Example | Description |
|---|---|
/constitution init | Initialize constitution file (interactive) |
/constitution init "TypeScript/React Web application" | Initialize with context (non-interactive) |
/constitution validate | Validate constitution compliance |
/constitution add "Library-First" | Add new principle |
/constitution bump-version major | Major version bump |
Create a constitution file in the project by running /constitution init.
Generated File: ${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/CONSTITUTION.md
Processing Flow:
${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/CONSTITUTION.md already existstemplates/${SDD_LANG:-en}/constitution_template.md{Principle Name}, {Description of the principle}, {Applicable scope}, {Validation item},
YYYY-MM-DD, etc.) with project-specific contentCRITICAL: The output language MUST match the template language. Do NOT mix languages regardless of the user's global language settings.
SDD_LANG=en (or unset) → All content in English (use templates/en/)SDD_LANG=ja → All content in Japanese (use templates/ja/)Content: Template customized for the project
Add a new principle to a constitution by running /constitution add "Library-First".
Process:
Command: /constitution show
Output Content:
Command: /constitution update
Interactive Prompts: See examples/update_interactive_session.md for an example interactive session.
Version Bump Rules:
| Change Type | Version Impact | Example |
|---|---|---|
| Add principle | MAJOR (X.y.z) | 1.0.0 -> 2.0.0 |
| Modify principle | MAJOR (X.y.z) | 1.0.0 -> 2.0.0 |
| Remove principle | MAJOR (X.y.z) | 1.0.0 -> 2.0.0 |
| Clarify principle | MINOR (x.Y.z) | 1.0.0 -> 1.1.0 |
| Update enforcement | MINOR (x.Y.z) | 1.0.0 -> 1.1.0 |
| Fix typo | PATCH (x.y.Z) | 1.0.0 -> 1.0.1 |
Verify all specifications and design documents comply with constitution by running /constitution validate.
Optimized Execution Flow:
Phase 1: Shell Script - Execute python3 "${CLAUDE_PLUGIN_ROOT}/skills/constitution/scripts/validate-files.py" to
scan file structure.
This script:
${CLAUDE_PROJECT_DIR}/${SDD_REQUIREMENT_PATH}/**/*.md)*_spec.md)*_design.md)$CLAUDE_ENV_FILE:
CONSTITUTION_REQUIREMENT_FILES - List of requirement filesCONSTITUTION_SPEC_FILES - List of spec filesCONSTITUTION_DESIGN_FILES - List of design filesCONSTITUTION_SUMMARY - JSON summary with file countsPhase 2: Claude - Read files from pre-scanned lists and validate content
Validation Targets:
${CLAUDE_PROJECT_DIR}/${SDD_REQUIREMENT_PATH}/**/*.md${CLAUDE_PROJECT_DIR}/${SDD_SPECIFICATION_PATH}/**/*_spec.md${CLAUDE_PROJECT_DIR}/${SDD_SPECIFICATION_PATH}/**/*_design.md${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/PRD_TEMPLATE.md${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/SPECIFICATION_TEMPLATE.md${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/DESIGN_DOC_TEMPLATE.mdValidation Items:
| Validation Item | Check Content |
|---|---|
| Principle Mention | Are principles mentioned in specs/designs? |
| Principle Compliance | Do implementation decisions follow principles? |
| Contradiction Detection | Are there descriptions contrary to principles? |
| Template Sync | Do templates reflect latest constitution? |
Validation Output Format: See examples/validation_report.md for the complete report template.
Command: /constitution sync
Purpose: Ensure principles are reflected in other documents
Actions:
Update Specification Template:
Update Design Template:
Update Task Templates:
Update Checklist Template:
Output: See examples/sync_report.md for an example sync report.
Update constitution version by running /constitution bump-version {major|minor|patch} (e.g.
/constitution bump-version major for a breaking change, minor to add a principle, patch for a typo fix).
Semantic Versioning:
| Version Type | Use Case | Example |
|---|---|---|
| Major | Remove/significantly change existing principle (breaking) | 1.0.0 -> 2.0.0 |
| Minor | Add new principle | 1.0.0 -> 1.1.0 |
| Patch | Fix expression of principle, typo fix | 1.0.0 -> 1.0.1 |
For a complete constitution file example with all categories (Business, Architecture, Development Methodology, Technical Constraints), principle hierarchy, verification items, and change history, see:
Reference: examples/constitution_file_structure.md
Save Location: ${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/CONSTITUTION.md
Depending on sub command, use the templates/${SDD_LANG:-en}/constitution_output.md template for output formatting.
YYYY-MM-DD → actual date)| Document | Sync Content |
|---|---|
${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/SPECIFICATION_TEMPLATE.md | Add principle reference sections |
${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/DESIGN_DOC_TEMPLATE.md | Add principle compliance checklist |
*_spec.md | Design based on principles |
*_design.md | Explicitly state principle compliance |
Running /constitution validate automatically verifies:
| Scenario | Command | Purpose |
|---|---|---|
| Project Start | /constitution init | Create constitution file |
| Add New Principle | /constitution add | Add principle and bump version |
| Before Creating Spec | /constitution validate | Check latest constitution |
| Before Review | /constitution validate | Verify constitution compliance |
| Major Policy Change | /constitution bump-version major | Major version bump |
The change process follows these steps in order: propose change (discuss in Issue, etc.) -> team approval -> update
constitution file -> bump version -> update affected documents -> verify with /constitution validate.
Major version bump required for any of the following:
See references/best_practices.md for detailed guidance on:
Constitution principles are checked at each level of the AI-SDD workflow, in this order: Constitution (Project-Level Principles) -> PRD (Business Requirements) -> Specification (Logical Design) -> Design Document (Technical Implementation) -> Implementation (Code).
${CLAUDE_PROJECT_DIR}/${SDD_ROOT}/CONSTITUTION.mdreferences/best_practices.md for additional recommendationsnpx claudepluginhub toshikiimagawa/ai-sdd-workflow --plugin sdd-workflowCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.