unioss-generate-migrationlisted
Install: claude install-skill ttncode/unioss-plugins
# CI3 Migration Generator For UNIOSS Project
## Overview
You are working in a CodeIgniter 3 repository with timestamp-based migrations. **Core principle:** keep diffs minimal — generate only the target migration set, touch nothing unrelated.
## Input
From the user message if any. All optional:
- `<env> only` (e.g. "production only") — generate for that environment alone
- a ticket id: f353, a1768, etc (meaning: include in the migration file name)
- column type/default/null/after (if provided, honor it)
**Column position is mandatory when adding to an existing table** (`rules/clean-code-php.md` → Database migrations). If the prompt does not say where the column goes, `DESCRIBE` the table, pick the position that groups it with related columns and keeps the `delete_flg, created_at, updated_at` audit tail last, and state the chosen position back to the user.
### Rules & structure
- Migration filename format:
`<timestamp>_<action>_<ticket_id>_<index>.php`, example: `20260114101209_alter_column_administrator_id_nullable_to_status_histories_table_a1678_222.php`
- A migration may exist in multiple env folders:
- production: `AdminPage/application/migrations/production`
- staging: `AdminPage/application/migrations/staging`
- testing: `AdminPage/application/migrations/testing`
- virtualbox_direct_domain: `AdminPage/application/migrations/virtualbox_direct_domain`
- the local environment currently in use (`node "${CLAUDE_PLUGIN_ROOT}/scripts/detect-app-env.mjs"`), if