|
| 1 | +# supaschema Agent Install Prompt |
| 2 | + |
| 3 | +Use this prompt when an AI agent is asked to install, initialize, inspect, or use supaschema in a consuming project. |
| 4 | + |
| 5 | +## Role |
| 6 | + |
| 7 | +You are working in the consuming project, not in the supaschema source repository. |
| 8 | + |
| 9 | +Do not clone `jmclaughlin724/supaschema` into the project, run `npm ci` in a nested supaschema checkout, or validate supaschema by running its internal fixture suite unless the user explicitly asks you to develop supaschema itself. For normal use, install the npm package in the target project and work from that project root. |
| 10 | + |
| 11 | +## Install Command |
| 12 | + |
| 13 | +If supaschema is not installed, run this from the project root: |
| 14 | + |
| 15 | +```bash |
| 16 | +npm install supaschema |
| 17 | +``` |
| 18 | + |
| 19 | +If install scripts did not run, or setup needs to be repaired, run: |
| 20 | + |
| 21 | +```bash |
| 22 | +npx supaschema init |
| 23 | +``` |
| 24 | + |
| 25 | +Use `npx supaschema init --dry-run` when you need to preview setup before writing files. |
| 26 | + |
| 27 | +## What Install Provides |
| 28 | + |
| 29 | +The npm package provides: |
| 30 | + |
| 31 | +- the `supaschema` CLI and typed ESM library exports; |
| 32 | +- PostgreSQL parser/deparser runtime dependencies; |
| 33 | +- `supaschema-config.schema.json` for editor and config validation; |
| 34 | +- the shared agent prompt at `.agents/prompts/supaschema-install.md`; |
| 35 | +- the supaschema workflow skill at `.agents/skills/supaschema/SKILL.md`; |
| 36 | +- Claude rule, skill, and hooks under `.claude/`; |
| 37 | +- Codex rule, skill, hook scripts, and hook registration under `.codex/`. |
| 38 | + |
| 39 | +Public docs and examples are hosted in the supaschema documentation and source repository. They are not part of the normal `node_modules/supaschema` install payload, and you should not clone the source repository just to read them during consumer setup. |
| 40 | + |
| 41 | +The installer or `supaschema init` writes or merges these project files: |
| 42 | + |
| 43 | +- `supaschema.config.json` when the project does not already have one; |
| 44 | +- configured schema and migration directories; |
| 45 | +- `.supaschema/install.json` with detected paths and install metadata; |
| 46 | +- `AGENTS.md` and `CLAUDE.md` managed supaschema guidance blocks; |
| 47 | +- `.agents/prompts/supaschema-install.md`; |
| 48 | +- `.agents/skills/supaschema/SKILL.md`; |
| 49 | +- `.claude/rules/supaschema.md`, `.claude/skills/supaschema/SKILL.md`, and the three supaschema Claude hooks; |
| 50 | +- `.claude/settings.json` hook wiring; |
| 51 | +- `.codex/rules/supaschema.rules`, `.codex/skills/supaschema/SKILL.md`, the three supaschema Codex hooks, and `.codex/hooks.json`. |
| 52 | + |
| 53 | +Install does not edit schema files, generate migrations, connect to a database, apply migrations, install maintainer editor/MCP/FastMCP tooling, or copy supaschema source/test infrastructure into the consumer project. |
| 54 | + |
| 55 | +## First Tasks After Install |
| 56 | + |
| 57 | +1. Read the supaschema managed block in `AGENTS.md` or `CLAUDE.md`. |
| 58 | +2. Read `.agents/skills/supaschema/SKILL.md` and the matching rule file for the active agent runtime: `.claude/rules/supaschema.md` or `.codex/rules/supaschema.rules`. |
| 59 | +3. Inspect `supaschema.config.json` and `.supaschema/install.json`. |
| 60 | +4. If `.supaschema/install.json` has `pathConfirmationNeeded: true`, stop before diffing. Ask the user which detected schema and migration paths to use, then update `supaschema.config.json`. |
| 61 | +5. Run `npx supaschema --version`. |
| 62 | +6. Run `npx supaschema config validate --json` after config exists or paths are confirmed. |
| 63 | + |
| 64 | +## Schema Change Workflow |
| 65 | + |
| 66 | +For schema changes, edit only the configured declarative SQL tree from `schemaPaths`. Then run: |
| 67 | + |
| 68 | +```bash |
| 69 | +npx supaschema diff |
| 70 | +npx supaschema check |
| 71 | +``` |
| 72 | + |
| 73 | +If installed hooks are trusted and fire after a schema-tree write, treat their returned migration name or `SUPA_*` diagnostic as authoritative. If they do not fire, run the commands manually. |
| 74 | + |
| 75 | +Generated migrations containing `-- supaschema: lineage` are artifacts. Do not hand-edit them; change the schema tree and regenerate. |
| 76 | + |
| 77 | +Do not run `npx supaschema sync --local` or `npx supaschema sync --remote` unless the user explicitly asks to apply migrations. |
| 78 | + |
| 79 | +## Completion Report |
| 80 | + |
| 81 | +When reporting installation or setup, summarize: |
| 82 | + |
| 83 | +- package install or `init` command used; |
| 84 | +- whether config exists and which schema/migration paths are configured; |
| 85 | +- whether path confirmation is pending; |
| 86 | +- `npx supaschema --version` result; |
| 87 | +- `npx supaschema config validate --json` result or why it was not run; |
| 88 | +- the next schema-change command. |
| 89 | + |
| 90 | +Do not include internal supaschema source checkout details, internal fixture diff output, or package development test output unless the user asked to work on supaschema itself. |
0 commit comments