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
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
Claude Code From Scratch
Build an AI Coding Agent from Scratch — Learning Context Engineering Step by Step. Companion code for the book
Book Memex
Powerful eBook metadata management tool with SQLite backend, AI-powered enrichment, web interface, and compreh
Skill Book Mind
🤖 一句话快速高效的生成书籍思维导图, AI Skill:支持 PDF / EPUB 等格式自动解析,整书建索引 + 提问式检索定位 + 一键提取「章→节→子节→核心要点」四层大纲,直接导入 XMind / MindM
Related Agents
Book Disruptor
Chaos agent for the book pipeline. Runs between Writer and Evaluator to break predictability, insert human noi
Blair Market Strategist
Use when preparing book proposal materials, title/subtitle options, comp-title logic, sample-chapter strategy,
Book Chapter Writer
AI 교육 책 챕터 집필 전문가. 기존 교육 자료를 독자 친화적이고 흥미로운 책 형식으로 재구성. '챕터 집필', '책 집필' 요청 시 사용.