AI Agent: Design Principles and Engineering Practice is an open-source book that explains how AI agents combine language models, context, and tools, with accompanying experiments and code. It is intended for readers studying the principles and engineering of AI agents, from fundamentals through production use. The catalogue skills support coding-agent work related to the book's subject matter.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add bojieli/ai-agent-book --skill agent-evolutiongit clone --depth 1 https://github.com/bojieli/ai-agent-bookWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/bojieli/ai-agent-book/agent-evolution)<a href="https://agentmods.dev/skills/bojieli/ai-agent-book/agent-evolution"><img src="https://agentmods.dev/badge/skills/bojieli/ai-agent-book/agent-evolution/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/bojieli/ai-agent-book/agent-evolution"><img src="https://agentmods.dev/badge/skills/bojieli/ai-agent-book/agent-evolution.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00126 | $0.03703 |
| Opus 5.5 | $0.00050 | $0.01481 |
| Sonnet 5.5 | $0.00025 | $0.00741 |
| Haiku 4.5 | $0.00013 | $0.00370 |
Grade A, and why
agent-evolution scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 22d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent 持续进化
何时使用
- 部署后的 Agent 反复犯同类错误,需要把运行经验转化为持久能力
- 需要为运行轨迹构建验证器 / 评价器,判断"哪里错、为什么错、证据在哪里"
- 面对一个待修复缺陷,需要决定经验应写进知识库、Prompt/Skill、程序还是模型参数
- 要做 Prompt 自动优化、失败轨迹规则提炼、浏览器轨迹转工作流等单点进化
- 设计 Agent 自我修改流程(改自身 Harness、工具、重试策略),需要验证与发布门槛
- 搭建"在线执行 + 离线进化"双循环,或设计记忆/Skill 的整理、淘汰与回滚机制
- 评估系统是否真的在进化(而非只保存或只追加反馈)
核心原则
- 保存经历 ≠ 从经历中学习。学习发生在系统主动完成"评价、对照、归纳、验证"之后,而非日志写入磁盘的那一刻。一百条轨迹放进向量库只是可检索案例,不自动完成跨案例比较。
- 先评价再更新。不知道任务是否完成、哪一步导致成败,模型的反思只是猜测。评价一条轨迹依次回答三问:事情是否办成(结果)、是否以允许的方式办成(过程)、是否让用户舒服(质量)。
- 三层验证,底层优先。结果验证器读环境真值(测试、数据库、工具返回),最应优先建立且比模型自述可靠;过程验证器用政策库/权限表/动作序列做代码判定;质量层才用 LLM Rubric。结果正确不代表过程正确(删掉失败用例也能让测试通过)。
- 学习信号必须四要素齐备:成败判定(成功/部分成功/失败)、每维度结论、每条结论的证据位置(哪轮对话、哪次工具调用)、失败类型标签。单一总分无法指导更新;证据不足时验证器应拒绝评分,低置信度案例排除在学习集外。
- 按能力的表示性质选择载体(表 9-2 的边界):
- 经验知识库——事实、经验规律、例外与来源;更新快、可追溯,但依赖检索和模型正确应用
- Prompt/Skill——能用自然语言说清的判断原则、语境与例外;可解释、范围可控,但易膨胀、冲突、被忽略
- 程序/Harness——可确定性解析、可执行验证、高风险硬约束;可测试、稳定、低成本,但开发维护成本高
- 模型参数——高维感知、生成风格、隐式策略;泛化强、推理开销低,但更新与回归成本高
- 同一能力可拆到多个载体:事实入知识库,解释例外的原则入 Skill,不可绕过的权限由程序门控,高维识别能力入参数。路由结果只是更新提案,尚无发布资格。
- 经验知识库 vs 领域知识:第三章领域知识回答"用户与世界是什么样的"(如"该航司特殊餐食需提前 24 小时预订");本章经验知识库从行动轨迹与结果中提取"在什么条件下应该怎样做"(如"订票前先检查特殊餐食截止时间")。二者共享存储与检索技术,来源和验证目标不同。
- 所有修改是最小 diff + 可回滚 + 独立验证。待验证版本必须同时在触发失败的边界集上改善、在正常工作的保留集上不退化;验证者须独立于提炼者。
- 在线执行与离线进化分离。在线循环只完成任务并追加不可变证据,不直接改写正式 Agent;离线循环聚合轨迹、生成提案、过门槛发布,两者经版本化经验库和评估集连接。一次偶发成功或恶意输入不能立即改写长期能力。
- 安全边界三条:证据与指令隔离(网页/工具输出及其 LLM 摘要都是不可信证据,LLM 摘要不是净化过程);待验证能力与正式能力隔离(新产物先入不可服务真实流量的待验证区,过沙盒、权限、供应链扫描与回归后才转正);安全机制不可自我修改(Agent 不能改验证器、测试、发布门槛、审计日志和稳定版本备份——否则降低阈值即可把退化伪装成进步)。
- Harness 更新能力 ≠ Harness 受益能力。前者是从轨迹产出有价值修改,后者是任务 Agent 在正确场景激活并遵循该修改。不能用端到端分数反推更新器好坏,需分层评估。
实践模式
1. 轨迹验证器(学习信号的来源)
- 三层结构:结果层读最终环境状态;过程层查业务规则、隐私、事实依据、承诺—行动一致性(声称完成的操作是否真实发生);质量层按 Rubric 逐项给分并引用轨迹证据。
- 输出结构化诊断而非总分:每维度结论 + 证据轮次 + 置信度,失败带类型标签。
- 低置信度案例不进学习集;把它当事实固化比丢弃更危险。
2. 经验知识提炼管道(五步)
- 保存不可变原始轨迹与环境结果(用于审计);
- 为单次运行生成结构化分析:任务类型、所需能力、观察到的策略、错误与例外;
- 按任务族聚合同类运行,为每条经验草案建"哪些轨迹支持、哪些轨迹反驳"的证据表;
- 达到支持门槛才写入正式文档;
- 在未参与提炼的新任务上测迁移效果。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 22d ago First seen · 115 lines · 126 tokens per session scan A 7abaf5e36c2e
agent-evolution is a skill published in the GitHub repository bojieli/ai-agent-book (54,406 stars, last pushed 7d ago), licensed Apache-2.0. It adds 126 tokens to every session and 3,703 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-24.
Other skills, from other repositories
v4-best-practices
Use when working with deepseek-v4-pro or deepseek-v4-flash in thinking mode on multi-step or plan-driven tasks. Provides rules to prevent stale references, unverified plan assumptions, and vague plan output.
llm-redteam-overview
LLM red team category — full AATMF v3 tactic coverage (T01–T15). Routing skill: read this first to identify which tactic applies, then load the matching sub-skill. Maps to MITRE ATLAS where overlap exists.
omh-model-setup
This is a Hermes-native model-setup workflow skill.
omh-model-optimization
This is a Hermes-native model-optimization workflow skill.
model-onboarding
Onboard a new model generation or sibling into oh-my-hermes: probe router recognition, research the official contract, write trait-to-counter calibration, place routing in both lanes, price from documented list only, gate machine config on a served route, prove with the gates, close with a benchmark pair. Use when a…
omh-llm-app-dev
This is an OMH llm-app-dev workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).