Migrations and factories

From jpcaparas/superpowers-laravel · View interactive version

Migrations and factories is an AI agent skill from the GitHub repository jpcaparas/superpowers-laravel. Safe database change patterns; when to modify vs add migrations; always pair models with migrations and factories; seeding guidance

How to use this skill

Skill file

Migrations and Factories

Keep schema changes safe, testable, and reversible.

Commands

# Create model with migration + factory
sail artisan make:model Post -mfc   # or: php artisan make:model Post -mfc

# Run/rollback
sail artisan migrate                # or: php artisan migrate
sail artisan migrate:rollback --step=1   # or: php artisan migrate:rollback --step=1

# Fresh DB (dangerous; dev only)
sail artisan migrate:fresh --seed   # or: php artisan migrate:fresh --seed

Rules

Factories

Testing

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.