ワンクリックで
data-migration-strategy
Plan safe Laravel data migrations with phased rollout, backfills, double writes, verification, and rollback.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Plan safe Laravel data migrations with phased rollout, backfills, double writes, verification, and rollback.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | data-migration-strategy |
| description | Plan safe Laravel data migrations with phased rollout, backfills, double writes, verification, and rollback. |
| license | MIT |
| tags | ["laravel","php"] |
| version | 0.1.0 |
| compatible_agents | ["laravel/boost"] |
Use this skill when a Laravel project needs a schema or data-shape change that cannot be done safely in one step. It is most useful for table splits, column renames, type changes, new canonical data structures, dual-write rollouts, backfills, phased cutovers, and cleanup of stale read/write paths.
Preparation, Schema expansion, Write compatibility, Backfill, Verification, Read cutover, Cleanup, and Old path removal.chunkById, upsert or updateOrInsert, queue isolation, progress tracking, canary rollout, metrics, row-count or checksum validation, and operator-visible rollback checkpoints.Recommended strategy, Phase plan, Verification steps, Rollback plan, and Cleanup plan. Keep the answer practical, conservative, and grounded in the actual Laravel codebase.Output expectations: return the safest migration strategy for the scenario, a phased rollout plan, verification steps, rollback guidance, and the final cleanup sequence.
Prompt 1:
Use data-migration-strategy for a Laravel app where we need to move invoice line items into a new normalized table without losing writes during rollout. Suggest whether we need double writes, backfills, and read cutover steps.
Prompt 2:
Review this Laravel data migration plan for moving user profile data from a JSON column into dedicated columns. We need low risk, rollback safety, and staged cleanup of the old read path.
JSON:
{
"skill": "data-migration-strategy",
"context": {
"scenario": "move denormalized order metadata into normalized tables",
"constraints": ["zero_downtime", "high_write_volume", "rollback_required"],
"techniques": ["double_write", "queued_backfill", "read_fallback"],
"files": ["database/migrations", "app/Models", "app/Jobs", "app/Services"]
}
}
Code example:
DB::transaction(function () use ($user, $payload): void {
// Write the new structure first and keep the legacy path in sync until cutover.
UserProfile::updateOrCreate(
['user_id' => $user->id],
[
'timezone' => $payload['timezone'],
'locale' => $payload['locale'],
]
);
if (config('data_migrations.keep_legacy_profile_json_in_sync')) {
$user->forceFill([
'profile' => array_merge($user->profile ?? [], [
'timezone' => $payload['timezone'],
'locale' => $payload['locale'],
]),
])->save();
}
});
Run the skill on a Laravel migration scenario that requires a new table, a large backfill, and staged cutover from old reads and writes to new ones. Verify that the response recommends an appropriate expand-contract or double-write strategy, includes verification and rollback steps, and delays destructive cleanup until after validation.
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 migrations and query paths for missing, redundant, or risky indexes before production.
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.