db-orchestrator
Skill22 starsChanged 5 months agoMITView on GitHub
Orchestrates a full database audit — detects the stack(s), dispatches read-only auditor subagents in parallel by paradigm, merges and dedupes their findings, computes the two never-blended scores (Design & Integrity + Performance & Scale) via score.mjs, and renders the report. Invoked by the audit command; 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-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
- stack-detectSkill
- startSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Run stack-detect (wraps scripts/detect-stack.mjs).
- Very specific: line 16
If the user opted into Tier-1, run introspect (read-only) so runtime-dependent checks can reach established.
- Very specific: line 29
Merge: all findings; dedupe by id (keep the most severe status: fail > warn > needs_api > pass > not_applicable).
- Distinctive: line 46
Keep this skill's own output tight — the value is the merged report, not narration.
≈ “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 -->db-orchestrator (Layer 2)
Coordinates the whole audit. Three phases: detect → dispatch → synthesize. Two scores, never blended.
1. Detect
- Resolve the target (project dir, or a plain-language description).
- Run stack-detect (wraps
scripts/detect-stack.mjs). Get thestacksarray, each withparadigm,engine,orm,platform,source_of_truth,confidence. - Empty result → route to
/claude-db:start(wizard) or description mode. Never guess an engine. - If the user opted into Tier-1, run introspect (read-only) so runtime-dependent checks can reach
established; otherwise those checks will returnneeds_api.
2. Dispatch (parallel, read-only)
For each stack, spawn the read-only auditor subagents in parallel — one message with multiple Task calls — so their verbose intermediate output stays isolated. (context: fork is NOT a Task parameter; parallelism is achieved by issuing several Task calls in a single message.) Pass each the source_of_truth location/contents, the paradigm, the engine/platform, and its assigned modules. Auditors of an inactive paradigm are not dispatched (their modules emit no findings and leave the denominator):
- schema-integrity-auditor → M1–M10 (modeling, keys, referential integrity, types, constraints, defaults, naming, temporal, multitenancy, security/RLS). Always (relational); for NoSQL it runs the paradigm-shaped subset.
- performance-scale-auditor → M11–M18 (indexing, hygiene, query patterns, concurrency, pooling, partitioning, replicas/views, storage/bloat). Always.
- nosql-paradigm-auditor → M19 (NoSQL anti-patterns) + access-pattern fit. Only for document / key-value / wide-column.
- specialized-platform-auditor → M20 (vector/time-series/graph/search), M21 (platform fit), M0 (engine-selection recommendation in design mode). For vector/TS/graph/search and all platform checks.
- migration-safety-auditor → M22 (migration lint). When migration files are in scope (
/claude-db:migrate, or audit when a migration dir exists).
Each subagent returns a JSON array of findings conforming to schema/finding.schema.json. Auditors are read-only (tools Read, Grep, Glob, Bash, WebFetch only) — the audit can never mutate files. M19/M20 findings keep their module id for provenance but inherit the natural module's category at scoring time.
3. Synthesize
- Merge all findings; dedupe by
id(keep the most severe status: fail > warn > needs_api > pass > not_applicable). - Score per stack with the matching paradigm:
Multi-store → score each stack, then roll up worst-of-across-stores per axis (node scripts/score.mjs --findings <merged.json> --paradigm <paradigm>design = min over stores, same for performance); name the flooring store (e.g. "Design 58 — floored byredis-cache"). - Render the report (bands/interpretations from
references/scoring-model.md):- Header: Design & Integrity band/score + Performance & Scale band/score, each with the one-line interpretation from
score.mjs. If a score iscapped:true, show bothvalueand uncappedcomputedand name the sev-5 fail that capped it. - Per-axis category table (one per score): category, weight, value, active?. Inactive categories shown as such (re-normalized out of the denominator).
- Confidence line: tier reached (0/1/2) + total
needs_apicount across both axes. Never present aneeds_apicheck as a pass. - Prioritized actions: findings sorted by
severity × magnitude ÷ effort(magnitude banded high|medium|low, never a fabricated %). Each: status, severity, evidence.observed (real DDL/query, secrets redacted), verification.reproduce, recommendation, fixability (auto/proposed/advisory), and expected_impact (axis + confidence + magnitude). - Footer: "Run
/claude-db:fixto apply the safe, reversible migrations — you confirm each change."
- Header: Design & Integrity band/score + Performance & Scale band/score, each with the one-line interpretation from
Plain-language layer (novice-friendly)
Alongside the technical report, give a short plain-language summary: what the two scores mean in one sentence each ("your design is solid but it won't hold load yet"), the top 3 things to fix first in non-jargon terms, and what needs_api means ("I'd need a read-only connection to confirm these"). Keep the expert detail; add the human translation — never replace one with the other.
Notes
- Keep this skill's own output tight — the value is the merged report, not narration.
- Honesty: never fabricate stats/latency/throughput/row-counts/prices.
needs_apiwhen a live DB is required. Read-only by default; speculative findings never cap. - 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.

