cursorrules

A set of coding rules for TypeScript projects, especially projects using React and JSX for user interfaces. It defines preferred file structure, naming, syntax, validation, and error-handling practices.

In plain words
What is it for?
Use it when writing or reviewing TypeScript components, functions, forms, server actions, and related files.
Why use it?
It gives the coding agent consistent project conventions, reducing inconsistent styles, duplicated code, and missed error cases.

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/guidovizoso/z1/cursorrules
Clone the repo
git clone --depth 1 https://github.com/guidovizoso/z1

Made for: Cursor.

Per session 337 This file is loaded in full into every session.
When invoked 337 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.00337 $0.00337
Opus 5 $0.00169 $0.00169
Sonnet 5 $0.00067 $0.00067
Haiku 4.5 $0.00034 $0.00034

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

Security

Grade A, and why

cursorrules 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 2d 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.

.cursorrules · 50 lines

What it actually says

Code Style and Structure:

  • Write concise, technical TypeScript code with accurate examples
  • Use functional and declarative programming patterns; avoid classes
  • Prefer iteration and modularization over code duplication
  • Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
  • Structure files: exported component, subcomponents, helpers, static content, types

Naming Conventions:

  • Use lowercase with dashes for directories (e.g., components/auth-wizard)
  • Favor named exports for components

TypeScript Usage:

  • Use TypeScript for all code; prefer interfaces over types
  • Avoid enums; use maps instead
  • Use functional components with TypeScript interfaces

Syntax and Formatting:

  • Use the "function" keyword for pure functions
  • Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements
  • Use declarative JSX

Error Handling and Validation:

  • Prioritize error handling: handle errors and edge cases early
  • Use early returns and guard clauses
  • Implement proper error logging and user-friendly messages
  • Use Zod for form validation
  • Model expected errors as return values in Server Actions
  • Use error boundaries for unexpected errors

UI and Styling:

  • Use Shadcn UI, Radix, and Tailwind Aria for components and styling
  • Implement responsive design with Tailwind CSS; use a mobile-first approach

Performance Optimization:

  • Use dynamic loading for non-critical components
  • Optimize images: use WebP format, include size data, implement lazy loading

Key Conventions:

  • Optimize Web Vitals (LCP, CLS, FID)

Follow Tanstack Start docs for Data Fetching, Rendering, and Routing

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. 2d ago First seen · 50 lines · 337 tokens per session scan A c89313317a2c

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository guidovizoso/z1 (10 stars, last pushed 1y ago), licensed MIT. It adds 337 tokens to every session, about $0.0017 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.