Skip to content
Merged
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
2 changes: 1 addition & 1 deletion docs/conversation/the-loop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Claude Code 不一样:你说一个需求,它可能连续执行十几步操

这背后的机制叫做 **Agentic Loop**(智能体循环),核心实现在 `src/query.ts` 的 `queryLoop()` 异步生成器函数(第 241 行)。它是一个 `while(true)` 无限循环,每次迭代代表一次"思考→行动→观察"周期。

> 图示:[`Agentic Loop 循环图(PNG)`](/docs/images/agentic-loop.png)
> 图示:[`Agentic Loop 循环图(PNG)`](../../images/agentic-loop.png)

## 循环的完整结构

Expand Down
8 changes: 4 additions & 4 deletions docs/internals/three-tier-gating.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ keywords: ["门禁系统", "功能门控", "feature flag", "灰度发布", "可
后续四篇文章将分别深入每一层门禁的细节:

<CardGroup cols={2}>
<Card title="88 面旗帜" icon="flag" href="/docs/internals/feature-flags">
<Card title="88 面旗帜" icon="flag" href="../feature-flags">
构建时 Feature Flags 的完整分类与解读
</Card>
<Card title="千面千人" icon="flask" href="/docs/internals/growthbook-ab-testing">
<Card title="千面千人" icon="flask" href="../growthbook-ab-testing">
GrowthBook A/B 测试体系的运作机制
</Card>
<Card title="未公开功能巡礼" icon="eye" href="/docs/internals/hidden-features">
<Card title="未公开功能巡礼" icon="eye" href="../hidden-features">
KAIROS、PROACTIVE 等 8 大隐藏功能深度解析
</Card>
<Card title="Ant 的特权世界" icon="shield" href="/docs/internals/ant-only-world">
<Card title="Ant 的特权世界" icon="shield" href="../ant-only-world">
Anthropic 员工专属的工具、命令与 API
</Card>
</CardGroup>
4 changes: 2 additions & 2 deletions docs/introduction/architecture-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords: ["Claude Code 架构", "五层架构", "QueryEngine", "Agentic Loop",

Claude Code 从上到下分为五个层次,每一层职责清晰、边界分明:

> 图示:[`Claude Code 五层架构图(PNG)`](/docs/images/architecture-layers.png)
> 图示:[`Claude Code 五层架构图(PNG)`](../../images/architecture-layers.png)

| 层次 | 职责 | 入口源码 | 关键词 |
|------|------|---------|--------|
Expand All @@ -22,7 +22,7 @@ Claude Code 从上到下分为五个层次,每一层职责清晰、边界分

## 一条主数据流的源码追踪

> 图示:[`Claude Code 核心数据流图(PNG)`](/docs/images/data-flow.png)
> 图示:[`Claude Code 核心数据流图(PNG)`](../../images/data-flow.png)

整个系统的运转可以浓缩为一条核心数据流,以下是每一步对应的源码路径:

Expand Down
10 changes: 5 additions & 5 deletions docs/research/project-capability-atlas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ keywords: ["Claude Code", "reverse engineering", "能力图谱", "skills", "MCP"

## 核心图谱区

> 图示:[`Claude Code 能力全景图(SVG)`](/docs/images/research/capability-overview.svg)
> 图示:[`Claude Code 能力全景图(SVG)`](../../images/research/capability-overview.svg)

```mermaid
flowchart LR
Expand All @@ -48,7 +48,7 @@ flowchart LR

## 模块地图区

> 图示:[`Claude Code 能力矩阵图(SVG)`](/docs/images/research/capability-matrix.svg)
> 图示:[`Claude Code 能力矩阵图(SVG)`](../../images/research/capability-matrix.svg)

```mermaid
flowchart TD
Expand Down Expand Up @@ -99,7 +99,7 @@ flowchart TD

## 社区核验区

> 图示:[`Claude Code 社区观点核验图(SVG)`](/docs/images/research/community-verdicts.svg)
> 图示:[`Claude Code 社区观点核验图(SVG)`](../../images/research/community-verdicts.svg)

| 社区共识 | Verdict | 当前仓库里的证据 |
|---|---|---|
Expand All @@ -118,10 +118,10 @@ flowchart TD
<Card title="最佳阅读顺序" icon="route">
建议按 `cli.tsx -> main.tsx -> query.ts -> QueryEngine.ts -> tools.ts -> commands.ts -> loadSkillsDir.ts -> mcp/client.ts -> AppStateStore.ts -> REPL.tsx` 进入。
</Card>
<Card title="延伸:对话循环" icon="arrows-rotate" href="/docs/conversation/the-loop">
<Card title="延伸:对话循环" icon="arrows-rotate" href="../../conversation/the-loop">
继续看 `query.ts` 的 agentic loop 状态机。
</Card>
<Card title="延伸:三层门禁" icon="shield" href="/docs/internals/three-tier-gating">
<Card title="延伸:三层门禁" icon="shield" href="../../internals/three-tier-gating">
继续看 feature gate、GrowthBook 与 ant-only 的层次关系。
</Card>
</CardGroup>
Expand Down
16 changes: 16 additions & 0 deletions scripts/docs-static-compat.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,20 @@ describe('docs static export compatibility', () => {

expect(offenders).toEqual([]);
});

it('avoids root-relative /docs links inside MDX content', async () => {
const files = await listMdxFiles(join(process.cwd(), 'docs'));
const offenders = [];
const rootRelativeDocsPattern = /(\]\(\/docs\/|href="\/docs\/|src="\/docs\/)/;

for (const file of files) {
const content = await readFile(file, 'utf8');

if (rootRelativeDocsPattern.test(content)) {
offenders.push(file);
}
}

expect(offenders).toEqual([]);
});
});
Loading