pgsql-guide-skill

pgsql-guide-skill is a skill for Claude Code, Codex from jiushiwon/wg-skills. It costs 118 tokens per session (1,852 once invoked), scanned A, original, Apache-2.0.

A learning and design guide for PostgreSQL, a relational database that stores structured data in tables. It covers setup, table design, indexes, JSON, arrays, transactions, replication, and choosing suitable uses.

In plain words
What is it for?
Use it to learn PostgreSQL, design tables and indexes, store JSON or arrays, improve slow queries, and plan transactions or read replicas.
Why use it?
It helps developers understand PostgreSQL and make database decisions before adding it to a project. It focuses on the database itself rather than a particular application framework.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to learn PostgreSQL, design tables and indexes, store JSON or arrays, improve slow queries, and plan transactions or read replicas.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jiushiwon/wg-skills/pgsql-guide-skill
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.

Any agent
npx skills add jiushiwon/wg-skills --skill pgsql-guide-skill
Clone the repo
git clone --depth 1 https://github.com/jiushiwon/wg-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 pgsql-guide-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/jiushiwon/wg-skills/pgsql-guide-skill/github.svg)](https://agentmods.dev/skills/jiushiwon/wg-skills/pgsql-guide-skill)
Your own site
<a href="https://agentmods.dev/skills/jiushiwon/wg-skills/pgsql-guide-skill"><img src="https://agentmods.dev/badge/skills/jiushiwon/wg-skills/pgsql-guide-skill/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pgsql-guide-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/jiushiwon/wg-skills/pgsql-guide-skill"><img src="https://agentmods.dev/badge/skills/jiushiwon/wg-skills/pgsql-guide-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 118 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,852 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00118 $0.01852
Opus 5.5 $0.00047 $0.00741
Sonnet 5.5 $0.00024 $0.00370
Haiku 4.5 $0.00012 $0.00185

Measured 2mo ago against content hash fd64f5be0b9a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pgsql-guide-skill 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 2mo ago.

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.

database/pgsql-guide-skill/SKILL.md · 288 lines

How it starts

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

PostgreSQL Module Skill

面向已有后端项目的开发者,快速集成 PostgreSQL 能力。

能力清单

能力 说明
连接配置 JDBC/连接池/环境变量配置
表结构设计 DDL 建表/字段类型/约束
ORM 映射 实体类/Repository/Service
JSON/JSONB JSON 文档存储与查询
数组类型 PostgreSQL 原生数组支持
索引优化 索引设计/慢查询优化
事务处理 声明式/编程式事务
主从复制 读写分离/流复制

触发场景

用户说"帮我加 PostgreSQL"或"集成 PostgreSQL"时触发。

核心配置

Java (Spring Boot)

# application.yml
spring:
  datasource:
    url: jdbc:postgresql://${PG_HOST:localhost}:${PG_PORT:5432}/${PG_DATABASE:myapp}
    username: ${PG_USER:postgres}
    password: ${PG_PASSWORD:}
    driver-class-name: org.postgresql.Driver
    hikari:
      maximum-pool-size: 10
      minimum-idle: 5
      connection-timeout: 30000

Python (FastAPI)

# config.py
from pydantic_settings import BaseSettings

class Settings(BaseSettings):
    pg_host: str = "localhost"
    pg_port: int = 5432
    pg_user: str = "postgres"
    pg_password: str = ""
    pg_database: str = "myapp"

# database.py
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

engine = create_engine(
    f"postgresql+psycopg2://{user}:{password}@{host}:{port}/{database}",
    pool_size=10,
    max_overflow=20,
    pool_pre_ping=True
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)

Go (Gin + GORM)

// config/config.go
package config

import (
    "fmt"
    "os"
)

type Config struct {
    PGHost     string
    PGPort     string
    PGUser     string
    PGPassword string
    PGDatabase string
}

func Load() *Config {
    return &Config{
        PGHost:     getEnv("PG_HOST", "localhost"),
        PGPort:     getEnv("PG_PORT", "5432"),
        PGUser:     getEnv("PG_USER", "postgres"),
        PGPassword: getEnv("PG_PASSWORD", ""),
        PGDatabase: getEnv("PG_DATABASE", "myapp"),
    }
}

func (c *Config) DSN() string {
    return fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%s sslmode=disable TimeZone=Asia/Shanghai",
        c.PGHost, c.PGUser, c.PGPassword, c.PGDatabase, c.PGPort)
}

func getEnv(key, defaultVal string) string {
    if val := os.Getenv(key); val != "" {
        return val
    }
    return defaultVal
}

Read the full file on GitHub · 288 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2mo ago First seen · 288 lines · 118 tokens per session scan A fd64f5be0b9a

Subscribe to this mod's changes

pgsql-guide-skill is a skill published in the GitHub repository jiushiwon/wg-skills (154 stars, last pushed 7d ago), licensed Apache-2.0. It adds 118 tokens to every session and 1,852 once invoked, about $0.0005 per session on Opus 5.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-09-30.

Related

pgsql-guide-skill compared with skills from other repositories

pgsql-guide-skill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pgsql-guide-skilljiushiwon/wg-skillsSkill1547d agoApache-2.0A118Claude Code, Codex
postgresql-table-designwshobson/agentsSkill43kyesterdayMITA37Claude Code
db-repairgarrytan/gbrainSkill34ktodayMITA96Claude Code
dsqlawslabs/agent-pluginsSkill955todayApache-2.0A247Claude Code
volcengine-rds-postgresqlbytedance/agentkit-samplesSkill496todayApache-2.0A63Claude Code, Codex
analyzing-insights-across-teamsPostHog/posthog-fossSkill734todayMITA115Claude Code, Codex
postgresdbericrisco/rsc-harnessSkill6916d agoMITA91Claude Code, Codex