/laraclaude:lc:consolidate-migrations [analyze | fix | fix --dry-run | table-name | fix table-name]from laraclaude
Analyzes fragmented Laravel migration files, groups by table, detects dependencies, and proposes safe merges to consolidate into single clean migrations.
Ships in laraclaude. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Analyze and consolidate fragmented migration files for Laravel projects. Multiple migrations that modify the same table over time can be merged into a single clean migration.
| Subcommand | Description |
|---|---|
| (no argument) | Analyze all migrations and report consolidation opportunities. Read-only. |
fix | Consolidate all tables classified as SAFE_TO_MERGE. Asks for confirmation before each change. |
fix --dry-run | Show what consolidation would produce without writing any files. |
[table-name] | Analyze migrations for a specific table only. |
fix [table-name] | Consolidate migrations for a specific table, with confirmation. |
analyze)Perform a read-only analysis of all migration files.
Steps:
Glob to find database/migrations/*.php files.Read to extract:
Schema::create('table_name', ...) -- table creationSchema::table('table_name', ...) -- table modificationSchema::dropIfExists('table_name') -- table dropSchema::rename('old', 'new') -- table renameDB::statement(...) or DB::table(...)->update(...) -- data migrations->foreign(...), ->foreignId(...), ->constrained(...), and ->references(...)->on(...) calls.Table | Migrations | Category | Notes
-----------------------|------------|-------------------|---------------------------
users | 5 | SAFE_TO_MERGE | 4 ALTER migrations
properties | 8 | MERGE_WITH_CAUTION| 2 data migrations found
locations | 2 | DO_NOT_MERGE | SQL data import in migration
clients | 1 | ALREADY_OPTIMAL |
fix or fix [table-name])Consolidate migrations, asking for confirmation before each change.
Steps:
[table-name] is specified, operate on all SAFE_TO_MERGE tables. If a table name is given, operate on that table only.php -l on every new migration file to validate syntax.fix --dry-run)Show what each consolidated migration would look like, without writing any files.
Steps:
[table-name])Analyze migrations for a specific table.
Steps:
When consolidating migrations for a table:
$table->string('name') in CREATE + $table->string('name', 500)->change() in ALTER = $table->string('name', 500) in final$table->string('temp') in CREATE + $table->dropColumn('temp') in ALTER = column removed from finalWrite, replacing the original CREATE file.php -l on the consolidated file via Bash.down() method logic. The consolidated down() should drop the table entirely.database/schema/*.sql). If one exists, warn the user that consolidation may conflict with the schema dump.If a docker-compose.yml exists in the project root, use docker exec {container_name} php -l {file} for PHP syntax validation. Detect the container name from the docker-compose.yml service configuration (look for the PHP/app service).
Always provide clear, structured output. Use tables for summaries. Show file paths as absolute paths. When showing migration content, use syntax-highlighted PHP code blocks.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub edulazaro/laraclaude --plugin laraclaude32 skills in this plugin
/lc:analyze-errorPaste a Laravel stacktrace and get root cause analysis with suggested fix./lc:analyze-modelDeep analysis of a Laravel Eloquent model - relationships, scopes, casts, fillable, observers, keepers, actions./lc:api-docsGenerate API documentation from routes, controllers, and form requests./lc:blade-auditDetect hardcoded text without @text(), duplicate CSS classes, unused Blade components, and accessibility issues./lc:boost-inspectRuntime-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./lc:cache-opportunitiesDetect repeated queries and computations that should be cached.Other plugins' skills for the same job