Skip to content

Commit 072e5bc

Browse files
committed
fix: unify anchor IDs between VitePress and GitHub with custom slugify
Add GitHub-compatible slugify (github-slugger algorithm) to VitePress config so heading anchor IDs are consistent across both platforms. Update all inline anchor links in 22 doc files accordingly.
1 parent 755804f commit 072e5bc

23 files changed

+72
-52
lines changed

docs/.vitepress/config.mts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
import { defineConfig } from 'vitepress'
22

3+
// GitHub-compatible slugify (matches github-slugger algorithm)
4+
// Makes heading anchor IDs consistent between VitePress and GitHub rendering
5+
function slugify(str: string): string {
6+
return str
7+
.replace(/<[^>]*>/g, '')
8+
.replace(/&lt;/g, '<')
9+
.replace(/&gt;/g, '>')
10+
.replace(/&amp;/g, '&')
11+
.trim()
12+
.toLowerCase()
13+
.replace(/[^\p{L}\p{M}\p{N}\p{Pc}\- ]/gu, '')
14+
.replace(/ /g, '-')
15+
}
16+
317
const zhSidebar = [
418
{
519
text: '快速开始',
@@ -136,6 +150,12 @@ export default defineConfig({
136150
lastUpdated: true,
137151
base: '/',
138152

153+
markdown: {
154+
anchor: {
155+
slugify,
156+
},
157+
},
158+
139159
head: [
140160
['script', { async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-D42DM82263' }],
141161
['script', {}, `window.dataLayer = window.dataLayer || [];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js', new Date());\ngtag('config', 'G-D42DM82263');`],

docs/agent/01-usage-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> 让 Claude Code 同时调度多个专业代理,并行处理复杂任务。
44
55
<p align="center">
6-
<a href="#一、什么是多-agent-系统">多 Agent 系统</a> · <a href="#二、六种内置-agent">六种内置 Agent</a> · <a href="#三、如何生成-agent">如何生成 Agent</a> · <a href="#四、后台任务管理">后台任务管理</a> · <a href="#五、agent-teams--多代理协作">Agent Teams</a> · <a href="#六、自定义-agent">自定义 Agent</a> · <a href="#七、权限模式">权限模式</a> · <a href="#八、快速参考">快速参考</a>
6+
<a href="#一什么是多-agent-系统">多 Agent 系统</a> · <a href="#二六种内置-agent">六种内置 Agent</a> · <a href="#三如何生成-agent">如何生成 Agent</a> · <a href="#四后台任务管理">后台任务管理</a> · <a href="#五agent-teams--多代理协作">Agent Teams</a> · <a href="#六自定义-agent">自定义 Agent</a> · <a href="#七权限模式">权限模式</a> · <a href="#八快速参考">快速参考</a>
77
</p>
88

99
![多 Agent 系统概览](./images/01-agent-overview.png)

docs/agent/02-implementation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> 深入剖析多 Agent 编排的架构设计、生成流程、上下文传递和协作机制。
44
55
<p align="center">
6-
<a href="#一、架构总览">架构总览</a> · <a href="#二、agent-生成流程--四条路径">生成流程</a> · <a href="#三、工具池系统-—-三层过滤">工具池系统</a> · <a href="#四、上下文传递机制">上下文传递</a> · <a href="#五、agent-teams-内部机制">Teams 内部机制</a> · <a href="#六、后台任务引擎">后台任务引擎</a> · <a href="#七、dreamtask-—-自动记忆整合">DreamTask</a> · <a href="#八、worktree-隔离实现">Worktree 隔离</a> · <a href="#九、权限同步机制">权限同步</a> · <a href="#十、agent-生命周期完整数据流">生命周期数据流</a> · <a href="#十一、关键源文件索引">源文件索引</a> · <a href="#十二、feature-flags">Feature Flags</a>
6+
<a href="#一架构总览">架构总览</a> · <a href="#二agent-生成流程--四条路径">生成流程</a> · <a href="#三工具池系统--三层过滤">工具池系统</a> · <a href="#四上下文传递机制">上下文传递</a> · <a href="#五agent-teams-内部机制">Teams 内部机制</a> · <a href="#六后台任务引擎">后台任务引擎</a> · <a href="#七dreamtask--自动记忆整合">DreamTask</a> · <a href="#八worktree-隔离实现">Worktree 隔离</a> · <a href="#九权限同步机制">权限同步</a> · <a href="#十agent-生命周期完整数据流">生命周期数据流</a> · <a href="#十一关键源文件索引">源文件索引</a> · <a href="#十二feature-flags">Feature Flags</a>
77
</p>
88

99
![实现架构总览](./images/05-architecture.png)

docs/agent/03-agent-framework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> 从源码视角剖析全球最流行 AI Code Editor 背后的 Agent 架构设计哲学。
44
55
<p align="center">
6-
<a href="#一、核心-agent-循环">核心循环</a> · <a href="#二、系统提示词工程">提示词工程</a> · <a href="#三、工具系统设计">工具系统</a> · <a href="#四、上下文管理与压缩">上下文管理</a> · <a href="#五、技能与插件生态">技能与插件</a> · <a href="#六、权限与安全体系">权限与安全</a> · <a href="#七、故障恢复机制">故障恢复</a> · <a href="#八、与-langchain-react-的本质区别">对比分析</a> · <a href="#九、为什么-claude-code-能做到这么好">成功之道</a>
6+
<a href="#一核心-agent-循环">核心循环</a> · <a href="#二系统提示词工程">提示词工程</a> · <a href="#三工具系统设计">工具系统</a> · <a href="#四上下文管理与压缩">上下文管理</a> · <a href="#五技能与插件生态">技能与插件</a> · <a href="#六权限与安全体系">权限与安全</a> · <a href="#七故障恢复机制">故障恢复</a> · <a href="#八与-langchain-react-的本质区别">对比分析</a> · <a href="#九为什么-claude-code-能做到这么好">成功之道</a>
77
</p>
88

99
![Agent 框架架构总览](./images/11-agent-framework-overview.png)

docs/channel/01-channel-system.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
> 从源码视角深度剖析 Claude Code 如何通过 IM 平台远程控制 Agent
44
55
<p align="center">
6-
<a href="#一、什么是-channel">概念</a> ·
7-
<a href="#二、整体架构">架构</a> ·
8-
<a href="#三、消息协议">协议</a> ·
9-
<a href="#四、六层访问控制">访问控制</a> ·
10-
<a href="#五、权限中继系统">权限中继</a> ·
11-
<a href="#六、ui-组件">UI</a> ·
12-
<a href="#七、插件-channel-架构">插件</a> ·
13-
<a href="#八、安全设计">安全</a> ·
14-
<a href="#九、命令行接口">CLI</a> ·
15-
<a href="#十、特性开关与分析">特性开关</a>
6+
<a href="#一什么是-channel">概念</a> ·
7+
<a href="#二整体架构">架构</a> ·
8+
<a href="#三消息协议">协议</a> ·
9+
<a href="#四六层访问控制">访问控制</a> ·
10+
<a href="#五权限中继系统">权限中继</a> ·
11+
<a href="#六ui-组件">UI</a> ·
12+
<a href="#七插件-channel-架构">插件</a> ·
13+
<a href="#八安全设计">安全</a> ·
14+
<a href="#九命令行接口">CLI</a> ·
15+
<a href="#十特性开关与分析">特性开关</a>
1616
</p>
1717

1818
![Channel System Overview](./images/01-channel-overview.png)

docs/channel/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
### 插件开发者
4848

49-
1. 阅读架构解析中的 [插件架构](./01-channel-system.md#七、插件-channel-架构) 章节
49+
1. 阅读架构解析中的 [插件架构](./01-channel-system.md#七插件-channel-架构) 章节
5050
2. 了解 `plugin.json` 中 Channel 声明格式
5151
3. 实现 MCP Server 的 `notifications/claude/channel` 协议
5252
4. 查看源码位置:

docs/en/agent/01-usage-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> Let Claude Code orchestrate multiple specialized agents to handle complex tasks in parallel.
44
55
<p align="center">
6-
<a href="#_1-what-is-the-multi-agent-system">Multi-Agent System</a> · <a href="#_2-six-built-in-agents">Six Built-in Agents</a> · <a href="#_3-how-to-spawn-agents">Spawning Agents</a> · <a href="#_4-background-task-management">Background Tasks</a> · <a href="#_5-agent-teams--multi-agent-collaboration">Agent Teams</a> · <a href="#_6-custom-agents">Custom Agents</a> · <a href="#_7-permission-modes">Permission Modes</a> · <a href="#_8-quick-reference">Quick Reference</a>
6+
<a href="#1-what-is-the-multi-agent-system">Multi-Agent System</a> · <a href="#2-six-built-in-agents">Six Built-in Agents</a> · <a href="#3-how-to-spawn-agents">Spawning Agents</a> · <a href="#4-background-task-management">Background Tasks</a> · <a href="#5-agent-teams--multi-agent-collaboration">Agent Teams</a> · <a href="#6-custom-agents">Custom Agents</a> · <a href="#7-permission-modes">Permission Modes</a> · <a href="#8-quick-reference">Quick Reference</a>
77
</p>
88

99
![Multi-Agent System Overview](./images/01-agent-overview.png)

docs/en/agent/02-implementation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> A deep dive into the architecture, spawn flow, context passing, and collaboration mechanisms of multi-agent orchestration.
44
55
<p align="center">
6-
<a href="#_1-architecture-overview">Architecture</a> · <a href="#_2-agent-spawn-flow--four-paths">Spawn Flow</a> · <a href="#_3-tool-pool-system--three-layer-filtering">Tool Pool</a> · <a href="#_4-context-passing-mechanism">Context Passing</a> · <a href="#_5-agent-teams-internals">Teams Internals</a> · <a href="#_6-background-task-engine">Task Engine</a> · <a href="#_7-dreamtask--automatic-memory-consolidation">DreamTask</a> · <a href="#_8-worktree-isolation-implementation">Worktree Isolation</a> · <a href="#_9-permission-synchronization">Permission Sync</a> · <a href="#_10-agent-lifecycle-end-to-end-data-flow">Lifecycle Data Flow</a> · <a href="#_11-key-source-file-index">Source Index</a> · <a href="#_12-feature-flags">Feature Flags</a>
6+
<a href="#1-architecture-overview">Architecture</a> · <a href="#2-agent-spawn-flow--four-paths">Spawn Flow</a> · <a href="#3-tool-pool-system--three-layer-filtering">Tool Pool</a> · <a href="#4-context-passing-mechanism">Context Passing</a> · <a href="#5-agent-teams-internals">Teams Internals</a> · <a href="#6-background-task-engine">Task Engine</a> · <a href="#7-dreamtask--automatic-memory-consolidation">DreamTask</a> · <a href="#8-worktree-isolation-implementation">Worktree Isolation</a> · <a href="#9-permission-synchronization">Permission Sync</a> · <a href="#10-agent-lifecycle-end-to-end-data-flow">Lifecycle Data Flow</a> · <a href="#11-key-source-file-index">Source Index</a> · <a href="#12-feature-flags">Feature Flags</a>
77
</p>
88

99
![Implementation Architecture Overview](./images/05-architecture.png)

docs/en/agent/03-agent-framework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> Deconstructing the architecture behind the world's most popular AI code editor — from source code to design philosophy.
44
55
<p align="center">
6-
<a href="#_1-the-core-agent-loop">Core Loop</a> · <a href="#_2-system-prompt-engineering">Prompt Engineering</a> · <a href="#_3-tool-system-design">Tool System</a> · <a href="#_4-context-management-compression">Context Management</a> · <a href="#_5-skills-plugin-ecosystem">Skills & Plugins</a> · <a href="#_6-permission-security-model">Permissions</a> · <a href="#_7-fault-recovery-mechanisms">Recovery</a> · <a href="#_8-how-it-differs-from-langchain-react">vs LangChain</a> · <a href="#_9-why-claude-code-is-so-good">Why It Works</a>
6+
<a href="#1-the-core-agent-loop">Core Loop</a> · <a href="#2-system-prompt-engineering">Prompt Engineering</a> · <a href="#3-tool-system-design">Tool System</a> · <a href="#4-context-management-compression">Context Management</a> · <a href="#5-skills-plugin-ecosystem">Skills & Plugins</a> · <a href="#6-permission-security-model">Permissions</a> · <a href="#7-fault-recovery-mechanisms">Recovery</a> · <a href="#8-how-it-differs-from-langchain-react">vs LangChain</a> · <a href="#9-why-claude-code-is-so-good">Why It Works</a>
77
</p>
88

99
![Agent Framework Architecture Overview](./images/11-agent-framework-overview.png)

docs/en/channel/01-channel-system.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
> A deep dive into how Claude Code enables remote Agent control via IM platforms
44
55
<p align="center">
6-
<a href="#_1-what-is-a-channel">Concepts</a> ·
7-
<a href="#_2-architecture-overview">Architecture</a> ·
8-
<a href="#_3-message-protocol">Protocol</a> ·
9-
<a href="#_4-six-layer-access-control">Access Control</a> ·
10-
<a href="#_5-permission-relay-system">Permission Relay</a> ·
11-
<a href="#_6-ui-components">UI</a> ·
12-
<a href="#_7-plugin-channel-architecture">Plugins</a> ·
13-
<a href="#_8-security-design">Security</a> ·
14-
<a href="#_9-command-line-interface">CLI</a> ·
15-
<a href="#_10-feature-flags-and-analytics">Feature Flags</a>
6+
<a href="#1-what-is-a-channel">Concepts</a> ·
7+
<a href="#2-architecture-overview">Architecture</a> ·
8+
<a href="#3-message-protocol">Protocol</a> ·
9+
<a href="#4-six-layer-access-control">Access Control</a> ·
10+
<a href="#5-permission-relay-system">Permission Relay</a> ·
11+
<a href="#6-ui-components">UI</a> ·
12+
<a href="#7-plugin-channel-architecture">Plugins</a> ·
13+
<a href="#8-security-design">Security</a> ·
14+
<a href="#9-command-line-interface">CLI</a> ·
15+
<a href="#10-feature-flags-and-analytics">Feature Flags</a>
1616
</p>
1717

1818
![Channel System Overview](./images/01-channel-overview.png)

0 commit comments

Comments
 (0)