Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/hainrixz/claude-db/stack-detectnpx skills add Hainrixz/claude-db --skill stack-detectgit clone --depth 1 https://github.com/Hainrixz/claude-dbWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00096 | $0.00796 |
| Opus 5 | $0.00048 | $0.00398 |
| Sonnet 5 | $0.00019 | $0.00159 |
| Haiku 4.5 | $0.00010 | $0.00080 |
Grade A, and why
stack-detect scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 42 lines — stays where its author put it; the contents beside it link to each section on GitHub.
stack-detect (Phase 1 — detect)
Classifies the project into one or more { paradigm, engine, orm, platform, source_of_truth, confidence, files } stacks. This is the deterministic front door of every audit: it picks the paradigm profile the scorer re-normalizes over (scripts/score.mjs → PROFILES) and the module set each auditor runs.
What to do
-
Resolve the target directory (
$ARGUMENTSpath, else the project root / cwd). -
Run the detector and read its JSON stdout:
node scripts/detect-stack.mjs --dir "<dir>"It returns
{ stacks: [...], files_scanned }. Never edit or re-implement it — it is tested foundation. -
Empty
stacks→ there is nothing to audit offline. Do not guess an engine. Route the user to/claude-db:start(the guided wizard) or invite a plain-language description of the intended database. Surface the detector'shintverbatim.
Source-of-truth precedence (see references/detection-signals.md)
When several sources describe one database, authority is, in order:
- Live Tier-1 introspection (via the
introspectskill) — beats any file. - Declarative / generated artifact —
schema.prisma, Drizzle*_snapshot.json,structure.sql,schema.rb, generated migration SQL →confidence: established. - Migration SQL over ORM program source.
- ORM program source (
schema.ts,models.py, Mongoose/CDK) →confidence: directional.
directional stacks parsed from program source never raise a severity-5 cap — they nudge toward a generated artifact or Tier-1. When a declarative artifact and ORM source disagree, that is schema drift, owned by db-migration-safety (M22).
Routing emitted per stack
For each detected stack, emit the routing the orchestrator needs:
- paradigm → selects the
score.mjsprofile and--paradigmflag (relational | document | key-value | wide-column | vector | time-series | graph). - module set → M0 engine-selection (recommendation, unscored) + M1..M22 filtered to the paradigm's profile modules. Categories whose modules emit no scored finding go inactive — e.g. a document store is never penalised for missing foreign keys.
- source_of_truth + confidence → the parse reliability ceiling carried into every finding (Tier 0(a) reliable vs 0(b) best-effort).
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 42 lines · 96 tokens per session scan A 8a483392967b
stack-detect is a skill published in the GitHub repository Hainrixz/claude-db (19 stars, last pushed 2mo ago), licensed MIT. It adds 96 tokens to every session and 796 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
malloy-gotchas-modeling
Common Malloy modeling mistakes and how to avoid them. Read BEFORE writing source definitions, dimensions, measures, or joins. Covers reserved words, NULL checks, date functions, type casts, field management (extend except/accept/rename vs include public/internal/private), and query-based source gotchas.
malloy-materialization
Add and debug Malloy Persistence materializations in a package - persist an expensive source so queries read a pre-built table. Read this whenever the user wants to materialize a source, add a persist annotation, speed up a slow source, or asks why a persist source isn't building.
malloy-materialization-tuning
Optimize a package's Malloy Persistence materializations for cost and performance using the malloy-pub CLI and the materialization history. Recommend what to persist, what to stop persisting, and how to schedule/scope it. Use when the user asks to make a package cheaper or faster, tune persistence, decide what to…
malloy-analysis-pitfalls
Common data analysis pitfalls to watch for during query construction and result interpretation. Reference this checklist when verifying queries and results to catch errors before presenting an answer.
convex-migrations
Schema migration strategies for evolving applications including adding new fields, backfilling data, removing deprecated fields, index migrations, and zero-downtime migration patterns.
terrabase-db-changes
Use when making Postgres schema or migration changes (CREATE/ALTER/DROP TABLE, indexes, columns, constraints, backfills) IN A PROJECT THAT DECLARES A TERRABASE TARGET (a TERRABASEDATABASEURL in its .env). Routes the change through terrabase's MCP tools for a deterministic safety analysis plus a local-Qwen plan, and…