PostgreSQL intelligence skill for Claude Code, Codex, Cursor, Windsurf, and local LLM agents
SaferSkills independently audited postgres-intelligence (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
PostgreSQL intelligence for LLM coding agents. It gives Claude Code, Codex, and other local agents a credential-safe way to discover PostgreSQL schemas, run read-first SQL, inspect query errors, and reason about performance.
The core rule is simple: the agent should not open or print .env directly. Scripts load credentials at runtime, and the agent only sees safe summaries, query results, and metadata.
.env using DB1_...DB10_....information_schema and pg_catalog.SELECT, WITH, SHOW, and EXPLAIN.EXPLAIN, and maintenance.cd postgres-intelligence
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -r requirements.txt
cp .env.example .env
python scripts/config.py
python scripts/db_connector.py
python scripts/schema_extractor.pyUse .env.example as the public template. Keep real .env, .venv, and schema_metadata.json out of git.
DB1_HOST=localhost
DB1_PORT=5432
DB1_USER=your_username
DB1_PASSWORD=your_password
DB1_DATABASE=your_database
DB1_NAME=primary
DB1_SSLMODE=prefer
DB1_CONNECT_TIMEOUT=10
DB1_APPLICATION_NAME=postgres-intelligenceUse DB*_NAME as the connection key for --db.
# Validate loaded config without printing secrets
python scripts/config.py
# Test all configured connections
python scripts/db_connector.py
# Extract schema metadata
python scripts/schema_extractor.py
# Run a read-only query against the default connection
python scripts/query_executor.py "SELECT current_database(), current_schema();"
# Select a named connection
python scripts/query_executor.py --db analytics "SELECT count(*) FROM public.events;"
# Agent-friendly JSON output
python scripts/query_executor.py --json-only "SELECT now();"
# Writes require explicit user approval
python scripts/query_executor.py --allow-write "UPDATE table_name SET flag = true WHERE id = 1;"
# DDL requires explicit user approval
python scripts/query_executor.py --allow-ddl "CREATE INDEX CONCURRENTLY idx_name ON table_name (col);".env exists, but do not open or print it.schema_metadata.json before generating SQL.information_schema or pg_catalog first.SELECT *; add LIMIT for exploratory reads.sqlstate and suggestions to refine the query, with a maximum of three attempts..env.UPDATE and DELETE without WHERE are blocked.--allow-ddl.--allow-write.EXPLAIN (ANALYZE, BUFFERS) for performance work.CREATE INDEX CONCURRENTLY for large production tables when appropriate.ANALYZE after bulk data changes.Read references/postgres_best_practices.md only when deeper PostgreSQL-specific guidance is needed.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.