> **Version 11 (RC)** — **React** / **TypeScript**
> Also available:
- `?codeOnly=true` for code snippets only
- other versions: Version 10.6 (latest) (`/docs/ai/skills/test-stories.md`), Version 9 (`/docs/9/ai/skills/test-stories.md`), Version 8 (`/docs/8/ai/skills/test-stories.md`)

# Test stories

The `/test-stories` skill tells your agent how to run your story tests, with their accessibility checks. It isn't available for your framework yet. See [supported frameworks](https://storybook.js.org/docs/11/ai/connect.md#supported-frameworks).

The `/test-stories` skill tells your agent how to run your [story tests](https://storybook.js.org/docs/11/writing-tests.md), with their [accessibility checks](https://storybook.js.org/docs/11/writing-tests/accessibility-testing.md), and what the result means.

## When your agent uses it

The [Storybook section in `AGENTS.md`](https://storybook.js.org/docs/11/ai/agents-md.md) names the test command itself (step 3), so your agent can run the story tests without opening this skill. When it runs them, and what it does about a failure, is up to your agent and the tool it runs in: some test after every change, others only when you ask. The skill gives the same commands when you or your agent call it by name.

## What the skill tells your agent

- **The command.** `npx storybook tools test run`: with `--changed` it tests the stories that the uncommitted changes affect, with story files it tests the stories in those files, and without either it tests every story.
- **The result.** The output lists the passing and failing stories, with the error of each failure.

### Accessibility issues

If you are using the [accessibility addon](https://storybook.js.org/docs/11/writing-tests/accessibility-testing.md), the agent fixes only the accessibility issues that its change caused, and reports the rest. For visual issues, such as low color contrast, it asks before it changes your design. The agent never changes your accessibility test level to make a test pass.

## Requirements

- The [Vitest addon](https://storybook.js.org/docs/11/writing-tests/integrations/vitest-addon.md), which needs the Vite builder. Without it in your main config, the `AGENTS.md` section has no test step.

To run accessibility checks with the tests, also install the [accessibility addon](https://storybook.js.org/docs/11/writing-tests/accessibility-testing.md).

**More AI resources**

- [Connect your agent](https://storybook.js.org/docs/11/ai/connect.md)
- [The AGENTS.md section](https://storybook.js.org/docs/11/ai/agents-md.md)
- [Write stories](https://storybook.js.org/docs/11/ai/skills/write-stories.md)
- [UI review](https://storybook.js.org/docs/11/ai/skills/ui-review.md)
- [Best practices for using Storybook with AI](https://storybook.js.org/docs/11/ai/best-practices.md)