postgres

postgres is a skill for Claude Code, Codex from digitalocean-labs/do-app-platform-skills. It costs 42 tokens per session (1,115 once invoked), scanned A, original, MIT.

A setup guide for DigitalOcean Managed Postgres, a hosted PostgreSQL database service used by applications. It covers application connections, separate schemas, users, permissions, and App Platform configuration.

In plain words
What is it for?
Use it to create databases and users, grant permissions, connect an App Platform service, isolate tenants with schemas, and troubleshoot access.
Why use it?
It helps prevent connection failures and keeps database access separated and properly configured.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/digitalocean-labs/do-app-platform-skills/postgres
Any agent
npx skills add digitalocean-labs/do-app-platform-skills --skill postgres
Clone the repo
git clone --depth 1 https://github.com/digitalocean-labs/do-app-platform-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for postgres

README.md
[![agentmods](https://agentmods.dev/badge/skills/digitalocean-labs/do-app-platform-skills/postgres.svg)](https://agentmods.dev/skills/digitalocean-labs/do-app-platform-skills/postgres)
Your own site
<a href="https://agentmods.dev/skills/digitalocean-labs/do-app-platform-skills/postgres"><img src="https://agentmods.dev/badge/skills/digitalocean-labs/do-app-platform-skills/postgres.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,115 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00042 $0.01115
Opus 5 $0.00021 $0.00558
Sonnet 5 $0.00008 $0.00223
Haiku 4.5 $0.00004 $0.00112

Measured 5d ago against content hash f6c8950e0e47, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

postgres scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

The scan reads SKILL.md. This mod also ships 11 executable files (scripts/add_client.py, scripts/cleanup_client.py, scripts/create_schema_user.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/postgres/SKILL.md · 143 lines

How it starts

The opening of the file, as written. The whole thing — 143 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Postgres Skill

Configure DigitalOcean Managed Postgres databases with proper security isolation and production-ready defaults.

Quick Decision

Need multiple isolated schemas in one database?
├── YES → Path B (Schema Isolation)
└── NO  → Path A (Bindable Variables) ✅ RECOMMENDED

Use when: Single app per database, standard CRUD applications.

Quick Start

# 1. Create cluster + user via doctl (DO stores password internally)
doctl databases create my-app-db --engine pg --region nyc3 --size db-s-1vcpu-2gb
CLUSTER_ID=$(doctl databases list --format ID,Name --no-header | grep my-app-db | awk '{print $1}')
doctl databases db create $CLUSTER_ID myappdb
doctl databases user create $CLUSTER_ID myappuser

# 2. Grant permissions (REQUIRED - users have no access by default!)
# Run: scripts/grant_permissions.sql as doadmin

# 3. Reference in app spec
# .do/app.yaml
databases:
  - name: db
    engine: PG
    production: true
    cluster_name: my-app-db
    db_name: myappdb
    db_user: myappuser

services:
  - name: api
    envs:
      - key: DATABASE_URL
        scope: RUN_TIME
        value: ${db.DATABASE_URL}

Full guide: See path-a-bindable-vars.md


Path B: Schema Isolation

Use when: Multi-tenant SaaS, multiple apps sharing one cluster, schema-level isolation needed.

Quick Start

# Hands-free setup (requires gh CLI)
./scripts/secure_setup.sh \
  --admin-url "$ADMIN_URL" \
  --app-name myapp \
  --schema myapp \
  --repo owner/repo

Password flows directly to GitHub Secrets — never displayed.

Full guide: See path-b-schema-isolation.md


Available Bindable Variables

Variable Example
${db.DATABASE_URL} postgresql://user:pass@host:25060/db?sslmode=require
${db.HOSTNAME} my-db-do-user-123.db.ondigitalocean.com
${db.PORT} 25060
${db.USERNAME} myappuser
${db.PASSWORD} (auto-populated)
${db.DATABASE} myappdb
${db.CA_CERT} (certificate content)

Read the full file on GitHub · 143 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 143 lines · 42 tokens per session scan A f6c8950e0e47

Subscribe to this mod's changes

postgres is a skill published in the GitHub repository digitalocean-labs/do-app-platform-skills (36 stars, last pushed 6d ago), licensed MIT. It adds 42 tokens to every session and 1,115 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

digitalocean

Use when deploying or operating a workload on DigitalOcean — Droplet vs App Platform vs Functions, doctl, app spec YAML, Managed Postgres/MySQL/Valkey on the VPC, S3-compatible Spaces + CDN. NOT host-agnostic CI/CD or rollback strategy (that is deployment), NOT a bare Hetzner VPS (that is hetzner), NOT another managed…

ericrisco/rsc-harness · 96 tokens

cloud-sql-postgres-replication

Use these skills when you need to monitor replication health, manage sync states between nodes, and audit database roles and security settings to ensure environment integrity.

tmolavi/mcp-agent-skills-hub · 38 tokens

deploio-provision

Provisions and connects managed backing services to Deploio apps — PostgreSQL, MySQL, Redis-compatible KVS, OpenSearch, and S3-compatible object storage. This skill should be triggered when the user needs to add a database, cache, or storage service: "add postgres to Deploio", "provision MySQL", "need a database on…

renuo/deploio-claude-plugin · 174 tokens

cloud-sql-postgres-admin

Use these skills when you need to provision new Cloud SQL instances, create databases and users, clone existing environments, and monitor the progress of long-running operations.

tmolavi/mcp-agent-skills-hub · 38 tokens

cloud-sql-postgres-data

Use these skills when you need to explore the database structure, discover schema objects like views or stored procedures, and execute custom SQL queries to interact with your data.

tmolavi/mcp-agent-skills-hub · 39 tokens

cloud-sql-postgres-lifecycle

Use these skills when you need to manage the lifecycle of your instances, including performing backups and restores, checking major version upgrade compatibility, and monitoring overall instance status.

tmolavi/mcp-agent-skills-hub · 40 tokens