Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions .ai/wayfinder/core.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<Form>` 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).
2 changes: 1 addition & 1 deletion .ai/wayfinder/skill/wayfinder-development/SKILL.blade.php
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 4 additions & 6 deletions tests/Feature/Install/GuidelineComposerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@
expect($guidelines)
->toContain('=== wayfinder/core rules ===')
->toContain('# Laravel Wayfinder')
->toContain('Inertia: Use `.form()` with `<Form>` component');
->toContain('Use Wayfinder to generate TypeScript functions for Laravel routes');
});

test('includes wayfinder guidelines with inertia vue integration', function (): void {
Expand Down Expand Up @@ -516,7 +516,7 @@
expect($guidelines)
->toContain('=== wayfinder/core rules ===')
->toContain('# Laravel Wayfinder')
->toContain('Inertia: Use `.form()` with `<Form>` component');
->toContain('Use Wayfinder to generate TypeScript functions for Laravel routes');
});

test('includes wayfinder guidelines with inertia svelte integration', function (): void {
Expand Down Expand Up @@ -552,7 +552,7 @@
expect($guidelines)
->toContain('=== wayfinder/core rules ===')
->toContain('# Laravel Wayfinder')
->toContain('Inertia: Use `.form()` with `<Form>` 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 {
Expand Down Expand Up @@ -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 {
Expand Down
Loading