**SKILL 包** 是专为 AI 编码助手(Cursor、Claude Code、OpenCode 等)设计的结构化知识包。
AI Agent 可以直接获取 `SKILL.md` 来了解整个 Yao Agent 框架的概览。`references/` 目录包含按需加载的详细规格。
> SKILL 包内容为英文,以确保 AI Agent 最佳消费效果。
---
## 文件索引
| 文件 | 行数 | 说明 |
|------|------|------|
| [SKILL.md](../../../en-us/agent/skill/SKILL) | ~500 | **入口文件** —— 核心概念、目录结构、package.yao、Hook、MCP、Model、脚本、测试、CLI Agent、Robot |
| [references/context-api.md](../../../en-us/agent/skill/references/context-api) | ~370 | `ctx.*` 完整 API —— 消息、Memory(4 层)、MCP、Agent(A2A)、LLM、Search、Trace、Workspace、Computer |
| [references/hooks-patterns.md](../../../en-us/agent/skill/references/hooks-patterns) | ~370 | 14 种即用模式 —— 加载指示、委托循环、并行研究、CLI 准备、Robot 宿主 |
| [references/runtime-api.md](../../../en-us/agent/skill/references/runtime-api) | ~270 | `@yao/runtime` 模块 —— Process、Exception、Authorized、log、Store、FS、Query、http |
| [references/testing.md](../../../en-us/agent/skill/references/testing) | ~220 | `yao agent test` CLI 标志、断言方法、测试约定、E2E 测试输入 |
URL 末尾加 `.md` 即可获取 Markdown 原文。
---
## 如何使用
### AI 编码助手
将 `SKILL.md` 作为入口获取,按需加载 `references/`。
**Markdown 直链:**
```
https://yaoapps.com/docs/tutorials/en-us/agent/skill/SKILL.md
```
### Cursor
复制到项目的 `.cursor/skills/`:
```
.cursor/skills/yao-agent-development/
├── SKILL.md
└── references/
├── context-api.md
├── hooks-patterns.md
├── runtime-api.md
└── testing.md
```
### Claude Code
在 `CLAUDE.md` 中引用:
```markdown
For Yao Agent development, fetch: https://yaoapps.com/docs/tutorials/en-us/agent/skill/SKILL.md
```
---
## 源码兜底
当文档不够明确时,SKILL 会指示 Agent 克隆源码并搜索实现:
| 仓库 | 说明 |
|------|------|
| [yaoapp/yao](https://github.com/yaoapp/yao) | Go 引擎 —— `agent/` 目录包含 Hook、Context API、Memory、测试 |
| [YaoApp/gou](https://github.com/YaoApp/gou) | Go 框架 —— `mcp/`、`model/`、`process/` |
| [YaoApp/cui](https://github.com/YaoApp/cui) | Chat UI —— TypeScript 前端组件 |