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.
npx skills add LeeYudok/agents-scaffold --skill yd-pg-expertgit clone --depth 1 https://github.com/LeeYudok/agents-scaffoldWrote 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.
[](https://agentmods.dev/skills/leeyudok/agents-scaffold/yd-pg-expert)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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.
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 |
없음. 대신 잠금을 쥔 채 전체를 스캔한다 |
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.
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.
- today First seen · 152 lines · 87 tokens per session scan A 0cc92044b047
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.
Other skills, from other repositories
memstack-security-rls-guardian
Use this skill when creating or altering database tables in Supabase or PostgreSQL projects. Triggers include: CREATE TABLE, ALTER TABLE, migration files, 'RLS', 'row level security', 'new table', 'database schema'. Enforces Row Level Security policies on every table to prevent unauthorized data access. Do NOT use for…
kysely
Guidelines for developing with Kysely, a type-safe TypeScript SQL query builder with autocompletion support.
postgresql-best-practices
PostgreSQL development best practices for schema design, query optimization, and database administration.
database-expert
Advanced database design and administration for PostgreSQL, MongoDB, and Redis. Use when designing schemas, optimizing queries, managing database performance, or implementing data patterns.
agent-database-expert
Specialist subagent: Expert database architect and engineer for PostgreSQL, MongoDB, Redis, and all major databases. Use when designing schemas, optimizing queries, planning migrations, implementing caching, or troubleshooting database performance.
dev-supabase
Backend development with Supabase. Trigger when the user wants to configure auth, the database, or Supabase storage.