agentleFS
Aidas-devAidas-dev/k8s-agent-skills/skills/atlas/SKILL.md

atlas

Skill4 starsChanged 6 months agoMITView on GitHub

Use when working with Atlas Operator on Kubernetes — creating or troubleshooting AtlasSchema or AtlasMigration resources; configuring DevDB, migration policies, credential patterns, or schema diff/lint rules.

  • Deletes or force-pushes

12 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use openai-docs.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • OpenAISkill

    openai-docs

    Use when the user asks how to build with OpenAI products or APIs, asks about Codex itself or choosing Codex surfaces, needs up-to-date official documentation with citations, help choosing the latest model for a use case, or model upgrade and prompt-upgrade guidance; use OpenAI docs MCP tools for non-Codex docs questions, use the Codex manual helper first for broad Codex self-knowledge, and restrict fallback browsing to official OpenAI domains.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use credentials struct when the URL is constructed from multiple Secret keys:

    line 112

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Atlas Operator

Overview

Database schema management on Kubernetes via db.atlasgo.io/v1alpha1. Two approaches: AtlasSchema (declarative — define desired schema, operator diffs and applies) and AtlasMigration (versioned — ordered SQL scripts). Deployed via OCI Helm chart: ghcr.io/ariga/charts/atlas-operator (latest: 0.7.32).

CRD Reference

CRDApproachUse When
AtlasSchemaDeclarativeSchema should match a desired state (operator auto-diffs)
AtlasMigrationVersionedNeed sequential migration files, rollback support, audit trail

AtlasSchema (Declarative)

apiVersion: db.atlasgo.io/v1alpha1
kind: AtlasSchema
metadata:
  name: app-schema
spec:
  urlFrom:
    secretKeyRef:
      name: db-creds
      key: url              # postgres://user:pass@host:5432/db?sslmode=require

  schema:
    sql: |
      CREATE TABLE users (
        id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
        email TEXT UNIQUE NOT NULL,
        created_at TIMESTAMPTZ DEFAULT now()
      );
      CREATE TABLE posts (
        id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
        user_id UUID REFERENCES users(id),
        title TEXT NOT NULL
      );

  policy:
    lint:
      destructive:
        error: true          # Block DROP COLUMN / DROP TABLE
    diff:
      skip:
        - drop_column        # Skip dropping columns (compatible changes only)
    exclude:
      - "audit_*"           # Glob patterns to ignore

  prewarmDevDB: true          # Default — ephemeral dev container for diff
  allowCustomConfig: false    # Don't allow DB config changes via atlas

AtlasMigration (Versioned)

apiVersion: db.atlasgo.io/v1alpha1
kind: AtlasMigration
metadata:
  name: app-migrations
spec:
  urlFrom:
    secretKeyRef:
      name: db-creds
      key: url

  dir:
    configMapRef:
      name: migration-files   # ConfigMap with SQL migration scripts

  execOrder: linear           # linear | linear-skip | non-linear
  baseline: "000000"          # Start from this version (skip earlier)

  policy:
    lint:
      destructive:
        error: true

  prewarmDevDB: true
  allowCustomConfig: false

Migration files in ConfigMap must be lexicographically ordered:

apiVersion: v1
kind: ConfigMap
metadata:
  name: migration-files
data:
  000001_init.sql: |
    CREATE TABLE users (...);
  000002_add_posts.sql: |
    CREATE TABLE posts (...);
  000003_add_indexes.sql: |
    CREATE INDEX idx_users_email ON users(email);

Credential Patterns

PatternExample
Connection URL in SecreturlFrom.secretKeyRef.key: url
Credentials structcredentials.host, .user, .passwordFrom, .database, .port
Extra connection parameterscredentials.parameters: { sslmode: require }

Use credentials struct when the URL is constructed from multiple Secret keys:

spec:
  credentials:
    host: myhost.example.com
    user: app
    passwordFrom:
      secretKeyRef:
        name: db-creds
        key: password
    database: mydb
    port: 5432

Policy Configuration

PolicyFieldEffect
lint.destructive.errortrue/falseBlock (true) or warn (false) on destructive changes
diff.skip[drop_column, drop_index, ...]Operations to skip in diff (safe for roll-forward)
exclude["pattern_*"]Glob patterns to exclude from management

Migration Directory Sources

SourceLocationUse Case
dir.configMapRefConfigMap in same namespaceSimple, no external deps
dir.local.pathMounted volume pathSidecar / init container pattern
dir.remoteAtlas Cloud URLTeam-managed schema registry
Inline (spec.schema.sql)Embedded in CRQuick prototyping

DevDB

Ephemeral database used to compute diff between desired and current schema. If devURL not set, operator spins a temporary container. Set explicitly to reuse or for air-gapped:

spec:
  devURL: postgres://user:pass@dev-db-host:5432/template?sslmode=disable

Or via Secret: devURLFrom.secretKeyRef.

Common Mistakes

  • allowCustomConfig: true without need — allows arbitrary DB config changes; keep false unless you need ALTER SYSTEM SET
  • No lint policy — destructive changes silently applied; always set lint.destructive.error: true for production
  • Wrong execOrder — non-linear skips version ordering; use linear for strict migration order
  • Missing baseline — operator tries to run all migrations including already-applied ones; set baseline to skip
  • ConfigMap not updated — AtlasMigration reads migration dir once at reconcile; if ConfigMap changes, operator picks it up on next loop
  • DevDB connection issues — operator needs network access to a temporary or explicit devDB; ensure prewarmDevDB: true works in your cluster

Supported Databases

MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, ClickHouse, CockroachDB, TiDB, YugabyteDB.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.