Agent skill

Postgres Readonly Queries

by sickn33 in sickn33/agentic-awesome-skills

Execute safe read-only SQL queries against PostgreSQL databases with multi-connection support and defense-in-depth write protection.

Apache-2.0Auto-check passedDatabases

Install Postgres Readonly Queries

skills CLI
$ npx skills add sickn33/agentic-awesome-skills --skill postgres-readonly-queries -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install sickn33/agentic-awesome-skills postgres-readonly-queries --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/postgres-readonly-queries .claude/skills/postgres-readonly-queries && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
postgres-readonly-queries
GitHub stars
47k
Used in
1 other repo
Token cost
~1.2k tokens
SKILL.md length
399 words
Files
5 (incl. scripts)
Skills in repo
1,394
Repo updated
First seen
Licence
Apache-2.0

At a glance

Execute safe read-only SQL queries against PostgreSQL databases with multi-connection support and defense-in-depth write protection.

  • Works in 4 steps: Run --list to show available databases → Match user intent to database description → Run --tables or --schema to explore… → …
  • Tasks that involve Secure coding
  • SKILL.md covers When to Use, Requirements, Setup and Usage, plus 6 more sections
  • Runs Python scripts from its folder; calls python3 and pip

What it does

Postgres Readonly Queries is an agent skill from sickn33/agentic-awesome-skills. Execute safe read-only SQL queries against PostgreSQL databases with multi-connection support and defense-in-depth write protection.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including scripts (for example `README.md`, `connections.example.json` and `scripts/query.py`).

It sits in Databases, covering Secure coding and SQL. It works with PostgreSQL and SQL. The repository describes itself as: AAS Core is the local, agent-first control plane for complete catalog discovery, agent-owned selection, stack validation, and planning, backed by 2,400+ agentic skills. Includes… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Secure coding
  • Tasks that involve SQL

Example prompts

  • “/postgres-readonly-queries”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Run --list to show available databases
  2. Match user intent to database description
  3. Run --tables or --schema to explore structure
  4. Execute query with appropriate LIMIT

What it can do on your machine

Read from SKILL.md and the folder at commit 1e53ce2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Postgres Readonly Queries loads about 1.2k tokens when it runs. Until then it costs about 40 tokens; SKILL.md has 399 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~40
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from sickn33/agentic-awesome-skills at commit 1e53ce2, republished under its Apache-2.0 licence (© sickn33). 399 words, ~1,189 tokens.

Download SKILL.mdSave it as .claude/skills/postgres-readonly-queries/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
postgres-readonly-queries
description
Execute safe read-only SQL queries against PostgreSQL databases with multi-connection support and defense-in-depth write protection.
category
data
risk
safe
source
https://github.com/sanjay3290/ai-skills/tree/main/skills/postgres
source_repo
sanjay3290/ai-skills
source_type
community
date_added
2026-07-09
author
sanjay3290
tags
postgres, sql, database, read-only
tools
claude, cursor, gemini
license
Apache-2.0

PostgreSQL Read-Only Query Skill

When to Use

  • Use when querying PostgreSQL databases and access must stay strictly read-only
  • Use when exploring schemas, tables, and data across multiple configured connections
  • Use when you want defense-in-depth protection against accidental INSERT/UPDATE/DELETE or DDL

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:

bash
chmod 600 connections.json
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
FieldRequiredDescription
nameYesIdentifier for the database (case-insensitive)
descriptionYesWhat data this database contains (used for auto-selection)
hostYesDatabase hostname
portNoPort number (default: 5432)
databaseYesDatabase name
userYesUsername
passwordYesPassword
sslmodeNoSSL mode: disable, allow, prefer (default), require, verify-ca, verify-full

Usage

List configured databases
bash
python3 scripts/query.py --list
Query a database
bash
python3 scripts/query.py --db production --query "SELECT * FROM users LIMIT 10"
List tables
bash
python3 scripts/query.py --db production --tables
Show schema
bash
python3 scripts/query.py --db production --schema
Limit results
bash
python3 scripts/query.py --db production --query "SELECT * FROM orders" --limit 100

Database Selection

Match user intent to database description:

User asks aboutLook for description containing
users, accountsusers, accounts, customers
orders, salesorders, transactions, sales
analytics, metricsanalytics, metrics, reports
logs, eventslogs, events, audit

If unclear, run --list and ask user which database.

Safety Features

  • Read-only session: Connection uses PostgreSQL readonly=True mode (primary protection)
  • Query validation: Only SELECT, SHOW, EXPLAIN, WITH queries allowed
  • Single statement: Multiple statements per query rejected
  • SSL support: Configurable SSL mode for encrypted connections
  • Query timeout: 30-second statement timeout enforced
  • Memory protection: Max 10,000 rows per query to prevent OOM
  • Column width cap: 100 char max per column for readable output
  • Credential sanitization: Error messages don't leak passwords
Show full SKILL.md (145 more words)Show less

Troubleshooting

ErrorSolution
Config not foundCreate connections.json in skill directory
Authentication failedCheck username/password in config
Connection timeoutVerify host/port, check firewall/VPN
SSL errorTry "sslmode": "disable" for local databases
Permission warningRun chmod 600 connections.json

Exit Codes

  • 0: Success
  • 1: Error (config missing, auth failed, invalid query, database error)

Workflow

  1. Run --list to show available databases
  2. Match user intent to database description
  3. Run --tables or --schema to explore structure
  4. Execute query with appropriate LIMIT

Limitations

  • Read-only protections reduce accidental writes but cannot override database-server policy, triggers, extensions, or an over-privileged account. Use a database role with read-only permissions as the primary control.
  • Query results can contain personal, confidential, or regulated data. Confirm the intended database and avoid exporting or sharing results without explicit authorization.
  • The script is not a replacement for backups, auditing, access reviews, or production change controls.

© sickn33, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (scripts) in skills/postgres-readonly-queries of sickn33/agentic-awesome-skills.

  • SKILL.md
  • README.md
  • connections.example.json
  • requirements.txt
  • scripts/query.py

Open the folder on GitHubat commit 1e53ce2

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in sickn33/agentic-awesome-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Postgres Readonly Queries next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Postgres Readonly Queries compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Postgres Readonly Queries this skillsickn33/agentic-awesome-skills47k1 repos~1.2kAutomated safety check: PassApache-2.0
SQL Database Support for pRESTprest/prest4.6k—~1.6kAutomated safety check: PassMIT
Chdb SQLvemetric/vemetric3941 repos~1.2kAutomated safety check: PassApache-2.0
Schema Explorationtimescale/pg-aiguide1.9k—~1.1kAutomated safety check: PassApache-2.0
Mz BenchmarkMaterializeInc/materialize6.4k—~2.8kAutomated safety check: PassCustom licence
Dingtalk AitableDingTalk-Real-AI/dingtalk-workspace-cli3.2k—~5.4kAutomated safety check: PassApache-2.0

Similar skills

  • Guides classifying, gap-analyzing and scaffolding support for a new SQL database in pREST, from Postgres-compatible variants to entirely new dialects.

    4.6k GitHub stars~1.6k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Chdb SQL

    vemetric/vemetric

    A skill your agent uses when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse…

    394 GitHub starsUsed in 1 repo~1.2k tokens
    DatabasesAuto-check passed
  • Schema Exploration

    timescale/pg-aiguide

    Explore an existing PostgreSQL database before answering questions about its data or writing SQL.

    1.9k GitHub stars~1.1k tokensUpdated 5 days ago
    DatabasesAuto-check passed
  • Mz Benchmark

    MaterializeInc/materialize

    Add/modify/debug Materialize perf benchmark scenarios. An agent skill from MaterializeInc/materialize.

    6.4k GitHub stars~2.8k tokensUpdated today
    DatabasesAuto-check passed
  • Dingtalk Aitable

    DingTalk-Real-AI/dingtalk-workspace-cli

    钉钉 AI 表格(多维表)业务操作。Use when 用户需要操作 AI 表格/多维表/Base/Table、应用模式/App 页面/Widget、建表、查写记录、字段、记录评论、评论回复、访问密钥(API Key)、SQL/PostgreSQL/SELECT/JOIN、筛选、排序、公式、模板、批量导入 CSV 或 JSON、导出、仪表盘、图表、上传附件、数据源配置与同步、按任务 ID…

    3.2k GitHub stars~5.4k tokensUpdated 2 days ago
    DatabasesAuto-check passed
  • Sql2er

    ystemsrx/sql_to_ER

    A skill your agent uses when the user wants a Chen-model ER diagram from SQL CREATE TABLE statements or DBML, wants to rearrange or clean up an existing sql2er state, wants a skeleton-only overview…

    188 GitHub stars~1.1k tokensUpdated 6 days ago
    DatabasesAuto-check passed

More from sickn33/agentic-awesome-skills

All 1,394 skills in this repo
  • Liuguang Banlan UI

    sickn33/agentic-awesome-skills

    Implements an interface in one of two named color modes, iridescent white or colorful black, from a parameterized starter that reports measured color intensity.

    47k GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • User Thoughts Memory

    sickn33/agentic-awesome-skills

    Saves a user's project decisions, rules and preferences into a project-local mdbase so later sessions and other agents can recover the intent.

    47k GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Using LWC Memory and Graphs

    sickn33/agentic-awesome-skills

    Keeps project decisions, research and verified results available across coding-agent sessions through LWC memory, a document Wiki graph and a CodeGraph code index.

    47k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Find Complementary Founders

    sickn33/agentic-awesome-skills

    Guides an agent through assessing its own owner for cofounder fit, publishing an approved profile, and ranking complementary profiles other agents published for their owners.

    47k GitHub starsUsed in 1 repo~4.8k tokens
    Auto-check passed
  • Whatsapp Cloud API

    sickn33/agentic-awesome-skills

    Integracao com WhatsApp Business Cloud API (Meta). An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~4.5k tokens
    Auto-check passed
  • Cline Pilot

    sickn33/agentic-awesome-skills

    Acts as a proxy for the Cline CLI, dispatching coding tasks one at a time, monitoring runs by hard evidence, relaying decisions to you and learning per-project preferences.

    47k GitHub starsUsed in 1 repo~4.6k tokens
    Auto-check passed

Works with

Categories

Questions about Postgres Readonly Queries

What does Postgres Readonly Queries do?

Execute safe read-only SQL queries against PostgreSQL databases with multi-connection support and defense-in-depth write protection. Postgres Readonly Queries is an agent skill from sickn33/agentic-awesome-skills. Execute safe read-only SQL queries against PostgreSQL databases with multi-connection support and defense-in-depth write protection.

When should I use Postgres Readonly Queries?

Postgres Readonly Queries fits situations like: tasks that involve Secure coding; tasks that involve SQL.

How do I install Postgres Readonly Queries in Claude Code?

Run `npx skills add sickn33/agentic-awesome-skills --skill postgres-readonly-queries -a claude-code`. Or copy the skill folder (skills/postgres-readonly-queries in sickn33/agentic-awesome-skills) into .claude/skills/postgres-readonly-queries in your project. Claude Code loads it when a task matches its description.

How do I install Postgres Readonly Queries in Codex?

Run `npx skills add sickn33/agentic-awesome-skills --skill postgres-readonly-queries -a codex`. Or copy the skill folder (skills/postgres-readonly-queries in sickn33/agentic-awesome-skills) into .agents/skills/postgres-readonly-queries in your project. Codex loads it when a task matches its description.

Can I use Postgres Readonly Queries in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sickn33/agentic-awesome-skills --skill postgres-readonly-queries -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/postgres-readonly-queries, .gemini/skills/postgres-readonly-queries, .github/skills/postgres-readonly-queries and .opencode/skills/postgres-readonly-queries in your project.

What does Postgres Readonly Queries need to run?

Going by SKILL.md and its folder, Postgres Readonly Queries needs Python for the scripts in its folder and the command-line tools its instructions call (python3 and pip). Our summary lists: Python 3.

Does Postgres Readonly Queries access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Postgres Readonly Queries safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Postgres Readonly Queries use?

Postgres Readonly Queries is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Postgres Readonly Queries use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Postgres Readonly Queries?

Skills that share tags, products or a category with Postgres Readonly Queries: SQL Database Support for pREST (prest/prest, 4.6k stars), Chdb SQL (vemetric/vemetric, 394 stars), Schema Exploration (timescale/pg-aiguide, 1.9k stars) and Mz Benchmark (MaterializeInc/materialize, 6.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Postgres Readonly Queries?

sickn33 (a GitHub user) maintains it in sickn33/agentic-awesome-skills, which has 47,304 GitHub stars. The repository holds 1,394 skills in this directory. The repository was last updated on October 6, 2026.

Source: sickn33/agentic-awesome-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.