stack-detect
Skill22 starsChanged 5 months agoMITView on GitHub
Detects the database stack(s) of a project — paradigm, engine, ORM, platform, and the authoritative source_of_truth — by wrapping scripts/detect-stack.mjs. Emits the stacks array plus routing (which paradigm profile and module set each stack drives) and the source_of_truth precedence. Never guesses an engine; an empty result routes to /claude-db:start. Invoked by db-orchestrator (Phase 1); not usually called directly.
In this repository36 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- auditSkill
- checklistSkill
- db-antipatternsSkill
- db-concurrencySkill
- db-connection-poolingSkill
- db-constraintsSkill
- db-defaults-generatedSkill
- db-engine-selectionSkill
- db-index-hygieneSkill
- db-indexingSkill
- db-keysSkill
- db-migration-safetySkill
- db-multitenancySkill
- db-namingSkill
- db-normalizationSkill
- db-orchestratorSkill
- db-partitioning-shardingSkill
- db-platform-fitSkill
- db-query-patternsSkill
- db-referential-integritySkill
- db-replicas-viewsSkill
- db-security-accessSkill
- db-specialized-fitSkill
- db-storage-bloatSkill
- db-temporal-historySkill
- db-types-precisionSkill
- designSkill
- explainSkill
- fixSkill
- introspectSkill
- migrateSkill
- nextSkill
- scoreSkill
- seedSkill
- startSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Run the detector and read its JSON stdout:
- Distinctive: line 24
When several sources describe one database, authority is, in order:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- Copyright (c) 2026 Enrique Rocha (@soyenriquerocha) · tododeia.com · id er-f37b7121 -->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).
Multi-store
Return all stacks (e.g. Postgres primary + Redis cache). The orchestrator audits each, scores each with its own --paradigm, and rolls up worst-of-across-stores per axis (see references/scoring-model.md → Multi-store rollup), naming the flooring store.
Output
Emit the raw stacks array, the per-stack routing (paradigm profile + module set), and the source_of_truth precedence note. Keep narration tight. Respond in the user's language (EN/ES).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

