Dump Schema
Developmentdump-schemaDump Schema is an Agent Skill for development published in the macro-inc/macro repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Dump clean Postgres schema to a file and copy path to clipboard.
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/macro-inc/macro/blob/HEAD/.claude/skills/dump-schema/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/dump-schema, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Dump Schema
Dump a clean PostgreSQL schema (no comments, no ownership, no privileges) from the local dev database.
Parameters
Ask the user (if not provided):
- output_file – absolute path for the
.sqlfile (default: prompt user)
Use this database URL unless the user specifies otherwise:
postgres://user:password@localhost:5432/macrodb
Steps
- Run
pg_dumpwith schema-only flags, pipe through cleanup, write to file:
pg_dump --schema-only --no-owner --no-privileges --no-comments --no-publications --no-subscriptions --no-security-labels --no-tablespaces "$DB_URL" | sed '/^--/d' | sed '/^SET /d' | sed '/^SELECT pg_catalog/d' | sed '/^$/N;/^\n$/d' > "$OUTPUT_FILE"
- Copy the output path to the clipboard:
echo -n "$OUTPUT_FILE" | pbcopy
- Report:
Schema dumped to <path> (path copied to clipboard)