routing
Installation
SKILL.md
Rails Routing Expert
Define clean, RESTful, minimal routes. Extra routes create unnecessary attack surface and confuse other developers reading routes.rb.
Philosophy
- RESTful by default — Use
resourcesandresource. Custom routes are a smell. - Minimal surface area — Always use
only:orexcept:to expose just what's needed. - Path helpers everywhere — Hardcoded URL strings break when routes change. Use
_pathand_urlhelpers. - Shallow nesting only — Don't nest resources more than 1 level deep; deeper nesting creates painful URLs and helper names.
- New resource > custom action — If you're adding many custom actions, you need a new controller.