← 返回 Skills 市场
40
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install migration-validator
功能描述
Validates SQL syntax of pending database migration files before execution
使用说明 (SKILL.md)
迁移验证器
概述
扫描迁移目录中的 SQL 文件,验证语法的正确性,记录已应用和待应用的迁移状态。确保只有语法正确的迁移才会进入执行管道。
使用场景
- 变更管控:在迁移执行前发现 SQL 语法错误
- CI/CD 集成:作为部署流水线中的门控步骤
- 多环境一致性:验证迁移文件跨环境兼容
使用方法
- 扫描 migrations 目录获取所有 SQL 文件。
- 使用 SQLite PRAGMA 或语法解析器验证每个文件。
- 记录已执行的迁移和待执行的迁移。
- 输出验证报告 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。
安全使用建议
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.
能力评估
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.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install migration-validator - 安装完成后,直接呼叫该 Skill 的名称或使用
/migration-validator触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
常见问题
Migration Validator 是什么?
Validates SQL syntax of pending database migration files before execution. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 40 次。
如何安装 Migration Validator?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install migration-validator」即可一键安装,无需额外配置。
Migration Validator 是免费的吗?
是的,Migration Validator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Migration Validator 支持哪些平台?
Migration Validator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Migration Validator?
由 InkLin(@ink5725)开发并维护,当前版本 v1.0.0。
推荐 Skills