# sql-db-fix-expert

> A safe, expert-level database troubleshooter for fixing migrations, performance issues, and schema drift.

sql-db-fix-expert is a paid AI agent skill on Agensi by Roy Yuen, in Data & Databases. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $8 (one-time purchase)
- Creator: [Roy Yuen](https://www.agensi.io/creators/roy-yuen)
- Category: [Data & Databases](https://www.agensi.io/skills/data-databases)
- Version: 1.0
- Last updated: 2026-05-25
- Security: scan passed (2026-05-25); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/sql-db-fix-expert
- Tags: data-engineering, database, mongodb, postgresql, sqlite, sre

## About this skill

### What it does

SQL DB Fix Expert is a specialized database reliability skill designed to diagnose and repair incidents across SQLite, PostgreSQL, and MongoDB. It functions as an on-call DBA for your AI agent, moving beyond simple query generation to provide deep troubleshooting for broken migrations, deadlocks, schema drift, and data corruption.

### Why use this skill

Most AI agents lack the safety guardrails required for database operations. This skill implements a strict "read-only first" diagnostic protocol and high-risk operation gating. It prevents accidental data loss by enforcing backup verification and providing explicit rollback plans before any modification is executed. It is significantly safer and more thorough than raw prompting because it follows a structured 'Evidence-Inference-Action' workflow.

### Supported Engines

- **PostgreSQL:** Vacuuming, lock analysis, complex migrations, and query planning.
- **SQLite:** Recovery, file integrity, and light-weight schema adjustments.
- **MongoDB:** Document validation, index optimization, and aggregation repairs.

### The Output

Every interaction produces a structured incident report containing identified root causes, read-only evidence, engine-specific repair scripts, and a concrete rollback strategy. Live execution only occurs after explicit user confirmation of the proposed commands.

## Known limitations

- Cannot perform physical hardware/disk repairs.
- Limited to SQLite, PostgreSQL, and MongoDB.
- Requires user-provided credentials/connection for live execution.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the sql-db-fix-expert skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill ensure my database stays safe during troubleshooting?

The skill follows a 'read-only first' protocol, performing thorough diagnostics and providing an explicit rollback plan before any modification takes place. Built-in safety gates ensure that high-risk operations are never executed without user confirmation and backup verification.

### Can I use this across different types of databases, or is it limited to SQL?

This skill is engine-specific, supporting full diagnostics and repair workflows for PostgreSQL (query planning/locks), SQLite (integrity/schema), and MongoDB (validation/indexing). It is not a generic text-to-SQL tool; it understands the nuances of each specific engine architecture.

### What is required to set this skill up with my existing AI agent?

SQL DB Fix Expert is designed to integrate with any AI agent or framework capable of executing tools/functions; you simply provide the database connection details as environment variables or through secure runtime inputs.

### What specific types of incidents is this skill best equipped to handle?

This skill is ideal for fixing failed schema migrations, resolving database deadlocks, identifying performance bottlenecks in query plans, and repairing document validation errors in MongoDB.

### What is included in the purchase of the SQL DB Fix Expert skill?

Your purchase includes the full skill integration package, lifecycle maintenance updates for compatibility with new database versions, and specialized documentation for the 'Evidence-Inference-Action' workflow.

### Does the skill provide documentation of the changes it recommends?

Yes, every session generates a structured incident report that includes the root cause, gathered evidence, proposed repair scripts, and a mandatory rollback strategy for your records.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
