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/bellmemo/bell-memo-android/maingit clone --depth 1 https://github.com/BellMemo/bell-memo-androidWhat 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.03061 | $0.03061 |
| Opus 5 | $0.01530 | $0.01530 |
| Sonnet 5 | $0.00612 | $0.00612 |
| Haiku 4.5 | $0.00306 | $0.00306 |
Grade A, and why
main 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 — 342 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Cursor AI 规则 - 通用开发指南
代码风格与最佳实践
通用原则
- 编写清晰、可读、可维护的代码
- 遵循项目现有的代码风格和约定
- 优先使用显式而非隐式代码
- 使用有意义的变量和函数名
- 保持函数小而专注,单一职责原则
- 避免深层嵌套(最多 3-4 层)
- 注释复杂逻辑,但优先编写自文档化代码
代码组织
- 将相关代码组织在一起
- 分离关注点(UI、业务逻辑、数据层)
- 使用一致的文件和文件夹命名约定
- 保持文件专注,避免上帝类/文件
- 组织导入:标准库优先,然后是第三方库,最后是本地文件
错误处理
- 始终显式处理错误
- 提供有意义的错误消息
- 使用适当的错误处理机制(try-catch、Result 类型等)
- 永远不要静默吞掉错误
- 适当记录错误以便调试
性能
- 避免过早优化
- 优化前先进行性能分析
- 注意内存使用
- 只优化关键路径
- 在适当的时候使用懒加载
- 缓存昂贵的计算(当有益时)
安全性
- 永远不要提交密钥、API 密钥或凭证
- 验证和清理用户输入
- 对数据库操作使用参数化查询
- 遵循最小权限原则
- 保持依赖项更新
- 审查第三方包的安全影响
Flutter/Dart 特定规则
Dart 风格指南
- 遵循官方 Dart 风格指南:https://dart.dev/guides/language/effective-dart/style
- 尽可能使用
const构造函数 - 当变量不会被重新赋值时,优先使用
final而非var - 适当使用空安全特性
- 仅在必要时且安全时使用
late关键字
Flutter 最佳实践
- 尽可能使用
constwidget 以提高性能 - 当不需要状态时,优先使用
StatelessWidget而非StatefulWidget - 当 widget 变得复杂时,将其提取到单独的文件中
- 对依赖于 context 的 widget 使用
Builder模式 - 避免在 build 方法中使用
setState - 适当使用
Key来标识 widget
状态管理
- 根据复杂度选择适当的状态管理解决方案
- 尽可能保持状态局部化
- 当多个 widget 需要时,将状态提升
- 使用 providers、bloc 或 riverpod 管理全局状态
- 避免属性传递 - 使用状态管理解决方案代替
Widget 组织
- 一个 widget 一个文件(除了小的、相关的 widget)
- 使用描述性的 widget 类名
- 将可复用的 widget 提取到单独的文件中
- 保持 build 方法清洁和可读
- 优先使用组合而非继承
资源与资源文件
- 将资源放在适当的目录中(
assets/、lib/assets/) - 使用从项目根目录的相对路径引用资源
- 使用适当的图片格式(尽可能使用 WebP)
- 添加到项目前优化图片
测试
- 为业务逻辑编写单元测试
- 为 UI 组件编写 widget 测试
- 为关键用户流程编写集成测试
- 在重要代码路径上追求良好的测试覆盖率
- 保持测试简单和专注
文件与项目结构
命名约定
- 文件名使用 snake_case(例如:
user_profile.dart) - 类名使用 PascalCase(例如:
UserProfile) - 变量和函数名使用 camelCase(例如:
userName、getUserData()) - 常量使用 UPPER_SNAKE_CASE(例如:
MAX_RETRY_COUNT)
目录结构
- 将相关文件放在一起
- 在适当时使用基于功能的组织方式
- 分离 UI、模型、服务和工具类
- 保持根目录整洁
文档
- 为公共 API 编写清晰的文档注释
- 使用
///进行文档注释 - 记录复杂的算法和业务逻辑
- 保持 README.md 更新
- 在 CHANGELOG.md 中记录破坏性更改
Git 与版本控制
提交信息规范
提交信息格式
提交信息应遵循以下格式:
<类型>(<范围>): <主题>
<正文>
<脚注>
提交类型(Type)
使用以下类型标识提交的性质:
feat: 新功能fix: 修复 bugdocs: 文档变更style: 代码格式调整(不影响代码运行)refactor: 代码重构(既不是新功能也不是 bug 修复)perf: 性能优化test: 添加或修改测试chore: 构建过程或辅助工具的变动ci: CI 配置文件和脚本的变更build: 构建系统或外部依赖的变更revert: 回滚之前的提交
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 · 342 lines · 3,061 tokens per session scan A 63baeb05bada
main is a cursor rule published in the GitHub repository BellMemo/bell-memo-android (4 stars, last pushed 8mo ago), licensed MIT. It adds 3,061 tokens to every session, about $0.0153 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
cursorrules
Kortix is a React Native + Expo app built with TypeScript, NativeWind (Tailwind CSS), and a custom design system.
git-commit-attribution
Git commits must use the human developer identity only; never Cursor Agent co-authorship.
android-viewmodel
Android ViewModel conventions — StateFlow, repository abstraction, coroutines, no LiveData.
project-structure
Cursor rule "project-structure" from HeeGyeong/ComposeSample, covering project structure guide, layer structure, modularization rules, dependency rules and resource management.
cursorrules
ROLE: Android Development Expert EXPERIENCELEVEL: Advanced (10+ years) SPECIALTIES.
ios-ui-development-focus
UI/UX and SwiftUI best practices - HIG compliance, presentation APIs, layout patterns.