重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
npx skills add https://github.com/pproenca/dot-skills --skill rails-dev适用于 Ruby on Rails 应用程序的全面性能和可维护性优化指南,由社区维护。包含 8 个类别共 45 条规则,按影响优先级排序,以指导自动化重构和代码生成。
在以下情况下参考这些指南:
| 优先级 | 类别 | 影响 | 前缀 |
|---|---|---|---|
| 1 | 数据库 & ActiveRecord | 关键 | db- |
| 2 | 控制器 & 路由 | 关键 | ctrl- |
| 3 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 安全 |
| 高 |
sec- |
| 4 | 模型 & 业务逻辑 | 高 | model- |
| 5 | 缓存 & 性能 | 高 | cache- |
| 6 | 视图 & 前端 | 中高 | view- |
| 7 | API 设计 | 中 | api- |
| 8 | 后台作业 & 异步 | 低中 | job- |
db-eager-load-associations - 预加载关联以消除 N+1 查询db-add-database-indexes - 在查询列上添加数据库索引db-select-specific-columns - 仅选择需要的列db-batch-processing - 使用 find_each 进行大数据集迭代db-avoid-queries-in-loops - 避免在循环内执行数据库查询db-use-scopes - 在模型上定义可复用的查询作用域db-safe-migrations - 编写可逆的零停机时间迁移db-exists-over-count - 使用 exists? 替代 count 进行存在性检查ctrl-thin-controllers - 通过委托给模型和服务来保持控制器精简ctrl-strong-params - 始终为批量赋值使用强参数ctrl-restful-routes - 遵循 RESTful 路由约定ctrl-before-action-scoping - 使用 only/except 限定 before_action 回调的范围ctrl-respond-to-format - 使用 respond_to 处理多格式响应ctrl-rescue-from - 在控制器中使用 rescue_from 处理错误sec-parameterized-queries - 切勿在 SQL 中插入用户输入sec-strong-params-whitelist - 白名单允许的参数,切勿使用黑名单sec-authenticate-before-authorize - 在每个请求中先认证再授权sec-csrf-protection - 为所有表单提交启用 CSRF 保护sec-scope-queries-to-user - 将查询范围限定在当前用户以进行授权model-validate-at-model-level - 在模型层验证数据model-avoid-callback-side-effects - 避免在模型回调中产生副作用model-use-service-objects - 将复杂逻辑提取到服务对象中model-scope-over-class-methods - 使用作用域而非类方法来组合查询model-use-enums - 对有限状态字段使用枚举model-concerns-for-shared-behavior - 使用 Concern 实现共享的模型行为model-query-objects - 将复杂查询提取到查询对象中cache-fragment-caching - 对开销大的视图局部使用片段缓存cache-russian-doll - 对嵌套集合使用俄罗斯套娃缓存cache-low-level - 使用 Rails.cache.fetch 缓存计算数据cache-counter-cache - 对关联计数使用计数器缓存cache-conditional-get - 使用 stale? 配合条件 GET 进行 HTTP 缓存view-collection-rendering - 使用集合渲染替代循环局部视图view-turbo-frames - 使用 Turbo Frames 进行局部页面更新view-turbo-streams - 使用 Turbo Streams 进行实时页面变更view-form-with - 使用 form_with 替代 form_tag 或 form_forview-avoid-logic-in-views - 将显示逻辑移至辅助器或展示器中api-serializers - 使用序列化器生成一致的 JSON 响应api-pagination - 始终对集合端点进行分页api-versioning - 从一开始就对 API 进行版本控制api-error-responses - 返回结构化的错误响应api-avoid-jbuilder-hot-paths - 避免在高流量端点上使用 Jbuilderjob-idempotent-design - 将作业设计为幂等的job-small-payloads - 向作业传递 ID,而非序列化对象job-error-handling - 为作业配置重试和错误处理job-unique-jobs - 防止重复作业入队阅读各个参考文件以获取详细解释和代码示例:
| 文件 | 描述 |
|---|---|
| references/_sections.md | 类别定义和排序 |
| assets/templates/_template.md | 新规则模板 |
| metadata.json | 版本和参考信息 |
每周安装次数
61
仓库
GitHub 星标数
93
首次出现
2026年2月12日
安全审计
已安装于
codex55
opencode55
gemini-cli55
github-copilot54
kimi-cli53
amp52
Comprehensive performance and maintainability optimization guide for Ruby on Rails applications, maintained by Community. Contains 45 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Database & ActiveRecord | CRITICAL | db- |
| 2 | Controllers & Routing | CRITICAL | ctrl- |
| 3 | Security | HIGH | sec- |
| 4 | Models & Business Logic | HIGH | model- |
| 5 | Caching & Performance | HIGH | cache- |
| 6 | Views & Frontend | MEDIUM-HIGH | view- |
| 7 | API Design | MEDIUM | api- |
| 8 | Background Jobs & Async | LOW-MEDIUM | job- |
db-eager-load-associations - Eager load associations to eliminate N+1 queriesdb-add-database-indexes - Add database indexes on queried columnsdb-select-specific-columns - Select only needed columnsdb-batch-processing - Use find_each for large dataset iterationdb-avoid-queries-in-loops - Avoid database queries inside loopsctrl-thin-controllers - Keep controllers thin by delegating to models and servicesctrl-strong-params - Always use strong parameters for mass assignmentctrl-restful-routes - Follow RESTful routing conventionsctrl-before-action-scoping - Scope before_action callbacks with only/exceptctrl-respond-to-format - Use respond_to for multi-format responsessec-parameterized-queries - Never interpolate user input in SQLsec-strong-params-whitelist - Whitelist permitted params, never blacklistsec-authenticate-before-authorize - Authenticate before authorize on every requestsec-csrf-protection - Enable CSRF protection for all form submissionssec-scope-queries-to-user - Scope queries to current user for authorizationmodel-validate-at-model-level - Validate data at the model levelmodel-avoid-callback-side-effects - Avoid side effects in model callbacksmodel-use-service-objects - Extract complex logic into service objectsmodel-scope-over-class-methods - Use scopes instead of class methods for query compositionmodel-use-enums - Use enums for finite state fieldscache-fragment-caching - Use fragment caching for expensive view partialscache-russian-doll - Use Russian doll caching for nested collectionscache-low-level - Use Rails.cache.fetch for computed datacache-counter-cache - Use counter caches for association countscache-conditional-get - Use conditional GET with stale? for HTTP cachingview-collection-rendering - Use collection rendering instead of loop partialsview-turbo-frames - Use Turbo Frames for partial page updatesview-turbo-streams - Use Turbo Streams for real-time page mutationsview-form-with - Use form_with instead of form_tag or form_forview-avoid-logic-in-views - Move display logic to helpers or presentersapi-serializers - Use serializers for consistent JSON responsesapi-pagination - Always paginate collection endpointsapi-versioning - Version APIs from day oneapi-error-responses - Return structured error responsesapi-avoid-jbuilder-hot-paths - Avoid Jbuilder on high-traffic endpointsjob-idempotent-design - Design jobs to be idempotentjob-small-payloads - Pass IDs to jobs, not serialized objectsjob-error-handling - Configure retry and error handling for jobsjob-unique-jobs - Prevent duplicate job enqueuingRead individual reference files for detailed explanations and code examples:
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
Weekly Installs
61
Repository
GitHub Stars
93
First Seen
Feb 12, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex55
opencode55
gemini-cli55
github-copilot54
kimi-cli53
amp52
GSAP 框架集成指南:Vue、Svelte 等框架中 GSAP 动画最佳实践
3,400 周安装
agentation - AI代理视觉UI反馈工具,连接人眼与代码的桥梁
13 周安装
LLM基准测试工具lm-evaluation-harness:评估大语言模型性能的60+学术基准
61 周安装
OMC (Oh-My-Claudecode) - Claude Code 多智能体编排插件,实现团队优先的AI代码开发
14 周安装
OMG智能体编排工具:自动化AI开发流程规划、执行与UI反馈
15 周安装
LangChain迁移到Agently指南:智能体开发、工具集成与RAG实现
17 周安装
Agently输出控制:结构化JSON输出、流式传输与可靠性控制指南
17 周安装
db-use-scopesdb-safe-migrations - Write reversible zero-downtime migrationsdb-exists-over-count - Use exists? instead of count for existence checksctrl-rescue-frommodel-concerns-for-shared-behaviormodel-query-objects - Extract complex queries into query objects