Install
$ agentstack add skill-me-shaon-agent-skills-data-migration-strategy ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Data Migration Strategy
When to use
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.
Input parameters
- The current and target data model or schema shape.
- Relevant migrations, models, repositories, services, jobs, commands, and controllers.
- Table size, write volume, downtime tolerance, and rollback constraints.
- Whether double writes, dual reads, backfills, or feature flags are acceptable.
- Any consistency requirements, external dependencies, or compliance constraints.
Procedure
- Identify the migration type and risk level. Clarify whether this is a pure schema change, a large data backfill, a write-path migration, a read-path migration, or a full expand-contract rollout.
- Inspect the current read and write paths in Laravel code. Review migrations, Eloquent models, casts, observers, jobs, commands, queue workers, APIs, admin tooling, and reporting queries to see where old and new data structures are touched.
- Choose the safest strategy for the scenario. Prefer:
- direct migration only for small, low-risk, reversible changes
- expand-contract for production schema evolution
- double writes when old and new structures must stay in sync during rollout
- dual reads or read fallbacks during cutover when consumers switch gradually
- chunked queued backfills for large datasets
- Design the rollout in phases. Usually this means
Preparation,Schema expansion,Write compatibility,Backfill,Verification,Read cutover,Cleanup, andOld path removal. - Build safety controls into the plan. Call out feature flags, idempotent jobs, chunking with
chunkById,upsertorupdateOrInsert, queue isolation, progress tracking, canary rollout, metrics, row-count or checksum validation, and operator-visible rollback checkpoints. - Review rollback and failure handling explicitly. Identify which phases are reversible, when double writes can be disabled, how stale reads are prevented, how failed backfills are retried, and what should happen if old and new data diverge.
- Return a scenario-specific recommendation under
Recommended strategy,Phase plan,Verification steps,Rollback plan, andCleanup 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.
Examples
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();
}
});
Smoke test
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.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: me-shaon
- Source: me-shaon/agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.