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 two skills. atlas covers schema migrations, linting, and testing, Data Scripts for backfills and reports, and Atlas Cloud operations: database status, failed deployments, and what is waiting for deployment. atlas-onboard takes a project from a first scan to production, one verified stage at a time. The agent runs the Atlas CLI instead of learning it from scratch.

Claude Code installs both skills as a plugin. Other agents install them with npx skills:

# Claude Code
claude plugin marketplace add ariga/atlas
claude plugin install atlas@ariga

# Codex, Cursor, GitHub Copilot, and other agents
npx skills add ariga/atlas

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.

A machine-readable docs index with usage terms is available at atlasgo.io/llms.txt.

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