yd-pg-expert

yd-pg-expert is a skill for Claude Code from LeeYudok/agents-scaffold. It costs 87 tokens per session (2,870 once invoked), scanned A, original, MIT.

A PostgreSQL guide for database behavior and shared-cluster operations. PostgreSQL is a relational database system, and the guide covers timestamps, exact numeric values, query plans, locks, concurrent indexes, vacuuming, and serialization retries.

In plain words
What is it for?
Use it when writing or reviewing PostgreSQL queries, checking execution plans, changing shared tables, creating indexes without blocking users, or operating a PostgreSQL cluster.
Why use it?
PostgreSQL has details that can silently produce wrong times or money values, slow queries, blocked schema changes, or failed concurrent transactions.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

Good fit Use it when writing or reviewing PostgreSQL queries, checking execution plans, changing shared tables, creating indexes without blocking users, or operating a PostgreSQL cluster.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leeyudok/agents-scaffold/yd-pg-expert
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 LeeYudok/agents-scaffold --skill yd-pg-expert
Clone the repo
git clone --depth 1 https://github.com/LeeYudok/agents-scaffold

Made for: Claude Code.

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 yd-pg-expert

README.md
[![agentmods](https://agentmods.dev/badge/skills/leeyudok/agents-scaffold/yd-pg-expert/github.svg)](https://agentmods.dev/skills/leeyudok/agents-scaffold/yd-pg-expert)
Your own site
<a href="https://agentmods.dev/skills/leeyudok/agents-scaffold/yd-pg-expert"><img src="https://agentmods.dev/badge/skills/leeyudok/agents-scaffold/yd-pg-expert/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 yd-pg-expert

Your own site · 80×15
<a href="https://agentmods.dev/skills/leeyudok/agents-scaffold/yd-pg-expert"><img src="https://agentmods.dev/badge/skills/leeyudok/agents-scaffold/yd-pg-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,870 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.00087 $0.02870
Opus 5.5 $0.00035 $0.01148
Sonnet 5.5 $0.00017 $0.00574
Haiku 4.5 $0.00009 $0.00287

Measured today against content hash 0cc92044b047, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

yd-pg-expert 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 today.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/verify_pg_claims.py, tests/test_pg_claims.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.

.claude/skills/yd-pg-expert/SKILL.md · 152 lines

How it starts

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

yd-pg-expert

PostgreSQL 엔진 고유 동작과 공유 클러스터 운영이 대상이다. 엔진과 무관한 설계(정규화·키·NULL·제약·쿼리 원칙·트랜잭션 경계·마이그레이션 단계)는 yd-db-expert, SQLite 파일 문제는 yd-sqlite-expert 가 맡는다. 여기서는 그 원칙을 반복하지 않는다.

엔진 동작에 관한 단언은 scripts/verify_pg_claims.py 가 일회용 서버에서 재현한다. 아래 관찰값은 PostgreSQL 17.11 에서 얻었다 (2026-10-04 실측). 버전을 올리면 다시 돌린다.

1. 타입

  • 타임스탬프는 timestamptz. timestamp 는 입력에 붙은 오프셋을 오류 없이 버린다. '2026-01-01 09:00:00+09' 를 넣으면 09:00:00 이 그대로 남아 UTC 로 읽을 때 9시간 어긋난다. timestamptz 는 같은 순간(00:00:00+00)을 유지한다.
  • 저장은 UTC, 표시에서 변환한다. 사용자 표기는 YYYY-MM-DD HH:MM:SS.mmm (KST 가정).
  • 돈은 numeric. float8 은 0.1 + 0.2 = 0.3 이 거짓이고, 0.1 을 열 번 더하면 0.9999999999999999 다. numeric 은 둘 다 정확하다.
  • UNIQUE 는 별도 옵션이 없으면 NULL 을 여러 개 허용한다. NULL 도 하나만 허용하려면 UNIQUE NULLS NOT DISTINCT (PostgreSQL 15 부터)를 쓴다.

2. 인덱스와 실행계획

  • FK 컬럼에는 인덱스가 자동으로 생기지 않는다. PK·UNIQUE 만 생긴다. 부모 행을 지우거나 키를 바꿀 때 자식 테이블을 풀스캔하므로 FK 인덱스는 직접 만든다.
  • 확인은 추측이 아니라 EXPLAIN (ANALYZE, BUFFERS) <쿼리> 로 한다.
  • EXPLAIN ANALYZE 는 문을 실제로 실행한다. DELETE·UPDATE 를 분석하면 행이 정말 지워진다. 쓰기 문은 BEGIN; EXPLAIN ANALYZE ...; ROLLBACK; 으로 감싼다.
  • 작은 테이블의 Seq Scan 은 인덱스 누락이 아니다. 20행 테이블은 PK 가 있어도 플래너가 일부러 순차 스캔을 고른다. 원인을 찾을 대상은 큰 테이블의 Seq Scan 이다.
  • 함수를 씌운 조건(WHERE lower(name) = ...)은 name 인덱스를 못 탄다. CREATE INDEX ... ON t (lower(name)) 표현식 인덱스를 만든다.
  • C 가 아닌 콜레이션 컬럼의 일반 인덱스는 LIKE 'abc%' 에 쓰이지 않는다. 공식 postgres 컨테이너 이미지의 기본 콜레이션은 en_US.utf8 이다. 접두 검색이 필요하면 text_pattern_ops 인덱스를 따로 만든다.
  • 부분 인덱스(WHERE status = 'pending')는 조회 조건이 인덱스 조건을 함의할 때만 쓰인다. status = 'done' 조회에는 쓰이지 않는다.

3. 잠금과 온라인 스키마 변경

모든 ALTER TABLE 은 짧게라도 ACCESS EXCLUSIVE 잠금을 잡는다. 관건은 두 가지다 — 테이블을 다시 쓰는가(잠금이 데이터 크기에 비례해 길어진다), 잠금을 기다리는 동안 무엇이 막히는가.

변경 테이블 재작성
ADD COLUMN (기본값 없음, NULL 허용) 없음
ADD COLUMN ... NOT NULL DEFAULT 0 (상수 기본값) 없음 (PostgreSQL 11 부터)
ADD COLUMN ... DEFAULT clock_timestamp() (volatile 기본값) 있음
ALTER COLUMN ... TYPE bigint (int 에서) 있음
varchar(10) → varchar(20), varchar → text 없음
ALTER COLUMN ... SET NOT NULL 없음. 대신 잠금을 쥔 채 전체를 스캔한다

Read the full file on GitHub · 152 lines

Files

What ships with it

3 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. today First seen · 152 lines · 87 tokens per session scan A 0cc92044b047

Subscribe to this mod's changes

yd-pg-expert is a skill published in the GitHub repository LeeYudok/agents-scaffold (36 stars, last pushed today), licensed MIT. It adds 87 tokens to every session and 2,870 once invoked, about $0.0003 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-10-25.