I recently stumbled on a README.md file I authored years ago for a Rails routing library I thought should exist, but at the time I wasn’t smart enough to figure out how to actually implement it. The premise of the proposed library was that while my method for Rails model namespacing had found adoption, and it had proved especially useful in applications with several hundred models, the gymnastics required within app/routes.rb could be overwhelming. In fact, in my own experience this was a place where Bullet Train’s Super Scaffolding became unreliable and buggy in ways that I also wasn’t smart enough to figure out and fix.

Well, years later, the README file still hits for me and the proposed library still felt like something that should exist, so I pointed Claude at it and a few hours later it now exists!

Now, with models like Project and Projects::Deliverable, instead of:

collection_actions = [:index, :new, :create]

resources :projects do
  scope module: 'projects' do
    resources :deliverables, only: collection_actions
  end
end

namespace :projects do
  resources :deliverables, except: collection_actions
end

We get:

model "Project" do 
  model "Projects::Deliverable"
end

I know in the agentic era there are people wondering whether this sort of syntactic sugar matters anymore. I think it does. There is nothing logical or maintainable about what we’ve been doing in app/routes.rb files. Even if agents were good at this, is this what I want my them thinking about every time they implement a new feature? Absolutely not. And every token it spends thinking about this is a distraction that blunts its focus on whatever unique problem I’m actually trying to solve.

A wise-man once said, “a framework is an intelligence cache.” So are libraries!

Check out the repository!