Book Ling Agent — AI skill for Claude Code
自己动手写 AI Agent — 从 Claude Code 开源架构到你的第一个编程助手.
How to install Book Ling Agent
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open diguike/book-ling-agent and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Book Ling Agent does
自己动手写 AI Agent — 从 Claude Code 开源架构到你的第一个编程助手.
Alternatives in AI
- Hermes Agent Orange Book — Hermes Agent 从入门到精通 · 橙皮书系列 · Nous Research 开源 AI Agent 框架实战指南 4.9k ★
- Claude Code Book — 《御舆:解码 Agent Harness》42万字拆解 AI Agent 的Harness骨架与神经 —— Claude Code 架构深度剖析,15 章从对话循环到构建你自己的 Agent Harness 2.8k ★
- Claude Code Orange Book — Claude Code: The Complete Guide · 橙皮书系列 · AI编程实战指南 308 ★
README
《自己动手写 AI Agent》
在线阅读 · [inferloop.dev/ling-agent](https://inferloop.dev/ling-agent) 所有书目 · [inferloop.dev](https://inferloop.dev)
**从 Claude Code 开源架构到你的第一个编程助手**
配套代码仓库 · 全书 11 章 + 终章 + 4 附录
Ling(灵)是什么
一个从零构建的 AI 编程助手,全书贯穿项目。读完本书,你将拥有一个能理解项目、能改代码、能接外部工具、能跑在 CI 里的 Agent。
| 项目 | 规格 |
|---|---|
| 语言 | TypeScript (Node.js) |
| LLM 支持 | 火山引擎(豆包)/ Claude / OpenAI |
| 内置工具 | 8 个(Bash、ReadFile、WriteFile、EditFile、Glob、Grep、ListFiles、AskUser) |
| 核心代码 | ~1800 行(不含依赖) |
| 协议 | MCP (Model Context Protocol) |
| 运行模式 | 交互式 CLI / 非交互(CI/CD) / Print 模式 |
快速开始
# 1. 克隆仓库
git clone https://github.com/diguike/book-ling-agent.git
cd book-ling-agent
# 2. 配置环境变量(火山引擎免费额度够跑完全书)
export ARK_API_KEY="your-api-key"
# 3. 运行第一章的 50 行 Agent
cd code/ch01
npm install
npx tsx ling.ts "分析一下当前目录的文件结构"
跑完这三步你就有了一个能对话、能调用工具的 Agent。接下来跟着书一章一章加功能。
目录结构
ling-agent/
├── book/ # 书稿(Markdown)
│ ├── 00-preface/ # 前言 · 先看最终效果
│ ├── 01-first-agent/ # 第 1 章
│ ├── 02-multi-provider/ # 第 2 章
│ ├── 03-tool-system/ # 第 3 章
│ ├── 04-context-engineering/ # 第 4 章
│ ├── 05-permission-security/ # 第 5 章
│ ├── 06-streaming/ # 第 6 章
│ ├── 07-session-memory/ # 第 7 章
│ ├── 08-hooks/ # 第 8 章
│ ├── 09-mcp/ # 第 9 章
│ ├── 09-multi-agent/ # 第 10 章
│ ├── 10-production/ # 第 11 章
│ ├── 11-finale/ # 终章
│ └── appendix/ # 4 篇附录
├── code/ # 配套代码(递进式,每章包含前章 + 新增)
│ ├── ch01/ # 50 行最小 Agent
│ ├── ch02/ # + 多模型适配
│ ├── ch03/ # + 工具系统
│ ├── ch04/ # + 上下文工程
│ ├── ch05/ # + 权限与安全
│ ├── ch06/ # + 流式交互
│ ├── ch07/ # + 会话与记忆
│ ├── ch08/ # + Hook 系统
│ ├── ch09/
Related Skills
OpenCode Most
Use any OpenCode Zen model (Muse Spark, Big Pickle, Ling, MiMo, Nemotron...) from Claude Code or any OpenAI cl
Harness Engineering Orange Book
Harness Engineering · 橙皮书系列 · AI Agent 缰绳工程学实战指南
Openclaw Orange Book
OpenClaw: The Complete Guide · 橙皮书系列 · 开源AI Agent框架实战指南
Cove Book Forge MCP
Turn PDF and EPUB books into cached AI analysis, Obsidian notes, and installable Codex/Claude Agent Skills thr
Book Learning Tutor
授业 · Book Learning Tutor — Turn any book on your drive into a personal AI tutor (Agent Skill)
Crisp Reading
AI reading companion — turn any book into understanding. Fuses 6 reading methodologies into interactive HTML r
Related Agents
Book Genesis Auditor
Read-only structural auditor for the book-genesis skill. Audits a full manuscript against its outline and cont
Book Disruptor
Chaos agent for the book pipeline. Runs between Writer and Evaluator to break predictability, insert human noi
Epub Chapter Extractor
Extracts a single chapter from an EPUB book using the ebook-mcp server and saves it to a markdown file. Call o