Skip to content

Commit 895dabd

Browse files
Prepare release 0.2.1 (#36)
1 parent 0f7fd3e commit 895dabd

122 files changed

Lines changed: 5786 additions & 4021 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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.

.agents/skills/supaschema/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ When the bundled PostToolUse hook is wired (`.claude/settings.json` / `.codex/ho
1515

1616
The normal consumer setup is one package install: `npm install supaschema`. 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.
1717

18+
If this skill was installed through `npx skills`, treat it as portable workflow context only. Agent Skills installs `SKILL.md`-based folders; it does not create `supaschema.config.json`, schema/migration directories, passive rule files, hook scripts, or hook registration. To install those project enforcement surfaces, run `npm install supaschema` from the consuming project root. If the package is already present but lifecycle scripts did not run, run `npx supaschema init` from the same root. The npm scaffold installs the rule and hooks; the `npx skills` lane does not.
19+
1820
Before the first schema edit, check `.supaschema/install.json` if it exists. If it says `"pathConfirmationNeeded": true`, inspect its candidate `schemaPaths` and `migrationsDirs`, ask the user which `schemaPaths`, `sources.to`, and `migrationsDir` to use, update `supaschema.config.json`, then run the workflow. Do not generate a migration from a guessed path; the bundled hooks also skip auto-diff until all three fields are explicit.
1921

2022
Use the configured `schemaPaths`, `sources`, and `migrationsDir` as the source of truth. Do not create a parallel schema tree, a second migrations directory, or a new config unless the user explicitly asks to change project layout.

.claude/rules/00-supaschema.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ description: Compatibility pointer for the canonical supaschema migration policy
44

55
# Rule 00 — supaschema Policy Pointer
66

7+
## Contract
8+
9+
This numbered file exists only to preserve rule-citation compatibility. The canonical migration policy owner is `.claude/rules/supaschema.md`.
10+
11+
712
The canonical owner is `.claude/rules/supaschema.md`.
813

914
This numbered file exists only for rule-citation compatibility. Do not add migration policy here; update `.claude/rules/supaschema.md` and keep `.codex/rules/supaschema.rules` as a Codex-native pointer to that owner.
15+
16+
## Verification
17+
18+
When migration policy changes, update `.claude/rules/supaschema.md`, then keep this file as a pointer only and run the rule/context sync check that applies to the repo.
19+
20+
## Failure behavior
21+
22+
Do not add unique migration policy here. Move any new policy to `.claude/rules/supaschema.md` and keep Codex pointers aligned.
23+
24+
## Done means
25+
26+
This file remains a compatibility pointer and contains no unique migration policy.

.claude/rules/01-operating-rules.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
---
2+
description: Repo operating discipline: STOP gates, enforcement, technical decisions, npm-only package manager, and closeout behavior.
3+
---
4+
15
# Rule 01 — Operating rules
26

3-
The non-negotiable working agreement for any agent or contributor in this repo. The standing rules live in the root `AGENTS.md` and the per-concern files under `.claude/rules/`; this file states the operating discipline that governs how all of them are applied.
7+
## Contract
8+
9+
This rule owns the repo-wide operating discipline that applies every other rule: gates are real, technical decisions are evidence-based, npm is the only package manager, and no standard ships without an executable enforcement path.
10+
11+
12+
The non-negotiable working agreement for any agent or contributor in this repo. Standing rules live in the per-concern files under `.claude/rules/`; `AGENTS.md` is the root route map that points agents to those owners.
413

514
## Hard rules
615

@@ -11,7 +20,7 @@ The non-negotiable working agreement for any agent or contributor in this repo.
1120
- **Stay inside the governed toolchain** (Rules 04/06/08): navigate and refactor via cclsp; format and lint with the one owner per concern — `ruff` for Python, Biome via Ultracite for JS/TS/JSON/CSS/HTML/GraphQL; analyze code structure with an AST, never ad hoc regex (Rule 07).
1221
- **Use Code Atlas for repo-wide graph claims** (Rule 10): build and query the atlas before broad owner, route, consumer, dependency, DB, API, worker, generated-surface, or rollout assertions, then prove exact behavior with cclsp and direct source reads.
1322
- **Keep agent surfaces synchronized.** After changing one of the six mirrored skills (`code-atlas`, `fastmcp`, `fastmcp-client-cli`, `supaschema`, `ultracite`, `upstream`), run `npm run sync:llm` so the `.codex/skills` and `.agents/skills` mirrors stay byte-identical to their `.claude/skills` owners (Rule 12). Codex hooks stay native; Codex rule files should hold executable command policy or short pointers to canonical rule owners, not duplicated long-form policy.
14-
- **Operator and agent guidance lives in `AGENTS.md` and `.claude/rules/`;** `README.md` is the npm package landing page and `docs/` is the Mintlify site. The published npm package boundary is the `package.json` `files` allowlist (Rule 13).
23+
- **Durable operator policy lives in `.claude/rules/`, not `AGENTS.md`.** `AGENTS.md` is a concise repo map and rule index; `README.md` is the npm package landing page and `docs/` is the Mintlify site. The published npm package boundary is the `package.json` `files` allowlist (Rule 13).
1524
- **The package manager is npm.** Never introduce pnpm, yarn, or an alternate lockfile; preserve `package-lock.json`. There is no Turborepo, no workspaces, and no `apps/` in this single-package repo.
1625
- **Commit only when asked; branch off the default branch first;** let lefthook run (never `--no-verify`).
1726

@@ -20,3 +29,24 @@ The non-negotiable working agreement for any agent or contributor in this repo.
2029
- `npm run guard` (`scripts/guards/check-all.mjs`) is the umbrella gate — tooling stack, agent hooks, agent-surface parity, rule-citation integrity, dependency catalog, Code Atlas, LSP coverage, FastMCP surface, and no-regex-in-scripts. lefthook (`pre-commit` runs Biome on staged files; `pre-push` runs `npm run typecheck` + `npm run guard`) and the PreToolUse/PostToolUse hooks enforce in-loop.
2130

2231
STOP if any STOP condition in `.claude/rules/*` is skipped, a guard or test is weakened instead of its cause being fixed, a standard ships without an executable enforcement path, the package manager is switched away from npm, or a technical decision ships on a guess when an authoritative upstream source was available.
32+
33+
## Verification
34+
35+
Run the narrowest command that proves the touched rule, then the umbrella gate when rule, hook, package, migration, toolchain, or CI behavior changed.
36+
37+
Required closeout checks when this rule or a cross-cutting rule changes:
38+
39+
```bash
40+
npm run guard
41+
npm run typecheck
42+
```
43+
44+
`npm run guard` must finish with `ALL_GUARDS_OK`.
45+
46+
## Failure behavior
47+
48+
If any gate fails, fix the underlying cause and rerun the failed command. Do not weaken, disable, skip, comment out, baseline, or bypass a guard, test, hook, assertion, or STOP condition to make the run green.
49+
50+
## Done means
51+
52+
Every accepted instruction has a disposition: resolved with evidence, not applicable with evidence, or blocked by a concrete external constraint after investigation. Deferral and future cleanup are not closeout states.

0 commit comments

Comments
 (0)