Generate and safety-review a TypeORM migration in a NestJS project that uses this convention (DataSource in src/entities/data-source.ts, generate-migration.ts wrapper, synchronize:false): it runs the auto-generate step and then gates on a review of the generated DDL to catch destructive operations (DROP COLUMN, DROP TABLE, type narrowing) before they are ever applied. Use this whenever an entity was added or changed and a migration is needed, phrases like "generate a migration", "마이그레이션 만들어", "I changed the User entity, migrate it", "create the migration for the new column", "diff the schema". Do NOT use this for: actually applying an already-generated migration in production/CI (that is a deploy step: `pnpm migration:run`), writing a hand-authored data-backfill migration by hand, reverting (`migration:revert`), or non-TypeORM stacks (Prisma, Drizzle, raw SQL, Django); those have their own tooling.
Ships in backend. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Auto-generated migrations are convenient and dangerous: TypeORM emits DROP
statements whenever the entity no longer matches the DB, and a blindly-run
generated migration can delete a column (and its data) that someone just
forgot to annotate. This skill generates the migration and forces a review
gate before it is considered safe to apply.
{
"name": "CreateUser", // migration name, PascalCase verb+subject; TypeORM appends a timestamp
"apiRoot": "apps/api" // package containing src/entities/data-source.ts (default: auto-detect)
}
{
"migrationFile": "src/migrations/1700000000000-CreateUser.ts",
"verdict": "safe" | "needs-review",
"destructiveOps": [] // e.g. ["DROP COLUMN \"user\".\"legacy_flag\""] — non-empty ⇒ gate STOP
}
Locate the api root — the package whose package.json exposes the
migration:generate script and holds src/entities/data-source.ts.
Default to apps/api; fall back to repo root.
Preconditions. The generate step diffs entities against a live DB, so:
.env points at (local: docker compose up -d db, or a native/other cluster; no-Docker envs just point DB_HOST/DB_PORT at whatever is running), andpnpm --filter <api-pkg> typeorm migration:show lists them as [ ] <Name> lines. If any are
pending, run pnpm --filter <api-pkg> migration:run first, unless the caller said not to run
migrations (an orchestrator that owns migration:run): then do not generate against the stale
schema; stop and report blocked: pending migrations <names>, andpnpm --filter <api-pkg> typeorm query "SELECT name FROM migrations"
returns only names declared in src/migrations/ (CreateUser1792205458130 is the name in
1792205458130-CreateUser.ts; no such table yet is a fresh DB, fine). A name with no file is another
project's schema, often a reused compose volume; stop and report, since a diff against it means nothing.
If the DB is unreachable, stop and report; do not fabricate a migration.Generate. Use the project's wrapper so the name is validated:
pnpm --filter <api-pkg> migration:generate <Name>
# wrapper runs: pnpm typeorm migration:generate src/migrations/<Name>
If the wrapper (generate-migration.ts) is absent, the project predates the
convention — fall back to the raw command but note it.
TypeORM exits non-zero with "No changes in database schema were found" when
the entities already match the DB. That is a valid outcome, not an error:
report verdict: "safe", migrationFile: null, and stop.
Otherwise format the new file with the formatter the project's format script runs, scoped to
that one file (skip if there is no format script):
pnpm --filter <api-pkg> exec prettier --write src/migrations/<timestamp>-<Name>.ts
TypeORM writes the file in its own style, which fails format:check every time; formatting
only this file keeps the rest of the tree out of the change.
Review the generated DDL — the gate. Open the new file in
src/migrations/ and read its up() method. Classify every statement:
Pattern in up() | Meaning | Verdict |
|---|---|---|
CREATE TABLE, ADD COLUMN, CREATE INDEX | additive | safe |
ALTER COLUMN ... TYPE (widening, e.g. varchar(50)→varchar(255)) | safe-ish | safe, note it |
DROP COLUMN, DROP TABLE | data loss | needs-review |
ALTER COLUMN ... TYPE (narrowing) or SET NOT NULL on populated table | may fail / truncate | needs-review |
DROP ... ADD recreating an FK/index | usually fine but verify intent | note it |
Collect every data-loss / risky statement into destructiveOps.
Decide.
destructiveOps empty → verdict: "safe". Report the file and tell the
caller they can apply it with pnpm --filter <api-pkg> migration:run (which is a deploy step,
not this skill's job).destructiveOps non-empty → verdict: "needs-review". STOP. Show the
user each destructive statement and ask whether it is intended:
@Column by accident, or renamed a
property so TypeORM sees drop+add instead of rename) → fix the entity /
hand-write a rename, delete the bad migration, regenerate.TypeORM has no notion of a column rename. Renaming an entity property emits
DROP COLUMN old + ADD COLUMN new, silently discarding the old data. When a
DROP/ADD pair matches a recent property rename, flag it as needs-review and
suggest hand-editing the migration to RENAME COLUMN instead.
synchronize: true to avoid writing a migration — the convention
forbids it (§6); it is how production data gets silently mangled.migrationsRun: false); running them is an
explicit deploy-pipeline step. This skill stops at "generated + reviewed".src/entities/data-source.ts; the
CLI loads .env itself, so the same env vars must be present in the shell.What SKILL.md sets; muted values are Claude Code's defaults
/backend:nestjs-migrationfrom backend
npx claudepluginhub siu9068/ggyul-skills --plugin backend11 skills in this plugin
/api-creator-bootstrapGenerates a backend repo's `api-creator` + `test-checker` skill pair: set up, port, or bootstrap the API + test skills here. Generate a project-tailored TDD skill PAIR — `api-creator` (scaffold new APIs) and `test-checker` (audit & fill existing unit tests) — for a backend project: extract the proven gated, test-first methodology and fill in THIS project's own conventions (layers, base classes, auth, DTO/serialization, folder layout, test framework, verify commands). Both skills share one discovered recipe so they stay consistent. Use whenever the user wants to "set up api-creator here", "port the api-creator/test-checker skills to this project", "bootstrap the API + test skills for this repo", or bring one project's API + test conventions into another as reusable skills. Do NOT use this to actually build an API or audit tests in the current project (that is the generated skills' job), nor to edit an existing skill (use skill-creator / skill-ops)./axum-bootstrapScaffolds a Rust axum 0.8 + SeaORM 2.0 + PostgreSQL 16 backend from zero, standalone or apps/api monorepo. House convention: DDD-lite domains with Admin/Client route groups, fail-fast env validation, three utoipa OpenAPI docs with Swagger UI, tracing JSON logs, a Docker image, tests against a real Postgres. Phase 0 decides standalone (Cargo workspace at the repo root) or apps/api in a pnpm monorepo next to packages/contracts. Use when the user wants to start, set up or scaffold a new axum or Rust backend with this stack: "러스트 백엔드 새로 세팅해줘", "axum 프로젝트 만들어줘", "sea-orm 붙여서 rust api 서버 깔아줘", "bootstrap an axum backend", "scaffold a Rust API with SeaORM and Postgres", "set up apps/api in Rust". Do NOT use for: adding a domain to an existing axum project (use axum-domain-module), writing a SeaORM migration (use axum-migration), NestJS or FastAPI backends (nestjs-bootstrap / fastapi-bootstrap), the whole multi-app bootstrap chain (project-setup), or other Rust frameworks such as actix-web, rocket, poem or loco.Other plugins' skills for the same job