Copilot instructions
.github/copilot-instructions.mdCopilot instructions
Quality
90/100
Scores the file, not the repository.Length
2,068 words
44 headings · 0 code blocksRepository
17k
— · pushed 2 days agoLast changed
3 days ago
First indexed 3 days ago.1<laravel-boost-guidelines>2=== foundation rules ===34# Laravel Boost Guidelines56The 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.78## Foundational Context9This 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.1011- php - 8.4.2012- laravel/framework (LARAVEL) - v1213- laravel/nightwatch (NIGHTWATCH) - v114- laravel/prompts (PROMPTS) - v015- laravel/sanctum (SANCTUM) - v416- laravel/scout (SCOUT) - v1017- laravel/socialite (SOCIALITE) - v518- larastan/larastan (LARASTAN) - v319- laravel/mcp (MCP) - v020- phpunit/phpunit (PHPUNIT) - v1121- vue (VUE) - v322- laravel-echo (ECHO) - v223- tailwindcss (TAILWINDCSS) - v42425## Conventions26- 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- Use descriptive names for variables and methods. For example, `isRegisteredForDiscounts`, not `discount()`.28- Check for existing components to reuse before writing a new one.2930## Verification Scripts31- Do not create verification scripts or tinker when tests cover that functionality and prove it works. Unit and feature tests are more important.3233## Application Structure & Architecture34- Stick to existing directory structure; don't create new base folders without approval.35- Do not change the application's dependencies without approval.3637## Frontend Bundling38- 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.3940## Replies41- Be concise in your explanations - focus on what's important rather than explaining obvious details.4243## Documentation Files44- You must only create documentation files if explicitly requested by the user.4546=== boost rules ===4748## Laravel Boost49- Laravel Boost is an MCP server that comes with powerful tools designed specifically for this application. Use them.5051## Artisan52- Use the `list-artisan-commands` tool when you need to call an Artisan command to double-check the available parameters.5354## URLs55- 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.5657## Tinker / Debugging58- You should use the `tinker` tool when you need to execute PHP to debug code or query Eloquent models directly.59- Use the `database-query` tool when you only need to read from the database.6061## Reading Browser Logs With the `browser-logs` Tool62- You can read browser logs, errors, and exceptions using the `browser-logs` tool from Boost.63- Only recent browser logs will be useful - ignore old logs.6465## Searching Documentation (Critically Important)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 Laravel ecosystem documentation before falling back to other approaches.69- Search the documentation before making code changes to ensure we are taking the correct approach.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`.7273### Available Search Syntax74- You can and should pass multiple queries at once. The most relevant results will be returned first.75761. Simple Word Searches with auto-stemming - query=authentication - finds 'authenticate' and 'auth'.772. Multiple Words (AND Logic) - query=rate limit - finds knowledge containing both "rate" AND "limit".783. Quoted Phrases (Exact Position) - query="infinite scroll" - words must be adjacent and in that order.794. Mixed Queries - query=middleware "rate limit" - "middleware" AND exact phrase "rate limit".805. Multiple Queries - queries=["authentication", "middleware"] - ANY of these terms.8182=== php rules ===8384## PHP8586- Always use curly braces for control structures, even if it has one line.8788### Constructors89- Use PHP 8 constructor property promotion in `__construct()`.90 - <code-snippet>public function __construct(public GitHub $github) { }</code-snippet>91- Do not allow empty `__construct()` methods with zero parameters unless the constructor is private.9293### Type Declarations94- Always use explicit return type declarations for methods and functions.95- Use appropriate PHP type hints for method parameters.9697<code-snippet name="Explicit Return Types and Method Params" lang="php">98protected function isAccessible(User $user, ?string $path = null): bool99{100 ...101}102</code-snippet>103104## Comments105- Prefer PHPDoc blocks over inline comments. Never use comments within the code itself unless there is something very complex going on.106107## PHPDoc Blocks108- Add useful array shape type definitions for arrays when appropriate.109110## Enums111- Typically, keys in an Enum should be TitleCase. For example: `FavoritePerson`, `BestLake`, `Monthly`.112113=== tests rules ===114115## Test Enforcement116117- 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.118- Run the minimum number of tests needed to ensure code quality and speed. Use `php artisan test --compact` with a specific filename or filter.119120=== laravel/core rules ===121122## Do Things the Laravel Way123124- 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.125- If you're creating a generic PHP class, use `php artisan make:class`.126- 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.127128### Database129- Always use proper Eloquent relationship methods with return type hints. Prefer relationship methods over raw queries or manual joins.130- Use Eloquent models and relationships before suggesting raw database queries.131- Avoid `DB::`; prefer `Model::query()`. Generate code that leverages Laravel's ORM capabilities rather than bypassing them.132- Generate code that prevents N+1 query problems by using eager loading.133- Use Laravel's query builder for very complex database operations.134135### Model Creation136- 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`.137138### APIs & Eloquent Resources139- For APIs, default to using Eloquent API Resources and API versioning unless existing API routes do not, then you should follow existing application convention.140141### Controllers & Validation142- Always create Form Request classes for validation rather than inline validation in controllers. Include both validation rules and custom error messages.143- Check sibling Form Requests to see if the application uses array or string based validation rules.144145### Queues146- Use queued jobs for time-consuming operations with the `ShouldQueue` interface.147148### Authentication & Authorization149- Use Laravel's built-in authentication and authorization features (gates, policies, Sanctum, etc.).150151### URL Generation152- When generating links to other pages, prefer named routes and the `route()` function.153154### Configuration155- 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')`.156157### Testing158- 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.159- Faker: Use methods such as `$this->faker->word()` or `fake()->randomDigit()`. Follow existing conventions whether to use `$this->faker` or `fake()`.160- 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.161162### Vite Error163- 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`.164165=== laravel/v12 rules ===166167## Laravel 12168169- Use the `search-docs` tool to get version-specific documentation.170- Since Laravel 11, Laravel has a new streamlined file structure which this project uses.171172### Laravel 12 Structure173- In Laravel 12, middleware are no longer registered in `app/Http/Kernel.php`.174- Middleware are configured declaratively in `bootstrap/app.php` using `Application::configure()->withMiddleware()`.175- `bootstrap/app.php` is the file to register middleware, exceptions, and routing files.176- `bootstrap/providers.php` contains application specific service providers.177- The `app\Console\Kernel.php` file no longer exists; use `bootstrap/app.php` or `routes/console.php` for console configuration.178- Console commands in `app/Console/Commands/` are automatically available and do not require manual registration.179180### Database181- 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.182- Laravel 12 allows limiting eagerly loaded records natively, without external packages: `$query->latest()->limit(10);`.183184### Models185- 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.186187=== phpunit/core rules ===188189## PHPUnit190191- 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.192- If you see a test using "Pest", convert it to PHPUnit.193- Every time a test has been updated, run that singular test.194- 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.195- Tests should test all of the happy paths, failure paths, and weird paths.196- 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.197198### Running Tests199- Run the minimal number of tests, using an appropriate filter, before finalizing.200- To run all tests: `php artisan test --compact`.201- To run all tests in a file: `php artisan test --compact tests/Feature/ExampleTest.php`.202- To filter on a particular test name: `php artisan test --compact --filter=testName` (recommended after making a change to a related file).203204=== tailwindcss/core rules ===205206## Tailwind CSS207208- Use Tailwind CSS classes to style HTML; check and use existing Tailwind conventions within the project before writing your own.209- Offer to extract repeated patterns into components that match the project's conventions (i.e. Blade, JSX, Vue, etc.).210- 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.211- You can use the `search-docs` tool to get exact examples from the official documentation when needed.212213### Spacing214- When listing items, use gap utilities for spacing; don't use margins.215216<code-snippet name="Valid Flex Gap Spacing Example" lang="html">217 <div class="flex gap-8">218 <div>Superior</div>219 <div>Michigan</div>220 <div>Erie</div>221 </div>222</code-snippet>223224### Dark Mode225- If existing pages and components support dark mode, new pages and components must support dark mode in a similar way, typically using `dark:`.226227=== tailwindcss/v4 rules ===228229## Tailwind CSS 4230231- Always use Tailwind CSS v4; do not use the deprecated utilities.232- `corePlugins` is not supported in Tailwind v4.233- In Tailwind v4, configuration is CSS-first using the `@theme` directive — no separate `tailwind.config.js` file is needed.234235<code-snippet name="Extending Theme in CSS" lang="css">236@theme {237 --color-brand: oklch(0.72 0.11 178);238}239</code-snippet>240241- In Tailwind v4, you import Tailwind using a regular CSS `@import` statement, not using the `@tailwind` directives used in v3:242243<code-snippet name="Tailwind v4 Import Tailwind Diff" lang="diff">244 - @tailwind base;245 - @tailwind components;246 - @tailwind utilities;247 + @import "tailwindcss";248</code-snippet>249250### Replaced Utilities251- Tailwind v4 removed deprecated utilities. Do not use the deprecated option; use the replacement.252- Opacity values are still numeric.253254| Deprecated | Replacement |255|------------+--------------|256| bg-opacity-* | bg-black/* |257| text-opacity-* | text-black/* |258| border-opacity-* | border-black/* |259| divide-opacity-* | divide-black/* |260| ring-opacity-* | ring-black/* |261| placeholder-opacity-* | placeholder-black/* |262| flex-shrink-* | shrink-* |263| flex-grow-* | grow-* |264| overflow-ellipsis | text-ellipsis |265| decoration-slice | box-decoration-slice |266| decoration-clone | box-decoration-clone |267</laravel-boost-guidelines>268
Also in koel/koel
Diff this repo’s formatsOne 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?
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 3 days ago | |
| nerolis-lab/nerolis-lab.github/copilot-instructions.md · 32 | Copilot instructions | setupbuildtestlint-format+11 | 96/100 | 3 days ago | |
| photoprism/photoprism.github/copilot-instructions.md · 40k | Copilot instructions | buildtestlint-formatstyle+5 | 90/100 | 2 days ago | |
| photoprism/photoprism.github/instructions/backend.instructions.md · 40k | Copilot instructions | testlint-formatstyletypes+4 | 83/100 | 2 days ago | |
| groupultra/telegram-search.github/copilot-instructions.md · 4.0k | Copilot instructions | teststyleagent-behaviour | 76/100 | 3 days ago | |
| photoprism/photoprism.github/instructions/frontend.instructions.md · 40k | Copilot instructions | testlint-formatstyleagent-behaviour | 76/100 | 2 days ago | |
| vitejs/vite.github/copilot-instructions.md · 82k | Copilot instructions | buildteststylearch+2 | 74/100 | 3 days ago |
