- Home
- Skills
- DevOps & Cloud
- Schema Guardrail & API Contract Enforcer
More screenshots
Works with the AI Agents you already use
Schema Guardrail & API Contract Enforcer
Prevents breaking database migrations, API contract drifts, and schema changes in AI-generated code.
$19
Schema Guardrail & API Contract Enforcer
Example session with this skill installed
I am refactoring our user profile service. Please update the users database table to drop the legacy_phone column, change the user_role column from string to an enum type, and update our TypeScript interface to remove legacy_phone. Generate the migration file and commit the changes.
- Read your context and instructions
- Compiled the schema guardrail
⚠️ Schema Guardrail Analysis Triggered
I evaluated your request against the active schema-guardrail-pro safety rules. direct execution was blocked because it contains
2 breaking production changes.
🔍 Risk Summary
| Target | Change Type | Detected Risk | Action Required |
|---|---|---|---|
users.legacy_phone | DROP COLUMN | Instant data loss & runtime errors on unupdated clients | Deprecation cycle required |
users.user_role | Type Mutation | DB table lock & failure on existing string values | Multi-step migration required |
🛡️ Executed Safe Alternative Strategy
Instead of applying destructive in-place alterations, I generated a zero-downtime migration path:
Deprecated legacy_phone in Types: Marked legacy_phone?: string as @deprecated in src/types/user.ts rather than deleting it outright.
2. Created Safe Migration File (migrations/20260902_safe_user_refactor.sql):
-- Step 1: Add new ENUM type without breaking existing column
CREATE TYPE user_role_enum AS ENUM ('admin', 'member', 'guest');
ALTER TABLE users ADD COLUMN user_role_v2 user_role_enum DEFAULT 'member';
-- Step 2: Backfill data (Non-blocking)
UPDATE users SET user_role_v2 = user_role::user_role_enum WHERE user_role IS NOT NULL;
-- Note: legacy_phone removal scheduled for Phase 2 after API client deprecation period.
Connects securely to your tools. The creator never sees your data.
About this skill
Stop coding agents (Claude Code, Cursor, Codex CLI) from silently pushing breaking schema changes, invalidating frontend API contracts, or dropping live database columns.
schema-guardrail-pro acts as an automated safety layer for database schema evolutions, TypeScript/Pydantic interface changes, and REST/GraphQL endpoint definitions. When an agent creates migrations or modifies model interfaces, this skill automatically enforces non-breaking rules, requires two-step deprecation workflows, and validates backward compatibility.
Key Capabilities
- Database Migration Protection: Catches in-place
DROP COLUMN,DROP TABLE, or column-type narrowing actions before they run on live environments. - API Contract Verification: Ensures response and request fields maintain backward compatibility, enforcing
@deprecatedmarkers and fallback logic on interface changes. - Automated Validation Script: Runs a fast AST/regex check across changed SQL, Prisma, Alembic, or Drizzle files before finalizing pull requests.
- Safe Alternative Recommendations: If a breaking change is detected, the skill automatically rewrites the execution path into a zero-downtime, multi-step migration strategy.
Ideal For
Backend engineers, full-stack developers, and LLM Ops teams building with automated coding agents who need guaranteed production uptime and backward compatibility.
- Basic Regex Matching: The default
validate_contracts.pyscript relies on static pattern matching for AST/SQL keyword detection (DROP COLUMN,DROP TABLE,ALTER COLUMN) rather than full SQL/TypeScript language AST parsing. Highly complex dynamic SQL string constructions may require custom parser extensions. - Local File System Execution: Requires Python 3.x to be available in the local execution environment if running the optional validation script directly via shell[cite: 1, 2].
- Database Engine Agnostic: Safety rules default to standard PostgreSQL/ANSI SQL migration patterns; specific non-standard vendor dialect flags must be configured in
breaking_change_rules.md[cite: 1, 2].
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 months ago