|
| 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 | +``` |
0 commit comments