Guides a repository through six verified stages to adopt Atlas for database schema management: planning, schema-as-code, migration workflow, CI with Atlas Registry, staging deploy, and production promotion.
Ships in Atlas. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Takes a repository from no Atlas setup to production in six stages, the same path as the Evaluating
Atlas guide (https://atlasgo.io/guides/evaluation/intro). Each stage ends on a check the agent runs and
shows the user. This skill holds the order, the decisions, and the checks. The atlas skill holds the
command reference.
This skill is SKILL.md plus seven files, each served at https://atlasgo.io/skills/atlas-onboard/<path>:
agents/openai.yaml, references/stage-0-plan.md, references/stage-1-schema.md,
references/stage-2-workflow.md, references/stage-3-ci.md, references/stage-4-deploy.md, and
references/stage-5-promote.md. Read a stage reference when its stage starts.
The atlas skill, installed next to this one (../atlas/SKILL.md). If it is missing, download
https://atlasgo.io/skills/atlas/SKILL.md to ../atlas/SKILL.md and each reference file listed in its
Files section to ../atlas/references/<name> before starting. Paths below that start with atlas/
point into that skill.
Also the database skill for the engine, when it has one, installed next to this one
(../<skill>/SKILL.md). The skills are atlas-postgres (PostgreSQL), atlas-mysql (MySQL and
MariaDB), atlas-mssql (SQL Server and Azure SQL), atlas-clickhouse, atlas-snowflake,
atlas-databricks, atlas-redshift, atlas-oracle, and atlas-spanner. On Databricks Lakebase, read
atlas-lakebase with atlas-postgres. The database skill holds the engine's rules,
such as the dev database, the URL scope, and the lint findings to review. Read it once stage 0 finds
the engine, and follow it in every stage. If it is missing, recommend that the user install it:
claude plugin update atlas@ariga in Claude Code, or the npx skills add ariga/atlas -a <agent> -y
command again in other agents. Until then, read it from https://atlasgo.io/skills/<skill>/SKILL.md.
When stage 4 deploys with the Atlas Kubernetes Operator (4.6, 4.7), also read the atlas-operator
skill (../atlas-operator/SKILL.md). Install and read it the same way, from
https://atlasgo.io/skills/atlas-operator/SKILL.md when it is missing. It covers the operator's install,
tokens, resource policies, and troubleshooting.
For stage 3 and the CI deploy job of stage 4, also read the atlas-action skill
(../atlas-action/SKILL.md). Install and read it the same way, from
https://atlasgo.io/skills/atlas-action/SKILL.md when it is missing. It covers the Atlas CI steps on each
platform, their tokens and permissions, and the fix for each failed step.
| Stage | What it sets up | Read | Done when |
|---|---|---|---|
| 0 Plan | Login, an inventory of the database, the units, the pilot, and the workflow | references/stage-0-plan.md | The user approved the units, the pilot, and the workflow |
| 1 Schema as code | atlas.hcl and the desired state: the database exported to SQL or HCL, or the ORM models | references/stage-1-schema.md | atlas schema apply --env local --dry-run reports no changes |
| 2 Migration workflow | Versioned: the baseline migration and the migrate diff loop. Declarative: the schema apply loop | references/stage-2-workflow.md | Versioned: atlas migrate diff reports the directory is synced; the project PR is open |
| 3 CI | Lint (versioned) or plan (declarative) on pull requests, push to the Atlas Registry on merge | references/stage-3-ci.md | CI passed on the merge, and the registry has its version |
| 4 Deploy to staging | Staging deploys from the registry, and the old tool stops deploying to staging | references/stage-4-deploy.md | Atlas Cloud records the staging deployment |
| 5 Promote to production | Production applies only the version staging runs (environment promotion) | references/stage-5-promote.md | The user ran the first production deployment, on staging's version |
Run the stages for the pilot unit first. Every other unit repeats stages 1 to 5 with the decisions already recorded. After the pilot, Hand Off.
atlas schema inspect and atlas schema diff skip
views, functions, procedures, triggers, and other objects and still exit 0. A schema exported that
way loses them. The skip notice prints once per machine, so its absence proves nothing. Run
atlas whoami first. If it fails, ask the user to run atlas login; a user without an account can
start a free trial with it.atlas-onboard/<unit>-<stage> from
an up-to-date default branch with a clean working tree. Stage 2 continues on the stage 1 branch,
since both land in the project PR; every later stage starts its own branch. Stage files by path,
never git add -A. Every change lands as a pull request, and the PR is the review gate. A separate GitOps repository gets its
own PR.! command would put the value in the conversation.
Check a variable with test -n "$STAGING_DATABASE_URL" && echo set. Never print, parse, or echo such
a URL, and never open .env, *.tfvars, or other secret files. Local development credentials that
the repository defines, such as a compose service's password, are not secrets.| Action | Rule |
|---|---|
Repo scan, schema inspect, migrate lint, atlas cloud reads, --dry-run (plans only, changes nothing) | Run |
| Writing files in the repository, branches, pull requests | Run; the PR is the gate |
Creating Atlas Cloud repos (the first migrate push or schema push, or the create-repo action), bot tokens, CI secrets | Ask first |
migrate apply or schema apply against anything but a local or docker:// dev database | Explicit approval, a named target, and a dry run first |
| Production deploy configuration | Only in a separate PR, when the user asks for it |
| Approving any plan, review, deployment, workflow run, or pull request | Never; tell the user what is waiting and where |
Each unit is one Atlas project in its own directory, next to the code that owns it (for example
services/billing/db/). A repository with one unit can use the root. A unit directory holds
atlas.hcl, the desired state (schema/, unless the source is an ORM), and, for versioned units, the
migration directory (migrations/). Every atlas.hcl uses the same env names, so Atlas Cloud shows
real environment names:
| Env | Used for | Written in |
|---|---|---|
local | The local or development database the schema is read from, where developers apply changes; generating and linting migrations | Stage 1 |
staging | Deploying to staging; a read-only check before the first deploy | Stage 4 (stage 1 only when the schema is read from staging) |
ci | Lint and registry push in CI | Stage 3 |
prod | Production deployments, promoted from staging | Stage 5 |
Run every Atlas command from the unit's directory.
atlas whoami. If it fails, ask the user to run atlas login (Rule 2), then continue.git fetch origin. Read the files below from the default branch
(git show origin/<default>:<path>), not from the working tree.git branch -r --list 'origin/atlas-onboard/*' and open
PRs (gh pr list or glab mr list when installed; otherwise ask). Continue on an open branch instead
of starting another one..atlas-onboarding.json, pilot first, find the last finished stage. Check from
stage 5 down; the first check that passes is the last finished stage. A stage listed under
deferred for the unit counts as finished.| Stage | Finished when |
|---|---|
| 5 | The prod env promotes from staging (to_version, a version in src, or a deny check), and atlas cloud migration list --repo <repo> --env-name prod --status PASSED lists a deployment |
| 4 | atlas cloud migration list --repo <repo> --env-name staging shows PASSED or NO_ACTION for the version atlas migrate ls --dir atlas://<repo> --latest --short prints |
| 3 | A workflow on the default branch runs Atlas lint (versioned) or plan (declarative) for the unit, and its last push run on the default branch passed |
| 2 | The project PR is merged: atlas.hcl and the source are on the default branch, and versioned units also have migrations/atlas.sum there |
| 1 | The unit's atlas.hcl and source exist on its onboarding branch, and atlas schema apply --env local --dry-run reports no changes |
| 0 | The unit is in .atlas-onboarding.json |
Copy this into the conversation and tick items as they close:
Stage 0 [ ] scan [ ] atlas login [ ] inventory [ ] units + pilot (user) [ ] workflow (user)
Stage 1 [ ] atlas.hcl [ ] desired state (export or ORM) [ ] dry run: no changes
Stage 2 [ ] baseline (versioned) [ ] new local database from the directory (versioned) [ ] change loop shown [ ] lint shown (versioned) [ ] project PR
Stage 3 [ ] bot token + secret (user) [ ] first push (ask) [ ] CI PR [ ] green run [ ] CI pushed the merge
Stage 4 [ ] cutover plan [ ] deploy config PR [ ] staging dry run [ ] staging deployment recorded
Stage 5 [ ] prod env with promotion (when asked) [ ] prod deploy behind approval [ ] first prod deploy (user)
Hand off [ ] AGENTS.md [ ] skill in repo [ ] next steps [ ] summary + next unit
.atlas-onboarding.json at the repository root holds only what the repository cannot show. Update it
in place and commit each change with the PR of the stage that made it.
{
"workflow": "versioned",
"units": [
{ "name": "identity", "dir": "services/identity/db", "repo": "identity", "schemas": ["identity"], "pilot": true },
{ "name": "billing", "dir": "services/billing/db", "repo": "billing", "schemas": ["billing"] }
],
"deploy": { "target": "argocd", "gitops_repo": "github.com/acme/gitops" },
"deferred": [{ "unit": "billing", "stage": 4, "reason": "deployments are owned by the platform team" }]
}
workflow is versioned or declarative. repo is the registry repo slug. Never store database URLs,
tokens, or status in this file: status comes from the checks above.
atlas migrate diff writes each change to the desired state as a migration file,
reviewed and applied in order. Declarative workflow: no migration files; atlas schema plan and
atlas schema apply plan each change against the target database, and the plan is reviewed.When the pilot finishes stage 5, or the last stage the user wants:
Add an Atlas section to AGENTS.md, creating the file if needed. If the repository has a
CLAUDE.md, add the line @AGENTS.md to it.
## Database schema (Atlas)
- Unit `<unit>` in `<dir>`: `atlas.hcl`, desired state in `schema/` (or the ORM models), migrations in
`migrations/`. Run Atlas from `<dir>`.
- Change the desired state, then run `atlas migrate diff --env local <name>`. A new file in `schema/`
needs an `-- atlas:import` line at the top of `schema/main.sql`.
- Never edit an applied migration. After editing an unapplied one, run `atlas migrate hash --env local`.
- Before opening a PR: `atlas migrate lint --env local --latest 1`.
- Deployments run from <CI workflow or GitOps target>, staging first, then production promoted from
staging. Never run `migrate apply` or `schema apply` against a shared database from a laptop.
- Use the `atlas` skill for schema work.
For declarative units, the change lines are: change the desired state, then
atlas schema apply --env local against the local database; CI plans the change for review on the
PR. When the engine has a database skill (Requires), the last line names it too, for example:
Use the atlas and atlas-postgres skills for schema work. On Databricks Lakebase, the line names
atlas, atlas-lakebase, and atlas-postgres.
Offer to commit the skills, so every teammate's agent gets them:
Claude Code: merge these keys into .claude/settings.json. Claude Code installs the Atlas plugin
for each teammate who trusts the repository folder.
{
"extraKnownMarketplaces": {
"ariga": { "source": { "source": "github", "repo": "ariga/atlas" } }
},
"enabledPlugins": { "atlas@ariga": true }
}
Codex, Cursor, GitHub Copilot: run npx skills add ariga/atlas -a <agent> -y from the repository
root, with codex, cursor, or github-copilot, and commit .agents/skills/ and
skills-lock.json. If the install already put them there, commit them unchanged.
Next steps: offer the practices from the guides that fit what the scan found, one at a time. The full list is https://atlasgo.io/guides/evaluation/advanced-topics.
| Practice | Guide |
|---|---|
| Production applies only reviewed and approved migrations | https://atlasgo.io/guides/reviewed-approved-migrations |
| Block accidental drops in CI, with a deprecation workflow | https://atlasgo.io/guides/destructive-change-policy |
| Detect drift at deploy time and between deployments | https://atlasgo.io/guides/drift-detection |
| Test functions, views, triggers, and data migrations | https://atlasgo.io/testing/schema |
Lock-safe NOT NULL changes on PostgreSQL | https://atlasgo.io/guides/lock-safe-not-null |
| Teams change only the objects they own | https://atlasgo.io/guides/schema-ownership |
| Roles, permissions, and row-level security as code | https://atlasgo.io/guides/security-as-code |
| Staged rollouts for database-per-tenant | https://atlasgo.io/guides/database-per-tenant/rollout |
Summarize per stage: what exists now, the doc page for it, what was deferred and why, and which units remain. For the next unit, the user runs this skill again; Detect the Stage starts it at stage 1.
atlas.hcl protects only commands that read it (--env). Commands that take --url
directly run logged out, so run atlas whoami before them.--exclude replaces the env's exclude list instead of adding to it. Keep exclusions
in the env and pass no --exclude with --env.audit_* for tables, *[type=function] for every function. With a database-scoped URL, the
first segment names the schema: public.audit_*, public.*[type=function], or internal to skip a
whole schema.modify schema "<name>" is not allowed when migration plan is scoped to one schema, or silently drops extensions.schema/main.sql plus one file per object) reads only the files main.sql
imports. A new file needs an -- atlas:import <path> line in the directive block at the top of
main.sql, with no blank line before it; otherwise it is ignored and migrate diff reports no changes.Error: missing scheme on an env that reads getenv() means the variable is not set in the agent's
shell, not that a stage failed.migrate apply on an existing database aborts with
connected database is not clean. Set baseline; never get past it with --allow-dirty. On a new
database, follow the database skill: atlas-lakebase runs that first apply once with --allow-dirty.workspace-write sandbox by default, with outbound network access off
until the user approves it. Atlas needs the network for Atlas Cloud and the database, so ask the user
to approve Atlas commands, or to enable network access, before Detect the Stage.agents/openai.yaml (opens in a new tab)references/stage-0-plan.md (opens in a new tab)references/stage-1-schema.md (opens in a new tab)references/stage-2-workflow.md (opens in a new tab)references/stage-3-ci.md (opens in a new tab)references/stage-4-deploy.md (opens in a new tab)references/stage-5-promote.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
14 skills in this plugin
/atlasDatabase schema management, migrations, data scripts, and Atlas Cloud operations with the Atlas CLI. Use when: generating or applying migrations, diffing, linting, validating, or testing schemas, working with atlas.hcl, schema.hcl, or ORM schemas (GORM, Drizzle, SQLAlchemy, Django, Ent, Sequelize, TypeORM, Prisma), running data backfills, purges, or reports with atlas script, or answering questions about Atlas Cloud: which databases are synced, pending, or failed, recent or failed deployments, what is waiting for deployment, registry repos, and pending plan approvals./atlas-actionAtlas in CI/CD pipelines with the Atlas actions: ariga/setup-atlas and ariga/atlas-action on GitHub Actions, the GitLab CI components, the CircleCI orb, the Bitbucket pipe, and the Azure DevOps AtlasAction task. The CI/CD steps (migrate lint, push, diff, hash, autorebase, test, apply, down, set, drift; schema plan, plan approve, push, apply, lint, test; script exec, query, loop, test, push; security scan; monitor schema; create-repo) with its inputs, outputs, tokens, permissions, and pull request comments, plus pinning versions, runners, and fixing a failed run. Use with the atlas skill whenever a pipeline runs Atlas or an Atlas check in CI fails./atlas-clickhouseClickHouse specifics for Atlas: the login-only driver, dev database and URL scope (database vs server), Docker dev images and version checks, cluster mode and ON CLUSTER, table engines, sort keys and table rebuilds, plans that skip destructive changes without a terminal, table recreation and the allow_recreate policy, mutations and CH lint checks, materialized views, dictionaries, UDFs and WASM, named collections, users, roles, grants, row policies and settings profiles, secret settings and the sensitive mode, no transactions and no lock, ClickHouse Cloud, schema and migration tests, and custom lint rules. Use with the atlas skill whenever Atlas manages a ClickHouse database./atlas-databricksDatabricks specifics for Atlas: the extended binary and login, connection URLs and scope (catalog vs schema), the dev catalog (no Docker), Delta table properties, managed and external tables, partitioning and liquid clustering, generated and identity columns, defaults and column mapping, renames, informational keys and checks, collations, column masks and row filters, views, metric views, and materialized views, SQL and Python functions, procedures, Unity Catalog grants, no transactions and no locks, partial failures, schema and migration tests, and custom lint rules. Use with the atlas skill whenever Atlas manages a Databricks database. For Databricks Lakebase, use atlas-lakebase./atlas-lakebaseDatabricks Lakebase specifics for Atlas: the databricks_lakebase_token data source and the Databricks credentials it uses (a CLI profile, or a service principal with the workspace-access entitlement), the endpoint host instead of the -pooler host, the Postgres role in the URL, password roles, the objects Lakebase manages in every database (__db_system, three grant_* functions, three on_create_* event triggers) and how to exclude them at schema and database scope, the first migrate apply, drift checks, object ownership, and Lakebase errors. Use with the atlas and atlas-postgres skills whenever Atlas manages a Databricks Lakebase database./atlas-mssqlSQL Server specifics for Atlas (also Azure SQL and MSSQL): login, Azure SQL sign-in with Microsoft Entra ID (fedauth, no password), dev database and URL scope (mode=schema vs mode=database, the database query parameter), compatibility level and collation, system-generated constraint names, clustered index defaults and datetime2 precision in HCL, GO batches and the delimiter directive, transactions and statements that cannot run in one, identity, computed and temporal columns, alias and table types, changes planned as a drop and an add, what Atlas leaves out (DENY, synonyms, row-level security, sparse columns), database roles, users and grants, schema and migration tests, and custom lint rules. Use with the atlas skill whenever Atlas manages a SQL Server or Azure SQL database./atlas:atlas-onboardfrom Atlas
npx claudepluginhub ariga/atlas --plugin atlasOther plugins' skills for the same job