Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By greenstevesterv2.0.0MITIn 1 marketplace
Document a PostgreSQL schema and review its logical and physical design in one run
Claude loads one when your task matches it, or you run it by name.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Document a PostgreSQL schema and review its design in one run. Docs and review come from the same model, so a finding always points at a table you can click through to, and the docs show every flaw next to the table it belongs to.
node scripts/archlens.ts schema.sql --narratives narratives.json --out docs/database
produces
docs/database/
├── index.html self-contained browsable docs, findings inline, filter box, a whole-schema SVG diagram plus an inline SVG diagram and a relationship list per domain
├── schema-3d.html rotatable 3D view of the whole schema: one island per domain, every foreign key as an arc, click any table or relationship for its detail. Self-contained, about 1 MB
├── schema.json the model + findings (input for the Claude Code judgment pass)
├── README.md markdown index leading with the schema map, linked to the explorer
├── schema-map.svg the 3D layout seen from above: islands, tables, one curve per foreign key (plain SVG, renders anywhere)
├── erd.svg whole-schema entity-relationship diagram (plain SVG, renders anywhere)
├── FINDINGS.md findings by severity, each with cause, effect and fix SQL
└── domains/ one .md page per domain with its own .svg diagram and a Relationships list (facts + why)
and exits 1 if any error-severity finding exists (--fail-on to tune).
npm install # two dependencies, both pinned: libpg-query (the real PostgreSQL parser as WebAssembly) and three (inlined into schema-3d.html)
Node 24 or newer. Node runs the .ts file directly, so there is no build step.
schema.sql — one PostgreSQL DDL file. pg_dump --schema-only from a
dev database is the most honest source; concatenated Flyway migrations work
too. CREATE TABLE, ALTER TABLE … ADD CONSTRAINT / ENABLE ROW LEVEL SECURITY, CREATE INDEX (incl. partial), CREATE POLICY, CREATE TYPE … AS ENUM, COMMENT ON are all understood. -- comments directly above a
table and at the end of a column line become descriptions.
narratives.json — human intent, in two parts. See
examples/narratives.json.
domains[]: key, title, blurb, tenant_scoped, tables[]. Every table
must be claimed by exactly one domain or the run fails — that is the
"a new table cannot silently fall out of the docs" gate.assertions: claims the script can check mechanically —
tenant_table / tenant_column / require_rls, global_tables,
singleton_tables, cardinality[] ({parent, child, expect: "1:1"|"1:N", why, columns} —
expect and why are optional; why is printed beside the relationship in the docs;
columns names which foreign key the entry means and is needed when a table has two
foreign keys to the same parent), natural_keys[], exclusive_arcs[],
accepted[] ({check, table, columns, why} — a finding reviewed and judged wrong
for this schema; see below).Some findings are wrong for a particular schema, and a checker cannot know it. A
CHECK on a column holding Apple's webhook vocabulary would reject the next value
Apple invents; a partial unique index on a soft-delete column is wrong when the
soft delete is meant to be reversible. Record the judgement so it stops being
re-litigated:
"accepted": [
{
"check": "undocumented-enum",
"table": "subscription_events",
"columns": ["event_type"],
"why": "Apple owns this vocabulary and adds to it. A CHECK would fail the webhook insert on any type Apple invents, dropping a real purchase event."
}
]
An entry is matched on check, table and columns — never on the finding id,
which is renumbered whenever a check moves. Omit columns for a finding about the
whole table (orphan-table, wide-table); a columns-less entry never matches a
column finding, so it cannot silently swallow the next one that appears.
Dismissed findings are printed, not hidden — FINDINGS.md gets a "Reviewed and
dismissed" section carrying each why, and schema.json gets a dismissed array.
They do not count toward the severity totals and do not trip --fail-on.
Two ways an entry is refused, both reported as an accepted-entry warning rather
than applied quietly: an entry with no why (the reasoning is the whole value of
the record), and an entry that matches no finding, which means either the problem
was fixed or something was renamed and the entry is now dismissing nothing while
looking like it does.
The narratives are optional (--narratives omitted → docs + physical checks
only), but the interesting findings — wrong cardinality, unenforced natural
keys, tenant gaps — need a claim to check against.
Plugins from other owners that cover similar ground
npx claudepluginhub greenstevester/archlens-postgres --plugin archlens-postgresBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.