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.
npx agentmods add rules/emilyli2020/wave/frontend-guardrailsgit clone --depth 1 https://github.com/emilyLi2020/WAVEWrote 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.
[](https://agentmods.dev/rules/emilyli2020/wave/frontend-guardrails)<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>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.
| Model | Per session | Once 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 |
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.
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 / Screensmaps to one route underclient/app/. Do not invent pages that are not in the PRD. - TypeScript strict mode. No
anywithout a justification comment. Prefer narrow string-literal unions (e.g.MedicationStatus) overstring. - 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.css—bg-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 toglobals.cssrather 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 inglobals.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) fromclient/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.
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.
- 3d ago First seen · 65 lines · 1,358 tokens per session scan A 22b91a086b3e
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.
Other cursor rules, from other repositories
01-code-style
Cursor rule "01-code-style" from refly-ai/refly, covering code style guidelines, typescript/javascript style, react performance optimization, error handling and css guidelines.
components
React components — shadcn/ui, RTL, theme, and client/server boundaries.
react-sot-storybook-parity
SOT component CSS ownership — Storybook preview must match live routes without per-page token overrides.
webview-ui
Skill Manager webview — React 19, VS Code messaging via acquireVsCodeApi, no Node APIs.
react-conventions
All UI via className={cn(...)} and Tailwind utilities. No CSS modules or co-located .css for normal components. Raw CSS belongs almost only in globals.css. Do not combine style={{ ... }} with Tailwind on the same node. See css-ui-enforcement.mdc.
cursorrules
Use functional components in React. Prefer Tailwind CSS classes.