itsmejay18/ai-skills-for-my-development-stack/routing-and-controllers

Claude Code and agent skill by itsmejay18/ai-skills-for-my-development-stack

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Creating controllers, registering routes, and understanding how routes map to Wayfinder TypeScript actions.

Install

npx vskill@latest install itsmejay18/ai-skills-for-my-development-stack/routing-and-controllers

SKILL.md

The same SKILL.md was published earlier as itsmejay18/ai-skills-for-my-development-stack/routing-and-controllers.

Routing and Controllers

When to Activate This Skill

Activate this skill whenever:

  • Creating new controllers or modifying existing ones
  • Registering routes in routes/web.php or other route files
  • Working with RESTful resource routing
  • Understanding how routes map to Wayfinder TypeScript actions
  • Troubleshooting missing controller actions or route registration issues

The Complete Workflow

When creating a new controller with a route:

  1. Create the controller using Artisan:

``bash php artisan make:controller JobController --no-interaction ``

  1. Implement the controller action with proper type hints and return types:

``php final class JobController { public function show(int $id): string { return "Job details for job {$id}"; } } ``

  1. Register the route in routes/web.php:

```php use App\Http\Controllers\JobController;

Route::middleware(['auth', 'verified'])->group(function () { Route::resource('jobs', JobController::class) ->only(['show']); }); ```

  1. Generate Wayfinder TypeScript actions:

``bash php artisan wayfinder:generate --no-interaction ``

  1. Use the generated action in React components:

```typescript import JobController from '@/actions/App/Http/Controllers/JobController';

<Link href={JobController.show(jobId).url}>View Job</Link> ```

RESTful Resource Routing

This project uses Laravel's resource routing convention:

php
Route::resource('jobs', JobController::class)
->only(['index', 'show', 'create', 'store', 'edit', 'update', 'destroy']);

Common patterns:

  • .only(['index', 'show']) — Read-only resources
  • .only(['show']) — Single action (like job details)
  • .only(['store', 'update', 'destroy']) — Mutation actions

Critical: Routes Must Be Registered for Wayfinder

Wayfinder only generates TypeScript action files for routes that are actually registered in your route files.

If you create a controller but don't register its route, Wayfinder won't generate the TypeScript action file, and you'll get import errors in your React components.

Troubleshooting Missing Action Files

If import JobController from '@/actions/...' fails:

  1. Check that the route is registered in routes/web.php
  2. Verify the controller class name matches the import path
  3. Run php artisan wayfinder:generate --no-interaction again
  4. Check that the generated file exists in resources/js/actions/

If still missing, activate the troubleshooting skill for further diagnosis.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/itsmejay18/ai-skills-for-my-development-stack/routing-and-controllers/badge)](https://verified-skill.com/skills/itsmejay18/ai-skills-for-my-development-stack/routing-and-controllers)

Something wrong with this skill or its page? Tell us.