RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/koel/koel

Cursor rule

.cursor/rules/laravel-boost.mdc
Cursor rules

Quality

90/100

Scores the file, not the repository.

Length

2,068 words

44 headings · 0 code blocks

Repository

17k

— · pushed 3 days ago

Last changed

3 days ago

First indexed 3 days ago.
koel/koel/.cursor/rules/laravel-boost.mdcRawGitHub
1---
2alwaysApply: true
3---
4<laravel-boost-guidelines>
5=== foundation rules ===
6 
7# Laravel Boost Guidelines
8 
9The Laravel Boost guidelines are specifically curated by Laravel maintainers for this application. These guidelines should be followed closely to enhance the user's satisfaction building Laravel applications.
10 
11## Foundational Context
12This application is a Laravel application and its main Laravel ecosystems package & versions are below. You are an expert with them all. Ensure you abide by these specific packages & versions.
13 
14- php - 8.4.20
15- laravel/framework (LARAVEL) - v12
16- laravel/nightwatch (NIGHTWATCH) - v1
17- laravel/prompts (PROMPTS) - v0
18- laravel/sanctum (SANCTUM) - v4
19- laravel/scout (SCOUT) - v10
20- laravel/socialite (SOCIALITE) - v5
21- larastan/larastan (LARASTAN) - v3
22- laravel/mcp (MCP) - v0
23- phpunit/phpunit (PHPUNIT) - v11
24- vue (VUE) - v3
25- laravel-echo (ECHO) - v2
26- tailwindcss (TAILWINDCSS) - v4
27 
28## Conventions
29- 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.
30- Use descriptive names for variables and methods. For example, `isRegisteredForDiscounts`, not `discount()`.
31- Check for existing components to reuse before writing a new one.
32 
33## Verification Scripts
34- Do not create verification scripts or tinker when tests cover that functionality and prove it works. Unit and feature tests are more important.
35 
36## Application Structure & Architecture
37- Stick to existing directory structure; don't create new base folders without approval.
38- Do not change the application's dependencies without approval.
39 
40## Frontend Bundling
41- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `pnpm run build`, `pnpm run dev`, or `composer run dev`. Ask them.
42 
43## Replies
44- Be concise in your explanations - focus on what's important rather than explaining obvious details.
45 
46## Documentation Files
47- You must only create documentation files if explicitly requested by the user.
48 
49=== boost rules ===
50 
51## Laravel Boost
52- Laravel Boost is an MCP server that comes with powerful tools designed specifically for this application. Use them.
53 
54## Artisan
55- Use the `list-artisan-commands` tool when you need to call an Artisan command to double-check the available parameters.
56 
57## URLs
58- 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.
59 
60## Tinker / Debugging
61- You should use the `tinker` tool when you need to execute PHP to debug code or query Eloquent models directly.
62- Use the `database-query` tool when you only need to read from the database.
63 
64## Reading Browser Logs With the `browser-logs` Tool
65- You can read browser logs, errors, and exceptions using the `browser-logs` tool from Boost.
66- Only recent browser logs will be useful - ignore old logs.
67 
68## Searching Documentation (Critically Important)
69- 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.
70- The `search-docs` tool is perfect for all Laravel-related packages, including Laravel, Inertia, Livewire, Filament, Tailwind, Pest, Nova, Nightwatch, etc.
71- You must use this tool to search for Laravel ecosystem documentation before falling back to other approaches.
72- Search the documentation before making code changes to ensure we are taking the correct approach.
73- Use multiple, broad, simple, topic-based queries to start. For example: `['rate limiting', 'routing rate limiting', 'routing']`.
74- Do not add package names to queries; package information is already shared. For example, use `test resource table`, not `filament 4 test resource table`.
75 
76### Available Search Syntax
77- You can and should pass multiple queries at once. The most relevant results will be returned first.
78 
791. Simple Word Searches with auto-stemming - query=authentication - finds 'authenticate' and 'auth'.
802. Multiple Words (AND Logic) - query=rate limit - finds knowledge containing both "rate" AND "limit".
813. Quoted Phrases (Exact Position) - query="infinite scroll" - words must be adjacent and in that order.
824. Mixed Queries - query=middleware "rate limit" - "middleware" AND exact phrase "rate limit".
835. Multiple Queries - queries=["authentication", "middleware"] - ANY of these terms.
84 
85=== php rules ===
86 
87## PHP
88 
89- Always use curly braces for control structures, even if it has one line.
90 
91### Constructors
92- Use PHP 8 constructor property promotion in `__construct()`.
93 - <code-snippet>public function __construct(public GitHub $github) { }</code-snippet>
94- Do not allow empty `__construct()` methods with zero parameters unless the constructor is private.
95 
96### Type Declarations
97- Always use explicit return type declarations for methods and functions.
98- Use appropriate PHP type hints for method parameters.
99 
100<code-snippet name="Explicit Return Types and Method Params" lang="php">
101protected function isAccessible(User $user, ?string $path = null): bool
102{
103 ...
104}
105</code-snippet>
106 
107## Comments
108- Prefer PHPDoc blocks over inline comments. Never use comments within the code itself unless there is something very complex going on.
109 
110## PHPDoc Blocks
111- Add useful array shape type definitions for arrays when appropriate.
112 
113## Enums
114- Typically, keys in an Enum should be TitleCase. For example: `FavoritePerson`, `BestLake`, `Monthly`.
115 
116=== tests rules ===
117 
118## Test Enforcement
119 
120- Every change must be programmatically tested. Write a new test or update an existing test, then run the affected tests to make sure they pass.
121- Run the minimum number of tests needed to ensure code quality and speed. Use `php artisan test --compact` with a specific filename or filter.
122 
123=== laravel/core rules ===
124 
125## Do Things the Laravel Way
126 
127- Use `php artisan make:` commands to create new files (i.e. migrations, controllers, models, etc.). You can list available Artisan commands using the `list-artisan-commands` tool.
128- If you're creating a generic PHP class, use `php artisan make:class`.
129- Pass `--no-interaction` to all Artisan commands to ensure they work without user input. You should also pass the correct `--options` to ensure correct behavior.
130 
131### Database
132- Always use proper Eloquent relationship methods with return type hints. Prefer relationship methods over raw queries or manual joins.
133- Use Eloquent models and relationships before suggesting raw database queries.
134- Avoid `DB::`; prefer `Model::query()`. Generate code that leverages Laravel's ORM capabilities rather than bypassing them.
135- Generate code that prevents N+1 query problems by using eager loading.
136- Use Laravel's query builder for very complex database operations.
137 
138### Model Creation
139- When creating new models, create useful factories and seeders for them too. Ask the user if they need any other things, using `list-artisan-commands` to check the available options to `php artisan make:model`.
140 
141### APIs & Eloquent Resources
142- For APIs, default to using Eloquent API Resources and API versioning unless existing API routes do not, then you should follow existing application convention.
143 
144### Controllers & Validation
145- Always create Form Request classes for validation rather than inline validation in controllers. Include both validation rules and custom error messages.
146- Check sibling Form Requests to see if the application uses array or string based validation rules.
147 
148### Queues
149- Use queued jobs for time-consuming operations with the `ShouldQueue` interface.
150 
151### Authentication & Authorization
152- Use Laravel's built-in authentication and authorization features (gates, policies, Sanctum, etc.).
153 
154### URL Generation
155- When generating links to other pages, prefer named routes and the `route()` function.
156 
157### Configuration
158- Use environment variables only in configuration files - never use the `env()` function directly outside of config files. Always use `config('app.name')`, not `env('APP_NAME')`.
159 
160### Testing
161- When creating models for tests, use the factories for the models. Check if the factory has custom states that can be used before manually setting up the model.
162- Faker: Use methods such as `$this->faker->word()` or `fake()->randomDigit()`. Follow existing conventions whether to use `$this->faker` or `fake()`.
163- When creating tests, make use of `php artisan make:test [options] {name}` to create a feature test, and pass `--unit` to create a unit test. Most tests should be feature tests.
164 
165### Vite Error
166- If you receive an "Illuminate\Foundation\ViteException: Unable to locate file in Vite manifest" error, you can run `pnpm run build` or ask the user to run `pnpm run dev` or `composer run dev`.
167 
168=== laravel/v12 rules ===
169 
170## Laravel 12
171 
172- Use the `search-docs` tool to get version-specific documentation.
173- Since Laravel 11, Laravel has a new streamlined file structure which this project uses.
174 
175### Laravel 12 Structure
176- In Laravel 12, middleware are no longer registered in `app/Http/Kernel.php`.
177- Middleware are configured declaratively in `bootstrap/app.php` using `Application::configure()->withMiddleware()`.
178- `bootstrap/app.php` is the file to register middleware, exceptions, and routing files.
179- `bootstrap/providers.php` contains application specific service providers.
180- The `app\Console\Kernel.php` file no longer exists; use `bootstrap/app.php` or `routes/console.php` for console configuration.
181- Console commands in `app/Console/Commands/` are automatically available and do not require manual registration.
182 
183### Database
184- 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.
185- Laravel 12 allows limiting eagerly loaded records natively, without external packages: `$query->latest()->limit(10);`.
186 
187### Models
188- 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.
189 
190=== phpunit/core rules ===
191 
192## PHPUnit
193 
194- This application uses PHPUnit for testing. All tests must be written as PHPUnit classes. Use `php artisan make:test --phpunit {name}` to create a new test.
195- If you see a test using "Pest", convert it to PHPUnit.
196- Every time a test has been updated, run that singular test.
197- When the tests relating to your feature are passing, ask the user if they would like to also run the entire test suite to make sure everything is still passing.
198- Tests should test all of the happy paths, failure paths, and weird paths.
199- You must not remove any tests or test files from the tests directory without approval. These are not temporary or helper files; these are core to the application.
200 
201### Running Tests
202- Run the minimal number of tests, using an appropriate filter, before finalizing.
203- To run all tests: `php artisan test --compact`.
204- To run all tests in a file: `php artisan test --compact tests/Feature/ExampleTest.php`.
205- To filter on a particular test name: `php artisan test --compact --filter=testName` (recommended after making a change to a related file).
206 
207=== tailwindcss/core rules ===
208 
209## Tailwind CSS
210 
211- Use Tailwind CSS classes to style HTML; check and use existing Tailwind conventions within the project before writing your own.
212- Offer to extract repeated patterns into components that match the project's conventions (i.e. Blade, JSX, Vue, etc.).
213- 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.
214- You can use the `search-docs` tool to get exact examples from the official documentation when needed.
215 
216### Spacing
217- When listing items, use gap utilities for spacing; don't use margins.
218 
219<code-snippet name="Valid Flex Gap Spacing Example" lang="html">
220 <div class="flex gap-8">
221 <div>Superior</div>
222 <div>Michigan</div>
223 <div>Erie</div>
224 </div>
225</code-snippet>
226 
227### Dark Mode
228- If existing pages and components support dark mode, new pages and components must support dark mode in a similar way, typically using `dark:`.
229 
230=== tailwindcss/v4 rules ===
231 
232## Tailwind CSS 4
233 
234- Always use Tailwind CSS v4; do not use the deprecated utilities.
235- `corePlugins` is not supported in Tailwind v4.
236- In Tailwind v4, configuration is CSS-first using the `@theme` directive — no separate `tailwind.config.js` file is needed.
237 
238<code-snippet name="Extending Theme in CSS" lang="css">
239@theme {
240 --color-brand: oklch(0.72 0.11 178);
241}
242</code-snippet>
243 
244- In Tailwind v4, you import Tailwind using a regular CSS `@import` statement, not using the `@tailwind` directives used in v3:
245 
246<code-snippet name="Tailwind v4 Import Tailwind Diff" lang="diff">
247 - @tailwind base;
248 - @tailwind components;
249 - @tailwind utilities;
250 + @import "tailwindcss";
251</code-snippet>
252 
253### Replaced Utilities
254- Tailwind v4 removed deprecated utilities. Do not use the deprecated option; use the replacement.
255- Opacity values are still numeric.
256 
257| Deprecated | Replacement |
258|------------+--------------|
259| bg-opacity-* | bg-black/* |
260| text-opacity-* | text-black/* |
261| border-opacity-* | border-black/* |
262| divide-opacity-* | divide-black/* |
263| ring-opacity-* | ring-black/* |
264| placeholder-opacity-* | placeholder-black/* |
265| flex-shrink-* | shrink-* |
266| flex-grow-* | grow-* |
267| overflow-ellipsis | text-ellipsis |
268| decoration-slice | box-decoration-slice |
269| decoration-clone | box-decoration-clone |
270</laravel-boost-guidelines>
271 

Commands it names

  • pnpm run build
  • pnpm run dev
  • composer run dev
  • php artisan test --compact
  • php artisan make:
  • php artisan make:class
  • php artisan make:model
  • php artisan make:test [options] {name}
  • php artisan make:test --phpunit {name}
  • php artisan test --compact tests/Feature/ExampleTest.php
  • php artisan test --compact --filter=testName

Sections

  • Laravel Boost Guidelines
  • Foundational Context
  • Conventions
  • Verification Scripts
  • Application Structure & Architecture
  • Frontend Bundling
  • Replies
  • Documentation Files
  • Laravel Boost
  • Artisan
  • URLs
  • Tinker / Debugging
  • Reading Browser Logs With the `browser-logs` Tool
  • Searching Documentation (Critically Important)
  • Available Search Syntax
  • PHP
  • Constructors
  • Type Declarations
  • Comments
  • PHPDoc Blocks
  • Enums
  • Test Enforcement
  • Do Things the Laravel Way
  • Database
  • Model Creation
  • APIs & Eloquent Resources
  • Controllers & Validation
  • Queues
  • Authentication & Authorization
  • URL Generation
  • Configuration
  • Testing
  • Vite Error
  • Laravel 12
  • Laravel 12 Structure
  • Database
  • Models
  • PHPUnit
  • Running Tests
  • Tailwind CSS
  • Spacing
  • Dark Mode
  • Tailwind CSS 4
  • Replaced Utilities

What it covers

buildtestlint-formatcode-stylearchitecturetypessecuritydatabaseuido-notdocs

Stack — with the evidence

php

(1.00)

vue

(1.00)

laravel

(1.00)

tailwind

(1.00)

vite

(1.00)

pnpm

(0.85)

vitest

(0.70)

typescript

(0.60)

javascript

(0.60)

github-actions

(0.60)

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
koel
Language
—
License
—
Archived
no

All configs in this repo

Also in koel/koel

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
koel/koel.github/copilot-instructions.md · 17kCopilot instructionsphpvue+8buildtestlint-formatstyle+790/1003 days ago
koel/koelAGENTS.md · 17kAGENTS.mdphpvue+8setupbuildtestlint-format+1078/1003 days ago
Diff against .github/copilot-instructions.md Diff against AGENTS.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
nerds-odd-e/doughnut.cursor/rules/cli.mdc · 49Cursor rulestypescriptcypress+14setupbuildteststyle+496/1003 days ago
coollabsio/coolify.cursor/rules/coolify-ai-docs.mdc · 60kCursor rulesjavascriptphp+6buildteststylearch+592/1003 days ago
groupultra/telegram-search.cursor/rules/architecture.mdc · 4.0kCursor rulestypescriptdrizzle+11buildtestlint-formatarch+489/1003 days ago
nerds-odd-e/doughnut.cursor/rules/frontend-testing.mdc · 49Cursor rulestypescriptcypress+14buildteststyletesting-strategy+289/1003 days ago
nerds-odd-e/doughnut.cursor/rules/linting_formating.mdc · 49Cursor rulestypescriptmonorepo+14testlint-formatstylearch+688/1003 days ago
nerds-odd-e/doughnut.cursor/rules/mcp-server.mdc · 49Cursor rulestypescriptcypress+14buildtestlint-formatarch+285/1003 days ago
nerds-odd-e/doughnut.cursor/rules/e2e-authoring.mdc · 49Cursor rulestypescriptcypress+14setupteststylearch+380/1003 days ago
xuliang2024/cutcli-cookbook.cursor/rules/commands.mdc · 66Cursor rulesjavascriptvue+4lint-formatgitsecuritydeployment+178/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack