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/system-diagnosticsgit 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.02650 | $0.02650 |
| Opus 5 | $0.01325 | $0.01325 |
| Sonnet 5 | $0.00530 | $0.00530 |
| Haiku 4.5 | $0.00265 | $0.00265 |
Grade A, and why
system-diagnostics 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 — 369 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🔧 系统诊断工具
第1层 - 诊断框架概述
核心诊断模块
诊断系统包括:
1. 规则系统诊断
2. 上下文记录诊断
3. 权限系统诊断
4. 性能监控诊断
5. 数据一致性诊断
6. 集成测试诊断
第2层 - 规则系统诊断
规则健康检查
检查项目:
1. 规则文件完整性:
- 检查所有规则文件是否存在
- 检查文件大小和行数
- 检查文件编码是否正确
2. 规则语法检查:
- 验证YAML语法有效性
- 检查Markdown格式正确性
- 验证特殊字符的编码
3. 规则版本一致性:
- 检查所有规则文件版本号
- 确认版本号格式正确
- 验证兼容性关系
4. 规则引用检查:
- 检查交叉引用有效性
- 验证包含关系完整性
- 检测循环引用
5. 优先级冲突检查:
- 检查优先级分配是否合理
- 检测优先级冲突
- 建议优先级优化
检查命令:
/diagnose-rules - 执行完整规则诊断
/check-rule-syntax [rule_file] - 检查特定规则文件语法
/verify-rule-references - 验证规则间引用关系
/check-rule-versions - 检查规则版本一致性
第3层 - 上下文记录诊断
上下文健康检查
检查项目:
1. 文件完整性:
- 检查 project.context.md 是否存在
- 检查 context.archive*.md 文件
- 检查备份文件完整性
2. 数据结构检查:
- 验证所有必需区块存在
- 检查区块内容格式
- 验证ID唯一性
3. 内容一致性检查:
- 检查Pinned条目引用有效性
- 验证TODO任务的状态一致性
- 检测重复条目
4. 时间戳有效性:
- 检查所有时间戳格式正确
- 验证时间戳的逻辑顺序
- 检测时间异常
5. 敏感信息扫描:
- 检测未脱敏的敏感信息
- 查找潜在的安全风险
- 建议清理措施
检查命令:
/diagnose-context - 执行完整上下文诊断
/check-context-integrity - 检查上下文数据完整性
/verify-timestamps - 验证时间戳一致性
/scan-sensitive-info - 扫描敏感信息
/check-duplicates - 检测重复条目
第4层 - 权限系统诊断
权限健康检查
检查项目:
1. 权限配置检查:
- 验证权限配置文件有效性
- 检查角色定义完整性
- 验证权限分配正确性
2. 审计日志检查:
- 检查审计日志文件存在
- 验证日志格式一致性
- 检查日志文件大小
3. 权限冲突检测:
- 检测权限分配冲突
- 发现权限缝隙
- 建议权限优化
4. 异常操作检测:
- 检查是否有越权操作
- 检测可疑的操作模式
- 查找安全威胁
检查命令:
/diagnose-permissions - 执行完整权限诊断
/verify-permission-config - 验证权限配置
/audit-anomalies - 检测审计异常
/permission-conflict-check - 检查权限冲突
/security-assessment - 执行安全评估
第5层 - 性能监控诊断
性能诊断
监控指标:
1. 文件操作性能:
- 读取延迟 (ms)
- 写入延迟 (ms)
- 操作吞吐量 (ops/sec)
2. 内存使用:
- 当前内存占用 (MB)
- 内存峰值 (MB)
- 内存泄漏风险
3. CPU使用率:
- 当前CPU使用 (%)
- 峰值CPU使用 (%)
4. 系统负载:
- 1分钟平均负载
- 5分钟平均负载
- 15分钟平均负载
5. 缓存效率:
- 缓存命中率 (%)
- 缓存大小 (MB)
- 缓存刷新频率
监控命令:
/diagnose-performance - 获取性能诊断报告
/monitor-memory - 监控内存使用
/monitor-cpu - 监控CPU使用
/cache-stats - 查看缓存统计
/performance-trends - 查看性能趋势
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 · 369 lines · 2,650 tokens per session scan A 91cd03a25beb
system-diagnostics 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 2,650 tokens to every session, about $0.0132 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.