← Back to Skills Marketplace
ink5725

Migration Validator

by InkLin · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
40
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install migration-validator
Description
Validates SQL syntax of pending database migration files before execution
README (SKILL.md)

迁移验证器

概述

扫描迁移目录中的 SQL 文件,验证语法的正确性,记录已应用和待应用的迁移状态。确保只有语法正确的迁移才会进入执行管道。

使用场景

  • 变更管控:在迁移执行前发现 SQL 语法错误
  • CI/CD 集成:作为部署流水线中的门控步骤
  • 多环境一致性:验证迁移文件跨环境兼容

使用方法

  1. 扫描 migrations 目录获取所有 SQL 文件。
  2. 使用 SQLite PRAGMA 或语法解析器验证每个文件。
  3. 记录已执行的迁移和待执行的迁移。
  4. 输出验证报告 JSON。

输出格式

{
  "validation_timestamp": "2026-06-01T12:00:00",
  "migrations_found": ["001_initial.sql", "002_create_orders.sql"],
  "pending_migrations": [],
  "validation_errors": [],
  "status": "completed"
}

实现代码

scripts/validate.py

Usage Guidance
Install only if you are comfortable with the skill reading the configured migrations directory and SQLite migration table. Configure the paths deliberately, avoid pointing it at production data unnecessarily, and run it in CI or another controlled environment because it executes local migration SQL in SQLite memory for validation.
Capability Assessment
Purpose & Capability
The skill’s stated purpose is SQL migration validation, and the script scans migration files, checks migration state, validates SQL with SQLite, and returns a JSON report, which fits that purpose.
Instruction Scope
The short description emphasizes pending migrations, while the documentation and script validate every .sql file in the migrations directory; the script also executes scripts in an in-memory SQLite database rather than only parsing syntax.
Install Mechanism
The artifact contains a SKILL.md file and one Python script, with no installer, package dependency, network call, obfuscation, or automatic setup behavior.
Credentials
Reading a migrations directory and querying the _migrations table are proportionate for this tool, but the default paths /migrations and /var/db/app.db should be reviewed and configured for the intended project.
Persistence & Privilege
No background persistence, privilege escalation, credential access, exfiltration, or direct execution against the real database was found; however, SQLite script execution should be treated as running trusted local SQL and kept in a controlled environment.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install migration-validator
  3. After installation, invoke the skill by name or use /migration-validator
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of migration-validator. - Validates SQL syntax of all pending database migration files before execution. - Scans migration directory, checks syntax with SQLite, and reports status. - Identifies applied and pending migrations for tracking. - Outputs a JSON validation report with detailed results. - Useful for change control, CI/CD pipelines, and ensuring environment consistency.
Metadata
Slug migration-validator
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Migration Validator?

Validates SQL syntax of pending database migration files before execution. It is an AI Agent Skill for Claude Code / OpenClaw, with 40 downloads so far.

How do I install Migration Validator?

Run "/install migration-validator" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Migration Validator free?

Yes, Migration Validator is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Migration Validator support?

Migration Validator is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Migration Validator?

It is built and maintained by InkLin (@ink5725); the current version is v1.0.0.

💬 Comments