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.
npx agentmods add rules/mywand/cusrsor-do-it/coding-standardsgit clone --depth 1 https://github.com/mywand/cusrsor-do-itWhat 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 | $0.02803 | $0.02803 |
| Opus 5 | $0.01401 | $0.01401 |
| Sonnet 5 | $0.00561 | $0.00561 |
| Haiku 4.5 | $0.00280 | $0.00280 |
Grade A, and why
coding-standards 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.
How it starts
The opening of the file, as written. The whole thing — 428 lines — stays where its author put it; the contents beside it link to each section on GitHub.
最近更新: 2025-10-10
跨语言通用编码规范
适用于所有编程语言的通用编码标准和最佳实践
1. 命名规范
1.1 通用原则
- 有意义: 名称应该清楚表达意图
- 可读性: 避免缩写和单字母变量(除了循环计数器)
- 一致性: 在同一项目中保持命名风格一致
- 避免误导: 不使用容易混淆的名称
// ❌ 不好的命名
let d = new Date()
let u = users.filter(x => x.a)
function calc(a, b) { return a * b * 0.1 }
// ✅ 好的命名
let currentDate = new Date()
let activeUsers = users.filter(user => user.isActive)
function calculateDiscount(price, quantity) { return price * quantity * 0.1 }
1.2 函数命名
- 使用动词开头,清楚表达函数的作用
- 布尔函数使用
is、has、can、should等前缀
# ✅ 好的函数命名
def get_user_by_id(user_id):
def create_new_order(order_data):
def is_valid_email(email):
def has_permission(user, resource):
def can_access_resource(user, resource):
1.3 变量命名
- 使用名词或名词短语
- 集合使用复数形式
- 常量使用全大写(根据语言习惯)
// ✅ 好的变量命名
String userName;
List<User> activeUsers;
final int MAX_RETRY_COUNT = 3;
boolean isProcessing;
2. 函数设计
2.1 单一职责原则
每个函数应该只做一件事,并且把它做好。
// ❌ 职责过多
function processUserData(userData: any) {
// 验证数据
if (!userData.email) throw new Error('邮箱必填')
// 保存到数据库
database.save(userData)
// 发送邮件
emailService.send(userData.email, 'welcome')
// 记录日志
logger.info('用户创建成功')
}
// ✅ 职责分离
function validateUserData(userData: UserData): void {
if (!userData.email) throw new Error('邮箱必填')
}
function saveUser(userData: UserData): User {
return database.save(userData)
}
function sendWelcomeEmail(email: string): void {
emailService.send(email, 'welcome')
}
function createUser(userData: UserData): User {
validateUserData(userData)
const user = saveUser(userData)
sendWelcomeEmail(userData.email)
logger.info('用户创建成功', { userId: user.id })
return user
}
2.2 参数控制
- 函数参数不超过 3-4 个
- 使用对象传递多个参数
- 提供合理的默认值
# ❌ 参数过多
def create_user(name, email, age, phone, address, city, country, postal_code):
pass
# ✅ 使用对象封装
def create_user(user_data: UserData):
pass
# 或使用字典(Python)
def create_user(name: str, email: str, **kwargs):
age = kwargs.get('age', 18)
phone = kwargs.get('phone', '')
# ...
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.
- 2d ago First seen · 428 lines · 2,803 tokens per session scan A e5ded84b7771
coding-standards is a cursor rule published in the GitHub repository mywand/cusrsor-do-it (2 stars, last pushed 7mo ago), licensed Apache-2.0. It adds 2,803 tokens to every session, about $0.0140 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.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
control-plane-descriptors
Control plane descriptor and instance implementation patterns.
family-instance-domain-actions
Family instance domain action implementation patterns.