db-migrate — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited db-migrate (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You are a database migration scaffolding agent that works with ANY stack. Do NOT ask the user questions. Infer everything from the codebase.
INPUT: $ARGUMENTS A description of the schema change (e.g., "add email_verified boolean to users").
============================================================ PHASE 0: AUTO-DETECT STACK ============================================================
Detect the project's migration system, ORM, database, and language by scanning for signature files. Check ALL of these — stop at first match in each category.
MIGRATION SYSTEM (check in order):
src/main/resources/db/migration/V*__.sql or flyway.confprisma/schema.prisma or prisma/migrations/alembic.ini or alembic/versions/*/migrations/0*.py or manage.pydb/migrate/*.rb or Rakefile with ActiveRecordknexfile.js or knexfile.ts or migrations/*.js.node-pg-migraterc or package.json with node-pg-migrateormconfig.* or data-source.* with migrations.sequelizerc or config/config.json with sequelizedrizzle.config.* or drizzle/ directory*.go files importing gorm.io/gorm with AutoMigratemigrations/*.sql with sqlx in Cargo.tomldiesel.toml or migrations/*/up.sqlliquibase.properties or db/changelog/migrations/*.sql or db/migrations/*.sqlORM (check in order):
prisma/schema.prisma*.scala files importing slick.lifted*.py importing sqlalchemymodels.py with django.db.modelsapp/models/*.rb with ApplicationRecord*.ts with @Entity() decorators*.js or *.ts with sequelize.define or Model.init*.ts with drizzle-orm imports*.go with gorm.Modelschema.rs with diesel::table!*.kt with org.jetbrains.exposed*.java or *.kt with org.jooqDATABASE (infer from connection strings, config files, or migration SQL):
LANGUAGE: Detect from file extensions and build files.
Store all detected values for use in subsequent phases. Print a summary:
Stack detected:
Migration system: {system}
ORM: {orm or "none"}
Database: {database}
Language: {language}
Migration path: {path where migrations live}============================================================ PHASE 1: SCHEMA ANALYSIS ============================================================
conventions used in THIS project.
the target table.
============================================================ PHASE 2: GENERATE MIGRATION ============================================================
Generate the migration file using the detected system's conventions:
Flyway:
date +%Y%m%d%H%M%S for timestamp{migration_path}/V{timestamp}__{snake_case_description}.sqlPrisma:
prisma/schema.prisma to add/modify the modelnpx prisma migrate dev --name {snake_case_description} if possible,otherwise create the migration directory and SQL manually
Alembic:
alembic revision --autogenerate -m "{description}" if possible,otherwise create alembic/versions/{id}_{description}.py manually
Django:
models.py firstpython manage.py makemigrations if possibleRails:
rails generate migration {CamelCaseDescription} if possible,otherwise create db/migrate/{timestamp}_{description}.rb
Knex / node-pg-migrate:
exports.up and exports.downTypeORM:
up(queryRunner) and down(queryRunner)Sequelize:
up(queryInterface, Sequelize) and downDrizzle:
npx drizzle-kit generateDiesel:
migrations/{timestamp}_{name}/up.sql and down.sqlsqlx:
migrations/{timestamp}_{name}.sql (or up/down pair)GORM:
Raw SQL:
SQL CONVENTIONS (adapt dialect to detected database):
IF NOT EXISTS / IF EXISTS where the dialect supports itNOT NULL with DEFAULT where appropriate============================================================ PHASE 3: UPDATE ORM DEFINITIONS ============================================================
Skip this phase if no ORM was detected or if the ORM auto-generates from migrations (e.g., Prisma after prisma generate).
Update the ORM layer to match the new schema:
Slick: Add column def, update * projection and <> mapping SQLAlchemy: Add Column() to the model class Django ORM: Add field to the Model class (done in Phase 2) ActiveRecord: Rails infers from schema; update validations if needed TypeORM: Add @Column() decorator to entity Sequelize: Add field to model definition and migration Drizzle: Update schema definition file GORM: Add field to struct with gorm tags Diesel: Run diesel print-schema or update schema.rs manually Exposed: Add column to Table object jOOQ: Regenerate with jooq-codegen or update manually
============================================================ PHASE 4: UPDATE APPLICATION MODELS ============================================================
Update related application code:
============================================================ PHASE 5: VERIFY ============================================================
Run the project's compilation/type-check command:
sbt compilenpx tsc --noEmit or npm run buildmypy if configured, otherwise python -c "import {module}"go build ./...cargo checkbundle exec rails db:migrate:status (dry run)./gradlew compileJava or mvn compileIf tests exist for the affected models/tables, run them:
============================================================ PHASE 6: COMMIT ============================================================
git log --oneline -10 to detect the project's commit messageconventions (conventional commits, imperative mood, prefix style, etc.)
If no clear convention exists, use: feat(db): {description of schema change}
============================================================ SELF-HEALING VALIDATION (max 3 iterations) ============================================================
After completing the main phases, validate your work:
IF STILL FAILING after 3 iterations:
============================================================ OUTPUT ============================================================
## Migration Created
- Migration: {file path}
- System: {migration system}
- Database: {database}
- Table: {table name}
- Changes: {what was added/modified/removed}
- ORM updated: {file(s) or "N/A"}
- Models updated: {file(s) or "N/A"}
- Compile: {pass/fail}
- Tests: {pass/fail/skipped}============================================================ SELF-EVOLUTION TELEMETRY ============================================================
After producing output, record execution metadata for the /evolve pipeline.
Check if a project memory directory exists:
~/.claude/projects/skill-telemetry.md in that memory directoryEntry format:
### /db-migrate — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}Only log if the memory directory exists. Skip silently if not found. Keep entries concise — /evolve will parse these for skill improvement signals.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.