> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# AI

To help AI better understand Rstest's features, configuration, and best practices so it can provide more accurate assistance during day-to-day development and troubleshooting, Rstest provides the following capabilities:

- [Agent prompt](#agent-prompt)
- [Agent Skills](#agent-skills)
- [llms.txt](#llmstxt)
- [Markdown docs](#markdown-docs)
- [Markdown reporter](#markdown-reporter)
- [AGENTS.md](#agentsmd)

## Agent prompt

If you are using a coding agent (such as Claude Code, Cursor, Copilot, etc.), copy the prompt that matches your project. The agent will read the linked instructions and install dependencies, create configuration, and write tests based on your project type.

### Set up Rstest

Use this prompt to add Rstest to a project that doesn't have a test runner configured yet:


For your Agent

Set up Rstest

Copy this prompt and send it to your coding agent.

Copy Prompt

Set up Rstest, the JavaScript testing framework, in this project by following the instructions here:
https://rstest.rs/guide/start/agent-install.md

### Migrate from Jest, Vitest, or Playwright

Use this prompt to migrate an existing Jest, Vitest, or Playwright Test project to Rstest. Playwright Test projects migrate to `@rstest/playwright`. For convenience, the linked instructions inline the full [migrate-to-rstest](https://github.com/rstackjs/agent-skills#migrate-to-rstest) skill so nothing needs to be installed; alternatively, you can [install the skill](#agent-skills) and use it directly:


For your Agent

Migrate to Rstest

Copy this prompt and send it to your coding agent.

Copy Prompt

Migrate this project to Rstest, the JavaScript testing framework. Detect whether it uses Jest, Vitest, or Playwright Test; for Playwright Test, migrate to @rstest/playwright. Follow the instructions here:
https://rstest.rs/guide/start/agent-migrate.md

## Agent Skills

Agent Skills are domain-specific knowledge packs that can be installed into Agents, enabling them to give more accurate and professional suggestions or perform actions in specific scenarios.

In the [rstackjs/agent-skills](https://github.com/rstackjs/agent-skills) repository, there are many skills for the Rstack ecosystem. The skills related to Rstest include:

- [migrate-to-rstest](https://github.com/rstackjs/agent-skills#migrate-to-rstest): Migrate Jest, Vitest, or Playwright Test projects to Rstest, using `@rstest/playwright` for Playwright E2E tests.
- [rstest-best-practices](https://github.com/rstackjs/agent-skills#rstest-best-practices): Share best practices for using Rstest.
- [rstest-debugging](https://github.com/rstackjs/agent-skills#rstest-debugging): Debug Rstest issues systematically, including performance regressions. Use it when Rstest is slower than expected, slower than Jest or Vitest, or when you need to determine whether the bottleneck is in build startup or test execution before trying config or code changes.

In Coding Agents that support skills, you can use the [skills](https://www.npmjs.com/package/skills) package to install a specific skill with the following command:


```sh [npx]
npx skills add rstackjs/agent-skills --skill migrate-to-rstest
```

```sh [yarn]
yarn dlx skills add rstackjs/agent-skills --skill migrate-to-rstest
```

```sh [pnpm]
pnpm dlx skills add rstackjs/agent-skills --skill migrate-to-rstest
```

```sh [bunx]
bunx skills add rstackjs/agent-skills --skill migrate-to-rstest
```

```sh [deno]
deno run -A npm:skills add rstackjs/agent-skills --skill migrate-to-rstest
```

After installation, simply use natural language prompts to trigger the skill, for example:

```
Help me migrate this Playwright Test project to @rstest/playwright
```

## llms.txt

[llms.txt](https://llmstxt.org/) is a standard that helps LLMs discover and use project documentation. Rstest follows this standard and publishes the following two files:

- [llms.txt](https://rstest.rs/llms.txt): A structured index file containing the titles, links, and brief descriptions of all documentation pages.

```
https://rstest.rs/llms.txt
```

- [llms-full.txt](https://rstest.rs/llms-full.txt): A full-content file that concatenates the complete content of every documentation page into a single file.

```
https://rstest.rs/llms-full.txt
```

You can choose the file that best fits your use case:

- `llms.txt` is smaller and consumes fewer tokens, making it suitable for AI to fetch specific pages on demand.
- `llms-full.txt` contains the complete documentation content, so AI doesn't need to follow individual links — ideal when you need AI to have a comprehensive understanding of Rstest, though it consumes more tokens and is best used with AI tools that support large context windows.

## Markdown docs

Every Rstest documentation page has a corresponding `.md` plain-text version that can be provided directly to AI. On any doc page, you can click “Copy Markdown” or “Copy Markdown Link” under the title to get the Markdown content or link.

```
https://rstest.rs/guide/start/index.md
```

Providing the Markdown link or content allows AI to focus on a specific chapter, which is useful for targeted troubleshooting or looking up a particular topic.

## Markdown reporter

When you want AI to directly consume test results, use the `md` reporter. It outputs a single markdown document to stdout, which is easier for LLMs to parse than colorful terminal logs. The output is also more concise, which usually reduces token usage.

In Agent environments, Rstest defaults to `md` when you didn't explicitly configure reporters.

```bash
npx rstest --reporters=md
```

You can also configure it in `rstest.config.ts` and combine it with other reporters in local or CI workflows.

```ts
import { defineConfig } from '@rstest/core';

export default defineConfig({
  reporters: ['md'],
});
```

More information about the `md` reporter can be found in [Markdown reporter](/guide/basic/reporters.md#markdown-reporter).

## AGENTS.md

You can create an `AGENTS.md` file in the root of any project that uses Rstest. This file follows the [AGENTS.md](https://agents.md/) specification and provides key project information to Agents.

Here is an example of Rstest-related content you can add to `AGENTS.md`:

```markdown wrapCode
# AGENTS.md

You are an expert in JavaScript, Rspack, Rsbuild, and Rstest. You write maintainable, performant, and accessible tests.

## Tools

### Rstest

- Run `npm run test` to run tests (`npx rstest`)
- Run `npm run test:watch` to run tests in watch mode (`npx rstest --watch`)

## Docs

- Rstest: https://rstest.rs/llms.txt
```

You can also customize it for your project, adding more details about the project structure, overall architecture, and other relevant information so Agents can better understand your project.

::: tip

If you are using Claude Code, you can create a `CLAUDE.md` file and reference the `AGENTS.md` file in it.

```markdown title="CLAUDE.md"
@AGENTS.md
```

:::
