/dna:compile — Compile Contracts
Compile decisions into human contract, agent contract, or both.
Usage: /dna:compile human, /dna:compile agent, /dna:compile (both)
Targets
Human Contract (contracts/human.md)
Organized by level. Narrative prose. What people agree on.
# Human Contract — [project name from .dna/config.json] ## Identity (Level 1) [compiled from level 1 decisions] ## Direction (Level 2) [compiled from level 2 decisions] ## Strategy (Level 3) [compiled from level 3 decisions] ## Tactics (Level 4) [compiled from level 4 decisions]
For each level section:
- •Read all committed decisions at that level
- •Weave into coherent narrative — decisions, reasoning, tradeoffs
- •Note any suggested decisions as "Under consideration: ..."
- •Include key Detail sections inline where they ground the narrative
Agent Contract (contracts/agent.md)
Structured for agent consumption. Constitution + project decisions.
# Agent Contract — [project name from .dna/config.json] ## Principles [from constitution decisions] ## Boundaries [assumptions + constraints from all levels] ## Authority [what's autonomous vs HITL — from stakes + tradeoffs] ## Context [key decisions the agent needs, with Detail inline] ## Rules [concrete enforcement rules from high-stakes decisions]
What to do
- •
Completeness analysis: Run
dna-graph progress --jsonto assess graph health before compilation. If foundation is thin (level 1-2 gaps), warn the person before proceeding.shCLAUDE_PROJECT_DIR="$PROJECT_DIR" python3 "$TOOL" progress --json
- •
Read
.dna/config.jsonto get the project name for contract headers - •
Get the deterministic compilation skeleton:
shCLAUDE_PROJECT_DIR="$PROJECT_DIR" python3 "$TOOL" compile-manifest --target {target} --json - •
Read decisions listed in the manifest (not all decisions — the manifest provides the exact set)
- •
Sort by level, then by dependency order within level
- •
Compile the target contract(s) following the structure above
- •
Present compiled output for human approval
- •
Write to
contracts/on approval
Constraints
- •Never invent content not grounded in decisions
- •If a decision's state is
suggested, mark it clearly in the output - •Respect the iron rule: committed language only for committed decisions
- •Include
<!-- Compiled from: DEC-001, DEC-003, ... -->comments per section
Context
- •Constitution:
constitution/directory - •DNA:
dna/directory - •Contracts:
contracts/directory - •Project config:
.dna/config.json - •All commands via Bash:
CLAUDE_PROJECT_DIR="$PROJECT_DIR" python3 "$TOOL" <command> - •Tool path is available from session-start output (## Tool Paths section)
- •Format spec: see
format.mdin the dna plugin