Master backend architectures, REST API design, microservices, and server-side development across multiple languages. Use this as a central index to access specialized sub-skills.
日本語の概要は準備中です。原文の説明を表示しています。
Apply 37signals/DHH Rails conventions when writing Ruby on Rails code. Use when building Rails applications, reviewing Rails code, or making architectural decisions. Covers various aspects of Rails application architecture, design and dependencies.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
| Gem/Pattern | Why |
|---|---|
devise | Auth is ~150 lines of custom code |
pundit/cancancan | Authorization lives in models |
dry-rb, interactor | Over-engineered |
view_component | ERB partials are fine |
sidekiq, redis | Use Solid Queue (database-backed) |
graphql | REST with Turbo is sufficient |
Every action maps to a CRUD verb. Create new resources instead of custom actions:
# Avoid: Custom actions
resources :cards do
post :close
end
# Good: State changes as resources
resources :cards do
resource :closure # POST to close, DELETE to reopen
resource :pin # POST to pin, DELETE to unpin
resource :watch # POST to watch, DELETE to unwatch
end
Use scope module: for namespaced nested resources. Use resolve for custom polymorphic URL generation.
Controllers orchestrate; business logic lives in models.
def create
@card.close # All logic in model
respond_to do |format|
format.turbo_stream { render_card_replacement }
format.json { head :no_content }
end
end
Use concerns for shared behavior:
CardScoped, BoardScoped - load parent resources via before_actionCurrentRequest - populate Current with request dataBlockSearchEngineIndexing, RequestForgeryProtectionTurboFlash - flash messages via Turbo StreamCheck permissions in controller, define permission logic in model:
# Controller
before_action :ensure_permission_to_administer_card, only: [:destroy]
# Model
def can_administer_card?(card)
admin? || card.creator == self
end
Each concern is self-contained with associations, scopes, and methods:
class Card < ApplicationRecord
include Assignable, Closeable, Eventable, Pinnable, Watchable
end
module Card::Closeable
extend ActiveSupport::Concern
included do
has_one :closure, dependent: :destroy
scope :closed, -> { joins(:closure) }
scope :open, -> { where.missing(:closure) }
end
def closed? = closure.present?
def close(user: Current.user)
create_closure!(user: user) unless closed?
end
end
belongs_to :account, default: -> { board.account }
belongs_to :creator, class_name: "User", default: -> { Current.user }
Use ActiveSupport::CurrentAttributes for session, user, identity, account, and request metadata.
Namespace under parent model: Event::Description, Card::Eventable::SystemCommenter
Use for:
POROs are model-adjacent, NOT controller-adjacent (that would be a service object).
Create separate records instead of boolean columns:
# Separate record gives you: timestamp, who did it, easy scoping
class Closure < ApplicationRecord
belongs_to :card, touch: true
belongs_to :user, optional: true
end
card.closure.present? # Is it closed?
card.closure.user # Who closed it?
card.closure.created_at # When?
# Scoping
Card.closed # joins(:closure)
Card.open # where.missing(:closure)
Examples: Closure, Pin, Watch, Publication, Goldness
Custom passwordless magic link auth (~150 lines). No Devise.
Key components:
Authentication concern with require_authentication, resume_session, start_new_session_forSession model (belongs_to identity)MagicLink model with expiration and consumptionturbo_stream.replace, turbo_stream.before)method: :morph)static values/static classes for config, this.dispatch() for events, this.#privateMethod() for private methods_later and _now convention - mark_as_read_later queues job, mark_as_read_now executes immediatelyconfig/recurring.ymlchange { }, as: :turbo_stream, as: :jsonSignup as ActiveModelclose, reopen, publishclosed?, published?Adjectives describing capability: Closeable, Publishable, Watchable, Searchable
Nouns matching the resource: Cards::ClosuresController, Boards::PublicationsController
chronologically, reverse_chronologically, alphabetically, latestpreloaded as standard name for eager loadingindexed_by(index), sorted_by(sort)fresh_when etag: [...] for conditional GETetag { "v1" } in ApplicationController (bump to bust caches)cache card do in viewscached: true for collection renderingtouch: true on associations for cache invalidationaccount_id for multi-tenancy/{account_id}/boards/...@layer reset, base, components, modules, utilities@starting-style, color-mix(), :has(), native nesting, container queriesrespond_to201 Created + Location, Update/Delete → 204 No ContentUse sparingly:
after_commit :relay_later, on: :create for async workbefore_save :set_defaults for derived dataThe best code is the code you don't write. The second best is the code that's obviously correct.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Master backend architectures, REST API design, microservices, and server-side development across multiple languages. Use this as a central index to access specialized sub-skills.
日本語の概要は準備中です。原文の説明を表示しています。
在每次回复中使用固定前缀并列出本次实际参考的指令/文件,便于校验是否遵循上下文与规则。
日本語の概要は準備中です。原文の説明を表示しています。
Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.
日本語の概要は準備中です。原文の説明を表示しています。
Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.
日本語の概要は準備中です。原文の説明を表示しています。
Arquitecto de Soluciones Principal y Consultor Tecnológico de Andru.ia. Diagnostica y traza la hoja de ruta óptima para proyectos de IA en español.
日本語の概要は準備中です。原文の説明を表示しています。
[00] META. Orchestrate skills into dynamic chains for complex tasks. Analyzes the task, discovers available skills, builds an optimal chain, explains why each skill is needed, and executes step-by-step with user confirmation. Use for any complex task requiring multiple thinking/research/analysis steps. Triggers on "plan this", "how to approach", "what's the strategy", "build a plan", or any multi-step problem requiring skill orchestration.
日本語の概要は準備中です。原文の説明を表示しています。