본문으로 건너뛰기
cccskills
무료GitHub에 공개

database

Schema design, migrations y data operations para Postgres + Prisma/GORM. Setup, indexing, queries, seeds, backups.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SebastianLuser/claude-code-arcane스타 3(GitHub 3 + cccskills 0)
연동 도구PostgreSQL

실행 점수 미검증

설치 방법 보기

포함된 파일(3)

  • SKILL.md4.2 KB
  • references/anti-patterns.md1.4 KB
  • references/query-patterns.md1.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

database — Schema, Migrations & Data Operations

Route

Intención del usuarioModoSecciones relevantes
"diseñar schema", "nueva tabla", "relación", "índice"SCHEMA→ 2. Schema Design, 3. Migrations
"query lenta", "EXPLAIN", "N+1", "optimizar"QUERY→ 5. Query Patterns
"migration", "ALTER TABLE", "expand-contract", "rollback"MIGRATION→ 3. Migrations
"sin datos", "seed", "fixtures", "datos demo"SEED→ 7. Seed Data
"conexiones", "pool", "timeout", "PgBouncer"CONNECTIONS→ 4. Connection Management
"backup", "restore", "recovery", "PITR"OPS→ 8. Backup & Recovery

Regla: si el argumento es full, ejecutar Checklist completo. Si la intención es ambigua, preguntar.


Stack: Fastify + Prisma + PostgreSQL + Zod + TypeScript

1. ORM Choice

Default Prisma (type-safe, declarative schema, built-in migrations). Consider Drizzle for SQL-like type-safe syntax, node-pg-migrate + pg for raw SQL control, golang-migrate for Go codebases. Never mix migration tools in one repo.

2. Schema Design

Naming: snake_case tables/columns, PascalCase Prisma models, singular names.

CriteriaRule
PKsUUID or CUID; avoid auto-increment if distributed
FKsAlways explicit, always indexed on child side
Timestampscreated_at + updated_at on every table
Soft deletedeleted_at NULL + partial index on non-nulls
EnumsPrisma enum for fixed sets; string if values change often
RelationsExplicit join tables for M:N; no circular FK deps
CompositesEquality first, range second, ORDER BY last
NullabilityNOT NULL by default; nullable only for meaningful absence

Index types: B-tree (95% — equality/range/sort), GIN (arrays/jsonb/tsvector), GiST (geo/ranges), BRIN (huge ordered tables). Use partial indexes to reduce size, covering indexes (INCLUDE) to avoid heap access, expression indexes when WHERE has functions.

3. Migrations

Forward-only default. .down.sql for reversible DDL; document one-way explicitly. Name: YYYYMMDDHHMMSS_verb_desc. Never edit merged migrations.

Rules: One change per migration. DDL and data backfills always separate (mixing = long locks). Set lock_timeout + statement_timeout on ALTER TABLE. CREATE INDEX CONCURRENTLY on live tables (outside transaction). ADD COLUMN with non-volatile DEFAULT instant on PG 11+. Adding NOT NULL: CHECK NOT VALID then VALIDATE in separate migration.

Zero-downtime expand-contract: Expand (nullable col/new table/concurrent idx, release N) -> Backfill (async idempotent batched ~10k, N) -> Dual-write (N+1) -> Migrate reads (N+2) -> Contract DROP (N+3, after 1+ stable release). CI: up -> down -> up must pass.

4. Connection Management

Pool size: max(2, cores*2) per instance, never exceed total max_connections. Connection timeout 5s, statement timeout 30s. Health check via SELECT 1 in health endpoint. PgBouncer transaction-mode for serverless/high-connection loads.

5. Query Patterns, Seed Data & Backup

→ Read references/query-patterns.md for: N+1 fixes, pagination, bulk ops, seed strategies, backup/recovery.

Anti-patterns

→ Read references/anti-patterns.md for the full 16-item checklist.

Checklist

  • Docker Compose + .env.example with DATABASE_URL
  • One change per migration, DDL/data separated, expand-contract for breaking changes
  • lock_timeout + statement_timeout on ALTER; CONCURRENTLY for prod indexes
  • CI: up -> down -> up passes
  • FK children indexed; composite order: equality -> range -> ORDER BY
  • EXPLAIN ANALYZE before/after query changes; N+1 eliminated; cursor pagination
  • Seeds idempotent, prod-guarded, no real PII, reference data separated
  • Backup restores tested; RTO/RPO documented

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Plan, design, and implement A/B tests and experiments with statistical rigor. Covers hypothesis frameworks, sample sizing, metrics, and result analysis.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SebastianLuser/claude-code-arcane32026년 10월 27일 업데이트

Web/mobile accessibility decision guide: WCAG 2.2 AA, ARIA, keyboard nav, focus management, contrast, testing. Use for: a11y, accessibility, wcag, aria, screen reader, keyboard, contrast.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SebastianLuser/claude-code-arcane32026년 10월 27일 업데이트

Generate, iterate, and scale ad creative for paid advertising across Google, Meta, LinkedIn, and X. Covers platform specs, creative frameworks, and quality validation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SebastianLuser/claude-code-arcane32026년 10월 27일 업데이트

Musica interactiva para juegos: layering vertical, re-secuenciacion horizontal, stingers, reglas de transicion con sync points, y mapeo de estados de gameplay a musica. Usar para: musica adaptativa, sistema de musica dinamica, transiciones musicales, combat music.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SebastianLuser/claude-code-arcane32026년 10월 27일 업데이트

Design multi-agent systems, create agent architectures, define communication patterns, and build autonomous agent workflows with structured evaluation frameworks.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SebastianLuser/claude-code-arcane32026년 10월 27일 업데이트

Inter-agent communication protocol for C-suite agent teams. Defines invocation syntax, loop prevention, isolation rules, response formats, and quality loops.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SebastianLuser/claude-code-arcane32026년 10월 27일 업데이트

SebastianLuser의 스킬 모두 보기

이 스킬의 문제 신고