Home / leeyudok / doksam-skills · skills/db-expert/SKILL.md · GitHub

db-expert skillA

db-expert is agent-read markdown (skill) from leeyudok/doksam-skills: 관계형 스키마를 설계·검토하거나 인덱스·쿼리 튜닝·트랜잭션·마이그레이션을 다룰 때, 그리고 doksam pig 의 공유 PostgreSQL 클러스터를 운영할 때 사용한다. SQLite 고유 주제는 sqlite-expert 를 쓴다..

Indexed from public GitHub and served as immutable, content-addressed versions. Install it pinned to an exact SHA-256 with the mdr CLI, and every file is verified against the hash recorded here before it reaches your agent. The deterministic audit below grades the latest version, and the same file always earns the same grade.

What the file says

# db-expert

관계형 설계 일반 + PostgreSQL 운영이 대상이다. SQLite 파일을 직접 다루는 문제는
`sqlite-expert`, 애플리케이션 코드는 각 언어 스킬이 맡는다.

## 1. 스키마 설계 — 판단 기준

정규화는 목적이 아니라 **이상현상(anomaly)을 없애는 수단**이다. 3NF 를 기본으로 두고,
역정규화는 **측정된 병목**이 있을 때만, 그리고 **갱신 경로를 하나로 유지**할 수 있을 때만.

읽기 전에 스스로 답한다:

1. **이 테이블의 한 행은 무엇 하나인가** — 한 문장으로 안 되면 쪼갤 신호다.
2. **자연키인가 대리키인가** — 사업자번호·사번처럼 외부가 소유한 값은 바뀐다.
   대리키(식별자)를 두고 자연키에는 유니크 제약을 건다.
3. **이 컬럼이 NULL 일 수 있는 실제 상황은 무엇인가** — 답이 없으면 `NOT NULL`.
   NULL 은 "모름"이지 "없음"이나 "0"이 아니다.
4. **삭제하면 무엇이 같이 사라져야 하는가** — FK 의 `ON DELETE` 를 의도적으로 정한다.
   기본값에 맡기지 않는다.

### 제약은 애플리케이션이 아니라 DB 에 건다

`NOT NULL`·`UNIQUE`·`CHECK`·`FOREIGN KEY` 는 마지막 방어선이다. 애플리케이션 검증은
사용자 경험용이고, 데이터 무결성은 DB 가 보장한다. **버그·수동 작업·다른 클라이언트**는
애플리케이션을 우회한다.

### 시간과 통화

- 타임스탬프는 `timestamptz`. `timestamp`(무TZ)는 서버·클라이언트 타임존이 갈리는 순간 깨진다.
- 저장은 UTC, 표시에서 변환. 사용자 표기는 `YYYY-MM-DD HH:MM:SS.mmm` (KST 가정).
- 돈은 `numeric`. 부동소수점 금지.

### 소프트 삭제

`deleted_at` 을 도입하면 **모든 조회에 조건이 붙는다.** 빠뜨린 한 곳이 사고가 된다.
정말 필요하면 뷰나 RLS 로 강제하고, 아니면 이력 테이블로 옮기는 편이 낫다.

## 2. 인덱스

- **WHERE·JOIN·ORDER BY 에 쓰이는 컬럼**이 후보다. 전부 만들지 않는다 — 인덱스는
  쓰기 비용과 저장공간을 먹는다.
- 복합 인덱스는 **앞 컬럼부터** 쓰인다. 카디널리티가 높은 것 또는 등호 조건이 앞이다.
…

Read the whole file at its exact version.

How to install

Latest version
mdr add leeyudok/doksam-skills/db-expert@git:20260922.6ef3683
Exact content
mdr add leeyudok/doksam-skills/db-expert@sha256:38530aac04e815fe

Pin to a label to follow the author's releases, or to a sha256 to freeze the exact bytes forever. Either way the resolved hash is written to mdr.lock, and mdr install reproduces it on any machine.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_gtxdr5tmgtpvod3l.svg)](https://markdownregistry.com/a/art_gtxdr5tmgtpvod3l)

1 badge views in 30 days

Versions

versioncommittedcommitsizeaudit
git:20260922.6ef3683 latest2026-09-22 6ef3683 7,396 BA view · diff
git:20260803.36bddec2026-08-03 36bddec 7,407 BA view

Audit of the latest version

A  17 of 17 checks passed. Deterministic, no model, same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (7396 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

leeyudok/doksam-skills · 12 stars · license MIT · pushed 2026-09-23 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_gtxdr5tmgtpvod3l
GET https://markdownregistry.com/api/v1/resolve?ref=leeyudok/doksam-skills/db-expert
GET https://markdownregistry.com/api/v1/blob/38530aac04e815fe1c7ead22f5d158fe52c428f61b5fbffb5f6f7bf4dfe498a1

Your agent does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

More from leeyudok/doksam-skills

AGENTS.md agents
leeyudok/doksam-skills · AGENTS.md
git:20260823.e6897b6 · audit A · 12 stars
CLAUDE.md claude
leeyudok/doksam-skills · CLAUDE.md
git:20260725.cd734ff · audit B · 12 stars
doksam-ui skill
leeyudok/doksam-skills · skills/doksam-ui/SKILL.md · doksam 프로젝트의 UI 를 만들거나 수정할 때, 사용자가 "ui.doksam.com 참고" / "doksam-ui" / "독삼 표준 UI" 라고 말할 때, 프론트엔드 작업이 doksam 인프라를 대상으로 할…
git:20260802.0245e6a · audit B · 12 stars
finguard skill
leeyudok/doksam-skills · skills/finguard/SKILL.md · FinGuard CLI로 소스코드 취약점을 점검하고 심각도 기반 보안 게이트와 제한된 수정·재검증 루프를 수행할 때 사용한다. 일반 코드 품질 리뷰나 SCA·모의해킹은 범위 밖이다.
git:20260822.5b50a42 · audit A · 12 stars
frontend-build skill
leeyudok/doksam-skills · skills/frontend-build/SKILL.md · pnpm 워크스페이스와 Vite 빌드를 설정·정비하거나, 의존성·락파일·번들 크기·폐쇄망 self-host 문제를 다룰 때 사용한다. 프레임워크 자체의 코드 작성이 아니라 빌드/패키징 층이 대상이다.
git:20260803.36bddec · audit A · 12 stars
go-expert skill
leeyudok/doksam-skills · skills/go-expert/SKILL.md · Go 코드를 작성·리뷰·리팩터링하거나 에러 처리, 동시성, 테스트, net/http 서버, go:embed 를 다룰 때 사용한다. Go 1.22+ 기준.
git:20260803.36bddec · audit A · 12 stars
handoff skill
leeyudok/doksam-skills · skills/handoff/SKILL.md · 세션을 끊고 다음 세션에 넘긴다 — 협업 인프라(GitHub·GitLab·Forgejo·Jira·Plane·Slack)가 있으면 재개 가능한 상태를 그 트래커 이슈 본문으로 남기고 HANDOFF.md 에는 이슈…
git:20260923.9bb4288 · audit B · 12 stars
memory-factcheck skill
leeyudok/doksam-skills · skills/memory-factcheck/SKILL.md · 에이전트 영속 메모리를 실제 근거(코드·DB·이슈 트래커·파일시스템)와 대조해 낡은 기억을 교정하고 죽은 기억을 아카이브 후보로 보고하는 감사 스킬. 메모리가 ~30개 파일을 넘었을 때, 큰 스택/인프라…
git:20260801.f018038 · audit A · 12 stars
mobile-web-planner skill
leeyudok/doksam-skills · skills/mobile-web-planner/SKILL.md · 사용자가 모바일 웹/앱의 기획서 / 화면설계서 / 스토리보드(storyboard) / 와이어프레임(wireframe) / IA / 화면기획을 요청할 때 도메인 불문(쇼핑, 커뮤니티, 예약, 뉴스, O2O, ...)…
git:20260922.6ef3683 · audit B · 12 stars
nextjs-implementer skill
leeyudok/doksam-skills · skills/nextjs-implementer/SKILL.md · mobile-web-planner의 Storyboard와 Business Rules를 동작하는 웹앱으로 구현할 때 사용한다. 프론트는 Next.js App Router 또는 Vite + React SPA 중…
git:20260823.e6897b6 · audit B · 12 stars
react-expert skill
leeyudok/doksam-skills · skills/react-expert/SKILL.md · React 컴포넌트를 설계·구현·리팩터링하거나 상태 관리, useEffect 남용, 리렌더 성능, 접근성 문제를 다룰 때 사용한다. React 19 기준.
git:20260922.6ef3683 · audit A · 12 stars
sdlc-orchestrator skill
leeyudok/doksam-skills · skills/sdlc-orchestrator/SKILL.md · 사용자가 "홈페이지 만들어줘" 등 단일 요청으로 서비스 전체 제작을 원할 때 기획(mobile-web-planner), 구현(nextjs-implementer), 보안(finguard)을 순차적으로 위임하고…
git:20260822.a48271f · audit A · 12 stars

Every file in leeyudok/doksam-skills

Browse by kind, by grade A, or by owner.