Db write

From Kevin-Liu-01/Agent-Machines · View interactive version

Db write is an AI agent skill from the GitHub repository Kevin-Liu-01/Agent-Machines. Run mutating SQL (INSERT, UPDATE, DELETE, DDL) against Supabase databases. Requires explicit user invocation. Use for migrations, seed data, schema changes, or data fixes.

How to use this skill

Skill file

Context

Query script

The query tool lives at ${CLAUDE_SKILL_DIR}/../db/scripts/query.ts. Run it with:

node --experimental-strip-types ${CLAUDE_SKILL_DIR}/../db/scripts/query.ts [flags] "<sql>"

Flags:

Note: do NOT pass --readonly. This skill is for mutations.

Credentials

Same as /db. See that skill for credential resolution order and SSM instructions.

Schema reference

Generated Supabase types with full table schemas, enums, and function signatures:

Read the relevant file when you need column names, types, enums, or relationships.

Rules

  1. NEVER target prod. Refuse all prod mutations. Production changes go through migrations

deployed via the pipeline (dev -> preview -> prod). See AGENTS.md "Production is Sacred."

  1. Confirm before executing on any remote environment (dev, preview). Show the SQL and

target environment, then ask the user to confirm.

  1. Default to --env local unless the user specifies otherwise.
  2. For DDL (CREATE, ALTER, DROP), prefer pnpm db diff --execute for tracked migrations.

Only use raw DDL for local experimentation.

  1. Show the SQL you intend to run before running it.

Task

Run the user's mutation. Always show the SQL and target before executing. For remote envs,

require explicit confirmation.

$ARGUMENTS

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.