Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/holtwood/awesome-cursorrules-zhnpx agentmods add rules/holtwood/awesome-cursorrules-zh/react-general-preferencesWrote 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/holtwood/awesome-cursorrules-zh/react-general-preferences)<a href="https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/react-general-preferences"><img src="https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/react-general-preferences/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.
<a href="https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/react-general-preferences"><img src="https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/react-general-preferences.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00000 | $0.00531 |
| Opus 5 | $0.00000 | $0.00266 |
| Sonnet 5 | $0.00000 | $0.00106 |
| Haiku 4.5 | $0.00000 | $0.00053 |
Grade A, and why
react-general-preferences 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.
What it actually says
- 优先使用带有 Hooks 的函数式组件:
- 现代化开发:
- 函数式组件结合 Hooks 是 React 官方推荐的现代开发范式。它使得组件逻辑更清晰、可复用性更高,并且避免了类组件中
this的复杂性。
- 函数式组件结合 Hooks 是 React 官方推荐的现代开发范式。它使得组件逻辑更清晰、可复用性更高,并且避免了类组件中
- 代码简洁性:
- Hooks 允许你在函数式组件中直接使用状态(
useState)、生命周期(useEffect)和其他 React 特性,从而减少了样板代码,使组件更简洁。 - 示例:
import React, { useState, useEffect } from 'react'; import { observer } from 'mobx-react-lite'; import { useStore } from '../stores'; const Counter = observer(() => { const [count, setCount] = useState(0); const { appStore } = useStore(); useEffect(() => { console.log('Component mounted or updated'); return () => console.log('Component unmounted'); }, []); return ( <div> <p>Count: {count}</p> <button onClick={() => setCount(count + 1)}>Increment</button> <p>App Status: {appStore.status}</p> </div> ); }); export default Counter;
- Hooks 允许你在函数式组件中直接使用状态(
- 逻辑复用:
- 自定义 Hooks 使得逻辑复用变得非常简单和直观,你可以将状态逻辑和副作用封装成可独立测试和复用的单元。
- 性能优化:
- 结合
React.memo、useCallback和useMemo等 Hooks,可以对函数式组件进行更细粒度的性能优化,避免不必要的重新渲染。
- 结合
- 与 MobX 兼容性:
mobx-react-lite库专门为函数式组件和 Hooks 优化,提供了observerHOC 和useObserverHook,使得 MobX 状态管理在函数式组件中表现出色。
- 社区支持:
- 随着 Hooks 的普及,越来越多的库和工具都优先支持函数式组件和 Hooks,这使得开发生态更加丰富和活跃。
- 现代化开发:
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.
- 6d ago First seen · 44 lines · 0 tokens per session scan A 8220033accdf
react-general-preferences is a cursor rule published in the GitHub repository holtwood/awesome-cursorrules-zh (233 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 531 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-09-03.
Other cursor rules, from other repositories
component-development
Modern React + TypeScript component patterns — hooks, typed props, performance optimization, forms, and testing.
app-router-patterns
Next.js 14+ App Router patterns — Server Components, Client Components, Route Handlers, Server Actions, and metadata API.
semiotic-react-dataviz-cursorrules-prompt-file
Cursor rules for Semiotic data visualization library with 30+ chart types, MCP server, and AI-assisted chart generation.
next-type-llm
Cursor rules for Next.js development with Type LLM integration.
ai-agent-specialist
Cursor rules for TypeScript, React, Node.js, clean architecture, testing, and WHY-oriented engineering guidance.
nextjs
Next.js with TypeScript and Tailwind UI best practices.