Inspiration

Every team has pushed a migration that looked fine locally and caused a 3 AM production incident. Missing indexes, FLOAT for money, unsafe nulls — these are silent killers. I wanted a DBA reviewer living inside GitLab that catches these before merge.

What it does

Schema Sentinel is a GitLab Duo AI agent that reviews any SQL schema and produces a structured report covering:

  • Missing indexes on foreign keys and filterable columns
  • FLOAT used for monetary values (should be DECIMAL)
  • Unsafe nullable fields (created_at, balance, etc.)
  • Missing primary keys
  • Naming inconsistencies across tables
  • Top 3 quick wins to fix before merging

How we built it

Built on the GitLab Duo Agent Platform using the read_file and read_files tools. The agent is configured via YAML and powered by Claude (Anthropic) through GitLab Duo Chat. Published to the GitLab AI Catalog.

Challenges we ran into

Structuring the agent prompt to produce consistent, actionable output across wildly different schema styles — from tiny 2-table schemas to 20+ table production databases.

Accomplishments that we're proud of

A single-paste workflow that gives junior developers instant senior DBA feedback. Zero setup for the end user beyond enabling the agent.

What we learned

How powerful the GitLab Duo Agent Platform is for automating real code review workflows — not just chat, but actual file-aware context.

What's next for Schema Sentinel

Auto-trigger on merge requests containing migration files, and a severity scoring system (critical / warning / info) for each issue found.

Built With

  • anthropic
  • claude
  • gitlab
  • gitlab-duo-agent-platform
  • sql
  • yaml
Share this project:

Updates