postgresql-cli
Skill8 starsChanged 6 months agoApache-2.0View on GitHub
Perform PostgreSQL operations using the psql CLI. Use for inspecting schemas, running read-only queries, and troubleshooting databases across environments.
- Deletes or force-pushes
- Installs packages
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use the connection table and rules below when constructing all psql commands.
- Distinctive: line 12
Update the table below with your connection details before using this skill:
- Distinctive: line 19
If the target environment is unclear, ask the user before running any command.
- Very specific: line 23
If psql is not installed or no connection service is configured, inform the user that setup is required and ask them to complete the …
- Very specific: line 33
Always use service=<name> from ~/.pg_service.conf — never pass raw host/user/password on the command line, where they could leak into shell …
- Distinctive: line 85
NEVER target a connection service not listed in the configuration table above.
- Very specific: line 86
NEVER pass -h, -U, or a password directly on the command line — always use a service= connection string backed by ~/.pg_service.conf and …
- Very specific: line 87
NEVER print, display, or store the contents of .pgpass or any credential value.
- Very specific: line 88
NEVER run DELETE, DROP, TRUNCATE, GRANT, or REVOKE without explicit user instruction — these are destructive or security-sensitive.
- Very specific: line 89
Always run EXPLAIN on unfamiliar or complex queries before executing them against a large table, to catch missing indexes or full table …
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PostgreSQL CLI Skill
Use the connection table and rules below when constructing all psql commands.
Configuration
Update the table below with your connection details before using this skill:
| Environment | Connection Service Name | Credential File |
| Production | <your-prod-service> | ~/.postgresql/prod.pgpass |
| Staging / Non-Prod | <your-nonprod-service> | ~/.postgresql/staging.pgpass |
If the target environment is unclear, ask the user before running any command.
Prerequisites (one-time setup by user)
If psql is not installed or no connection service is configured, inform the user that setup is required and ask them to complete the following steps manually. Do not perform these steps yourself.
brew install libpq && brew link --force libpqConfigure ~/.pg_service.conf with a named [service] section per environment, and store credentials in a .pgpass file (hostname:port:database:username:password, chmod 600). Never share credential file contents with the assistant.
Command Format
Always use service=<name> from ~/.pg_service.conf — never pass raw host/user/password on the command line, where they could leak into shell history or process listings:
psql "service=<connection-service-name>" -c "<SQL>"Examples
# Non-Prod — list tables
psql "service=<your-nonprod-service>" -c "\dt"
# Non-Prod — describe a table
psql "service=<your-nonprod-service>" -c "\d <table_name>"Available Commands
Read-only (safe, no confirmation needed)
| Command | Description |
\l | List databases |
\dt [pattern] | List tables |
\d <table> | Describe a table's schema |
\dn | List schemas |
\du | List roles/users |
\di | List indexes |
SELECT ... | Any read-only query |
EXPLAIN <query> | Show a query plan without executing it |
\timing | Toggle query timing (informational) |
Mutating operations (confirm with user before running)
| Command | Description |
INSERT / UPDATE | Insert or update rows |
CREATE TABLE / CREATE INDEX | Create new schema objects |
ALTER TABLE | Modify an existing table's structure |
Never run — requires explicit human approval
| Command | Reason |
DELETE FROM ... (without a WHERE reviewed by the user) | Can irreversibly remove rows at scale |
DROP TABLE / DROP DATABASE / DROP SCHEMA | Irreversible destruction of data or structure |
TRUNCATE | Irreversibly wipes all rows from a table |
GRANT / REVOKE | Alters access control, security-sensitive |
| Any DDL/DML against the production service | A human must execute changes against production data |
Rules
- NEVER target a connection service not listed in the configuration table above. If a command references an unfamiliar service, stop and ask the user to confirm.
- NEVER pass
-h,-U, or a password directly on the command line — always use aservice=connection string backed by~/.pg_service.confand.pgpass, so credentials never appear in shell history. - NEVER print, display, or store the contents of
.pgpassor any credential value. - NEVER run
DELETE,DROP,TRUNCATE,GRANT, orREVOKEwithout explicit user instruction — these are destructive or security-sensitive. - Always run
EXPLAINon unfamiliar or complex queries before executing them against a large table, to catch missing indexes or full table scans. - For any
UPDATE/DELETE, always show the equivalentSELECT ... WHERE ...first and confirm the row count before proceeding.
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- chaunsin/agent-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository54 other files it gives its agents.
- alibabacloud-cliSkill
- ansible-cliSkill
- appdynamics-cliSkill
- argocd-cliSkill
- aws-cliSkill
- aws-cloudwatch-cliSkill
- azure-cliSkill
- bash-lintingSkill
- betterstack-cliSkill
- bitbucket-cliSkill
- chef-cliSkill
- code-reviewSkill
- commit-codeSkill
- create-dockerfileSkill
- create-terraform-helm-upgrade-planSkill
- datadog-cliSkill
- digitalocean-cliSkill
- dockerfile-lintingSkill
- dynatrace-cliSkill
- elasticsearch-cliSkill
- gcp-cliSkill
- github-cliSkill
- gitlab-cliSkill
- go-lintingSkill
- grafana-cliSkill
- grafana-loki-cliSkill
- graylog-cliSkill
- helm-cliSkill
- hetzner-cliSkill
- huaweicloud-cliSkill
- jaeger-cliSkill
- jenkins-cliSkill
- jira-and-confluence-cliSkill
- kibana-cliSkill
- kubernetes-cliSkill
- loggly-cliSkill
- maintenance-check-aws-eksSkill
- maintenance-create-ticket-on-jiraSkill
- ms-teams-cliSkill
- mysql-cliSkill
- newrelic-cliSkill
- oci-cliSkill
- packer-cliSkill
- papertrail-cliSkill
- prometheus-cliSkill
- python-lintingSkill
- rollbar-cliSkill
- salesforce-cliSkill
- sentry-cliSkill
- slack-cliSkill
- splunk-cliSkill
- terraform-cliSkill
- terraform-lintingSkill
- vault-cliSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

