You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/prompts/supaschema-install.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ Use the matching local runner for every command after install:
38
38
| Yarn |`yarn exec supaschema <cmd>`|
39
39
| Bun |`bunx --no-install supaschema <cmd>`|
40
40
41
-
Always run the matching explicit setup command from the owning package directory after install. The command is idempotent; it leaves existing config intact and refreshes the managed agent surfaces. `supaschema init` combines the consuming repo's detected package manager, workspace owner, provider markers, schema paths, and migration paths with the packaged supaschema rule, skill, hook, config, and prompt bundle.
41
+
Always run the matching explicit setup command from the owning package directory after install. The command is idempotent; it leaves existing config intact, preserves existing hook entries, appends missing supaschema hook entries at the end of the relevant event array, and refreshes the managed agent surfaces. `supaschema init` combines the consuming repo's detected package manager, workspace owner, provider markers, schema paths, and migration paths with the packaged supaschema rule, skill, hook, config, and prompt bundle.
Copy file name to clipboardExpand all lines: .agents/skills/supaschema/SKILL.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ When the bundled PostToolUse hook is wired (`.claude/settings.json` / `.codex/ho
13
13
14
14
## Installed Setup
15
15
16
-
The normal consumer setup is package install plus one explicit setup command through the consuming project's package manager. Read `.agents/prompts/supaschema-install.md` before installing, initializing, inspecting, or explaining setup. That prompt owns package-manager detection, workspace targeting, local runner commands, setup commands, and wrong-manager stop conditions. Treat `supaschema.config.json`, installed schema/migration directories, Claude/Codex rule and skill files, hook wiring, and tagged `AGENTS.md` / `CLAUDE.md` addenda as the package-owned setup surface. Run `supaschema init` through the matching local runner from the schema-owning package directory after install; it is idempotent and uses the package scaffold to refresh managed setup surfaces. The package scaffold installs the full supaschema skill directories directly into `.agents/skills/supaschema` and `.claude/skills/supaschema`; it does not invoke `npx skills`.
16
+
The normal consumer setup is package install plus one explicit setup command through the consuming project's package manager. Read `.agents/prompts/supaschema-install.md` before installing, initializing, inspecting, or explaining setup. That prompt owns package-manager detection, workspace targeting, local runner commands, setup commands, and wrong-manager stop conditions. Treat `supaschema.config.json`, installed schema/migration directories, Claude/Codex rule and skill files, hook wiring, and tagged `AGENTS.md` / `CLAUDE.md` addenda as the package-owned setup surface. Run `supaschema init` through the matching local runner from the schema-owning package directory after install; it is idempotent, preserves existing hook entries, appends missing supaschema hook entries at the end of the relevant event array, and uses the package scaffold to refresh managed setup surfaces. The package scaffold installs the full supaschema skill directories directly into `.agents/skills/supaschema` and `.claude/skills/supaschema`; it does not invoke `npx skills`.
17
17
18
18
If this skill was installed through `npx skills`, treat it as portable workflow context only. Agent Skills installs `SKILL.md`-based folders into a user-selected skill location; it does not create `supaschema.config.json`, schema/migration directories, passive rule files, hook scripts, or hook registration. To install those project enforcement surfaces, install the npm package with the consuming project's manager from the owning package directory, then run `supaschema init` through the same manager's local runner from that directory. The package scaffold installs the rule and hooks; the `npx skills` lane does not.
Copy file name to clipboardExpand all lines: .claude/rules/supaschema.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ This rule owns how schema migrations are produced and protected in a repo that u
11
11
## Rules
12
12
13
13
- Consumer migration policy must rely on project files, generated hook context, and supaschema command output. Repo-local maintainer tooling such as Code Atlas, cclsp, FastMCP, and context-enforcement hooks is not part of the published consumer install surface.
14
-
- Consumer setup is package install plus one explicit setup command with the consuming project's package manager. The agent install protocol lives at `.agents/prompts/supaschema-install.md`; it owns package-manager selection, workspace targeting, local runner commands, setup commands, and wrong-manager stop conditions. The installed config, schema/migration directories, supaschema consumer rule/skill/hook bundle, hook wiring, and tagged `AGENTS.md` / `CLAUDE.md` addendum are part of the package setup surface. Maintainer-only Claude/Codex optimization and context-enforcement tooling remains repo-local under Rule 13. `supaschema init` performs consumer setup through the shared scaffolder (`bin/scaffold.mjs`) — config, directories, agent bundle, hook wiring, and pending path-confirmation state when needed. Run it through the matching local runner from the schema-owning package directory after install. It is idempotent: existing JSON config files are left untouched unless explicit repair is requested, JavaScript config files are not loaded or converted, and the managed guidance block is upserted in place.
14
+
- Consumer setup is package install plus one explicit setup command with the consuming project's package manager. The agent install protocol lives at `.agents/prompts/supaschema-install.md`; it owns package-manager selection, workspace targeting, local runner commands, setup commands, and wrong-manager stop conditions. The installed config, schema/migration directories, supaschema consumer rule/skill/hook bundle, hook wiring, and tagged `AGENTS.md` / `CLAUDE.md` addendum are part of the package setup surface. Maintainer-only Claude/Codex optimization and context-enforcement tooling remains repo-local under Rule 13. `supaschema init` performs consumer setup through the shared scaffolder (`bin/scaffold.mjs`) — config, directories, agent bundle, hook wiring, and pending path-confirmation state when needed. Run it through the matching local runner from the schema-owning package directory after install. It is idempotent: existing JSON config files are left untouched unless explicit repair is requested, JavaScript config files are not loaded or converted, and the managed guidance block is upserted in place. Hook wiring preserves existing entries and appends missing supaschema hook entries at the end of the relevant event array; it only removes the known broken package-owned Claude script entries that passed `${CLAUDE_PROJECT_DIR}` script paths through `args`.
15
15
- Normal resolved installs do not create `.supaschema/`. If `.supaschema/install.json` exists and records `"pathConfirmationNeeded": true`, inspect the detected candidates, ask the user which `schemaPaths`, `sources.to`, and `migrationsDir` to use, and update `supaschema.config.json` before the first diff. Do not generate from the installer's guessed first candidate; `config validate`, `doctor`, and zero-source `diff` block until all three fields are explicit, and the PostToolUse hook must skip auto-diff until all three fields are explicit.
16
16
- `supaschema.config.json` owns four workflow decisions. Schema tree fields are `schemaPaths`, `sources.to`, and `migrationsDir`; `dir:` sources read nested `.sql` files recursively, and install writes `sources.to: "dir:<schemaPaths[0]>"`. Diff baseline fields are `sources.from` and `sources.to`; `sources.from: "auto"` resolves valid `git:HEAD`, then a database URL, then `empty:` for a first migration in a fresh repository. Generated contract fields are `typesFile`, `zodFile`, `workflow.type_generation`, `workflow.zod_generation`, and `workflow.type_usage`; defaults create or refresh TypeScript and Zod outputs after `diff` and tell agents to use generated Zod validators at runtime boundaries. Apply policy fields are `workflow.migration_sync` and `sync.targets`; default `workflow.migration_sync: "auto"` keeps bare `supaschema sync` apply-capable, while `sync.targets.<name>.mode` decides selected targets and remote targets require approval variables. `adapter: "auto"` is provider-neutral and is not a Supabase switch. Provider-specific behavior is expressed through paths, managed schemas, transaction mode, excluded grant roles, sync targets, and explicit verify flags. Generic PostgreSQL installs use `managedSchemas: []` and reuse detected existing database URL environment variable names in `sync.targets` when present; Supabase installs seed the Supabase platform schema list and use the Supabase CLI runner by default.
17
17
- Schema intent changes only in the configured declarative SQL tree (`schemaPaths` in `supaschema.config.json`), such as `database/schemas/**`, `supabase/schemas/**`, `neon/schemas/**`, `aws-postgresql/schemas/**`, `cloud-sql/schemas/**`, `alloydb/schemas/**`, or `azure-postgresql/schemas/**`. Render the migration with `supaschema diff`; do not hand-author migration SQL for changes the tree can express.
Copy file name to clipboardExpand all lines: .claude/skills/supaschema/SKILL.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ When the bundled PostToolUse hook is wired (`.claude/settings.json` / `.codex/ho
13
13
14
14
## Installed Setup
15
15
16
-
The normal consumer setup is package install plus one explicit setup command through the consuming project's package manager. Read `.agents/prompts/supaschema-install.md` before installing, initializing, inspecting, or explaining setup. That prompt owns package-manager detection, workspace targeting, local runner commands, setup commands, and wrong-manager stop conditions. Treat `supaschema.config.json`, installed schema/migration directories, Claude/Codex rule and skill files, hook wiring, and tagged `AGENTS.md` / `CLAUDE.md` addenda as the package-owned setup surface. Run `supaschema init` through the matching local runner from the schema-owning package directory after install; it is idempotent and uses the package scaffold to refresh managed setup surfaces. The package scaffold installs the full supaschema skill directories directly into `.agents/skills/supaschema` and `.claude/skills/supaschema`; it does not invoke `npx skills`.
16
+
The normal consumer setup is package install plus one explicit setup command through the consuming project's package manager. Read `.agents/prompts/supaschema-install.md` before installing, initializing, inspecting, or explaining setup. That prompt owns package-manager detection, workspace targeting, local runner commands, setup commands, and wrong-manager stop conditions. Treat `supaschema.config.json`, installed schema/migration directories, Claude/Codex rule and skill files, hook wiring, and tagged `AGENTS.md` / `CLAUDE.md` addenda as the package-owned setup surface. Run `supaschema init` through the matching local runner from the schema-owning package directory after install; it is idempotent, preserves existing hook entries, appends missing supaschema hook entries at the end of the relevant event array, and uses the package scaffold to refresh managed setup surfaces. The package scaffold installs the full supaschema skill directories directly into `.agents/skills/supaschema` and `.claude/skills/supaschema`; it does not invoke `npx skills`.
17
17
18
18
If this skill was installed through `npx skills`, treat it as portable workflow context only. Agent Skills installs `SKILL.md`-based folders into a user-selected skill location; it does not create `supaschema.config.json`, schema/migration directories, passive rule files, hook scripts, or hook registration. To install those project enforcement surfaces, install the npm package with the consuming project's manager from the owning package directory, then run `supaschema init` through the same manager's local runner from that directory. The package scaffold installs the rule and hooks; the `npx skills` lane does not.
Copy file name to clipboardExpand all lines: .codex/rules/supaschema.rules
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
# ## Rules
16
16
#
17
17
# - Consumer migration policy must rely on project files, generated hook context, and supaschema command output. Repo-local maintainer tooling such as Code Atlas, cclsp, FastMCP, and context-enforcement hooks is not part of the published consumer install surface.
18
-
# - Consumer setup is package install plus one explicit setup command with the consuming project's package manager. The agent install protocol lives at `.agents/prompts/supaschema-install.md`; it owns package-manager selection, workspace targeting, local runner commands, setup commands, and wrong-manager stop conditions. The installed config, schema/migration directories, supaschema consumer rule/skill/hook bundle, hook wiring, and tagged `AGENTS.md` / `CLAUDE.md` addendum are part of the package setup surface. Maintainer-only Claude/Codex optimization and context-enforcement tooling remains repo-local under Rule 13. `supaschema init` performs consumer setup through the shared scaffolder (`bin/scaffold.mjs`) — config, directories, agent bundle, hook wiring, and pending path-confirmation state when needed. Run it through the matching local runner from the schema-owning package directory after install. It is idempotent: existing JSON config files are left untouched unless explicit repair is requested, JavaScript config files are not loaded or converted, and the managed guidance block is upserted in place.
18
+
# - Consumer setup is package install plus one explicit setup command with the consuming project's package manager. The agent install protocol lives at `.agents/prompts/supaschema-install.md`; it owns package-manager selection, workspace targeting, local runner commands, setup commands, and wrong-manager stop conditions. The installed config, schema/migration directories, supaschema consumer rule/skill/hook bundle, hook wiring, and tagged `AGENTS.md` / `CLAUDE.md` addendum are part of the package setup surface. Maintainer-only Claude/Codex optimization and context-enforcement tooling remains repo-local under Rule 13. `supaschema init` performs consumer setup through the shared scaffolder (`bin/scaffold.mjs`) — config, directories, agent bundle, hook wiring, and pending path-confirmation state when needed. Run it through the matching local runner from the schema-owning package directory after install. It is idempotent: existing JSON config files are left untouched unless explicit repair is requested, JavaScript config files are not loaded or converted, and the managed guidance block is upserted in place. Hook wiring preserves existing entries and appends missing supaschema hook entries at the end of the relevant event array; it only removes the known broken package-owned Claude script entries that passed `${CLAUDE_PROJECT_DIR}` script paths through `args`.
19
19
# - Normal resolved installs do not create `.supaschema/`. If `.supaschema/install.json` exists and records `"pathConfirmationNeeded": true`, inspect the detected candidates, ask the user which `schemaPaths`, `sources.to`, and `migrationsDir` to use, and update `supaschema.config.json` before the first diff. Do not generate from the installer's guessed first candidate; `config validate`, `doctor`, and zero-source `diff` block until all three fields are explicit, and the PostToolUse hook must skip auto-diff until all three fields are explicit.
20
20
# - `supaschema.config.json` owns four workflow decisions. Schema tree fields are `schemaPaths`, `sources.to`, and `migrationsDir`; `dir:` sources read nested `.sql` files recursively, and install writes `sources.to: "dir:<schemaPaths[0]>"`. Diff baseline fields are `sources.from` and `sources.to`; `sources.from: "auto"` resolves valid `git:HEAD`, then a database URL, then `empty:` for a first migration in a fresh repository. Generated contract fields are `typesFile`, `zodFile`, `workflow.type_generation`, `workflow.zod_generation`, and `workflow.type_usage`; defaults create or refresh TypeScript and Zod outputs after `diff` and tell agents to use generated Zod validators at runtime boundaries. Apply policy fields are `workflow.migration_sync` and `sync.targets`; default `workflow.migration_sync: "auto"` keeps bare `supaschema sync` apply-capable, while `sync.targets.<name>.mode` decides selected targets and remote targets require approval variables. `adapter: "auto"` is provider-neutral and is not a Supabase switch. Provider-specific behavior is expressed through paths, managed schemas, transaction mode, excluded grant roles, sync targets, and explicit verify flags. Generic PostgreSQL installs use `managedSchemas: []` and reuse detected existing database URL environment variable names in `sync.targets` when present; Supabase installs seed the Supabase platform schema list and use the Supabase CLI runner by default.
21
21
# - Schema intent changes only in the configured declarative SQL tree (`schemaPaths` in `supaschema.config.json`), such as `database/schemas/**`, `supabase/schemas/**`, `neon/schemas/**`, `aws-postgresql/schemas/**`, `cloud-sql/schemas/**`, `alloydb/schemas/**`, or `azure-postgresql/schemas/**`. Render the migration with `supaschema diff`; do not hand-author migration SQL for changes the tree can express.
0 commit comments