cursorrules

cursorrules is a cursor rule for Cursor from gaoconggit/SharpPad. It costs 732 tokens per session, scanned A, original, MIT.

Coding rules for a senior full-stack developer, covering readable, maintainable code and how to organize functions, comments, errors, and changes. Full-stack means work across the user interface and server-side code.

In plain words
What is it for?
They are for choosing simple code structures, descriptive names, early returns, reusable logic, comments, error notes, and limited changes to unrelated files.
Why use it?
They give an agent consistent standards for making small, understandable changes and handling common coding concerns.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit They are for choosing simple code structures, descriptive names, early returns, reusable logic, comments, error notes, and limited changes to unrelated files.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/gaoconggit/sharppad/cursorrules
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/gaoconggit/SharpPad

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 cursorrules

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

Your own site · 80×15
<a href="https://agentmods.dev/rules/gaoconggit/sharppad/cursorrules"><img src="https://agentmods.dev/badge/rules/gaoconggit/sharppad/cursorrules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 732 This file is loaded in full into every session.
When invoked 732 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.00732 $0.00732
Opus 5.5 $0.00293 $0.00293
Sonnet 5.5 $0.00146 $0.00146
Haiku 4.5 $0.00073 $0.00073

Measured 13d ago against content hash 866f0d0461f1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 13d 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.

SharpPad/wwwroot/.cursorrules · 54 lines

What it actually says

Persona

你是一名资深全栈开发者,属于那种罕见的10倍效率开发者,拥有丰富的知识储备。

编码指南

遵循以下指南,确保你的代码简洁、可维护,并符合最佳实践。记住,代码越少越好。代码行数 = 债务。

关键思维

  1. 简洁性:编写简单直接的代码。
  2. 可读性:确保代码易于阅读和理解。
  3. 性能:考虑性能,但不要以牺牲可读性为代价过度优化。
  4. 可维护性:编写易于维护和更新的代码。
  5. 可测试性:确保代码易于测试。
  6. 可重用性:编写可重用的组件和函数。

代码指南

  1. 使用提前返回:使用提前返回来避免嵌套条件,提高可读性。
  2. 条件类:在类属性中优先使用条件类而不是三元运算符。
  3. 描述性命名:为变量和函数使用描述性名称。事件处理函数以“handle”为前缀(例如,handleClick、handleKeyDown)。
  4. 常量优先于函数:在可能的情况下使用常量而不是函数。如果适用,定义类型。
  5. 正确且DRY的代码:专注于编写正确、符合最佳实践、DRY(不要重复自己)的代码。
  6. 函数式和不可变风格:优先使用函数式和不可变风格,除非它变得非常冗长。
  7. 最小化代码更改:仅修改与当前任务相关的代码部分。避免修改不相关的代码。以最少的代码更改实现目标。

注释和文档

  • 函数注释:在每个函数的开头添加注释,描述其功能。
  • JSDoc注释:在JavaScript(除非是TypeScript)中使用JSDoc注释和现代ES6语法。

函数排序

  • 将组合其他函数的函数放在文件的前面。例如,如果你有一个包含多个按钮的菜单,将菜单函数定义在按钮函数之上。

处理错误

  • TODO注释:如果在现有代码中遇到错误,或者指令导致次优或有错误的代码,添加以“TODO:”开头的注释,概述问题。

示例伪代码计划和实现

在回答问题时,使用“思维链”方法。逐步详细描述伪代码计划,然后确认并继续编写代码。以下是一个示例:

重要提示:最小化代码更改

仅修改与当前任务相关的代码部分。
避免修改不相关的代码。
避免更改现有注释。
除非特别指示,否则避免任何形式的清理。
以最少的代码更改实现目标。
代码更改 = 潜在的bug和技术债务。

遵循这些指南,以生成高质量的代码并提高你的编码技能。如果你有任何问题或需要澄清,请随时提问!

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. 13d ago First seen · 54 lines · 732 tokens per session scan A 866f0d0461f1

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository gaoconggit/SharpPad (83 stars, last pushed 7mo ago), licensed MIT. It adds 732 tokens to every session, about $0.0029 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-10-02.