Skip to content
Open

111 #11

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install Dependencies
run: npm ci

- name: Build Site
env:
VITE_BASE_PATH: /${{ github.event.repository.name }}/
run: npm run build

- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.DS_Store
node_modules/
dist/
83 changes: 61 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,11 @@

# 解码 Agent Harness

### Claude Code 架构深度剖析

**不做使用教程,不列 Prompt 技巧——拆解 Agent 的骨架与神经。**

[![Stars](https://img.shields.io/github/stars/lintsinghua/claude-code-book?style=social)](https://github.com/lintsinghua/claude-code-book/stargazers)
[![Website](https://img.shields.io/website?url=https%3A%2F%2Flintsinghua.github.io&label=在线阅读)](https://lintsinghua.github.io/)
[![License](https://img.shields.io/badge/license-CC%20BY--NC--SA%204.0-lightgrey)](LICENSE)
[![Chapters](https://img.shields.io/badge/章节-15-blue)]()
[![Language](https://img.shields.io/badge/语言-中文-informational)]()

### [在线阅读 →](https://lintsinghua.github.io/)
### [在线阅读 →](https://gugugugun.github.io/claude-code-book)

</div>

<img width="2880" height="1558" alt="image" src="https://github.com/user-attachments/assets/39efa7d4-4521-444e-a222-fd0acb756e51" />


## 这本书讲什么
Expand All @@ -30,7 +20,7 @@
> **⚠️ 声明**
> 本书基于对 Claude Code 公开文档和产品行为的架构分析编写,**未引用、未使用任何未公开或未授权的源码**。Claude Code 为 Anthropic PBC 产品,本书不隶属于、未获授权于、也不代表 Anthropic。

---
本项目基于原仓库 [lintsinghua/claude-code-book](https://github.com/lintsinghua/claude-code-book) 进行二次开发,目标是提供更友好的网页阅读体验。

## 为什么值得读

Expand Down Expand Up @@ -125,19 +115,68 @@
| 对 Agent 工程感兴趣的 **研究者** | 从实现角度理解 Agent 系统的运作方式 |
| 希望最大化利用 Claude Code 的 **实践者** | 理解设计意图,用得更准、调得更深 |

---

## 约定

- 中文写作,技术术语保留英文原文(如 *StreamingToolExecutor*、*Feature Flag*)
- 每章结构:**学习目标 → 核心概念 → 架构图 → 实战练习 → 关键要点**
- 示例代码为说明设计模式的示意代码,非产品源码

## 背景
- 章节树导航:按书籍结构展示全部章节
- Markdown 渲染:实时加载并渲染各章节内容
- 上一篇/下一篇:支持连续阅读
- 主题切换:支持明暗主题偏好
- 阅读记忆:自动记录最近阅读章节

## 项目结构

```text
.
├─ src/
│ ├─ main.js
│ ├─ style.css
│ └─ bookManifest.js
├─ 第一部分-基础篇/
├─ 第二部分-核心系统篇/
├─ 第三部分-高级模式篇/
├─ 第四部分-工程实践篇/
├─ 附录/
├─ index.html
├─ vite.config.js
└─ package.json
```

## 快速开始

2026 年 3 月 31 日,安全研究员 [Chaofan Shou (@Fried_rice)](https://x.com/Fried_rice) 发现 Anthropic 发布在 npm registry 中的 `@anthropic-ai/claude-code` 包存在构建配置失误:source map 文件引用了未设访问控制的 Cloudflare R2 存储桶。披露推文获得超 1700 万次浏览,引发了技术社区对 Agent 架构的空前讨论。Anthropic 随后修补了该配置。
### 1. 安装依赖

```bash
npm install
```

### 2. 本地开发

```bash
npm run dev
```

本书写作的初衷正是受到这场讨论的启发——当 Agent 架构成为开发者社区的热门话题,我们意识到需要一本系统性的书来讲解 Agent Harness 的设计原理。
### 3. 生产构建

```bash
npm run build
```

### 4. 本地预览构建产物

```bash
npm run preview
```

## 内容维护说明

- 书籍内容来源于仓库内各 Markdown 章节文件
- 章节目录由 `src/bookManifest.js` 统一维护
- 新增章节时,请同步更新 `src/bookManifest.js`

## 贡献

Expand All @@ -146,13 +185,13 @@
## 致谢

[Linux.Do](https://linux.do/) 社区
[lintsinghua/claude-code-book](https://github.com/lintsinghua/claude-code-book)
[![CC BY-NC-SA 4.0](https://img.shields.io/badge/license-CC%20BY--NC--SA%204.0-lightgrey)](https://creativecommons.org/licenses/by-nc-sa/4.0/)

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=lintsinghua/claude-code-book&type=Date)](https://star-history.com/#lintsinghua/claude-code-book&Date)

## License
## 友链
- 灌注L站喵,https://linux.do/

[![CC BY-NC-SA 4.0](https://img.shields.io/badge/license-CC%20BY--NC--SA%204.0-lightgrey)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
## 许可证

本书内容采用 [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) 协议发布——可自由分享和改编,但须署名、非商业使用、并以相同协议共享
书籍内容与相关版权遵循原项目及其许可证约定;如需转载或二次发布,请先阅读并遵守原仓库许可条款
15 changes: 15 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Claude Code Book 在线阅读</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;700&family=ZCOOL+XiaoWei&display=swap" rel="stylesheet" />
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
Loading