frontend-guardrails

frontend-guardrails is a cursor rule for Cursor from emilyLi2020/WAVE. It costs 1,358 tokens per session, scanned A, original, Apache-2.0.

A set of rules for building the frontend of the WAVE project. It covers page routes, TypeScript code, React components, and Tailwind CSS styling.

In plain words
What is it for?
Use it when adding or changing files under the client/ folder, especially when creating routes, components, interactive elements, or styles.
Why use it?
It gives developers one shared standard for where pages belong, how code should be structured, and which design tokens to use. This reduces inconsistent code and accidental pages or styles.

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/emilyli2020/wave/frontend-guardrails
Clone the repo
git clone --depth 1 https://github.com/emilyLi2020/WAVE

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 frontend-guardrails

README.md
[![agentmods](https://agentmods.dev/badge/rules/emilyli2020/wave/frontend-guardrails.svg)](https://agentmods.dev/rules/emilyli2020/wave/frontend-guardrails)
Your own site
<a href="https://agentmods.dev/rules/emilyli2020/wave/frontend-guardrails"><img src="https://agentmods.dev/badge/rules/emilyli2020/wave/frontend-guardrails.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,358 This file is loaded in full into every session.
When invoked 1,358 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.01358 $0.01358
Opus 5 $0.00679 $0.00679
Sonnet 5 $0.00272 $0.00272
Haiku 4.5 $0.00136 $0.00136

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

Security

Grade A, and why

frontend-guardrails 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.

client/.cursor/rules/frontend-guardrails.mdc · 65 lines

How it starts

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

WAVE frontend guardrails (scope: client/)

These rules mirror AGENTS.md and PRD.md at the repo root and apply to every file inside client/. Read those two documents before adding pages, prompts, or components.

Architecture

  • Server components by default. Only add "use client" when interactivity is required (forms, sliders, buttons with local state, Lottie, body-scan tap targets).
  • Route per PRD row. Every page in PRD.md > Pages / Screens maps to one route under client/app/. Do not invent pages that are not in the PRD.
  • TypeScript strict mode. No any without a justification comment. Prefer narrow string-literal unions (e.g. MedicationStatus) over string.
  • Keep components under 200 lines. Split larger files into colocated pieces.
  • Filenames use kebab-case; React components use PascalCase.

Styling

  • Tailwind CSS v4 only. No CSS-in-JS libraries.
  • No hardcoded colors. Use the tokens declared in app/globals.cssbg-background, text-foreground, bg-surface, border-border, text-accent, bg-accent-soft, bg-warn-soft, bg-danger-soft, bg-wave-rise, bg-wave-peak, bg-wave-fall. Add a new token to globals.css rather than inlining a hex value.
  • Use semantic HTML (<main>, <section>, <nav>, <header>, <footer>, <article>). Every interactive control must have an accessible label.
  • Respect prefers-color-scheme. Dark-mode tokens are already declared in globals.css.

Forms and validation

  • Validate every form input with Zod at the submit boundary. Infer the form type from the schema (z.infer<typeof schema>).
  • Use typed union fields (MedicationStatus, TriggerCategory, SessionOutcome, MatType) from client/types/models.ts. Do not accept free-text where a union is defined.
  • Never trust client input on any future Route Handler. Re-validate with Zod on the server side.

Clinical copy

  • All medication-aware prompts and session narration live under client/lib/prompts/ as typed, reviewable data — never inline strings inside components. This lets a clinician review a prompt PR without reading React.
  • Any change to medication prompts must cite an MBRP, SAMHSA, or FDA source in the PR description.
  • Tone is trauma-informed, non-judgmental, and grounded. Never use toxic-positivity copy. Never imply the patient has failed. Normalize missed doses and redirect.
  • WAVE is not a prescriber. "Take your medication if available" is acceptable. "Increase your dose" is not.
  • Every page that could encounter a patient in crisis must surface 988 and 1-800-662-HELP before continuing the flow.

Read the full file on GitHub · 65 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 · 65 lines · 1,358 tokens per session scan A 22b91a086b3e

Subscribe to this mod's changes

frontend-guardrails is a cursor rule published in the GitHub repository emilyLi2020/WAVE (2 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 1,358 tokens to every session, about $0.0068 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-31.