# svelte-testing

The svelte-testing subagent helps test Svelte and SvelteKit apps, from component behavior to end-to-end flows. Use it when you need coverage for UI interactions or server-side functions.

- subagent · `type=agent` · Claude Code, Codex, Cursor · ★ 1357 repo stars
- Author: qdhenry
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/qdhenry/Claude-Command-Suite/tree/HEAD/.claude/agents/svelte-testing.md
- Updated: 2026-03-01
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/agents/svelte-testing

## What it does

The subagent handles unit, component, and end-to-end testing for Svelte and SvelteKit projects. Its testing toolkit includes Vitest and Playwright. It can work on component interactions and states, as well as SvelteKit load functions, form actions, and API routes.

Its guidance covers Vitest setup, component lifecycle helpers such as `mount` and `unmount`, reactive updates with `flushSync()`, and cleanup between tests. It also includes accessibility checks, such as keyboard navigation and ARIA attributes. Playwright E2E tests need a runnable app and their own setup, so treat them as a separate layer from unit tests.

## Requirements
- Works with: Playwright

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/agents/svelte-testing.md` — For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

### Codex

**Manually: put the files in place**
- File: `.codex/agents/svelte-testing.toml` — Codex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/

### Cursor

**Manually: put the files in place**
- File: `.cursor/agents/svelte-testing.md` — Cursor also reads .claude/agents/

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/qdhenry/Claude-Command-Suite/tree/HEAD/.claude/agents/svelte-testing.md

## When to use it
- check how a component responds to clicks and input
- test a SvelteKit load function or form action
- write a Playwright flow for a user journey
- verify that reactive values update

## Example prompts
- Test `Counter.svelte` and add a case for clicking its button.
- Write a test for the loader in `+page.server.js`.
- Create a Playwright E2E test for the purchase flow.

## Similar
- [svelte-test](https://affpapa.org/en/nevibecode/commands/svelte-test.md) — command · 124 installs
- [svelte-test-fix](https://affpapa.org/en/nevibecode/commands/svelte-test-fix.md) — command · 115 installs
- [svelte](https://affpapa.org/en/nevibecode/skills/mindrally-svelte.md) — skill · 806 installs
- [svelte-development](https://affpapa.org/en/nevibecode/skills/travisjneuman-svelte-development.md) — skill · 139 installs
- [sveltekit](https://affpapa.org/en/nevibecode/rules/sveltekit.md) — rule · ★ 3589 repo stars
- [vue-testing-best-practices](https://affpapa.org/en/nevibecode/skills/vue-testing-best-practices.md) — skill · 15300 installs

From the same set: [qdhenry/claude-command-suite](https://affpapa.org/en/nevibecode/by/qdhenry/claude-command-suite.md) — 112 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
