一键导入
migration-index-reviewer
Review Laravel migrations and query paths for missing, redundant, or risky indexes before production.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Review Laravel migrations and query paths for missing, redundant, or risky indexes before production.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Plan safe Laravel data migrations with phased rollout, backfills, double writes, verification, and rollback.
Review Laravel frontend performance, responsiveness, and Lighthouse-impacting best practices.
Review Laravel API endpoints for validation, authorization, abuse resistance, and safer defaults.
Review a Laravel app for deployment blockers across config, queues, caching, operations, and rollback readiness.
Review Laravel workflows for retries, timeouts, idempotency, and graceful failure under partial outages.
Plan a Laravel or PHP upgrade by identifying blockers, risky code paths, and the safest execution order.
| name | migration-index-reviewer |
| description | Review Laravel migrations and query paths for missing, redundant, or risky indexes before production. |
| license | MIT |
| tags | ["laravel","php"] |
| version | 0.1.1 |
| compatible_agents | ["laravel/boost"] |
Use this skill when reviewing Laravel migrations, schema changes, or slow-query fixes that add tables, foreign keys, filters, sorts, tenant scopes, or reporting queries. It is most useful before merging migrations that will run on large production tables.
database/migrations and note new tables, altered columns, foreign keys, unique constraints, softDeletes(), polymorphic relations, and any columns likely to be filtered, sorted, joined, or backfilled.where, orderBy, latest, firstOrCreate, updateOrCreate, and eager-loading patterns.account_id or team_id, compound filter-plus-sort patterns, uniqueness enforced only in validation, and common lookups involving deleted_at.constrained() without checking real query needs, or schema changes that can slow queues and reporting jobs.Schema::table() or $table->index([...]) examples when helpful. End with these sections: Missing indexes, Redundant or weak indexes, Rollout risks, and Recommended migration changes.Output expectations: return a short review of missing or weak indexes, rollout risks, and concrete migration edits tied to observed Laravel query paths.
Prompt 1:
Use migration-index-reviewer on the new order and order_items migrations. Focus on account_id, status, created_at, foreign keys, and rollout safety.
Prompt 2:
Review these Laravel migrations for missing or redundant indexes on MySQL 8. Tie recommendations back to the actual Laravel query paths.
JSON:
{
"skill": "migration-index-reviewer",
"context": {
"database": "mysql",
"tables": ["orders", "order_items"],
"query_patterns": ["account_id+status", "account_id+created_at desc"],
"zero_downtime": true,
"laravel_artifacts": ["Order model", "OrderController", "OrderReportJob"],
"focus": ["foreign_keys", "compound_indexes", "rollout_risks"]
}
}
Code example:
Schema::table('orders', function (Blueprint $table) {
$table->index(
['account_id', 'status', 'created_at'],
'orders_account_status_created_at_idx'
);
});
Provide a Laravel migration that adds foreign keys and common filter columns without useful indexes, plus a model or controller that queries them. Verify that the response ties every recommendation to a real query pattern and returns a short, concrete set of migration changes.