What problem does it solve? Querying production databases directly is risky: accidental writes, unbounded full-table scans, and untraceable results. This Skill enforces a safety-first database query workflow where production is strictly read-only (script interception + read-only session + read-only account), test-environment writes require explicit user confirmation, and every query result is persisted to disk as evidence. ## Core Features & Use Cases - Safety-Enforced Querying: Single-statement execution, mandatory LIMIT, no select *, and side-effect detection (e.g., EXPLAIN ANALYZE on write statements, SELECT ... INTO, nextval) treated as writes and blocked on read-only environments. - Multi-Environment Config: Switch environments with --env; config loads from explicit path, project-level .claude/db-query.config.json, or skill-level default, supporting PostgreSQL-compatible databases like GaussDB. - Companion Tools: Convert query results into batch UPDATE fix SQL (gen-fix-sql.py), dry-run SQL files with rollback (run-sql-file.py), and sync table data across environments (sync-table.py). - Use Case: Verify a broken order's status in production, cross-check it against log-diagnose findings, generate a fix SQL script, test it in the test environment, and hand the validated script to the user for production execution. ## Quick Start Use the db-query skill to check the status and del_flag of order 12345 in the prod environment.