You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .junie/guidelines.md
+56-68Lines changed: 56 additions & 68 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,15 +23,15 @@ This application is a Laravel application and its main Laravel ecosystems packag
23
23
- tailwindcss (TAILWINDCSS) - v4
24
24
25
25
## Conventions
26
-
- You must follow all existing code conventions used in this application. When creating or editing a file, check sibling files for the correct structure, approach, naming.
26
+
- You must follow all existing code conventions used in this application. When creating or editing a file, check sibling files for the correct structure, approach, and naming.
27
27
- Use descriptive names for variables and methods. For example, `isRegisteredForDiscounts`, not `discount()`.
28
28
- Check for existing components to reuse before writing a new one.
29
29
30
30
## Verification Scripts
31
31
- Do not create verification scripts or tinker when tests cover that functionality and prove it works. Unit and feature tests are more important.
32
32
33
33
## Application Structure & Architecture
34
-
- Stick to existing directory structure - don't create new base folders without approval.
34
+
- Stick to existing directory structure; don't create new base folders without approval.
35
35
- Do not change the application's dependencies without approval.
36
36
37
37
## Frontend Bundling
@@ -43,17 +43,16 @@ This application is a Laravel application and its main Laravel ecosystems packag
43
43
## Documentation Files
44
44
- You must only create documentation files if explicitly requested by the user.
45
45
46
-
47
46
=== boost rules ===
48
47
49
48
## Laravel Boost
50
49
- Laravel Boost is an MCP server that comes with powerful tools designed specifically for this application. Use them.
51
50
52
51
## Artisan
53
-
- Use the `list-artisan-commands` tool when you need to call an Artisan command to doublecheck the available parameters.
52
+
- Use the `list-artisan-commands` tool when you need to call an Artisan command to double-check the available parameters.
54
53
55
54
## URLs
56
-
- Whenever you share a project URL with the user you should use the `get-absolute-url` tool to ensure you're using the correct scheme, domain / IP, and port.
55
+
- Whenever you share a project URL with the user, you should use the `get-absolute-url` tool to ensure you're using the correct scheme, domain/IP, and port.
57
56
58
57
## Tinker / Debugging
59
58
- You should use the `tinker` tool when you need to execute PHP to debug code or query Eloquent models directly.
@@ -64,22 +63,21 @@ This application is a Laravel application and its main Laravel ecosystems packag
64
63
- Only recent browser logs will be useful - ignore old logs.
65
64
66
65
## Searching Documentation (Critically Important)
67
-
- Boost comes with a powerful `search-docs` tool you should use before any other approaches. This tool automatically passes a list of installed packages and their versions to the remote Boost API, so it returns only version-specific documentation specific for the user's circumstance. You should pass an array of packages to filter on if you know you need docs for particular packages.
68
-
- The 'search-docs' tool is perfect for all Laravelrelated packages, including Laravel, Inertia, Livewire, Filament, Tailwind, Pest, Nova, Nightwatch, etc.
69
-
- You must use this tool to search for Laravel-ecosystem documentation before falling back to other approaches.
66
+
- Boost comes with a powerful `search-docs` tool you should use before any other approaches when dealing with Laravel or Laravel ecosystem packages. This tool automatically passes a list of installed packages and their versions to the remote Boost API, so it returns only version-specific documentation for the user's circumstance. You should pass an array of packages to filter on if you know you need docs for particular packages.
67
+
- The `search-docs` tool is perfect for all Laravel-related packages, including Laravel, Inertia, Livewire, Filament, Tailwind, Pest, Nova, Nightwatch, etc.
68
+
- You must use this tool to search for Laravelecosystem documentation before falling back to other approaches.
70
69
- Search the documentation before making code changes to ensure we are taking the correct approach.
71
-
- Use multiple, broad, simple, topicbased queries to start. For example: `['rate limiting', 'routing rate limiting', 'routing']`.
72
-
- Do not add package names to queries - package information is already shared. For example, use `test resource table`, not `filament 4 test resource table`.
70
+
- Use multiple, broad, simple, topic-based queries to start. For example: `['rate limiting', 'routing rate limiting', 'routing']`.
71
+
- Do not add package names to queries; package information is already shared. For example, use `test resource table`, not `filament 4 test resource table`.
73
72
74
73
### Available Search Syntax
75
74
- You can and should pass multiple queries at once. The most relevant results will be returned first.
76
75
77
-
1. Simple Word Searches with auto-stemming - query=authentication - finds 'authenticate' and 'auth'
78
-
2. Multiple Words (AND Logic) - query=rate limit - finds knowledge containing both "rate" AND "limit"
79
-
3. Quoted Phrases (Exact Position) - query="infinite scroll" - Words must be adjacent and in that order
- If you receive an "Illuminate\Foundation\ViteException: Unable to locate file in Vite manifest" error, you can run `npm run build` or ask the user to run `npm run dev` or `composer run dev`.
168
164
169
-
170
165
=== laravel/v12 rules ===
171
166
172
167
## Laravel 12
173
168
174
-
- Use the `search-docs` tool to get versionspecific documentation.
169
+
- Use the `search-docs` tool to get version-specific documentation.
175
170
- This project upgraded from Laravel 10 without migrating to the new streamlined Laravel file structure.
176
-
- This is **perfectly fine** and recommended by Laravel. Follow the existing structure from Laravel 10. We do not to need migrate to the new Laravel structure unless the user explicitly requests that.
171
+
- This is **perfectly fine** and recommended by Laravel. Follow the existing structure from Laravel 10. We do not need to migrate to the new Laravel structure unless the user explicitly requests it.
177
172
178
173
### Laravel 10 Structure
179
174
- Middleware typically lives in `app/Http/Middleware/` and service providers in `app/Providers/`.
- When modifying a column, the migration must include all of the attributes that were previously defined on the column. Otherwise, they will be dropped and lost.
188
-
- Laravel 11 allows limiting eagerly loaded records natively, without external packages: `$query->latest()->limit(10);`.
183
+
- Laravel 12 allows limiting eagerly loaded records natively, without external packages: `$query->latest()->limit(10);`.
189
184
190
185
### Models
191
186
- Casts can and likely should be set in a `casts()` method on a model rather than the `$casts` property. Follow existing conventions from other models.
192
187
193
-
194
188
=== livewire/core rules ===
195
189
196
-
## Livewire Core
197
-
- Use the `search-docs` tool to find exact version specific documentation for how to write Livewire & Livewire tests.
198
-
- Use the `php artisan make:livewire [Posts\CreatePost]` artisan command to create new components
190
+
## Livewire
191
+
192
+
- Use the `search-docs` tool to find exact version-specific documentation for how to write Livewire and Livewire tests.
193
+
- Use the `php artisan make:livewire [Posts\CreatePost]` Artisan command to create new components.
199
194
- State should live on the server, with the UI reflecting it.
200
-
- All Livewire requests hit the Laravel backend, they're like regular HTTP requests. Always validate form data, and run authorization checks in Livewire actions.
195
+
- All Livewire requests hit the Laravel backend; they're like regular HTTP requests. Always validate form data and run authorization checks in Livewire actions.
201
196
202
197
## Livewire Best Practices
203
198
- Livewire components require a single root element.
<code-snippet name="Testing a Livewire component exists within a page" lang="php">
236
-
$this->get('/posts/create')
237
-
->assertSeeLivewire(CreatePost::class);
238
-
</code-snippet>
239
-
228
+
<code-snippet name="Testing Livewire Component Exists on Page" lang="php">
229
+
$this->get('/posts/create')
230
+
->assertSeeLivewire(CreatePost::class);
231
+
</code-snippet>
240
232
241
233
=== livewire/v3 rules ===
242
234
243
235
## Livewire 3
244
236
245
237
### Key Changes From Livewire 2
246
-
- These things changed in Livewire 2, but may not have been updated in this application. Verify this application's setup to ensure you conform with application conventions.
238
+
- These things changed in Livewire 3, but may not have been updated in this application. Verify this application's setup to ensure you conform with application conventions.
247
239
- Use `wire:model.live` for real-time updates, `wire:model` is now deferred by default.
248
240
- Components now use the `App\Livewire` namespace (not `App\Http\Livewire`).
249
241
- Use `$this->dispatch()` to dispatch events (not `emit` or `dispatchBrowserEvent`).
document.addEventListener('livewire:init', function () {
264
256
Livewire.hook('request', ({ fail }) => {
265
257
if (fail && fail.status === 419) {
@@ -273,7 +265,6 @@ document.addEventListener('livewire:init', function () {
273
265
});
274
266
</code-snippet>
275
267
276
-
277
268
=== pest/core rules ===
278
269
279
270
## Pest
@@ -294,9 +285,9 @@ it('is true', function () {
294
285
295
286
### Running Tests
296
287
- Run the minimal number of tests using an appropriate filter before finalizing code edits.
297
-
- To run all tests: `php artisan test`.
298
-
- To run all tests in a file: `php artisan test tests/Feature/ExampleTest.php`.
299
-
- To filter on a particular test name: `php artisan test --filter=testName` (recommended after making a change to a related file).
288
+
- To run all tests: `php artisan test --compact`.
289
+
- To run all tests in a file: `php artisan test --compact tests/Feature/ExampleTest.php`.
290
+
- To filter on a particular test name: `php artisan test --compact --filter=testName` (recommended after making a change to a related file).
300
291
- When the tests relating to your changes are passing, ask the user if they would like to run the entire test suite to ensure everything is still passing.
301
292
302
293
### Pest Assertions
@@ -315,7 +306,7 @@ it('returns all', function () {
315
306
- You can also create partial mocks using the same import or self method.
316
307
317
308
### Datasets
318
-
- Use datasets in Pest to simplify tests which have a lot of duplicated data. This is often the case when testing validation rules, so consider going with this solution when writing tests for validation rules.
309
+
- Use datasets in Pest to simplify tests that have a lot of duplicated data. This is often the case when testing validation rules, so consider this solution when writing tests for validation rules.
@@ -326,39 +317,37 @@ it('has emails', function (string $email) {
326
317
]);
327
318
</code-snippet>
328
319
329
-
330
320
=== tailwindcss/core rules ===
331
321
332
-
## Tailwind Core
322
+
## Tailwind CSS
333
323
334
-
- Use Tailwind CSS classes to style HTML, check and use existing tailwind conventions within the project before writing your own.
335
-
- Offer to extract repeated patterns into components that match the project's conventions (i.e. Blade, JSX, Vue, etc..)
336
-
- Think through class placement, order, priority, and defaults - remove redundant classes, add classes to parent or child carefully to limit repetition, group elements logically
324
+
- Use Tailwind CSS classes to style HTML; check and use existing Tailwind conventions within the project before writing your own.
325
+
- Offer to extract repeated patterns into components that match the project's conventions (i.e. Blade, JSX, Vue, etc.).
326
+
- Think through class placement, order, priority, and defaults. Remove redundant classes, add classes to parent or child carefully to limit repetition, and group elements logically.
337
327
- You can use the `search-docs` tool to get exact examples from the official documentation when needed.
338
328
339
329
### Spacing
340
-
- When listing items, use gap utilities for spacing, don't use margins.
341
-
342
-
<code-snippet name="Valid Flex Gap Spacing Example" lang="html">
343
-
<div class="flex gap-8">
344
-
<div>Superior</div>
345
-
<div>Michigan</div>
346
-
<div>Erie</div>
347
-
</div>
348
-
</code-snippet>
349
-
330
+
- When listing items, use gap utilities for spacing; don't use margins.
331
+
332
+
<code-snippet name="Valid Flex Gap Spacing Example" lang="html">
333
+
<div class="flex gap-8">
334
+
<div>Superior</div>
335
+
<div>Michigan</div>
336
+
<div>Erie</div>
337
+
</div>
338
+
</code-snippet>
350
339
351
340
### Dark Mode
352
341
- If existing pages and components support dark mode, new pages and components must support dark mode in a similar way, typically using `dark:`.
353
342
354
-
355
343
=== tailwindcss/v4 rules ===
356
344
357
-
## Tailwind 4
345
+
## Tailwind CSS 4
358
346
359
-
- Always use Tailwind CSS v4 - do not use the deprecated utilities.
347
+
- Always use Tailwind CSS v4; do not use the deprecated utilities.
360
348
- `corePlugins` is not supported in Tailwind v4.
361
349
- In Tailwind v4, configuration is CSS-first using the `@theme` directive — no separate `tailwind.config.js` file is needed.
350
+
362
351
<code-snippet name="Extending Theme in CSS" lang="css">
363
352
@theme {
364
353
--color-brand: oklch(0.72 0.11 178);
@@ -374,9 +363,8 @@ it('has emails', function (string $email) {
374
363
+ @import "tailwindcss";
375
364
</code-snippet>
376
365
377
-
378
366
### Replaced Utilities
379
-
- Tailwind v4 removed deprecated utilities. Do not use the deprecated option - use the replacement.
367
+
- Tailwind v4 removed deprecated utilities. Do not use the deprecated option; use the replacement.
0 commit comments