hf.enforce-migrations

Block direct SQL DDL in non-migration files during Edit and Write operations.

5|2|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/T-rav/hydraflow --skill hf-enforce-migrations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hf.enforce-migrations
Source: https://github.com/T-rav/hydraflow/tree/main/.codex/skills/hf.enforce-migrations
Command: npx skills add https://github.com/T-rav/hydraflow --skill hf-enforce-migrations

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Direct database schema changes outside of migrations can lead to untracked changes, drift, and risky deployments. This Skill enforces migration-based workflows to preserve versioned schemas and audit trails.

Core Features & Use Cases

  • Intercepts non-migration edits and edits to SQL/DLL-related content, blocking risky changes.
  • Guides developers to create Alembic migrations for any schema-altering operation.
  • Validates that migrations exist before applying changes, reducing drift in production databases.

Quick Start

Install the pretool hook and attempt a direct DDL change to observe it blocked and redirected to a migration.

Frequently Asked Questions about hf.enforce-migrations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce Alembic migrations and block direct SQL schema changes in non-migration files?

You can enforce Alembic migrations by using a PreToolUse hook that intercepts Edit and Write operations, evaluating file paths and content to block direct DDL statements outside migration files. This guardrail automatically rejects risky changes and redirects developers to create new migration stubs, preserving versioned schemas and audit trails.

What is the best way to prevent database drift from untracked schema modifications during development?

Preventing database drift is best achieved by enforcing migration-based workflows that block direct schema modifications. A PreToolUse hook validates that all DDL operations reside strictly within Alembic migration files, rejecting non-migration edits and instructing developers to generate proper migration stubs.

Can I use a pretool hook to intercept and validate DDL statements before they are written to code or SQL files?

Yes, you can use a PreToolUse hook to intercept and validate DDL statements before they are written. The hook evaluates file paths and content during Edit and Write operations across code and SQL-related files, blocking direct DDL outside migrations and ensuring schema changes go through Alembic.

Does this migration enforcement guardrail work with both code files and SQL files?

Yes, this migration enforcement guardrail works with both code and SQL files. It operates as a PreToolUse hook across Edit and Write operations, evaluating the file path and content to detect and block DDL statements in any non-migration files, ensuring all schema changes use Alembic migrations.

What happens when I attempt a direct database schema change outside of an Alembic migration?

When you attempt a direct database schema change outside an Alembic migration, the PreToolUse hook blocks the operation and rejects the DDL statement. It then instructs you to create a new Alembic migration stub, ensuring the change is tracked and preventing risky untracked deployments.