coding-style-rules

coding-style-rules is a cursor rule for Cursor from holtwood/awesome-cursorrules-zh. It costs 245 tokens per session, scanned A, original, MIT.

A coding-style guide for Next.js projects covering comments, small focused modules, reusable components, performance, and input validation.

In plain words
What is it for?
Use it when reviewing or writing components, hooks, UI code, lists, and code that handles user-provided data.
Why use it?
It helps keep code easier to maintain while reducing duplicated logic, unnecessary rendering, and unsafe user input.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when reviewing or writing components, hooks, UI code, lists, and code that handles user-provided data.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/holtwood/awesome-cursorrules-zh/coding-style-rules
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/holtwood/awesome-cursorrules-zh

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 coding-style-rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/coding-style-rules/github.svg)](https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/coding-style-rules)
Your own site
<a href="https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/coding-style-rules"><img src="https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/coding-style-rules/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 coding-style-rules

Your own site · 80×15
<a href="https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/coding-style-rules"><img src="https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/coding-style-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 245 This file is loaded in full into every session.
When invoked 245 The same file — it is already loaded in full.
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.00245 $0.00245
Opus 5.5 $0.00098 $0.00098
Sonnet 5.5 $0.00049 $0.00049
Haiku 4.5 $0.00024 $0.00024

Measured 2mo ago against content hash e80b1c19babc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

coding-style-rules 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 2mo 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.

docs/rules/frontend/react/nextjs-basic/coding-style-rules.mdc · 25 lines

What it actually says

  • 文件头注释: 必须包含文件路径和主要功能说明
    // src/components/ui/button.tsx
    // 通用按钮组件,支持多种变体和尺寸
    
  • 代码注释:
    • 复杂逻辑必须添加行内注释
    • 避免无意义的注释(如"增加计数器")
  • 模块化:
    • 单一组件不超过300行
    • 每个组件/钩子只做一件事
  • DRY原则:
    • 重复逻辑抽象为自定义钩子
    • 通用UI提取为共享组件
  • 性能:
    • 避免不必要的re-render
    • 大数据列表使用虚拟滚动
  • 安全:
    • 所有用户输入必须验证
    • 敏感操作需要二次确认
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. 2mo ago First seen · 25 lines · 245 tokens per session scan A e80b1c19babc

Subscribe to this mod's changes

coding-style-rules is a cursor rule published in the GitHub repository holtwood/awesome-cursorrules-zh (244 stars, last pushed 1mo ago), licensed MIT. It adds 245 tokens to every session, about $0.0010 per session on Opus 5.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-09-03.

Related

coding-style-rules compared with cursor rules from other repositories

coding-style-rules next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
coding-style-rulesholtwood/awesome-cursorrules-zhCursor rule2441mo agoMITA245Cursor
creating-cursor-rulespr-pm/prpmCursor rule1251mo agoMITA16Cursor
creating-skillspr-pm/prpmCursor rule1251mo agoMITA19Cursor
pyspark-etl-best-practices-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A3,275Cursor
playwright-integration-testing-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A1,658Cursor
react-tanstack-router-query-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A1,995Cursor
go-backend-scalability-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A1,200Cursor