stack-detect

A project scanner that identifies the database setup, including the database engine, programming approach, object-relational mapper, hosting platform, and most authoritative source.

In plain words
What is it for?
Use it as the first step in database audits to choose the right checks and report detected database stacks.
Why use it?
It prevents database audits from relying on guesses when several files or systems describe the same database.

Skill for Claude CodeCodex

Part of the claude-db plugin — 36 skills, 6 agents, 1 hook shipped together

Install

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.

agentmods
npx agentmods add skills/hainrixz/claude-db/stack-detect
Any agent
npx skills add Hainrixz/claude-db --skill stack-detect
Clone the repo
git clone --depth 1 https://github.com/Hainrixz/claude-db

Made for: Claude Code, Codex.

Or install claude-db, the plugin that ships this one along with the rest of its 36 skills, 6 agents, 1 hook.

Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 796 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce 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

Measured 3d ago against content hash 8a483392967b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

skills/stack-detect/SKILL.md · 42 lines

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.mjsPROFILES) and the module set each auditor runs.

What to do

  1. Resolve the target directory ($ARGUMENTS path, else the project root / cwd).

  2. 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.

  3. 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's hint verbatim.

Source-of-truth precedence (see references/detection-signals.md)

When several sources describe one database, authority is, in order:

  1. Live Tier-1 introspection (via the introspect skill) — beats any file.
  2. Declarative / generated artifactschema.prisma, Drizzle *_snapshot.json, structure.sql, schema.rb, generated migration SQL → confidence: established.
  3. Migration SQL over ORM program source.
  4. 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.mjs profile and --paradigm flag (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).

Read the full file on GitHub · 42 lines

Changes

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.

  1. 3d ago First seen · 42 lines · 96 tokens per session scan A 8a483392967b

Subscribe to this mod's changes

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.

Related

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.

malloydata/publisher · 67 tokens

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.

malloydata/publisher · 61 tokens

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…

malloydata/publisher · 81 tokens

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.

malloydata/publisher · 37 tokens

convex-migrations

Schema migration strategies for evolving applications including adding new fields, backfilling data, removing deprecated fields, index migrations, and zero-downtime migration patterns.

waynesutton/convexskills · 35 tokens

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…

Terrabase-in/terrabase · 98 tokens