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/mr-chen-05/rules-2.1-optimized/code-quality-checkgit clone --depth 1 https://github.com/Mr-chen-05/rules-2.1-optimizedWhat 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.05010 | $0.05010 |
| Opus 5 | $0.02505 | $0.02505 |
| Sonnet 5 | $0.01002 | $0.01002 |
| Haiku 4.5 | $0.00501 | $0.00501 |
Grade A, and why
code-quality-check 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 — 689 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🔍 Code Quality Check - 智能代码质量检查
AI驱动的跨语言代码质量检查系统,集成智能分析引擎、MCP工具自动化和超级大脑系统推荐。
🧠 AI Intelligence Core - AI智能核心
智能激活条件
自动激活场景:
- 检测到代码文件变更需要质量检查
- 用户执行 "/quality-check" 命令
- commit工作流提交前自动触发(/commit 或 /commit --fast;支持 /commit-fast 别名)
- 超级大脑系统推荐质量检查
- 项目进入代码审查阶段
智能分析维度:
- 代码复杂度和可维护性 (30%)
- 安全漏洞和潜在风险 (25%)
- 性能问题和优化机会 (20%)
- 代码规范和最佳实践 (15%)
- 测试覆盖率和质量 (10%)
🚀 Commands - 智能命令
/quality-check- AI智能质量检查(推荐)/quality-check --language <lang>- 指定语言检查/quality-check --severity <level>- 指定严重级别 (critical/high/medium/low)/quality-check --fix- 自动修复可修复的问题/quality-check --report- 生成详细质量报告/quality-check --baseline- 建立质量基线
✨ AI-Powered Features - AI驱动功能
🤖 智能代码分析引擎
多语言支持:
前端语言:
- JavaScript/TypeScript (ES6+, React, Vue, Angular)
- HTML5/CSS3 (响应式设计, 可访问性)
- SCSS/SASS/Less (预处理器优化)
后端语言:
- Python (Django, Flask, FastAPI)
- Node.js (Express, Koa, NestJS)
- Java (Spring Boot, Maven, Gradle)
- C# (.NET Core, ASP.NET)
- Go (Gin, Echo, 微服务)
数据库和配置:
- SQL (MySQL, PostgreSQL, SQLite)
- NoSQL (MongoDB, Redis)
- YAML/JSON/XML 配置文件
- Docker/Kubernetes 配置
智能分析能力:
- 语法和语义分析
- 代码复杂度计算
- 安全漏洞扫描
- 性能瓶颈识别
- 代码异味检测
- 依赖关系分析
🔧 MCP工具智能编排
工具链集成:
代码分析工具:
- ESLint/Prettier (JavaScript/TypeScript)
- Pylint/Black (Python)
- SonarQube (多语言静态分析)
- CodeQL (安全分析)
- Bandit (Python安全扫描)
性能分析工具:
- Lighthouse (前端性能)
- Profiler (后端性能)
- Memory Analyzer (内存分析)
- Load Testing (负载测试)
自动化修复:
- 代码格式化自动修复
- 简单语法错误修复
- 导入语句优化
- 代码风格统一
📋 Quality Check Categories - 质量检查分类
🔴 Critical Issues - 致命问题
安全漏洞:
- SQL注入风险
- XSS跨站脚本攻击
- CSRF跨站请求伪造
- 敏感信息泄露
- 不安全的加密实现
架构问题:
- 循环依赖
- 紧耦合设计
- 单点故障
- 资源泄露
- 死锁风险
🟠 High Priority - 高优先级
性能问题:
- 内存泄露
- 无限循环
- 低效算法
- 数据库N+1查询
- 大文件处理问题
可维护性:
- 代码重复率过高
- 函数复杂度过高
- 类职责不清
- 命名不规范
- 缺少文档注释
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 · 689 lines · 5,010 tokens per session scan A 2df12ffb8620
code-quality-check is a cursor rule published in the GitHub repository Mr-chen-05/rules-2.1-optimized (172 stars, last pushed 9mo ago), licensed MIT. It adds 5,010 tokens to every session, about $0.0250 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-30.
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.