Wheels Routing Generator

Generate RESTful, nested, and custom routes for CFWheels applications.

203|108|Updated Jan 13, 2011
One-click install
npx skills add https://github.com/wheels-dev/wheels --skill wheels-routing-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Wheels Routing Generator
Source: https://github.com/wheels-dev/wheels/tree/main/.claude/skills/wheels-routing-generator
Command: npx skills add https://github.com/wheels-dev/wheels --skill wheels-routing-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill simplifies the often-complex task of defining URL structures and RESTful routes in CFWheels applications, preventing routing errors and ensuring a consistent, maintainable API design. It automates the boilerplate, so you don't have to.

Core Features & Use Cases

  • Comprehensive Route Generation: Create basic, RESTful, nested, and custom routing patterns.
  • Advanced Routing Controls: Implement route constraints, namespaces, path scoping, and API versioning.
  • Use Case: Quickly set up a /posts resource with all standard CRUD actions, then easily add nested /posts/[key]/comments routes. This ensures your application's URL structure is logical, maintainable, and adheres to RESTful principles without manual configuration.

Quick Start

In config/routes.cfm:

mapper() .resources("posts") # Generates 7 RESTful routes for posts .get(name="about", pattern="about", to="pages##about") .end();

Frequently Asked Questions about Wheels Routing Generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define RESTful routes in CFWheels applications?

RESTful routes in CFWheels are defined using the mapper in config/routes.cfm. Call .resources("modelname") to automatically generate seven standard CRUD routes (index, show, new, create, edit, update, delete) with proper HTTP verbs and URL patterns, eliminating manual route configuration.

Can I create nested routes with parent-child resource relationships?

Yes, CFWheels supports nested routes with shallow nesting to avoid deeply coupled URL structures. Use mapper chaining to add nested resources like .resources("posts").resources("comments"), generating routes such as /posts/[id]/comments while maintaining clean URL hierarchies.

What's the best way to organize API versioning and namespaces in URL routing?

Namespaces and path scoping organize routes by API version or logical grouping. Use mapper.namespace() and mapper.scope() to prefix routes, applying HTTP constraints and versioning (e.g., /v1/api/posts) across multiple resources without duplicating configuration.

How do I add custom route constraints and named routes to CFWheels applications?

Custom routes use mapper methods to define constraints on HTTP verbs, URL patterns, and parameter validation. Named routes let you reference routes by identifier in templates and controllers, improving maintainability and reducing hardcoded URLs across your application.

Do I need to manually configure each HTTP verb mapping for REST endpoints?

No, the resources() method automates HTTP verb mapping. It binds GET, POST, PUT, PATCH, and DELETE to appropriate controller actions based on REST conventions, eliminating repetitive boilerplate and ensuring consistency across endpoints.

What are the limitations of URL routing patterns in CFWheels?

Route constraints apply at definition time in config/routes.cfm and enforce URL format, HTTP verb, and namespace rules. Overly complex wildcard patterns or deeply nested resource chains can reduce readability; shallow nesting and clear scoping preserve maintainability.