Skip to content

Commit 927fa5d

Browse files
committed
docs: add AI guide
1 parent 2256830 commit 927fa5d

6 files changed

Lines changed: 184 additions & 36 deletions

File tree

‎website/docs/en/guide/_meta.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"name": "configuration",
1414
"label": "Configuration"
1515
},
16+
{
17+
"type": "file",
18+
"name": "ai",
19+
"label": "AI"
20+
},
1621
{
1722
"type": "file",
1823
"name": "api-reference",

‎website/docs/en/guide/ai.mdx‎

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
description: 'Use Rstack CLI with coding agents through Agent Skills, llms.txt, Markdown docs, and AGENTS.md.'
3+
---
4+
5+
import { PackageManagerTabs } from '@rspress/core/theme';
6+
7+
# AI
8+
9+
To help coding agents understand Rstack CLI commands, configuration, and best practices, Rstack CLI provides the following resources:
10+
11+
- [AGENTS.md](#agentsmd)
12+
- [Agent Skills](#agent-skills)
13+
- [llms.txt](#llmstxt)
14+
- [Markdown docs](#markdown-docs)
15+
16+
## AGENTS.md
17+
18+
Projects created with [create-rstack](https://www.npmjs.com/package/create-rstack) include an [`AGENTS.md`](https://agents.md/) file that gives coding agents the key context for working with Rstack CLI.
19+
20+
You can also copy the following content into your own `AGENTS.md`:
21+
22+
```markdown wrapCode title="AGENTS.md"
23+
This project uses Rstack CLI as its JavaScript toolchain.
24+
25+
- Before working with `rs` commands, `rstack.config.*` files, or imports from `rstack`, start with `node_modules/rstack/dist/docs/llms.txt`, then read only the linked pages relevant to the task.
26+
- For command details, use `rs -h` or `rs <command> -h`.
27+
- If the local documentation is unavailable, use https://rstack.rs/llms.txt and `rs <command> -h`.
28+
```
29+
30+
This content serves a similar purpose to the [rstack-cli-best-practices](#rstack-cli-best-practices) Skill, helping coding agents use Rstack CLI and find relevant documentation. Add it to `AGENTS.md` or install the Skill; either is sufficient.
31+
32+
## Agent Skills
33+
34+
Rstack CLI provides domain-specific Agent Skills that help coding agents give more accurate guidance and perform relevant tasks.
35+
36+
### rstack-cli-best-practices
37+
38+
The [rstack-cli-best-practices](https://github.com/rstackjs/rstack-cli/tree/main/.agents/skills/rstack-cli-best-practices) Skill provides guidance and best practices for using Rstack CLI.
39+
40+
Install it with the [skills](https://www.npmjs.com/package/skills) package:
41+
42+
<PackageManagerTabs
43+
command="skills add rstackjs/rstack-cli --skill rstack-cli-best-practices"
44+
dlx
45+
/>
46+
47+
### migrate-to-rstack-cli
48+
49+
The [migrate-to-rstack-cli](https://github.com/rstackjs/rstack-cli/tree/main/.agents/skills/migrate-to-rstack-cli) Skill migrates projects from standalone Rstack tools and related development tools to Rstack CLI.
50+
51+
To migrate an existing project, install the Skill:
52+
53+
<PackageManagerTabs command="skills add rstackjs/rstack-cli --skill migrate-to-rstack-cli" dlx />
54+
55+
For supported tools and migration instructions, see [Migrate to Rstack CLI](./migration).
56+
57+
## llms.txt
58+
59+
[llms.txt](https://llmstxt.org/) is a standard that helps LLMs discover and use project documentation. The Rstack CLI documentation site provides the following files:
60+
61+
- [llms.txt](https://rstack.rs/llms.txt): A structured index containing the title, link, and description of each documentation page.
62+
63+
```text
64+
https://rstack.rs/llms.txt
65+
```
66+
67+
- [llms-full.txt](https://rstack.rs/llms-full.txt): A single file containing the full content of all documentation pages.
68+
69+
```text
70+
https://rstack.rs/llms-full.txt
71+
```
72+
73+
Use `llms.txt` when the agent can follow links and load only the pages relevant to a task. Use `llms-full.txt` when the agent needs the complete documentation in one context and the larger token cost is acceptable.
74+
75+
## Markdown docs
76+
77+
Every Rstack CLI documentation page has a corresponding `.md` plain-text version that can be provided directly to an agent. On any documentation page, use “Copy Markdown” or “Copy Markdown Link” under the title to copy its content or URL.
78+
79+
```text
80+
https://rstack.rs/guide/quick-start.md
81+
```

‎website/docs/en/guide/quick-start.mdx‎

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
description: 'Install Rstack CLI, add project scripts, and configure the Rstack JavaScript toolchain.'
3+
---
4+
15
# Quick start
26

37
import { PackageManagerTabs } from '@rspress/core/theme';
@@ -88,22 +92,6 @@ define.lint({
8892

8993
See [Configuration](./configuration) for all available configuration APIs.
9094

91-
## Skills
92-
93-
### Best practice
94-
95-
Install the Rstack CLI skill so the agent can understand how to use it:
96-
97-
```bash
98-
npx skills add rstackjs/rstack-cli --skill rstack-cli-best-practices
99-
```
100-
101-
### Migration
102-
103-
Install the migration skill so the agent can migrate existing projects to Rstack CLI:
104-
105-
```bash
106-
npx skills add rstackjs/rstack-cli --skill migrate-to-rstack-cli
107-
```
95+
## AI
10896

109-
For supported tools and migration instructions, see [Migrate to Rstack CLI](./migration).
97+
To learn how to use Rstack CLI with coding agents, see the [AI guide](./ai).

‎website/docs/zh/guide/_meta.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"name": "configuration",
1414
"label": "配置"
1515
},
16+
{
17+
"type": "file",
18+
"name": "ai",
19+
"label": "AI"
20+
},
1621
{
1722
"type": "file",
1823
"name": "api-reference",

‎website/docs/zh/guide/ai.mdx‎

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
description: '通过 Agent Skills、llms.txt、Markdown 文档和 AGENTS.md,配合 Coding Agent 使用 Rstack CLI。'
3+
---
4+
5+
import { PackageManagerTabs } from '@rspress/core/theme';
6+
7+
# AI
8+
9+
为了帮助 Coding Agent 理解 Rstack CLI 的命令、配置和最佳实践,Rstack CLI 提供了以下资源:
10+
11+
- [AGENTS.md](#agentsmd)
12+
- [Agent Skills](#agent-skills)
13+
- [llms.txt](#llmstxt)
14+
- [Markdown 文档](#markdown-docs)
15+
16+
## AGENTS.md
17+
18+
使用 [create-rstack](https://www.npmjs.com/package/create-rstack) 创建的项目会包含一个遵循 [`AGENTS.md`](https://agents.md/) 规范的文件,为 Coding Agent 提供使用 Rstack CLI 所需的关键上下文。
19+
20+
你也可以将以下内容复制到自己的 `AGENTS.md` 中:
21+
22+
```markdown wrapCode title="AGENTS.md"
23+
This project uses Rstack CLI as its JavaScript toolchain.
24+
25+
- Before working with `rs` commands, `rstack.config.*` files, or imports from `rstack`, start with `node_modules/rstack/dist/docs/llms.txt`, then read only the linked pages relevant to the task.
26+
- For command details, use `rs -h` or `rs <command> -h`.
27+
- If the local documentation is unavailable, use https://rstack.rs/llms.txt and `rs <command> -h`.
28+
```
29+
30+
这段内容与 [rstack-cli-best-practices](#rstack-cli-best-practices) Skill 作用相似,都能指导 Coding Agent 使用 Rstack CLI 并查找相关文档。将其添加到 `AGENTS.md` 或安装该 Skill,任选其一即可。
31+
32+
## Agent Skills
33+
34+
Rstack CLI 提供面向特定领域的 Agent Skills,帮助 Coding Agent 更准确地提供建议并执行相关任务。
35+
36+
### rstack-cli-best-practices
37+
38+
[rstack-cli-best-practices](https://github.com/rstackjs/rstack-cli/tree/main/.agents/skills/rstack-cli-best-practices) Skill 提供 Rstack CLI 的使用指南和最佳实践。
39+
40+
使用 [skills](https://www.npmjs.com/package/skills) 包安装该 Skill:
41+
42+
<PackageManagerTabs
43+
command="skills add rstackjs/rstack-cli --skill rstack-cli-best-practices"
44+
dlx
45+
/>
46+
47+
### migrate-to-rstack-cli
48+
49+
[migrate-to-rstack-cli](https://github.com/rstackjs/rstack-cli/tree/main/.agents/skills/migrate-to-rstack-cli) Skill 可以将使用独立 Rstack 工具及相关开发工具的项目迁移到 Rstack CLI。
50+
51+
迁移现有项目时,安装该 Skill:
52+
53+
<PackageManagerTabs command="skills add rstackjs/rstack-cli --skill migrate-to-rstack-cli" dlx />
54+
55+
支持的工具和迁移说明请参阅[迁移到 Rstack CLI](./migration)。
56+
57+
## llms.txt
58+
59+
[llms.txt](https://llmstxt.org/) 是一种帮助 LLM 发现和使用项目文档的标准规范。Rstack CLI 文档站提供了以下文件:
60+
61+
- [llms.txt](https://rstack.rs/zh/llms.txt):结构化索引文件,包含每篇文档的标题、链接和描述。
62+
63+
```text
64+
https://rstack.rs/zh/llms.txt
65+
```
66+
67+
- [llms-full.txt](https://rstack.rs/zh/llms-full.txt):包含所有文档完整内容的单个文件。
68+
69+
```text
70+
https://rstack.rs/zh/llms-full.txt
71+
```
72+
73+
当 Agent 可以按需跟随链接并只加载与任务相关的页面时,使用 `llms.txt`。当 Agent 需要在同一上下文中读取完整文档,并且可以接受更多 token 消耗时,使用 `llms-full.txt`。
74+
75+
## Markdown 文档 \{#markdown-docs}
76+
77+
Rstack CLI 的每篇文档都有对应的 `.md` 纯文本版本,可以直接提供给 Agent。在任意文档页面的标题下方使用「复制 Markdown」或「复制 Markdown 链接」,即可复制文档内容或 URL。
78+
79+
```text
80+
https://rstack.rs/zh/guide/quick-start.md
81+
```

‎website/docs/zh/guide/quick-start.mdx‎

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
description: '安装 Rstack CLI、添加项目脚本,并配置 Rstack JavaScript 工具链。'
3+
---
4+
15
# 快速上手 \{#quick-start}
26

37
import { PackageManagerTabs } from '@rspress/core/theme';
@@ -88,22 +92,6 @@ define.lint({
8892

8993
所有可用的配置 API 请参见[配置](./configuration)。
9094

91-
## Skills \{#skills}
92-
93-
### 最佳实践 \{#best-practice}
94-
95-
安装 Rstack CLI Skill,使 Agent 能够了解如何使用 Rstack CLI:
96-
97-
```bash
98-
npx skills add rstackjs/rstack-cli --skill rstack-cli-best-practices
99-
```
100-
101-
### 迁移 \{#migration}
102-
103-
安装迁移 Skill,使 Agent 能够将现有项目迁移到 Rstack CLI:
104-
105-
```bash
106-
npx skills add rstackjs/rstack-cli --skill migrate-to-rstack-cli
107-
```
95+
## AI
10896

109-
支持的工具和迁移说明请参阅[迁移到 Rstack CLI](./migration)。
97+
如需了解如何配合 Coding Agent 使用 Rstack CLI,请参阅 [AI 指南](./ai)。

0 commit comments

Comments
 (0)