Install
openclaw skills install intent-engineeringAdds an intent layer to OpenClaw agents, ensuring subagents optimize for your actual priorities via INTENT.md and context-aware task spawning.
openclaw skills install intent-engineeringWithout an intent layer, agents optimize for what's measurable (fast response, no errors) rather than what matters (your actual priorities). The Klarna failure: AI saved $60M and destroyed customer loyalty because it optimized resolution time, not relationships.
INTENT.md — YAML priority manifest at workspace rootlib/agent-context-loader.js — prepends intent summary to every subagent spawnCopy references/intent-template.md to your workspace root as INTENT.md and edit:
cp $(dirname $0)/references/intent-template.md $OPENCLAW_WORKSPACE/INTENT.md
Or create it manually — see references/intent-template.md for the annotated schema.
Copy the reference implementation to lib/:
cp $(dirname $0)/references/agent-context-loader-template.js $OPENCLAW_WORKSPACE/lib/agent-context-loader.js
Verify it runs:
node $OPENCLAW_WORKSPACE/lib/agent-context-loader.js $OPENCLAW_WORKSPACE
In any subagent spawn, prepend the intent context to the task description:
const { prepareAgentContext } = require('./lib/agent-context-loader');
const { context } = prepareAgentContext(taskType, workspaceRoot);
const fullTask = context ? context + '\n\n---\n\n' + originalTask : originalTask;
// Use fullTask as your subagent task description
taskType is a string describing the work (e.g. "code_review", "research", "writing"). The loader extracts relevant context from INTENT.md and recent memory automatically.
Spawn a test subagent with a task that would normally trigger a tradeoff (cost vs quality, speed vs depth). Confirm the subagent's output reflects your priorities from INTENT.md.
| Field | Purpose |
|---|---|
optimization_priority | Ordered priorities: primary → never_sacrifice |
tradeoffs | Explicit rules when objectives conflict |
model_tier_intent | Which task types get which model tier |
delegation_intent | When to delegate vs handle inline |
quality_intent | Per-domain quality standards |
See references/intent-template.md for the full annotated template.
prepareAgentContext() reads INTENT.md fresh on every call, extracts a compact summary (≤200 chars), and prepends it to the spawn task. Subagents receive:
## Intent
Optimize for: user_value > honesty > cost. Never sacrifice: honesty, safety.
Delegate when blocking chat. Prefer depth for architecture/writing.
If INTENT.md is missing, a safe default is injected. The loader never throws — it degrades silently.
references/intent-template.md — Full annotated INTENT.md template with all fieldsreferences/agent-context-loader-template.js — Complete agent-context-loader.js implementation