diff --git a/.ai/wayfinder/core.blade.php b/.ai/wayfinder/core.blade.php index 73df67ee..d851cf2e 100644 --- a/.ai/wayfinder/core.blade.php +++ b/.ai/wayfinder/core.blade.php @@ -3,12 +3,4 @@ @endphp # Laravel Wayfinder -Wayfinder generates TypeScript functions for Laravel routes. Import from `@/actions/` (controllers) or `@/routes/` (named routes). - -- IMPORTANT: Activate `wayfinder-development` skill whenever referencing backend routes in frontend components. -- Invokable Controllers: `import StorePost from '@/actions/.../StorePostController'; StorePost()`. -- Parameter Binding: Detects route keys (`{post:slug}`) — `show({ slug: "my-post" })`. -- Query Merging: `show(1, { mergeQuery: { page: 2, sort: null } })` merges with current URL, `null` removes params. -@if($assist->roster->uses(\Laravel\Roster\Enums\Packages::INERTIA_LARAVEL) || $assist->roster->uses(\Laravel\Roster\Enums\Packages::INERTIA_REACT) || $assist->roster->uses(\Laravel\Roster\Enums\Packages::INERTIA_VUE) || $assist->roster->uses(\Laravel\Roster\Enums\Packages::INERTIA_SVELTE)) -- Inertia: Use `.form()` with `
` component or `form.submit(store())` with useForm. -@endif +Use Wayfinder to generate TypeScript functions for Laravel routes. Import from `@/actions/` (controllers) or `@/routes/` (named routes). diff --git a/.ai/wayfinder/skill/wayfinder-development/SKILL.blade.php b/.ai/wayfinder/skill/wayfinder-development/SKILL.blade.php index e0382224..70df8895 100644 --- a/.ai/wayfinder/skill/wayfinder-development/SKILL.blade.php +++ b/.ai/wayfinder/skill/wayfinder-development/SKILL.blade.php @@ -1,6 +1,6 @@ --- name: wayfinder-development -description: "Activates whenever referencing backend routes in frontend components. Use when importing from @/actions or @/routes, calling Laravel routes from TypeScript, or working with Wayfinder route functions." +description: "Use this skill for Laravel Wayfinder which auto-generates typed functions for Laravel controllers and routes. ALWAYS use this skill when frontend code needs to call backend routes or controller actions. Trigger when: connecting any React/Vue/Svelte/Inertia frontend to Laravel controllers, routes, building end-to-end features with both frontend and backend, wiring up forms or links to backend endpoints, fixing route-related TypeScript errors, importing from @/actions or @/routes, or running wayfinder:generate. Use Wayfinder route functions instead of hardcoded URLs. Covers: wayfinder() vite plugin, .url()/.get()/.post()/.form(), query params, route model binding, tree-shaking. Do not use for backend-only task" license: MIT metadata: author: laravel diff --git a/tests/Feature/Install/GuidelineComposerTest.php b/tests/Feature/Install/GuidelineComposerTest.php index 5dcde82a..97d364e1 100644 --- a/tests/Feature/Install/GuidelineComposerTest.php +++ b/tests/Feature/Install/GuidelineComposerTest.php @@ -480,7 +480,7 @@ expect($guidelines) ->toContain('=== wayfinder/core rules ===') ->toContain('# Laravel Wayfinder') - ->toContain('Inertia: Use `.form()` with `` component'); + ->toContain('Use Wayfinder to generate TypeScript functions for Laravel routes'); }); test('includes wayfinder guidelines with inertia vue integration', function (): void { @@ -516,7 +516,7 @@ expect($guidelines) ->toContain('=== wayfinder/core rules ===') ->toContain('# Laravel Wayfinder') - ->toContain('Inertia: Use `.form()` with `` component'); + ->toContain('Use Wayfinder to generate TypeScript functions for Laravel routes'); }); test('includes wayfinder guidelines with inertia svelte integration', function (): void { @@ -552,7 +552,7 @@ expect($guidelines) ->toContain('=== wayfinder/core rules ===') ->toContain('# Laravel Wayfinder') - ->toContain('Inertia: Use `.form()` with `` component'); + ->toContain('Use Wayfinder to generate TypeScript functions for Laravel routes'); }); test('includes wayfinder guidelines without inertia integration when inertia is not present', function (): void { @@ -586,9 +586,7 @@ expect($guidelines) ->toContain('=== wayfinder/core rules ===') ->toContain('# Laravel Wayfinder') - ->toContain('Invokable Controllers') - ->toContain('Parameter Binding') - ->not->toContain('Inertia:'); + ->toContain('Use Wayfinder to generate TypeScript functions for Laravel routes'); }); test('the guidelines are in correct order', function (): void {