agentsclimarketplace

Writing routes

Skill chrisrackstallion/pitchd-rails-cursor-plugin/skills/writing-routes

Declare Rails routes in DHH/37signals style — REST-first resources, shallow nesting, clear path helpers, constraints for wiring not auth, boring routes.rb. Use when editing config/routes.rb, adding resources, namespaces, member/collection routes, API boundaries, or when the user mentions routing, rails routes, paths, or URL design.From its SKILL.md

Install
npx -y skills add chrisrackstallion/pitchd-rails-cursor-plugin --skill writing-routes

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.7 KB, as published. Nobody here has run it

Writing Rails Routes

<objective> Shape URLs and `config/routes.rb` so they read like a table of contents: REST as default, shallow nesting where parents scope identity, member vs collection used correctly, constraints for real routing predicates only, and no clever meta-programming that hides the map of the app. Follow DHH/37signals instincts — boring routes, predictable helpers, monolith-friendly clarity. </objective>

Process

1. Determine What You're Building

TaskAction
New resourceRead references/patterns.md § REST Resources
Nested routesRead references/patterns.md § Shallow Nesting
Custom action / verb on URLRead references/patterns.md § Custom Actions vs New Resources; align with writing-controllers REST mapping
Singleton (session, account)Read references/patterns.md § Singleton resource
API namespaceRead references/patterns.md § API vs HTML
Format / host / subdomainRead references/patterns.md § Constraints
Redirects and legacy URLsRead references/patterns.md § Redirects
Code reviewRead all references, run PR checklist below

2. Decision Hints

Should this be nested? Nest when the child does not make sense without the parent in the URL for index / create. Use shallow: true so member routes drop the parent prefix.

Member or collection? One record → member; the collection → collection. Otherwise consider index with query params or a new resource.

Non-RESTful route? Allowed when rare, named, and honest — not as a junk drawer. Prefer new resources + CRUD (see writing-controllers) when the custom verb keeps multiplying.

3. Verification

Before finishing, verify:

  • rails routes output is scannable — no unexplained duplication of huge blocks
  • Nesting is at most one parent deep for member routes, or shallowing is used
  • only / except match real controller actions
  • Path helpers read clearly in views (*_path / *_url — no ambiguous names)
  • constraints are for format/host/subdomain — not user permissions
  • No meta-programmed route tables that obscure rails routes
  • Custom routes are justified in a comment or PR (why not standard REST?)

References

For examples, edge cases, and testing notes, see references/patterns.md.

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.