Create and manage project constitution - defines project-wide principles, patterns, and standards that guide all specs and implementations
Creates and maintains a project constitution that defines architectural principles, coding standards, and quality requirements. Claude will use this when patterns emerge across multiple features or for team projects needing consistency.
/plugin marketplace add rhuss/cc-superpowers-sdd/plugin install sdd@sdd-plugin-developmentThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Create and maintain a project constitution that defines project-wide principles, standards, and patterns.
A constitution provides:
All specs are validated against the constitution for consistency.
Ensure spec-kit is initialized:
{Skill: spec-kit}
If spec-kit prompts for restart, pause this workflow and resume after restart.
Purpose: Document project-wide rules that ensure consistency across features.
Contains:
Benefits:
Good times:
Bad times:
Rule of thumb: Create after you see patterns repeating.
Ask:
If solo + small project: Constitution might be overkill
If team OR large OR long-term: Constitution recommended
Review existing specs:
ls specs/features/
cat specs/features/*.md
Identify patterns:
Extract commonalities: Make implicit standards explicit.
With spec-kit:
speckit constitution
Manual creation:
Create specs/constitution.md with template below.
Template:
# Project Constitution
**Project:** [Project Name]
**Created:** YYYY-MM-DD
**Last Updated:** YYYY-MM-DD
## Purpose
This constitution defines project-wide principles, patterns, and standards.
All features and implementations must align with these principles.
## Architectural Principles
### [Principle Name]
**Description:** [What this principle means]
**Rationale:** [Why we follow this]
**Examples:**
- ā [Good example]
- ā [Bad example]
[Repeat for each principle]
## API Design Standards
### RESTful Conventions
- Use standard HTTP methods (GET, POST, PUT, DELETE)
- Plural resource names (/users, not /user)
- Return appropriate status codes
- Use JSON for request/response bodies
### Error Responses
**Format:**
```json
{
"error": "Human-readable error message",
"code": "ERROR_CODE",
"details": { ... }
}
Status Codes:
tests/ directory[Term 1]: [Definition] [Term 2]: [Definition]
Context: [Why decision needed] Decision: [What was decided] Rationale: [Why this decision] Implications: [What this affects]
[Add new decisions here]
### 5. Review and Refine
**Questions to ask:**
- Is this too restrictive?
- Is this clear enough?
- Can we realistically follow this?
- Does this reflect our actual practices?
**Adjust as needed.**
### 6. Validate Against Existing Specs
**Check existing specs:**
```bash
# For each existing spec
cat specs/features/[feature].md
# Does it align with constitution?
# Any violations?
If violations found:
git add specs/constitution.md
git commit -m "Add project constitution
Defines project-wide principles and standards:
- Architectural principles
- API design standards
- Error handling patterns
- Security requirements
- Testing standards
- Code quality standards
All future specs will be validated against this constitution.
š¤ Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>"
For team projects:
For solo projects:
Use TodoWrite to track:
# Todo App Project Constitution
**Created:** 2025-11-10
## Purpose
Define standards for the todo app project to ensure consistency.
## Architectural Principles
### RESTful API Design
All endpoints follow REST conventions:
- `GET /api/todos` - List todos
- `POST /api/todos` - Create todo
- `PUT /api/todos/:id` - Update todo
- `DELETE /api/todos/:id` - Delete todo
### Data Validation
- Validate on server (never trust client)
- Return 422 for validation failures
- Provide specific error messages
## Error Handling
### Error Response Format
```json
{
"error": "Human-readable message",
"field": "field_name", // for validation errors
"code": "ERROR_CODE"
}
Context: Need authentication for multi-user support Decision: Use JWT tokens stored in httpOnly cookies Rationale: Secure, stateless, industry standard Implications: Need token refresh mechanism, logout handling
## Maintaining the Constitution
**Update when:**
- New patterns emerge
- Decisions change
- Standards evolve
- Exceptions become rules
**Don't update when:**
- Single feature needs exception
- Trying to justify shortcut
- Reacting to single issue
**Update process:**
1. Propose change
2. Update constitution
3. Update affected specs
4. Communicate change
5. Add to decision log
## Common Sections
### Minimal Constitution
- Architectural principles
- Error handling
- Testing standards
### Standard Constitution
- Above, plus:
- API design
- Security requirements
- Code quality
### Comprehensive Constitution
- Above, plus:
- Performance requirements
- Accessibility standards
- Deployment practices
- Monitoring/observability
**Start minimal, expand as needed.**
## Anti-Patterns
**Avoid:**
- Creating constitution too early (no patterns yet)
- Making it too restrictive (can't follow it)
- Copying from other projects (doesn't fit yours)
- Never updating it (becomes outdated)
- Not following it (then why have it?)
**Instead:**
- Wait for patterns to emerge
- Make it realistic and followable
- Extract from your own project
- Update as project evolves
- Enforce during spec validation
## Remember
**Constitution is living document.**
- Starts small, grows with project
- Reflects actual practices
- Updated as standards evolve
- Referenced regularly
**Constitution enables consistency.**
- Specs validated against it
- Reduces decision fatigue
- Onboards new developers
- Documents architectural decisions
**Constitution serves the project.**
- Not rigid rules set in stone
- Pragmatic guidelines
- Updated when they don't serve
- Exceptions documented
**Good constitution helps. Bad constitution hinders.**
Make yours helpful.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.