feat: add claude command to review latest commit as per laravel-boost guidelines
This commit is contained in:
94
.claude/commands/review-commit.md
Normal file
94
.claude/commands/review-commit.md
Normal file
@@ -0,0 +1,94 @@
|
||||
# Review Latest Laravel Boost Commit
|
||||
|
||||
Perform a comprehensive code review of the latest commit using Laravel Boost guidelines.
|
||||
|
||||
---
|
||||
|
||||
## Review Process:
|
||||
|
||||
1. **Show what changed:**
|
||||
\`git show --stat\`
|
||||
\`git show\`
|
||||
|
||||
2. **Use Boost Tools to verify:**
|
||||
- Use \`search-docs\` to check version-specific documentation
|
||||
- Check if artisan commands used are correct
|
||||
- Review against Laravel Boost foundation rules
|
||||
|
||||
3. **Analyze by file type:**
|
||||
|
||||
**Models (app/Models/):**
|
||||
- Check constructor property promotion
|
||||
- Verify explicit return types
|
||||
- Review Eloquent relationships with proper type hints
|
||||
- Check $fillable/$guarded arrays
|
||||
- Verify casts() method usage (not $casts property)
|
||||
- Look for N+1 query vulnerabilities
|
||||
|
||||
**Controllers (app/Http/Controllers/):**
|
||||
- Ensure controllers are thin
|
||||
- Verify business logic is in Services
|
||||
- Check Form Requests for validation (not inline)
|
||||
- Verify authorization checks
|
||||
- Review response types and status codes
|
||||
|
||||
**Filament Resources (app/Filament/Resources/):**
|
||||
- Check resource pages auto-generated correctly
|
||||
- Verify static make() methods
|
||||
- Review Forms\Components and Tables\Columns usage
|
||||
- Check relationship() method for selects/options
|
||||
- Verify schema fluent chaining
|
||||
|
||||
**Livewire Components (app/Livewire/):**
|
||||
- Verify App\Livewire namespace (not App\Http\Livewire)
|
||||
- Check wire:model.live (not wire:model)
|
||||
- Verify wire:key in loops
|
||||
- Check $this->dispatch() usage
|
||||
- Validate form data and authorization in actions
|
||||
- Review lifecycle hooks usage
|
||||
|
||||
**Blade Templates (resources/views/):**
|
||||
- Verify {{ }} for output (proper escaping)
|
||||
- Check no business logic in views
|
||||
- Review Flux UI component usage (Free Edition only)
|
||||
- Check dark mode support if needed
|
||||
|
||||
**Tailwind CSS:**
|
||||
- Verify v4 utilities (NOT v3 deprecated)
|
||||
- Check opacity syntax: bg-black/50 (not bg-opacity-50)
|
||||
- Verify gap utilities for spacing (not margins)
|
||||
- Check shrink-*, grow-*, text-ellipsis, box-decoration-* usage
|
||||
|
||||
**Database (database/migrations/):**
|
||||
- Run: \`php artisan migrate --dry-run\` to validate
|
||||
- Check schema design and indexing
|
||||
- Verify column modifications include ALL previous attributes
|
||||
- Review foreign keys and cascading
|
||||
|
||||
**Tests (tests/Feature/ and tests/Unit/):**
|
||||
- Verify Pest v3 syntax (not PHPUnit)
|
||||
- Check created with \`php artisan make:test --pest\`
|
||||
- Review happy paths, failure paths, edge cases
|
||||
- Check Filament tests use livewire()
|
||||
- Verify specific assertions (assertForbidden(), not assertStatus(403))
|
||||
|
||||
4. **PHP 8.4 Standards Check:**
|
||||
- Constructor property promotion in __construct()
|
||||
- Explicit return types on ALL methods
|
||||
- Type hints on ALL parameters
|
||||
- Curly braces for ALL control structures
|
||||
- PHPDoc blocks over inline comments
|
||||
- TitleCase for Enum keys
|
||||
|
||||
5. **Laravel v12 Specifics:**
|
||||
- Middleware in bootstrap/app.php (not app/Http/Middleware/)
|
||||
- Commands auto-register from app/Console/Commands/
|
||||
- Service providers in bootstrap/providers.php
|
||||
- No app\Console\Kernel.php
|
||||
|
||||
6. **Run code formatting check:**
|
||||
\`vendor/bin/pint --dirty\`
|
||||
|
||||
7. **Verify against Laravel Boost guidelines** (see system prompt)
|
||||
|
||||
8. **Provide structured feedback** with priorities and action items
|
||||
Reference in New Issue
Block a user