Layered Rails
Granskar och refaktorerar Rails-kod per arkitekturlager med hjälp av specifikationstestet
Testad · Fungerar
Vad den gör
Analyserar, granskar och refaktorerar Ruby on Rails-kod mot en fyrskiktsarkitektur (presentation, applikation, domän, infrastruktur), flaggar skiktsöverträdelser som Current-i-modeller, affärslogik i controllers, anemiska modeller och lågpoängs-callbacks. Utlöses vid granskning av Rails PRs/diffs eller skrivning/refaktorering av models, controllers, services, jobs, policies, form/query/value objects, presenters, or state machines. Levereras med workflows for a full architecture audit, code review, specification test, callback scoring, and god-object analysis, plus pattern and gem references.
Testrapport
Hämtade SKILL.md på layered-rails/skills/layered-rails/; frontmatter parsas med name+description; punktkontrollerade 4 refererade filer (architecture-layers, spec-test workflow, service-objects, plugin.json) alla HTTP 200; inga security smells. Verifierade the install block in a temp HOME — SKILL.md lands at ~/.claude/skills/layered-rails/SKILL.md. Körde the spec-test workflow on a fresh fat SubscriptionsController I wrote (not the skill's own example). Baslinjegranskningen svepte proration/tax OCH alla side effects into one CreateSubscription service (an anemic-model trap); the skill-followed output produced a per-context test skeleton (10 contexts, 3 ✓ / 7 ✗, "30% belongs at this layer") and routed each concern to a different layer — proration/tax to the Subscription model as a before_validation transformer plus a TaxRate value object, Stripe to a service+job, email/analytics to Active Delivery — with test-impact per extraction. Konkret divergence: model vs service placement for domain math, which baseline got backwards.
Testad: 2026-07-21 · Claude Code 2.x (agent harness)
Installation
git clone --depth 1 https://github.com/palkan/skills.git /tmp/layered-rails-src mkdir -p ~/.claude/skills cp -R /tmp/layered-rails-src/layered-rails/skills/layered-rails ~/.claude/skills/layered-rails # No external deps: allowed-tools are Grep/Glob/Read/Task, all in-context. Pure Rails/Ruby architecture guidance. # Plugin alternative (adds /layered-rails:* slash commands): # /plugin marketplace add palkan/skills # /plugin install layered-rails@palkan-skills
Kommandon och exempelprompter
/layered-railsGranskar och refaktorerar Rails-kod per arkitekturlager med hjälp av specifikationstestet
Skills triggas av vanliga förfrågningar — inga kommandon att memorera. Efter installationen aktiverar prompter som dessa skillen (på engelska):
Refactor this fat controller using layered designReview this PR for layer violationsMove this business logic into a service object