Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Migrate Check

ASecurity

Pre-flight safety check for Prisma/SQL migrations. MUST be run before creating or applying any migration in a project whose database is shared Postgres. Opens with a written GO or NO-GO verdict, then classifies every SQL statement additive vs destructive, checks migration-history drift and folder reuse, enforces create-only plus deploy discipline, and identifies the backup path first. Never fixes anything - it blocks and explains.

2 stars
0 votes
0 copies
0 views
Added 9/28/2026
ai-agentsrustgobashsqlrailsgitdatabasesecurity

Works with

cli

Security Analysis

A100/100

Scanned 9/28/2026

Install to Claude Code

$npx -y skills add AaravChadha/acstack --skill migrate-check --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Migrate Check?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Migrate Check
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aaravchadha-migrate-check/badge)](https://www.skillsdirectory.com/skills/aaravchadha-migrate-check)

More formats (shields.io, HTML) on the badges page.

Files
SKILL.md
---
name: migrate-check
description: "Pre-flight safety check for Prisma/SQL migrations. MUST be run before creating or applying any migration in a project whose database is shared Postgres. Opens with a written GO or NO-GO verdict, then classifies every SQL statement additive vs destructive, checks migration-history drift and folder reuse, enforces create-only plus deploy discipline, and identifies the backup path first. Never fixes anything - it blocks and explains."
argument-hint: "[prisma/migrations/<folder>]"
allowed-tools: Read, Grep, Glob, Bash(git diff:*), Bash(git log:*), Bash(git status:*), Bash(ls:*), Bash(cat:*), Bash(npx prisma migrate status:*)
---

# /migrate-check — the gate before the shared database

A teammate's migration once dropped a table from a shared production
database. This skill exists so that never happens again. It is structurally
read-only: the tool whitelist has no Edit, no Write, and no prisma
subcommand that mutates anything. It blocks and explains; it never fixes.
(One residual: `git log` and `git diff` accept `--output=FILE`, which a
prefix grant can't exclude; the skill never uses it — see check.sh §13.)

`Adjacent skills:` /secure (security review; /migrate-check is DB-change
safety) · /audit code (defects in code; this gates schema changes).

<!-- acstack:runtime -->
Run before the skill's steps — per invocation, not per session (4.36); failures degrade to markdown:
```bash
link="$(readlink "$HOME/.claude/skills/health" 2>/dev/null || true)"   # empty = not symlinked
pack="$(dirname "$(dirname "$link")")"   # NEVER trust this unless $link was non-empty
if [ "${link#/}" != "$link" ] && [ -x "$pack/bin/acstack-config" ] && ! "$pack/bin/acstack-config" runtime | grep -q '=off'; then
  "$pack/bin/acstack-config" || true          # resolved keys, with sources
  "$pack/bin/acstack-update-check" || true    # ≤1 fetch/day; silent ONLY if already checked today
  "$pack/bin/acstack-recall" || true          # LEARNINGS.md + bug-class names, capped 3KB
else
  echo "runtime off — proceeding without recall/update-check"
fi
```
<!-- /acstack:runtime -->

<!-- acstack:principles -->
## Operating principles

- Be direct. Push back in writing when the plan or the user is wrong. No sycophancy.
- Never delete a decision. Supersede it: `~~old~~ → **Verdict (YYYY-MM-DD):** new call — reason.`
- Never fix, tune, or delete a test or eval case to raise a score. Log the miss honestly and leave the case unchanged.
- Name exact things: regex patterns, function signatures, model names, before → after numbers. Never "fixed bugs".
- Attribution: follow the project's `attribution` setting (default `none`) — no AI-tool mentions in generated docs, no attribution trailers in commits or PRs. Commit with explicit `-m`/`-F` messages only.
- Config: read `.claude/acstack.md` at the project root (fall back to `~/.claude/acstack.md`) before acting. `## Settings` keys override pack defaults; a `## <skill-name>` section overrides both. Unknown keys and sections are ignored.
- Docs: BRIEF.md (frozen seed) / PLAN.md (living plan) / JOURNAL.md (rolling journal). If the repo uses legacy names (PLANNING_PROMPT.md / PLANNING.md / STATUS.md), use those instead — never create both.
- Recall: if `LEARNINGS.md` exists at the project root, read it before starting.
- Conduct: follow the `acstack-conduct` block in this repo's AGENTS.md — the word is the mode; the user sets the pace.
- Hackathon lane: if the project's AGENTS.md carries the `acstack:hackathon-lane` block, only `/do` changes the repository during the event. Any other skill that would write a tracked file, commit or push says what it would have done and stops; a change that is not a task goes through the lane's operator route.
<!-- /acstack:principles -->

## Procedure

1. **Resolve the safety level** from config `db:`. Default when unspecified
   is **shared-prod** — the conservative assumption. `local` → lighter path
   (step 8). `none` → say so in one line and stop.

   **No-database autodetect.** When `db:` is *unset* AND the project shows
   **no** database signal at all — no `prisma/`, no `migrations/`
   directory, no `*.sql`, no `alembic.ini`/`Gemfile`, no ORM or driver
   dependency in a manifest, no `DATABASE_URL` in `.env`/`.env.example` —
   open with *"no database in this project — nothing to pre-flight"* and
   stop there. That is the honest answer up front, rather than reaching it
   the long way through a failed stack lookup in step 2. **The conservative
   default is unchanged whenever a database MIGHT exist:** any one signal
   present, or `db:` set explicitly, means shared-prod strictness as
   before. Absence of every signal is the only trigger — never a partial
   match, and never an inference from "I couldn't find the stack."
2. **Identify the target**: the folder or file named in the arguments,
   else the newest unapplied migration. Resolution is stack-dependent —
   `npx prisma migrate status` for Prisma; otherwise the newest unapplied
   file in the project's migrations directory (Drizzle, Rails, Alembic,
   Flyway, plain SQL). **If the stack cannot be determined or the target
   cannot be resolved, say exactly that and ask for the target path —
   never assume Prisma.**

   **Honest scope on non-Prisma stacks.** Steps 3 (backup path) and 4
   (classification) are stack-agnostic and run normally. Steps 5, 6, 7,
   and 8 name Prisma commands specifically, and the `allowed-tools`
   whitelist deliberately permits no migration CLI except
   `prisma migrate status` — running an
   arbitrary stack's CLI is exactly the mutation risk this skill exists
   to prevent. So on Drizzle/Alembic/Rails/Flyway/plain SQL, say plainly:
   *"history-drift and command-discipline checks skipped — <stack> CLI is
   outside this skill's read-only whitelist; verify applied-migration
   history manually before the GO."* A narrowed verdict stated is honest;
   a full verdict implied from a partial check is not.
3. **Backup and undo path FIRST.** Name the exact backup command (default
   `pg_dump "$DATABASE_URL" > backups/pre_<timestamp>.sql`; config
   `## migrate-check` `backup-command` overrides) and the restore step. If
   no undo path can be identified, the verdict is **NO-GO** — automatically.
4. **Classify every statement** in the migration SQL per
   `references/sql-classification.md`. Output a per-statement table:
   statement / class / risk / safe alternative where one exists.
5. **History drift and folder reuse.** Compare `migrate status` output with
   `prisma/migrations/`. Enforce the re-land rule: re-landing a previously
   dropped migration requires a NEW timestamped folder — a reused folder
   name already recorded in `_prisma_migrations` is silently skipped and
   the table never created. Flag any drift between recorded history and the
   folder set.
6. **Command discipline** (shared-prod): author with
   `npx prisma migrate dev --create-only`, apply with
   `npx prisma migrate deploy`. NEVER plain `migrate dev` and never
   `db push` against a shared database — both can reset or drift it.
7. **Sequencing.** Migrations are applied manually BEFORE merging code that
   depends on them: CI/hosting builds run `prisma generate && next build`
   (or equivalent) and never run migrations, so merged code referencing a
   not-yet-existing column fails at runtime. Confirm the ordering plan.
8. **`db: local` lighter path**: file backup
   (`cp prisma/dev.db prisma/dev.db.backup_<timestamp>`), plain
   `migrate dev` acceptable, but statement classification (step 4) still
   runs — destructive is destructive on any database.

## The verdict

**The verdict is the report's FIRST line**, then the evidence that earned
it — a reader who stops after one line must still get the answer. Restate
it at the end as a written block, always:

- `**Verdict: GO**` — only when every statement is additive, history is
  clean, and the backup path is named. Include the exact next commands in
  order.
- `**Verdict: NO-GO — <reason>**` — for any destructive statement without
  an explicit user-acknowledged plan, missing undo path, folder reuse, or
  history drift. Include: what to check (expected row counts, expected
  `migrate status` output), and a symptom → cause → action table for the
  likely failure modes.

Destructive operations are never a hard stop forever — they are a stop
until the user explicitly acknowledges the classification table and the
backup is confirmed taken. The skill's job is to make "I didn't realize it
would drop that" impossible.

Attribution

AaravChadhaAaravChadha
View sourceMore from AaravChadha →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1074701 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

695601 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

691 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →