db-investigator
Installation
SKILL.md
Tool Selection
| Need | Tool |
|---|---|
| Data investigation (counts, WHERE, GROUP BY, JOIN) | db_query.py |
| Table structure (DDL, columns, indexes, sample rows) | fetch_structure.py --tables |
| SP/Function source code | fetch_structure.py --procedures |
| Database overview (list all objects) | fetch_index.py |
Decision flow: Data question → db_query.py. Structure → fetch_structure.py. Don't know what exists → fetch_index.py.
Tool experience: When a query pattern or parameter combination proves especially effective (or a pitfall is discovered), note it in the relevant references/ file alongside the query template or investigation flow.
Initialization
On first use or new environment, run: python $S/decay_engine.py init
- Creates
references/directory +_index.mdtemplate +db_config.initemplate - Idempotent: safe to re-run, skips existing files
- After init: edit
db_config.iniwith database credentials before any queries