front-react

front-react is a cursor rule for Cursor from louisbrulenaudet/monorepo-template. It costs 0 tokens per session (512 once invoked), scanned A, original, Apache-2.0.

Testing rules for a React frontend using Vitest and browser-testing tools. React is a library for building user interfaces, while these tools help test components and user interactions.

In plain words
What is it for?
Use them to test React services, utilities, queries, DOM behavior, and user actions with the project's approved configuration.
Why use it?
They prevent frontend tests from using the wrong runtime or sharing state in ways that make results unreliable.

Cursor rule for Cursor

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 rules/louisbrulenaudet/monorepo-template/front-react
Clone the repo
git clone --depth 1 https://github.com/louisbrulenaudet/monorepo-template

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for front-react

README.md
[![agentmods](https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/front-react.svg)](https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/front-react)
Your own site
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/front-react"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/front-react.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 512 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.00512
Opus 5 $0.00000 $0.00256
Sonnet 5 $0.00000 $0.00102
Haiku 4.5 $0.00000 $0.00051

Measured yesterday against content hash bbc6b1a89d49, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

front-react 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 yesterday.

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.

.cursor/rules/tests/front-react.mdc · 20 lines

What it actually says

Front-app Vitest

General: vitest.mdc. Discipline: testing.mdc. DOM/RTL harness depth: skill front-vitest. Never use the Workers pool on front-*.

Repo invariants

  • Config: defineNodeConfig + resolvePackageRoot(import.meta.dirname) for root / test.dir from @repo/vitest-config (Node). Never cloudflareTest.
  • Prefer Node unit tests for services/, utils/, *-query-options: isolated QueryClient with retry: false and gcTime: Infinity; exercise shared queryOptions via fetchQuery / ensureQueryData. Do not reuse src/config/query-client.ts across tests without clear.
  • Never hand-edit src/routeTree.gen.ts - regenerate with app routes:generate / routes:check.
  • Imports from vitest only; in-app paths via #/*. Typecheck via tests/tsconfig.json (in package check-types).
  • Agents: pnpm turbo run test --filter=front-app (non-watch).
  • DOM harness installed: happy-dom + @testing-library/react / jest-dom / user-event (catalog deps). Config-wide environment stays node; a DOM suite opts in per file with // @vitest-environment happy-dom on line 1. vitest.setup.ts sets the React 19 act flag for every suite, and imports the jest-dom matchers plus afterEach(cleanup) only when a DOM environment is present (globals are off, so RTL auto-cleanup never registers) - a Node suite must not pay the ~600ms harness import. .tsx test files are matched. Canonical example: tests/components/ui/button.test.tsx. Depth: skill front-vitest.
  • happy-dom is the deliberate default (speed on constrained hardware). If a suite hits a happy-dom spec gap, switch that one file to @vitest-environment jsdom after adding the dep - do not change the config-wide environment.
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. yesterday First seen · 20 lines · 0 tokens per session scan A bbc6b1a89d49

Subscribe to this mod's changes

front-react is a cursor rule published in the GitHub repository louisbrulenaudet/monorepo-template (19 stars, last pushed 4d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 512 tokens. 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-09-03.