sveltest AGENTS.md

Repository instructions for Sveltest, a Svelte 5 testing example project. They define testing patterns, naming rules, commands, and rules for checking browser, server, and server-rendered components.

In plain words
What is it for?
Use them when writing or reviewing Svelte tests, choosing locators, handling derived values and forms, naming files and variables, and running linting and builds.
Why use it?
They give contributors consistent testing practices and prevent common mistakes such as unreliable element selection or excessive mocking.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/spences10/sveltest/agents-md
Clone the repo
git clone --depth 1 https://github.com/spences10/sveltest

Made for: Codex, OpenCode.

Per session 1,850 This file is loaded in full into every session.
When invoked 1,850 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01850 $0.01850
Opus 5 $0.00925 $0.00925
Sonnet 5 $0.00370 $0.00370
Haiku 4.5 $0.00185 $0.00185

Measured 3d ago against content hash 1f2dd00b6c55, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sveltest AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 242 lines

How it starts

The opening of the file, as written. The whole thing — 242 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Sveltest is a comprehensive testing example project for Svelte 5 applications using vitest-browser-svelte. It demonstrates real-world testing patterns with client-side, server-side, and SSR testing approaches.

Unbreakable Rules:

  • Always use locators (page.getBy*()) - never containers in vitest-browser-svelte
  • Use .first(), .nth(), .last() for multiple elements to avoid strict mode violations
  • Always use untrack() when accessing $derived values in tests
  • Use real FormData/Request objects in server tests - minimal mocking only
  • Co-locate tests with components (.svelte.test.ts, .ssr.test.ts)
  • Follow naming conventions: kebab-case files, snake_case variables
  • Start tests with "Foundation First" approach using .skip blocks for planning
  • Always run pnpm lint after making changes
  • Never click SvelteKit form submit buttons - test state directly
  • Use await expect.element() for all locator assertions

Essential Commands

Development

pnpm dev      # Start development server
pnpm build    # Build for production
pnpm preview  # Preview production build

Testing

pnpm test           # Run all tests (unit + e2e)
pnpm test:unit      # Run all unit tests
pnpm test:client    # Client-side component tests (browser)
pnpm test:server    # Server-side tests (Node.js)
pnpm test:ssr       # SSR tests (server-side rendering)
pnpm test:e2e       # Playwright e2e tests
pnpm coverage       # Generate test coverage report

Code Quality

pnpm lint                  # Check formatting, linting, and types with Vite+
pnpm lint:fix              # Fix Vite+ formatting and linting issues
pnpm format                # Format JS, TS, Svelte, and Markdown with Oxfmt
pnpm check                 # Run vp check (oxlint + oxfmt + type check)
pnpm check:watch           # Watch mode for type checking

Read the full file on GitHub · 242 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 242 lines · 1,850 tokens per session scan A 1f2dd00b6c55

Subscribe to this mod's changes

sveltest AGENTS.md is an instructions file published in the GitHub repository spences10/sveltest (112 stars, last pushed 4d ago), licensed MIT. It adds 1,850 tokens to every session, about $0.0093 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.