This is a read-only PostgreSQL client that lets Claude query your databases safely. You set up connections in a JSON config file with descriptions like "user accounts and profiles" or "sales transactions," and Claude can auto-select the right database based on context. The security model is solid: connections are opened in read-only mode, query validation blocks anything that's not a SELECT, and there's a 30-second timeout plus 10,000 row limit to prevent runaway queries. The schema exploration commands (list tables, show structure) are genuinely useful for letting Claude understand your data model before writing queries. If you're doing data analysis or exploration with an AI assistant, this handles the boring connection plumbing while keeping your data safe from accidental writes.

skills.sh installs
646
GitHub stars
454
last updated
Aug 21, 2026

Install

$ npx -y skills add sanjay3290/ai-skills --skill postgres --agent claude-code

Installs into .claude/skills of the current project.

Files

PostgreSQL Read-Only Query Skill

Execute safe, read-only queries against configured PostgreSQL databases.

Requirements

  • Python 3.8+
  • psycopg2-binary: pip install -r requirements.txt

Setup

Create connections.json in the skill directory or ~/.config/claude/postgres-connections.json.

Security: Set file permissions to 600 since it contains credentials:

chmod 600 connections.json
{
  "databases": [
    {
      "name": "production",
      "description": "Main app database - users, orders, transactions",
      "host": "db.example.com",
      "port": 5432,
      "database": "app_prod",
      "user": "readonly_user",
      "password": "your-password",
      "sslmode": "require"
    }
  ]
}

Config Fields

Sponsors

Details

Repository
github.com/sanjay3290/ai-skills
Categories
Backend & APIs, AI & Agent Building, Databases
License
Apache-2.0
First seen
Jun 3, 2026

More from sanjay3290/ai-skills

All 20
1alirezarezvani avatarsaas-scaffolderalirezarezvani/claude-skillsGenerates complete, production-ready SaaS project boilerplate including authentication, database schemas, billing integration, API routes, and a working dashboa641skills.sh installs
2fugazi avatarplaywright-e2e-testingfugazi/test-automation-skills-agentsAuthor and maintain versioned Playwright (@playwright/test) TypeScript UI specs for browser user flows. Use when asked to create, run, debug, or refactor E2E te634skills.sh installs
3intellectronica avatartavilyintellectronica/agent-skillsUse this skill for web search, extraction, mapping, crawling, and research via Tavily’s REST API when web searches are needed and no built-in tool is available,631skills.sh installs
4astronomer avatarairflow-pluginsastronomer/agentsBuilds Airflow 3.1+ plugins that embed FastAPI apps, custom UI pages, React components, middleware, macros, and operator links directly into the Airflow UI. Use622skills.sh installs
5patricio0312rev avatarbruno-collection-generatorpatricio0312rev/skillsGenerates Bruno collection files (.bru) from Express, Next.js, Fastify, or other API routes. Creates organized collections with environments, authentication, an617skills.sh installs
6jezweb avatarhono-routingjezweb/claude-skillsBuild type-safe APIs with Hono for Cloudflare Workers, Deno, Bun, Node.js. Routing, middleware, validation (Zod/Valibot), RPC, streaming (SSE), WebSocket, secur615skills.sh installs