performance

A set of rules for keeping user interfaces and application code responsive. They cover safe hook usage, avoiding unnecessary re-renders, handling long lists, loading heavy resources when needed, and moving expensive work away from the main thread.

In plain words
What is it for?
Use them when building component hooks, optimizing lists and images, controlling re-renders, lazy-loading screens, and choosing where animations or heavy calculations should run.
Why use it?
They reduce slow screens, wasted rendering, and UI freezes. They also help prevent common mistakes in component and hook code.

Cursor rule

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/cmaranho/rn-agent-skills/performance
Clone the repo
git clone --depth 1 https://github.com/cmaranho/rn-agent-skills
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 177 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.00177
Opus 5 $0.00000 $0.00088
Sonnet 5 $0.00000 $0.00035
Haiku 4.5 $0.00000 $0.00018

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

Security

Grade A, and why

performance 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.

rules/performance.mdc · 17 lines

What it actually says

Performance

  • Componentes e hooks são puros: sem efeitos colaterais no render.
  • Rules of Hooks: hooks no topo, nunca condicionais.
  • Memoize cálculos caros; mantenha integridade referencial de props (objetos, arrays, funções).
  • Sem literais de objeto/array/função inline como props em componentes memoizados.
  • Listas longas usam componente virtualizado com keyExtractor estável (nunca índice).
  • Evite trabalho pesado na main thread; anime na UI thread.
  • Minimize re-render: selectors granulares; sem estado global desnecessário.
  • Carregue sob demanda (lazy) telas e recursos pesados; dimensione e cacheie imagens.
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 · 17 lines · 177 tokens per session scan A c9da439a6796

Subscribe to this mod's changes

performance is a cursor rule published in the GitHub repository cmaranho/rn-agent-skills (2 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 177 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.