Skip to main content

Using Atlas with AI Agents

AI agents are great at writing code, but generating database migrations is a different challenge. As schemas grow, ensuring migrations are deterministic, safe, and policy-compliant becomes critical.

Atlas lets AI agents focus on editing the schema while it handles the infrastructure:

  1. Migration Generation — correct, safe, and deterministic migrations.
  2. Migration Linting — semantic validation and best-practice enforcement.
  3. Policy Enforcement — organizational rules for allowed changes.
  4. Schema Testing — AI writes logic (functions, views, queries) and tests; Atlas executes and reports failures.
  5. Data Migration Testing — seed data, run tests, detect errors, and let the AI fix them.

Agent Skills

Agent Skills are an open standard for packaging domain expertise for AI agents. Atlas provides a skill that handles schema migrations, linting, testing, and policy enforcement — so the agent doesn't need to learn the Atlas CLI from scratch.

To help agents produce better results, provide structured schema context. See the Database Schema as Context guide for how to organize schema files and the benchmark showing 10/10 query accuracy with the right structure.

Setup Instructions

Configure your AI agent to work with Atlas using project-level instruction files:

Example Workflow

The instructions above teach the AI agent to follow this workflow when generating migrations:

1. Edit the schema

Editing the schema

2. Generate and validate migrations

The agent runs atlas migrate diff to generate the migration, then atlas migrate lint to validate it.

Generating and linting migrations

3. Apply the migration

The agent applies with atlas migrate apply, starting with a dry-run.

Applying the migration