lc-test-coverage
Analyze which models, controllers, and actions have tests and which don't.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Analyze which models, controllers, and actions have tests and which don't.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Create a Larascraper scraper (v2 or v3) for a target website, chaining browser actions (click, type, wait, scroll), conditional flow (when/repeatUntil), captcha solving, and file/PDF downloads. Detects the installed major and generates the matching style.
Add or edit a Laracrate file collection in config/laracrate.php with the correct anatomy (disk, access, types, variants, previews, extract/embed, flags, per-model scoping).
Runtime-verified Laravel inspection using the Laravel Boost MCP server (Tinker, Database Query/Schema, Last Error) instead of static grep. Falls back to Docker/Tinker if Boost is not installed.
Scaffold spatie/laravel-permission setup - add the HasRoles trait to a model and generate a roles & permissions seeder.
Audit spatie/laravel-permission usage - permissions used in code but undefined, defined but unused, unprotected routes, guard mismatches, and cache pitfalls.
Extract business logic from a controller or Livewire component method into a Laractions Action class.
| name | lc:test-coverage |
| description | Analyze which models, controllers, and actions have tests and which don't. |
| argument-hint | [analyze | directory] |
| user-invocable | true |
| allowed-tools | Read Grep Bash Edit Write Glob |
Analyze which application classes have corresponding tests and which are untested. Provides a coverage map without requiring actual test execution.
| Subcommand | Description |
|---|---|
| (no argument) | Analyze the full project for test coverage gaps. Read-only report. |
[directory] | Analyze a specific directory (e.g., app/Models, app/Actions). |
This is an analysis-only skill. It does not modify files. Use lc:generate-test to create missing tests.
Use Glob to find all testable classes:
app/Models/*.phpapp/Http/Controllers/**/*.phpapp/Actions/**/*.phpapp/Services/*.phpapp/Jobs/*.phpapp/Observers/*.phpresources/views/livewire/**/*.blade.php (only those with PHP class blocks)If a [directory] argument is provided, limit scanning to that directory.
Use Glob to find all test files:
tests/Feature/**/*.phptests/Unit/**/*.phpFor each application class, check if a corresponding test exists:
App\Models\Property -> tests/Feature/Models/PropertyTest.php or tests/Unit/Models/PropertyTest.phpGrep to search test files for references to the class (e.g., use App\Models\Property, Property::factory(), Property::create()Classify each class as:
For untested classes, estimate testing priority based on:
Score each untested class:
TEST COVERAGE ANALYSIS
=======================
SUMMARY
--------
Total application classes: 85
With dedicated tests: 23 (27%)
Partially tested: 12 (14%)
Untested: 50 (59%)
BY CATEGORY
------------
Category | Total | Tested | Partial | Untested | Coverage
-----------------|-------|--------|---------|----------|--------
Models | 18 | 5 | 8 | 5 | 72%
Controllers | 22 | 8 | 2 | 12 | 45%
Actions | 15 | 3 | 1 | 11 | 27%
Services | 8 | 2 | 0 | 6 | 25%
Jobs | 12 | 3 | 0 | 9 | 25%
Observers | 5 | 1 | 1 | 3 | 40%
Volt Components | 5 | 1 | 0 | 4 | 20%
HIGH PRIORITY UNTESTED CLASSES
-------------------------------
These classes have the most impact and should be tested first:
1. App\Http\Controllers\PropertyController (8 public methods, DB mutations)
2. App\Actions\Property\ValidateToPublish (complex business logic)
3. App\Services\IdealistaService (external API integration)
4. App\Jobs\SyncPropertyToFotocasa (external service, queued)
5. App\Http\Controllers\OrganizationStripeWebhookController (payment handling)
FULLY TESTED CLASSES
---------------------
App\Models\User -> tests/Unit/Models/UserTest.php (12 tests)
App\Http\Controllers\AuthController -> tests/Feature/AuthTest.php (8 tests)
...
UNTESTED CLASSES (by category)
-------------------------------
Models:
- App\Models\Showcase (5 public methods)
- App\Models\ShowcaseLogger (3 public methods)
...
Controllers:
- App\Http\Controllers\DashboardController (4 methods)
...
End with actionable recommendations:
RECOMMENDATIONS
================
1. Start with high-priority untested classes (listed above)
2. Use lc:generate-test to scaffold test files quickly
3. Focus on controllers with validation rules -- they catch the most bugs
4. Actions with business logic are the most valuable unit tests
5. Consider adding tests before refactoring any existing code
php artisan test --coverage (requires Xdebug or PCOV).