style

style is a cursor rule for Cursor from maccman/ai-expo-starter-template. It costs 422 tokens per session, scanned A, original, MIT.

A project-specific guide for keeping a TypeScript and Rust application small, testable, and consistently connected. Rust is a programming language often used for fast system-level code, while TypeScript commonly runs the user interface.

In plain words
What is it for?
Use it when planning or implementing features that involve React state, incoming data, events, or Rust background work. It requires plans, validation schemas, shared event constants, typed event variants, and checks with cargo check and pnpm commands.
Why use it?
It defines how data and events should move between the Rust and TypeScript parts of the application. This helps prevent mismatched names, unclear event formats, oversized modules, and unsafe hook usage.

Cursor rule for Cursor

Written for Cursor: installed under .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/maccman/ai-expo-starter-template/style
Clone the repo
git clone --depth 1 https://github.com/maccman/ai-expo-starter-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 style

README.md
[![agentmods](https://agentmods.dev/badge/rules/maccman/ai-expo-starter-template/style.svg)](https://agentmods.dev/rules/maccman/ai-expo-starter-template/style)
Your own site
<a href="https://agentmods.dev/rules/maccman/ai-expo-starter-template/style"><img src="https://agentmods.dev/badge/rules/maccman/ai-expo-starter-template/style.svg" alt="Measured on agentmods" height="20"></a>
Per session 422 This file is loaded in full into every session.
When invoked 422 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.1 $0.00422 $0.00422
Opus 5 $0.00211 $0.00211
Sonnet 5 $0.00084 $0.00084
Haiku 4.5 $0.00042 $0.00042

Measured 6d ago against content hash 05b67145aacb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

style 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 6d 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.

.cursor/rules/style.mdc · 40 lines

What it actually says

Context:

  • Conventions: small files, single-responsibility, testable interfaces, providers+hooks for state, one component per file, '@/' imports, zod for parsing/validation, no any.
  • Events: define event name constants; payloads are discriminated unions; normalize snake_case (Rust) → camelCase (TS).
  • Rust: offload blocking work with spawn_blocking; emit structured serde-tagged payloads; keep interfaces minimal.
  • Quality gates: Propose a plan first; after edits run cargo check, pnpm typecheck, pnpm lint; fix issues; ensure hooks rules respected.

Do this:

  1. Propose a concise plan (files to add/edit, public APIs, event names, schemas).
  2. After approval, implement:
    • Keep modules small and composable.
    • Add zod schemas for all incoming data; normalize to camelCase once in a bridge layer.
    • Use discriminated unions and type guards; export helper predicates (e.g., isTerminalEvent).
    • Centralize constants (event names, keys) in a types or constants file.
    • In React, create a provider and a small hook for state; avoid conditional hooks.
    • In Rust, use spawn_blocking for blocking ops; include identifiers like repo_id in every event.
  3. After coding, run:
    • cargo check
    • pnpm typecheck
    • pnpm lint Fix issues immediately.
  4. Summarize the changes succinctly and note any follow-up suggestions.

Non-negotiables:

  • No any. Use zod for runtime validation.
  • Normalize casing at boundaries; TS types are camelCase.
  • Small, testable modules; clear public APIs.
  • Don’t call hooks conditionally.
  • Prefer to split out logic into smaller files.
  • Never use any or as any in Typescript.
  • Never use single character variable names.
  • Always write documentation for all public APIs.
  • Always run build/typecheck/lint before declaring done.
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. 6d ago First seen · 40 lines · 422 tokens per session scan A 05b67145aacb

Subscribe to this mod's changes

style is a cursor rule published in the GitHub repository maccman/ai-expo-starter-template (4 stars, last pushed 11mo ago), licensed MIT. It adds 422 tokens to every session, about $0.0021 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.