本文へスキップ
Skillpedia
APIとサーバー(バックエンド)81k · #1659

migrate-validate

できること

このスキルは、まだ適用されていないデータベースのマイグレーションファイルをレビューし、よくある安全上の問題を探します。ライブのデータベースを変更する前に、ミスを見つけたい開発者向けです。

使う場面

  • ✓保留中のマイグレーションがあり、適用の前に確認したいとき。
  • ✓マイグレーションがテーブルや列を削除するため、安全性のレビューが必要なとき。
  • ✓リリースの工程の一部として、命名と安全性のチェックがほしいとき。

スキルのリンク

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-migrations/skills/migrate-validate/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-migrations/skills/migrate-validate/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“適用する前に、保留中のデータベースマイグレーションに危険な変更がないか確認してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

スキルは未適用のマイグレーションファイルを見つけ、その SQL を読み、外部キーの参照先、新しく必須になった列の既定値、取り消しの完全性、破壊的な操作、安全な表現、テーブル名の付け方を確認します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Migrate Validate

Validate all pending database migrations for correctness, safety, and adherence to best practices.

When to use

Before applying migrations to catch issues early -- foreign key references to non-existent tables, missing rollback SQL, destructive operations without safeguards, and naming convention violations.

Steps

  1. Find pending migrations -- use Glob to list all migration files, cross-reference with applied history via mcp__plugin_ruflo-core_ruflo__memory_search --namespace migrations (or memory_list) to identify pending ones. The memory_* tool family routes by namespace; agentdb_hierarchical-* does NOT (it routes by tier), so use memory_* here.
  2. Parse SQL -- use Read to load each pending .up.sql and .down.sql file and parse the SQL statements
  3. Check foreign keys -- verify that all REFERENCES targets exist in the current schema or in prior migrations (both applied and pending)
  4. Check NOT NULL defaults -- verify that any ADD COLUMN with NOT NULL has a DEFAULT value
  5. Check rollback completeness -- verify every CREATE/ALTER in the UP file has a corresponding DROP/ALTER in the DOWN file
  6. Flag destructive ops -- warn on DROP TABLE, DROP COLUMN, TRUNCATE without explicit confirmation
  7. Check idempotency -- verify IF EXISTS / IF NOT EXISTS is used for safety
  8. Check naming -- verify table names are plural, column names are snake_case, index names follow idx_table_column convention
  9. Store validation patterns -- two paths (per ruflo-cost-tracker ADR-0001 dual-path pattern):
    • Pattern store (typed, recommended): mcp__plugin_ruflo-core_ruflo__agentdb_pattern-store with type: 'migration-validation'. No namespace arg — ReasoningBank routes it.
    • Plain store (namespace-routable): mcp__plugin_ruflo-core_ruflo__memory_store --namespace migrations for validation results tied to a specific migration number.
  10. Report -- display: errors (must fix), warnings (should fix), info (suggestions), with file path and line number for each issue

CLI alternative

npx @claude-flow/cli@latest memory search --query "migration validation results" --namespace migrations
よくある質問

破壊的な変更とは何ですか?

DROP TABLE、DROP COLUMN、TRUNCATE の文が、あなたが確認できるように印付けされます。

マイグレーションのファイルを変更しますか?

説明では、確認と報告が扱われています。結果を確認して、何を変えるかを決めてください。

どのマイグレーションが保留中かは、どうやって分かりますか?

マイグレーションファイルを、migrations のメモリーの名前空間にある履歴と比べて判断します。

詳細

作者による元の説明

Validate pending migrations for foreign key consistency, rollback safety, and best practices

repo: ruvnet/ruflo

人気

GitHubのスター
81k
ランキング
#1659
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル