From atlas
Read-only database audit via parallel subagents: inventory a live schema, reconcile it against the code, and check privileges and naming before any change.
How this skill is triggered — by the user, by Claude, or both
Slash command
/atlas:atlas-db-audit [repo path] [db connection] [glossary path] [naming-convention notes]When to use
inventory a live database schema, reconcile it against the code, and check privileges and naming before any change
[repo path] [db connection] [glossary path] [naming-convention notes]**/*.sqlmigrations/**supabase/**This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Apply the Operating Contract to this entire task. It is injected below.
Apply the Operating Contract to this entire task. It is injected below.
cat "${CLAUDE_PLUGIN_ROOT}/references/operating-contract.md"
If the contract did not load above, read ${CLAUDE_PLUGIN_ROOT}/references/operating-contract.md and apply it before proceeding.
Audit this database: $ARGUMENTS
Read the arguments as four inputs:
If the DB connection or repo path is missing or ambiguous, ask once for it, then proceed.
This is READ-ONLY. Nothing here may change the database or the code. The only outputs are a findings report and a remediation plan you review before anything changes.
ENFORCE READ-ONLY:
${CLAUDE_PLUGIN_ROOT}/hooks/validate-readonly-query.sh as a PreToolUse(Bash) hook on every audit subagent. The guard is a coarse denylist, NOT a "blocks any non-SELECT" guarantee. It matches a fixed set of SQL write/DDL/privilege structures: DELETE FROM, INSERT INTO, REPLACE INTO, MERGE INTO, UPDATE <table> SET, TRUNCATE[ TABLE], DROP|CREATE|ALTER against TABLE|DATABASE|SCHEMA|INDEX|VIEW|MATERIALIZED|SEQUENCE|TRIGGER|FUNCTION|ROLE|USER|EXTENSION|POLICY|PUBLICATION, GRANT|REVOKE ... ON, and COPY ... FROM|TO. It does NOT catch every mutating statement: CREATE OR REPLACE FUNCTION, CREATE TEMPORARY|UNLOGGED TABLE, CREATE AGGREGATE, and UPDATE|DELETE|INSERT whose verb and target are split by SQL comments all pass the guard and can install persistent executable DB code or write rows. Enforce read-only at the database level (a read-only role or a replica) and treat the guard as defense-in-depth, not the boundary.Dispatch four investigations IN PARALLEL, each in a fresh context, each given only the inputs it needs. Each writes detailed findings to its own file under a .audit/ directory and returns only a short structured summary plus that file path, so the main context stays lean:
GROUNDING: each subagent reports only what a tool result confirms - a catalog query result, or a file and line. Anything it cannot verify it labels UNVERIFIED. No finding may rest on a name alone or on training-data assumptions.
SYNTHESIS (main context, after all four return):
VERIFY:
REPORT:
.audit/ file paths holding the full detail.references/audit-workflow.md - the four parallel investigations, the three
agent roles (atlas:schema-inventory, atlas:rls-privilege-audit,
atlas:naming-glossary-audit) and the explorer, grounding rules, and
synthesis ranking order.scripts/read-only-catalog-queries.sql - SELECT-only catalog query
templates the prober agents use (tables, columns, constraints, indexes, RLS
policies, grants, roles, sequences, functions). The
${CLAUDE_PLUGIN_ROOT}/hooks/validate-readonly-query.sh guard is a coarse denylist that blocks
the SQL write/DDL/privilege structures listed under ENFORCE READ-ONLY before
they run. It is NOT a "blocks any non-SELECT" guarantee: CREATE OR REPLACE FUNCTION, CREATE TEMPORARY|UNLOGGED TABLE, CREATE AGGREGATE, and
comment-split UPDATE|DELETE|INSERT pass it, so pair it with a read-only
DB role or replica.npx claudepluginhub w159/atlas --plugin atlasGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.