Token导航 LogoToken导航

Agent Skill · 开发

layered-rails(layered Rails 搜索)

layered-rails 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

layered-rails 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 14,181。

总安装 742周安装 30GitHub Stars 37下载 233核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:layered-rails(layered Rails 搜索)
来源仓库:https://github.com/majesticlabs-dev/majestic-marketplace
仓库路径:skills/layered-rails
安装命令:
npx skills add https://github.com/majesticlabs-dev/majestic-marketplace --skill layered-rails
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/majesticlabs-dev/majestic-marketplace --skill layered-rails

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

layered-rails 用于处理 GitHub 仓库、Issue、Pull Request 等协作信息,适合代码变更跟踪。适用于需要围绕仓库状态或协作事项进行整理的场景,如项目进度管理。通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 核验具体用法。

安装前建议确认权限范围和维护状态,注意可能触发联网或命令执行操作。使用时需核实来源仓库内容,避免依赖未经验证的外部资源。

来源仓库内路径:skills/layered-rails

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/majesticlabs-dev/majestic-marketplace --skill…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

layered-rails 怎么安装?

在终端执行 npx skills add https://github.com/majesticlabs-dev/majestic-marketplace --skill layered-ra…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

layered-rails 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

layered-rails 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

layered-rails 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

layered-rails 用的人多吗?

公开数据是累计安装 742 次,近一周安装 30 次,下载 233 次,GitHub 37 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

layered-rails 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
layered-rails

layered Rails 搜索 · 本页

74237调用外部服务未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Layered Rails Architecture

Audience: Rails developers working on applications that have outgrown single-file patterns. Goal: Know which layer code belongs in, when to extract, and which existing skill handles the implementation.

Four-Layer Architecture

Presentation  →  Application  →  Domain  →  Infrastructure
(HTTP/UI)        (Orchestration)  (Business)   (Persistence/APIs)

Core rule: Lower layers MUST NOT depend on higher layers. Data flows top-to-bottom only.

Layer Responsibilities

LayerOwnsDoes NOT Own
PresentationHTTP concerns, params, rendering, channels, mailersBusiness logic, direct DB queries
ApplicationOrchestration across models, authorization, form validationPersistence details, rendering
DomainBusiness rules, validations, associations, value objectsHTTP context, request objects, Current.*
InfrastructureActiveRecord, external APIs, file storage, cachingBusiness rules, presentation

Common Layer Violations

ViolationWhy It's WrongFix
Current.user in modelDomain depends on presentation contextPass user as explicit parameter
request param in serviceApplication depends on presentationExtract needed values before calling service
Pricing calc in controllerBusiness logic in presentationMove to model method or service
All logic in services, anemic modelsDomain layer is hollowKeep domain logic in models; services orchestrate
Model sends emails directlyDomain depends on infrastructure side-effectsUse callbacks only for data transforms; extract delivery

The Specification Test

Diagnostic for misplaced code:

  1. List every responsibility the object handles
  2. For each, ask: "Does this belong to this layer's primary concern?"
  3. If NO → extract to the appropriate layer

Example: A User model that handles authentication, avatar processing, notification preferences, and activity logging.

  • Authentication → Domain (keep)
  • Avatar processing → Infrastructure (extract to service/job)
  • Notification preferences → Domain (keep as concern)
  • Activity logging → Infrastructure (extract to observer/event)

See references/extraction-signals.md for the full methodology.

Callback Scoring

Rate each callback 1-5. Extract anything scoring 1-2.

ScoreTypeExampleAction
5Transformerbefore_validation:normalize_emailKeep
4Normalizerbefore_save:strip_whitespaceKeep
4Utilityafter_create:update_counter_cacheKeep
2Observerafter_save:notify_adminConsider extracting
1Operationafter_create:send_welcome_email,:provision_accountExtract

Rule of thumb: If removing the callback would break the model's own data integrity → keep. If it triggers external side-effects → extract.

Pattern Selection

"Where should this code go?"

SituationPatternLayerSkill
Complex multi-model formForm ObjectPresentation—
Request param filteringFilter ObjectPresentation—
View-specific formattingPresenter / ViewComponentPresentationviewcomponent-coder
Authorization rulesPolicy ObjectApplicationaction-policy-coder
Business operation (one-time)Service / InteractionApplicationactive-interaction-coder
Multi-model orchestrationService ObjectApplicationactive-interaction-coder
State lifecycle managementState MachineDomainaasm-coder
Complex reusable queryQuery ObjectDomain—
Immutable concept (Money, DateRange)Value ObjectDomain—
Shared model behaviorConcernDomain—
Typed configurationConfig ObjectInfrastructureanyway-config-coder
Domain events / audit trailEvent SourcingInfrastructureevent-sourcing-coder
JSON-backed attributesStore ModelDomainstore-model-coder

Decision Tree

Is it about HTTP/params/rendering?
  YES → Presentation layer
    Multi-model form? → Form Object
    Filtering params? → Filter Object
    Formatting for view? → Presenter or ViewComponent
  NO ↓

Is it authorization?
  YES → Policy Object (action-policy-coder)
  NO ↓

Does it orchestrate multiple models/services?
  YES → Application layer
    One-time operation? → Service/Interaction (active-interaction-coder)
    Needs typed inputs? → ActiveInteraction (active-interaction-coder)
  NO ↓

Is it a business rule about a single model?
  YES → Domain layer (keep in model or concern)
    Has state transitions? → AASM (aasm-coder)
    Reusable query? → Query Object
    Immutable value? → Value Object
  NO ↓

Is it about persistence/external APIs/caching?
  YES → Infrastructure layer

Services as Waiting Rooms

app/services/ is a temporary staging area, not a permanent home.

  • Services that survive should eventually reveal the real abstraction they represent
  • If a service wraps a single model operation → it probably belongs in the model
  • If a service coordinates 3+ models → it's a legitimate orchestrator
  • If a service grows complex → look for Form Object, Policy, or Query Object hiding inside

Smell test: If app/services/ has 50+ files and no subdirectories, the waiting room has become permanent storage.

Extraction Signals

When to extract code from existing locations:

SignalThresholdAction
Method length> 15 linesExtract method or object
External API call in modelAnyExtract to service/gateway
God objectHigh churn × high complexityDecompose (see references/extraction-signals.md)
Spec exceeds layer concernSpecification test failsExtract to appropriate layer
Callback score1-2/5Extract to service or event handler
Duplicated query logic2+ locationsExtract Query Object
Current.* in modelAny usagePass as explicit parameter

See references/extraction-signals.md for the complete methodology.

Model Organization

Recommended ordering within model files:

class Order < ApplicationRecord
  # 1. Extensions/DSL (has_secure_password, acts_as_*)
  # 2. Associations
  # 3. Enums
  # 4. Normalizations
  # 5. Validations
  # 6. Scopes
  # 7. Callbacks (transformers/normalizers only — score 4-5)
  # 8. Delegations
  # 9. Public methods
  # 10. Private methods
end

When Layered vs DHH Style

This skill complements dhh-coder, not replaces it.

SituationUse
Small/medium app, standard CRUDdhh-coder — keep it simple
Complex domain, multiple bounded contextslayered-rails — add structure
Authorization beyond simple checksaction-policy-coder via layered guidance
Fat model with 500+ lineslayered-rails extraction signals
Standard controller actionsdhh-coder — 7 REST actions
Multi-step business operationactive-interaction-coder via layered guidance

Default to simplicity. Reach for layered patterns only when complexity demands it.

Success Checklist

  • No reverse dependencies (lower layers don't reference higher)
  • Models don't access Current attributes
  • Services don't accept request/controller objects
  • Controllers contain only HTTP concerns
  • Domain logic lives in models, not leaked into services
  • All callbacks score 4+ (or extracted)
  • Concerns group by behavior, not by artifact type
  • Each abstraction belongs to exactly one layer

Cross-References

NeedSkill
Authorization policiesaction-policy-coder
Typed business operationsactive-interaction-coder
State machinesaasm-coder
Operations + state routingbusiness-logic-coder
ViewComponentsviewcomponent-coder
Typed configurationanyway-config-coder
Event sourcing / auditevent-sourcing-coder
JSON attributesstore-model-coder
Refactoring executionrails-refactorer
DHH-style simplicitydhh-coder
Pattern catalog detailsreferences/pattern-catalog.md
Extraction methodologyreferences/extraction-signals.md

平台分布

Codex

34.9%
按下载量换算81

Claude

28.3%
按下载量换算66

Cursor

21.79%
按下载量换算51

Gemini CLI

9.27%
按下载量换算22

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills