← 返回
未分类 中文

Intent Engineering - Make Agents Optimize for What You Actually Want

Adds an intent layer to OpenClaw agents, ensuring subagents optimize for your actual priorities via INTENT.md and context-aware task spawning.
为 OpenClaw 代理添加意图层,使子代理通过 INTENT.md 与上下文感知任务生成来优化您的实际优先级。
donovanpankratz-del donovanpankratz-del 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 190
下载
💾 1
安装
1
版本
#agent-alignment#agent-behavior#agent-goals#agent-values#alignment#context#cost-quality#decision-making#delegation#depth-speed#goals#intent#intent-layer#klarna#latest#model-tier#openclaw#optimization#priority#routing#spawn#subagent#tradeoffs#what-you-want

概述

Intent Engineering

The Problem

Without 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.

What This Skill Installs

  1. INTENT.md — YAML priority manifest at workspace root
  2. lib/agent-context-loader.js — prepends intent summary to every subagent spawn
  3. Routing integration — intent propagation flag in all routing decisions

Installation

Step 1 — Create INTENT.md

Copy 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.

Step 2 — Install agent-context-loader

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

Step 3 — Wire into spawn calls

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.

Step 4 — Verify

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.

INTENT.md Structure

FieldPurpose
------
optimization_priorityOrdered priorities: primary → never_sacrifice
tradeoffsExplicit rules when objectives conflict
model_tier_intentWhich task types get which model tier
delegation_intentWhen to delegate vs handle inline
quality_intentPer-domain quality standards

See references/intent-template.md for the full annotated template.

How It Works

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

  • references/intent-template.md — Full annotated INTENT.md template with all fields
  • references/agent-context-loader-template.js — Complete agent-context-loader.js implementation

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-12 06:13 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 863 📥 341,799
it-ops-security

Skill Vetter - Pre-Install Security Review

donovanpankratz-del
安装任意AI代理技能前的安全审查协议。针对凭证窃取、混淆代码、数据渗出进行危险信号检测。风险等级分类L...
★ 30 📥 23,732
ai-agent

Find Skills

root
帮助用户发现和安装智能体技能,当用户询问如「如何做X」、「找X的技能」、「有能做...的吗」等问题时
★ 1,513 📥 570,133