frontend-policy

frontend-policy is a cursor rule for Cursor from vanessamarely/ai-playbook-reposito. It costs 0 tokens per session (542 once invoked), scanned A, original, MIT.

A set of coding rules for building React interfaces with TypeScript, including component structure, state, effects, accessibility, and performance.

In plain words
What is it for?
Use it when creating or reviewing React components, managing state and effects, defining props, or checking interface accessibility and rendering performance.
Why use it?
It provides consistent decisions for organizing components and handling common React behavior safely and accessibly.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when creating or reviewing React components, managing state and effects, defining props, or checking interface accessibility and rendering performance.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/vanessamarely/ai-playbook-reposito/frontend-policy
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.

Clone the repo
git clone --depth 1 https://github.com/vanessamarely/ai-playbook-reposito

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-policy

README.md
[![agentmods](https://agentmods.dev/badge/rules/vanessamarely/ai-playbook-reposito/frontend-policy/github.svg)](https://agentmods.dev/rules/vanessamarely/ai-playbook-reposito/frontend-policy)
Your own site
<a href="https://agentmods.dev/rules/vanessamarely/ai-playbook-reposito/frontend-policy"><img src="https://agentmods.dev/badge/rules/vanessamarely/ai-playbook-reposito/frontend-policy/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for frontend-policy

Your own site · 80×15
<a href="https://agentmods.dev/rules/vanessamarely/ai-playbook-reposito/frontend-policy"><img src="https://agentmods.dev/badge/rules/vanessamarely/ai-playbook-reposito/frontend-policy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 542 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.00542
Opus 5 $0.00000 $0.00271
Sonnet 5 $0.00000 $0.00108
Haiku 4.5 $0.00000 $0.00054

Measured 10d ago against content hash 158ddc59f694, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

frontend-policy 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 10d 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.

ai-playbook/.cursor/rules/frontend-policy.mdc · 75 lines

How it starts

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

Frontend Policy

Technology Stack

Primary focus: React + TypeScript applications.

Core Principles

  1. Component-driven architecture with clear boundaries.
  2. Type safety enforced at compile time.
  3. Accessibility as a first-class requirement.
  4. Performance considerations in rendering and bundling.

React + TypeScript Standards

Component Structure

  • Use functional components with hooks.
  • Define explicit TypeScript interfaces for props.
  • Co-locate types with components when project-specific; extract shared types to dedicated type definition files.

State Management

  • Use useState for local component state.
  • Use useReducer for complex state logic.
  • Lift state only when necessary.
  • Consider context for cross-cutting concerns.

Effect Management

  • Use useEffect with explicit dependency arrays.
  • Clean up side effects (subscriptions, timers, listeners).
  • Avoid effects for derived state; use useMemo or direct computation.

Event Handlers

  • Prefix handler functions with handle (e.g., handleClick).
  • Use inline arrow functions sparingly (consider performance implications).
  • Type event parameters explicitly (e.g., React.MouseEvent<HTMLButtonElement>).

Accessibility Policy

All frontend code must meet WCAG 2.2 Level AA standards.

  • Semantic HTML as foundation.
  • Keyboard navigation support (Tab, Enter, Escape, Arrow keys).
  • Valid ARIA usage (roles, states, properties).
  • Focus management for dynamic content and modals.
  • Perceivable contrast ratios (4.5:1 normal text, 3:1 large text).
  • Reduced motion support via prefers-reduced-motion.

Tooling Assumptions

  • eslint-plugin-jsx-a11y configured and enforced.
  • @axe-core/react or equivalent for runtime checks in development.
  • Manual keyboard testing required for interactive components.

For the full WCAG 2.2 checklist, anti-patterns, and ARIA patterns, see the a11y-automation and react-components rules (both auto-apply to .tsx/.jsx files).

Error Boundaries

Read the full file on GitHub · 75 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. 10d ago First seen · 75 lines · 0 tokens per session scan A 158ddc59f694

Subscribe to this mod's changes

frontend-policy is a cursor rule published in the GitHub repository vanessamarely/ai-playbook-reposito (2 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 542 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-08-31.