From 29882336b7a555c3b8055311a9a5c9390f797cea Mon Sep 17 00:00:00 2001 From: James Brooks Date: Fri, 15 Aug 2025 11:13:32 +0100 Subject: [PATCH] Install Laravel Boost and configure Claude Code --- .claude/settings.local.json | 11 ++++++ .mcp.json | 20 +++++++++++ CLAUDE.md | 71 +++++++++++++++++++++++++++++++++++++ composer.json | 1 + 4 files changed, 103 insertions(+) create mode 100644 .claude/settings.local.json create mode 100644 .mcp.json create mode 100644 CLAUDE.md diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 00000000..4277abcd --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,11 @@ +{ + "enabledMcpjsonServers": [ + "laravel-boost", + "herd" + ], + "permissions": { + "allow": [ + "Bash(vendor/bin/testbench tinker:*)" + ] + } +} \ No newline at end of file diff --git a/.mcp.json b/.mcp.json new file mode 100644 index 00000000..b6b874ba --- /dev/null +++ b/.mcp.json @@ -0,0 +1,20 @@ +{ + "mcpServers": { + "laravel-boost": { + "command": "php", + "args": [ + "./artisan", + "boost:mcp" + ] + }, + "herd": { + "command": "php", + "args": [ + "/Applications/Herd.app/Contents/Resources/herd-mcp.phar" + ], + "env": { + "SITE_PATH": "/Users/james/Code/cachet-core/vendor/orchestra/testbench-core/laravel" + } + } + } +} \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..0946b5da --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,71 @@ + +=== foundation rules === + +# Laravel Boost Guidelines + +The 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. + +## Foundational Context +This 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. + +- php - 8.3.22 + + +## Conventions +- 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. +- Use descriptive names for variables and methods. For example, `isRegisteredForDiscounts`, not `discount()`. +- Check for existing components to reuse before writing a new one. + +## Verification Scripts +- Do not create verification scripts or tinker when tests cover that functionality and prove it works. Unit and feature tests are more important. + +## Application Structure & Architecture +- Stick to existing directory structure - don't create new base folders without approval. +- Do not change the application's dependencies without approval. + +## Frontend Bundling +- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `npm run build`, `npm run dev`, or `composer run dev`. Ask them. + +## Replies +- Be concise in your explanations - focus on what's important rather than explaining obvious details. + +## Documentation Files +- You must only create documentation files if explicitly requested by the user. + + +=== boost rules === + +## Laravel Boost +- Laravel Boost is an MCP server that comes with powerful tools designed specifically for this application. Use them. + +## Artisan +- Use the `list-artisan-commands` tool when you need to call an Artisan command to double check the available parameters. + +## URLs +- 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. + +## Tinker / Debugging +- You should use the `tinker` tool when you need to execute PHP to debug code or query Eloquent models directly. Because Cachet is a Laravel package, developed with Testbench, you should run Tinker with `vendor/bin/testbench tinker`. +- Use the `database-query` tool when you only need to read from the database. + +## Reading Browser Logs With the `browser-logs` Tool +- You can read browser logs, errors, and exceptions using the `browser-logs` tool from Boost. +- Only recent browser logs will be useful - ignore old logs. + +## Searching Documentation (Critically Important) +- 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. +- The 'search-docs' tool is perfect for all Laravel related packages, including Laravel, Inertia, Livewire, Filament, Tailwind, Pest, Nova, Nightwatch, etc. +- You must use this tool to search for Laravel-ecosystem documentation before falling back to other approaches. +- Search the documentation before making code changes to ensure we are taking the correct approach. +- Use multiple, broad, simple, topic based queries to start. For example: `['rate limiting', 'routing rate limiting', 'routing']`. +- Do not add package names to queries, package information is already shared. Use `test resource table`, not `filament 4 test resource table`. + +### Available Search Syntax +- You can and should pass multiple queries at once. The most relevant results will be returned first. + +1. Simple Word Searches with auto-stemming - query=authentication - finds 'authenticate' and 'auth' +2. Multiple Words (AND Logic) - query=rate limit - finds knowledge containing both "rate" AND "limit" +3. Quoted Phrases (Exact Position) - query="infinite scroll" - Words must be adjacent and in that order +4. Mixed Queries - query=middleware "rate limit" - "middleware" AND exact phrase "rate limit" +5. Multiple Queries - queries=["authentication", "middleware"] - ANY of these terms + \ No newline at end of file diff --git a/composer.json b/composer.json index 749c825e..68ad45ce 100644 --- a/composer.json +++ b/composer.json @@ -43,6 +43,7 @@ "require-dev": { "dedoc/scramble": "^0.12", "larastan/larastan": "^3.4", + "laravel/boost": "^1.0", "laravel/pail": "^1.1", "laravel/pint": "^1.24", "orchestra/testbench": "^9.5.1",