db-migrate
Create, validate, and manage database migrations across any framework. Auto-detects Alembic, Prisma, Knex, Django, Flyway, Rails, and more.
What this skill does
# DB Migrate > **Cross-Platform AI Agent Skill** > This skill works with any AI agent platform that supports the skills.sh standard. Create, validate, and run database migrations across any framework. Auto-detects the migration tool from project files. ## Anti-Hallucination Guidelines **CRITICAL**: Migration operations can be irreversible in production: 1. **Detect before acting** — Always scan for marker files before running any command 2. **Never invent commands** — Only use commands listed in the detection table or discovered in project docs 3. **Warn on destructive operations** — Always flag DROP, TRUNCATE, or irreversible schema changes 4. **Dry-run first** — Use `--dry-run` mode when supported by the framework 5. **Read existing migrations** — Check naming conventions before creating new ones ## Workflow ### Phase 1: Detect Framework Scan for marker files to identify the migration framework: ```bash # Check for common marker files ls alembic.ini 2>/dev/null ls prisma/schema.prisma 2>/dev/null ls knexfile.* 2>/dev/null ls flyway.conf 2>/dev/null ls db/migrate/ 2>/dev/null ls manage.py 2>/dev/null ls atlas.hcl 2>/dev/null ``` Also check: - `package.json` for `knex`, `db-migrate`, `sequelize`, `typeorm` dependencies - `pyproject.toml` / `requirements.txt` for `alembic`, `sqlalchemy` - `Gemfile` for `activerecord` If multiple frameworks detected, ask user which one to use. If none detected, ask user to specify. Refer to [references/framework-commands.md](references/framework-commands.md) for the full detection table and per-framework commands. ### Phase 2: Parse Arguments Determine operation mode from `$ARGUMENTS`: - `create` (or no argument): Create a new migration file - `status`: Show pending and applied migrations - `validate`: Check rollback scripts, naming conventions, index coverage If `--name <name>` provided, use it for migration name. Otherwise ask for a descriptive name. If `--dry-run` provided, show what would be created/run without executing. ### Phase 3: Execute Operation #### create — New Migration 1. **Check naming conventions** in existing migrations (Glob `migrations/`, `db/migrate/`) — infer pattern 2. **Generate timestamp prefix**: `date +%Y%m%d%H%M%S` 3. **Run framework-native CLI** to create the migration file 4. **Verify file was created** — read and display it to the user 5. **If autogenerate is available** (Alembic, Prisma): generate from schema diff After creation, remind user to: - Review the generated migration for correctness - Add rollback/down script if not auto-generated - Add indexes for any new foreign keys #### status — Pending Migrations Run the framework's status command and display: - Applied migrations (with timestamps) - Pending migrations (not yet applied) - Current database schema version #### validate — Migration Quality Check Check the following: 1. **Rollback exists**: Every `up` migration has a `down` script (warn if missing) 2. **Naming convention**: All files follow the project's timestamp + description pattern 3. **Foreign key indexes**: Grep for `REFERENCES` or foreign key declarations without corresponding `CREATE INDEX` 4. **Destructive operations**: Grep for `DROP TABLE`, `DROP COLUMN`, `TRUNCATE` — flag each one 5. **Data migrations vs schema migrations**: Warn if both data and schema changes exist in one file ### Phase 4: Safety Checks Always run these before finalizing a `create` operation: **Destructive operation detection**: ```bash grep -iE "DROP TABLE|DROP COLUMN|TRUNCATE|DELETE FROM" <migration_file> ``` If found: warn user, require explicit confirmation to proceed. **Missing index check**: ```bash grep -iE "REFERENCES|foreign_key|FK_" <migration_file> ``` If foreign keys present, check for corresponding index creation. **Rollback verification**: - Check if the migration has both up and down sections - For autogenerated migrations (Prisma, Alembic): verify the shadow database check passes ### Phase 5: Report Display a summary of what was created or checked: - File path of new migration - Migration name and timestamp - Any warnings (destructive ops, missing rollbacks, missing indexes) - Next steps (apply with `<command>`, rollback with `<command>`) ## Argument Parsing - `create`: Create a new migration (default if no subcommand given) - `status`: Show migration status - `validate`: Validate existing migrations - `--name <name>`: Migration description for the filename - `--dry-run`: Show what would happen without executing ## Important Notes - **Always review auto-generated migrations** before applying — they may include unintended changes - **Rollback scripts are required** for production safety; warn loudly if missing - **Never run migrations directly against production** without a backup - **Prisma shadow database**: Prisma dev migrations use a shadow DB; ensure `DATABASE_URL` is not production - **Transaction wrapping**: Ensure migrations run in transactions for atomicity ## Examples ```bash # Create a new migration /db-migrate create --name add_users_table # Check pending migrations /db-migrate status # Validate migration quality /db-migrate validate # Create without executing (preview) /db-migrate create --name drop_legacy_column --dry-run ```
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.