/edikt:compile
Compile accepted ADRs, active invariants, and team guidelines into a single governance directives file.
The output — .claude/rules/governance.md — is read by Claude automatically every session. It contains short, actionable directives distilled from your decision records. The ADRs and invariants remain the source of truth; the compiled output is the enforcement format.
Usage
/edikt:compile
/edikt:compile --checkArguments
| Argument | Description |
|---|---|
| (none) | Compile and write .claude/rules/governance.md |
--check | Validate only — report contradictions and conflicts without writing |
What it compiles
Accepted ADRs — status: accepted only. Drafts and superseded ADRs are skipped. Each ADR's decision is distilled to 1–2 actionable sentences.
Active invariants — status: active only. Revoked invariants are skipped. Invariant directives are marked non-negotiable.
Guidelines — all files in docs/guidelines/ (if the directory exists). Compiled as team preferences, no status filtering.
Contradiction detection
Before writing, the command checks for contradictions:
CONTRADICTION DETECTED
ADR-001: "Claude Code only — no multi-tool support"
ADR-007: "Support Cursor for rule distribution"
Resolve before compiling. Supersede one or reconcile both.Cross-source conflicts:
CONFLICT: guideline vs invariant
guidelines/testing.md: "Always mock the database in all tests"
INV-001: "Integration tests must hit a real database, no mocks"
Action: Scope the guideline to unit tests only, or amend INV-001.Invariant conflicts are errors — invariants always win. ADR conflicts are warnings.
Output
Writes .claude/rules/governance.md with paths: "**/*" — applied globally, not scoped to specific file types:
---
paths: "**/*"
---
<!-- edikt:compiled — generated by /edikt:compile, do not edit manually -->
# Governance Directives
## Architecture
- Claude Code is the only supported platform. Do not write configuration
targeting other tools. (ref: ADR-001)
## Constraints
- Every command and template must be a .md or .yaml file. No TypeScript,
no compiled binaries. Non-negotiable. (ref: INV-001)
## Team Guidelines
### Testing
- Always test error paths first. (ref: guidelines/testing.md)Confirmation:
COMPILED .claude/rules/governance.md
4 ADRs → 5 directives
1 invariant → 1 directive
1 guideline → 3 directives
9 total directives
Skipped: 1 superseded ADR, 2 draft ADRs
Claude will read these directives automatically in every session.CI validation
/edikt:compile --checkExit code 1 if contradictions or conflicts exist. Use this in CI to catch governance drift before it reaches production.
/edikt:compile --check
Sources: 5 ADRs (4 accepted), 2 invariants (2 active), 1 guideline
Contradictions: 0
Conflicts: 0
Directives: 9 would be generated
All clear — governance compiles cleanly.When to run
Run after:
- Capturing a new ADR with
/edikt:adr - Adding an invariant with
/edikt:invariant - Updating a guideline file in
docs/guidelines/ - Changing an ADR status to
accepted
The ADR and invariant commands will remind you:
Run /edikt:compile to update governance directives.What's next
- Compiled Directives — full explanation of how compilation works
- /edikt:review-governance — review compiled output for language quality
- /edikt:adr — capture an architecture decision
- /edikt:invariant — add a hard constraint