db-intelligence
Unified database intelligence for PostgreSQL, MySQL, SQLite, and MongoDB in one skill: detect the engine, connect credential-safe, extract schema, build an…
Skill by cskwork
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/cskwork-db-intelligence
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, testing, data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/db-intelligence
What's inside
- Skill name
db-intelligence- Description
- Unified database intelligence for PostgreSQL, MySQL, SQLite, and MongoDB in one skill: detect the engine, connect credential-safe, extract schema, build an entity-relationship graph, and run read-first queries. Use BEFORE coding to establish domain language, domain data shapes, and real data evidence (specify/explore stage); use during hardening/QA for read-only data verification of selects, updates, and deletions. Triggers: database, DB, schema, domain data, data shapes, ER diagram, PostgreSQL, MySQL, SQLite, MongoDB, mongosh, psql, sqlite3, 'check the data', 'what does the table look like', 'verify in DB'.
- License
- MIT
- Metadata
- author: cskwork · version: 1.0.0 · consolidates: postgres-intelligence, mysql-intelligence, mongodb-intelligence, sql-check
- Instructions
- 124 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (7)
- .env.example
- SKILL.md
- mongodb.md · reference/
- mysql.md · reference/
- postgres.md · reference/
- sqlite.md · reference/
- config.py · scripts/
SKILL.md (first lines)
# db-intelligence One skill, four engines. Contract: **schema before SQL, evidence before claims, reads before writes.** The output of this skill is not just query results — it is a *domain evidence artifact* other agents (specifier, coder, QA) can consume. ## Step 1 — Detect the engine | Signal | Engine | Reference | |---|---|---| | `psql`, port 5432, `pg_catalog`, DATABASE_URL `postgres://` | PostgreSQL | `reference/postgres.md` | | `mysql`, port 3306, JDBC `mysql:`, MyBatis/JPA against MySQL | MySQL | `reference/mysql.md` | | a `.db`/`.sqlite`/`.sqlite3` file, `better-sqlite3`, embedded/local store | SQLite | `reference/sqlite.md` | | `mongodb://` URI, collections, aggregation, `mongosh` | MongoDB | `reference/mongodb.md` | Can't tell? Look at the repo: ORM config (`application.yml`, `mybatis`, `prisma/schema.prisma`, `knexfile`, `mongoose`), docker-compose services, and `.env*` keys name the engine. Multiple engines in one task are normal — open each engine's reference and keep one evidence artifact. Project-specific routing (which logical DB owns which table prefix, which environments are allowed) lives in **domain packs**: check `reference/domain/*.md` in this skill (local-only, never synced publicly) and any `sql-check`-style router in the project's `.agents/skills/` — obey them first. ## Hard rules (all engines) 1. **Never open or print `.env` / credential files.** Scripts and CLIs load credentials at runtime; you see results, never passwords. Never echo a connection string containing a password. 2. **Read-first.** `SELECT` / `find` / `EXPLAIN` run freely. Any `UPDATE`/`DELETE`/`INSERT`/DDL/`updateMany`/`deleteMany`: show the exact statement + expected row count to the user, get approval, then run, then re-`SELECT` to verify the effect. Writes to prod are forbidden. 3. **`WHERE`-less UPDATE/DELETE is always a bug.** Refuse and ask. 4. **Schema before SQL.** Never guess table, column, or field names. Extract or load schema metadata first; RAG over it to pick tables. 5. **LIMIT by default** (≤1000) on exploratory reads. Prefer explicit columns over `SELECT *`. 6. **Max 3 retry refinements** on query errors, then report the blocker. 7. **Evidence, not bulk.** Quote the executed statement, row count, and the deciding rows in your report. Large dumps go to scratch files, get read, get deleted. 8. **Code is the oracle for code claims.** When explaining why a production query/CTE/ORM call behaves a certain way, first quote the actual SQL from the repo (mapper XML, migration, ORM output) and evaluate ONLY the conditions that text contains. Never evaluate conditions inferred from requirements prose or column names — a plausible invented condition is the classic false root cause. If you cannot locate the real query, say so instead of reconstructing it. ## Step 2 — Schema → entity graph (the domain model) This is what makes the data *domain knowledge* rather than rows: 1. Extract schema (per-engine command in its reference file). **Staleness check first**: if a `schema_metadata.json` (or cached DDL dump) already exists, compare its mtime against the repo's migration/DDL files (`migration*/`, `db/`, `*.sql`, `prisma/`, Flyway/Liquibase dirs) — older than the newest migration means re-extract before trusting it. MongoDB has no migrations: re-sample when the metadata is older than the feature you are specifying, or on any field-shape surprise. 2. Build the **entity-relationship graph**: nodes = tables/collections, edges = FKs / embedded refs / join-table links. For engines without declared FKs (MongoDB, legacy MySQL), infer edges from `*_id` naming and sampled values. 3. Record the **ubiquitous language**: table/column comments, enum/code values and their meanings, status-flag semantics (`_YN`, `del_yn`, soft deletes). 4. Note **data-shape gotchas**: nullable columns that are "never null in practice", JSON columns, date encodings, charset/collation, multi-tenancy keys. Output shape (write it to the path the task names, else `db-evidence.md`): ```markdown # DB evidence — <task/feature> ## Engines & connections (names + source environment e.g. dev/audit — never credentials; non-prod data is never prod truth) ## Entity graph (mermaid erDiagram or adjacency list, relevant slice only) ## Ubiquitous language (term → table.column → meaning, code values decoded) ## Data shapes (types, nullability-in-practice, gotchas) ## Queries run (statement → row count → deciding rows) ## Open questions (what the data could not answer) ``` Keep the graph to the **relevant slice** — the 5–15 entities the task touches, not the whole schema. **Cache the stable part in the domain pack.** Entity-graph edges and ubiquitous language change rarely; data shapes and row realities drift. When a `reference/domain/<project>.md` pack exists, read its cached graph slice first and only re-verify the *data* (shapes, counts, code values) against the live DB. After a session that mapped new entities or decoded new terms, append them to the domain pack (dated) so the next run starts warm. No pack, recurring project → offer to create one. ## Step 3 — Query Natural language → statement, using the schema metadata (never guesses). Per-engine syntax, executors, retry-error taxonomy, and performance analysis live in the reference files. Multi-step analysis: prefer one statement that answers the question over N round trips. ## Step 4 — Present Three formats when useful, at minimum the first: **data table** (≤20 rows shown, note total), **analysis** (direct answer + notable pattern/outlier), and optionally a **chart** via the legacy visualizer scripts. ## Reference map | File | When | |---|---| | `reference/postgres.md` | psql, information_schema/pg_catalog, EXPLAIN ANALYZE, existing postgres-intelligence scripts | | `reference/mysql.md` | mysql CLI, multi-DB routing, existing mysql-intelligence scripts | | `reference/sqlite.md` | sqlite3 CLI, file discovery, PRAGMA schema/introspection, WAL/locking gotchas | | `reference/mongodb.md` | mongosh, sample-based schema inference, aggregation pipelines, existing mongodb-intelligence scripts | | `reference/domain/*.md` | local-only domain packs: per-project DB routing, environments, known failure classes (gitignored — may be absent on a fresh install) | **Done =** engine stated · schema loaded before any statement · entity-graph
From cskwork/skills, MIT.
More from cskwork/skills
- 0.586score
motion-graphics
cskwork
Make code-driven motion-graphics videos rendered from HTML, frame-accurate and reproducible.
SkillAFreshness: A★ 3Claude Code +9 - 0.586score
bughunt
cskwork
Find and fix interaction bugs in games, CRUD apps, AI chat and media apps with seeded self-playing personas, per-step invariant oracles, reproducible failure…
SkillAFreshness: A★ 3Claude Code +9 - 0.586score
diagram-design
cskwork
Create branded architecture, architecture delta, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant…
SkillAFreshness: A★ 3Claude Code +9 - 0.586score
gpt-image-2
cskwork
Generate images with ChatGPT's current image model (GPT Image 2 at the time of writing, and whatever model succeeds it) inside your agent, using your existing…
SkillAFreshness: A★ 3Claude Code +9 - 0.586score
image-first-ui
cskwork
Image-first interface creation.
SkillAFreshness: A★ 3Claude Code +9 - 0.581score
quality-loop
cskwork
Product quality bar and improvement loop for iPhone apps, websites, web apps, games, and other software.
SkillAFreshness: A★ 3Claude Code +9 - 0.581score
mobile-ui-ux
cskwork
Measurable usability and interaction rules for iPhone apps, mobile web, and mobile games, with a 7-category scoring rubric, an independent-judge prompt, and a…
SkillAFreshness: A★ 3Claude Code +9 - 0.581score
sdlc-kit
cskwork
Four-phase SDLC loop for any codebase: intent (90% clear: explore, reproduce, research, ask the requester), plan (parallel scouts, one PLAN.md), build…
SkillAFreshness: A★ 3Claude Code +9 - 0.580score
jk
cskwork
Manage Jenkins controllers with jk, including jobs, runs, logs, artifacts, credentials, nodes, queues, and plugins.
SkillAFreshness: A★ 3Claude Code +9 - 0.578score
sol
cskwork
Orchestrate application work through GPT-6.1 Sol subagents (high reasoning, fast tier).
SkillAFreshness: A★ 3Claude Code +9 - 0.578score
update-all
cskwork
Update all coding agent harnesses (Codex, Claude Code, pi, Antigravity CLI) in one run with before/after version reporting.
SkillAFreshness: A★ 3Claude Code +9 - 0.575score
call-agent
cskwork
Delegate a bounded task to a user-named peer CLI, or to fill a capability the host lacks.
SkillAFreshness: A★ 3Claude Code +9
Signals
- Stars
- 3
- Forks
- 1
- Open issues
- 0
- Last commit (this folder)
- Oct 5, 2026 (23 days ago)
- Last release
- Oct 24, 2026 (4 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0.0
- License
- MIT
- Repository
- github.com/cskwork/skills
- Website
- cskwork.github.io/skills/
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from cskwork
- 0.586score
bughunt
cskwork
Find and fix interaction bugs in games, CRUD apps, AI chat and media apps with seeded self-playing personas, per-step invariant oracles, reproducible failure…
SkillAFreshness: A★ 3Claude Code +9 - 0.586score
image-first-ui
cskwork
Image-first interface creation.
SkillAFreshness: A★ 3Claude Code +9 - 0.586score
motion-graphics
cskwork
Make code-driven motion-graphics videos rendered from HTML, frame-accurate and reproducible.
SkillAFreshness: A★ 3Claude Code +9 - 0.586score
gpt-image-2
cskwork
Generate images with ChatGPT's current image model (GPT Image 2 at the time of writing, and whatever model succeeds it) inside your agent, using your existing…
SkillAFreshness: A★ 3Claude Code +9 - 0.586score
diagram-design
cskwork
Create branded architecture, architecture delta, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant…
SkillAFreshness: A★ 3Claude Code +9 - 0.581score
mobile-ui-ux
cskwork
Measurable usability and interaction rules for iPhone apps, mobile web, and mobile games, with a 7-category scoring rubric, an independent-judge prompt, and a…
SkillAFreshness: A★ 3Claude Code +9
Cite this page
db-intelligence skill. Agent Mart. https://agentmart.dev/skills/cskwork-db-intelligence (last updated 2026-10-24)