// Guide OAK engineering constitution creation with decision-driven requirements, requirement language patterns, and reality-grounded standards.
| name | constitution-authoring |
| description | Guide OAK engineering constitution creation with decision-driven requirements, requirement language patterns, and reality-grounded standards. |
Guide the creation of effective engineering constitutions that balance aspirational standards with project reality.
/oak.constitution-create → Analyze & Gather Decisions → Generate → /oak.constitution-validate
| Command | Purpose |
|---|---|
oak constitution create | Generate constitution from decisions |
oak constitution analyze --json | Analyze project structure and capabilities |
oak constitution validate --json | Validate structure and quality |
oak constitution list-agent-files | List synced agent instruction files |
oak/
├── constitution.md # Main engineering constitution
└── agent-instructions/ # Per-agent instruction files (synced)
├── CLAUDE.md
└── ...
Constitutions should be decision-driven, not template-filled. Each section should reflect explicit decisions about project standards.
Choose based on project maturity, team size, and risk tolerance:
| Strategy | Coverage | TDD | E2E | Best For |
|---|---|---|---|---|
| Comprehensive | High (80%+) | Required | Required | Critical systems, regulated industries |
| Balanced | Moderate (60-80%) | Encouraged | Recommended | Most production applications |
| Pragmatic | Flexible | Optional | Optional | MVPs, prototypes, rapid iteration |
Decision questions:
Choose based on domain complexity and team experience:
| Pattern | Complexity | Coupling | Best For |
|---|---|---|---|
| Clean Architecture | High | Very Low | Complex domains, long-lived systems |
| Vertical Slice | Medium | Low | Feature-focused teams, rapid delivery |
| Modular Monolith | Medium | Medium | Future microservices candidates |
| Layered | Low | Medium | Traditional enterprise apps |
| Pragmatic | Adaptive | Varies | Mixed complexity, smaller teams |
Decision questions:
Choose based on team turnover and system complexity:
| Level | Public APIs | Internal | ADRs | Best For |
|---|---|---|---|---|
| Extensive | All documented | All documented | Required | High turnover, complex systems |
| Standard | All documented | Complex only | Recommended | Most teams |
| Minimal | Critical only | None | Optional | Small stable teams, simple systems |
Decision questions:
Choose based on team trust and risk tolerance:
| Policy | Reviews | Approvals | Direct Commits | Best For |
|---|---|---|---|---|
| Strict | All PRs | 1-2 required | Never allowed | Regulated, critical systems |
| Standard | All PRs | 1 required | Hotfixes only | Most production teams |
| Flexible | Recommended | Optional | Simple changes | High-trust small teams |
Decision questions:
Choose based on infrastructure maturity:
| Level | Quality Gates | Coverage Check | Deploy Blocking |
|---|---|---|---|
| Full | All must pass | Enforced | Yes |
| Standard | Most must pass | Advisory | Most |
| Basic | Advisory | No | No |
Use precise requirement keywords to indicate obligation levels:
| Keyword | Meaning | Use When |
|---|---|---|
| MUST | Absolute requirement | Violation is unacceptable |
| MUST NOT | Absolute prohibition | Action is never acceptable |
| SHOULD | Strong recommendation | Exceptions need justification |
| SHOULD NOT | Strong discouragement | Only in unusual cases |
| MAY | Optional | Team discretion |
Strong requirement (MUST):
- All public APIs MUST be documented
- Tests MUST be deterministic and repeatable
- Security patches MUST be applied within 2 weeks
Recommendation (SHOULD):
- Complex logic SHOULD include inline comments
- Code reviews SHOULD be completed within 24 hours
- Integration tests SHOULD cover critical paths
Optional (MAY):
- Teams MAY use pair programming for complex features
- Documentation MAY include diagrams
- E2E tests MAY be skipped for internal tools
| Instead of | Use |
|---|---|
| "should try to" | "SHOULD" |
| "ideally" | "SHOULD" or remove |
| "if possible" | "MAY" or remove |
| "we want to" | "MUST" or "SHOULD" |
| "best practice" | Specific requirement |
Constitution requirements must be achievable, not aspirational fantasies.
Before adding a requirement, ask:
When a requirement doesn't match reality:
| Situation | Approach |
|---|---|
| Nearly there | Use MUST, add implementation plan |
| Significant gap | Use SHOULD with timeline |
| Aspirational | Use "Future Requirement" section |
| Unrealistic | Don't include it |
Example: Coverage Gap
If constitution wants 80% coverage but project has 45%:
### Coverage Requirements
**Target:** 80% code coverage for new code
**Current State:** Project-wide coverage is 45%. New code MUST meet 80% target.
Existing code coverage will be increased incrementally per the Coverage Roadmap.
**Enforcement:** Coverage checks run in CI. New code below 80% will be flagged
but not blocked until Q2 2025.
Goal: Define core values that guide all other decisions.
Include:
Each principle needs:
Goal: Document the chosen architectural pattern and its implications.
Include:
Goal: Define the testing strategy with measurable requirements.
Include:
Goal: Define how the constitution itself is maintained.
Include:
Before finalizing a constitution:
{{placeholders}} replaced| Pitfall | How to Fix |
|---|---|
| Aspirational MUSTs | Downgrade to SHOULD or add timeline |
| Missing rationale | Add "Rationale:" explaining why |
| Vague requirements | Add specific measurable criteria |
| Copy-pasted templates | Customize to actual project decisions |
| Over-prescription | Use SHOULD instead of MUST for non-critical items |
| No enforcement path | Add how requirement will be verified |