From wrangler
Develops project constitutional principles through Socratic questioning. Use when establishing design values, creating project governance, or resolving ambiguous design decisions.
npx claudepluginhub bacchus-labs/wrangler --plugin wranglerThis skill uses the workspace's default tool permissions.
The project defining-constitution serves as "supreme law" - a clear, unambiguous statement of:
Guides strict Test-Driven Development (TDD): write failing tests first for features, bugfixes, refactors before any production code. Enforces red-green-refactor cycle.
Guides systematic root cause investigation for bugs, test failures, unexpected behavior, performance issues, and build failures before proposing fixes.
Guides A/B test setup with mandatory gates for hypothesis validation, metrics definition, sample size calculation, and execution readiness checks.
The project defining-constitution serves as "supreme law" - a clear, unambiguous statement of:
Goal: Create constitutional principles so clear that both AI and human can independently evaluate feature alignment and reach the same conclusion.
When helping user create new defining-constitution from scratch, use the initializing-governance skill instead (it includes defining-constitution creation as part of full setup).
When user has existing defining-constitution needing improvement:
Read Current Constitution:
# Read existing file
cat .wrangler/CONSTITUTION.md
Analyze for Issues:
Present Findings:
## Constitution Analysis
### Strengths
- [What's working well]
### Issues Found
#### Ambiguity Issues
- **Principle N**: "[Quote]" - Ambiguous because [reason]
- **Principle M**: Missing concrete examples
#### Missing Elements
- No anti-patterns documented
- No decision framework
- Unclear amendment process
#### Conflicts
- Principle X conflicts with Principle Y when [scenario]
THIS IS YOUR PRIMARY VALUE-ADD: Systematically eliminate all ambiguity through structured questioning.
Invocation: User can invoke this directly with phrases like:
Process: Use the integrated clarity refinement workflow below.
When user proposes changes to existing principles:
Amendment Process (from defining-constitution template):
constitutional-amendment labelYour Role:
This is the core value of the defining-constitution skill - systematic ambiguity removal.
Scan for Common Ambiguity Patterns:
Vague Quality Terms:
Unmeasurable Claims:
Context-Dependent Terms:
Conflicting Principles:
For EACH ambiguity identified, ask structured questions to force specificity:
Template for Questioning:
For Vague Quality: "You say '[vague term]'. Let's make this concrete:"
For Unmeasurable Claim: "You want '[claim]'. How will we know we achieved it?"
For Context-Dependent: "You mention '[term]' - let's define the context:"
For Conflicts: "These principles could conflict. Let's resolve:"
From user's answers, derive concrete, verifiable criteria:
Transform Vague to Specific:
Before: "Code should be clean" After (from questioning):
**Principle**: Code Clarity Over Cleverness
**In Practice**:
- Functions limited to 50 lines maximum
- No nested ternaries or complex one-liners
- Variable names describe business concepts, not implementations
- Every function has single, obvious purpose
**Anti-patterns**:
- ❌ Combining multiple operations in single expression for brevity
- ❌ Using abbreviations or domain jargon without comments
- ❌ Functions that do "and also" (multiple responsibilities)
**Examples**:
- ✅ **Good**: `getUserByEmail(email)` with clear early returns
- ❌ **Bad**: `getUsr(e)` with nested if-else chains
Before: "System should be scalable" After (from questioning):
**Principle**: Scale Incrementally, Not Prematurely
**In Practice**:
- Design for 10x current load, not 1000x
- Choose boring, proven technologies over cutting-edge
- Measure before optimizing (no guessing performance)
- Accept tech debt to ship, pay it down when load demands
**Anti-patterns**:
- ❌ Adding caching/sharding before measuring need
- ❌ Choosing distributed systems for <1M users
- ❌ Optimizing code paths with no evidence of bottleneck
**Examples**:
- ✅ **Good**: Started with single Postgres, added read replicas at 100K users
- ❌ **Bad**: Used microservices from day 1 for 100 user MVP
After refining principles, ensure decision framework exists:
Five Questions (from template):
Customize for Project:
Test Refined Constitution against real or hypothetical features:
Process:
If answers differ: Constitution still has ambiguity - return to Phase 2
If answers align: Constitution is concrete enough
Example Scenarios:
Scenario A: "Add a visual theme customizer allowing users to change all UI colors"
Scenario B: "Build admin dashboard to view all user data"
Goal: Both you and user reach same conclusion using only the written principles.
If you see ANY of these in a principle, invoke clarity refinement:
Test: Can a new LLM, given ONLY the defining-constitution (no conversation history), evaluate a feature request and reach the same conclusion as you and the user?
If NO: Constitution needs refinement. If YES: Constitution is concrete enough.
When user wants to change existing principles:
Use issues_create:
issues_create({
title: "[CONSTITUTIONAL AMENDMENT] [Short title]",
description: `## Amendment Proposal: [Title]
### Summary
[1-2 sentence summary of proposed amendment]
### Rationale
[Why this amendment is necessary]
[What issues it addresses]
[What improvements it achieves]
### Current Text
\`\`\`
[Exact text of current principle if modifying existing]
\`\`\`
### Proposed Text
\`\`\`
[Exact text of new/modified principle]
\`\`\`
### Impact Analysis
**Affected Specifications**: [List spec IDs]
**Affected Code**: [List files/components]
**Breaking Changes**: [Yes/No - explain]
### Potential Risks
- [Risk 1]: [Mitigation]
- [Risk 2]: [Mitigation]
### Migration Plan
[How existing code/specs will be updated to reflect new principle]
`,
type: "issue",
status: "open",
priority: "high",
labels: ["governance", "constitutional-amendment"],
project: "Governance"
})
Wait for user to explicitly approve amendment.
Don't auto-approve - constitutional changes are serious.
Once approved, update .wrangler/CONSTITUTION.md:
Version increment:
Update sections:
Example edit:
**Version**: 1.1.0
**Last Amended**: 2024-11-18
[... principles sections ...]
### Version History
- **1.1.0** (2024-11-18): Modified Principle 2 (Simplicity) to add concrete example about microservices
- **1.0.0** (2024-10-01): Initial defining-constitution ratified
Add entry to .wrangler/ROADMAP.md changelog:
## Changelog
- **2024-11-18**: Constitutional amendment 1.1.0 affects Phase 2 (modified simplicity principle)
- [...]
Search for specifications that might conflict:
# Search specs for mentions of modified principle
grep -r "Principle [N]" .wrangler/specifications/*.md
grep -r "[principle keyword]" .wrangler/specifications/*.md
grep -r "[principle keyword]" .wrangler/CONSTITUTION.md
Review each affected spec and propose updates if needed.
Mark amendment issue as closed with summary:
## Amendment Complete
**Version**: [X.Y.Z]
**Date**: [YYYY-MM-DD]
**Changes Made**:
- Updated Principle [N] in .wrangler/CONSTITUTION.md
- Version incremented to [X.Y.Z]
- Roadmap changelog updated
- [List any spec updates made]
**Migration Status**:
- [ ] All affected specs reviewed
- [ ] Code updates [N/A or completed]
- [ ] Team notified
Amendment is now in effect.
DO:
DON'T:
When principles conflict (e.g., "Move Fast" vs "High Quality"):
Option 1 - Hierarchy: Explicitly rank principles
### Principle Hierarchy
When principles conflict, apply in this order:
1. Security (never compromised)
2. User Privacy
3. Reliability
4. Simplicity
5. Speed of iteration
Option 2 - Rewrite: Eliminate conflict by rewriting both
**Before**:
- Move fast and ship features quickly
- Maintain high code quality always
**After**:
- Ship fast with tech debt, pay it down when velocity slows
- Quality in external APIs and data models, pragmatic in internals
Validation Checklist:
For detailed information, see:
references/detailed-guide.md - Complete workflow details, examples, and troubleshooting