tsq-database

tsq-database is a skill for Claude Code, Codex from sonature-lab/timsquad. It costs 72 tokens per session (670 once invoked), scanned A, original, MIT.

A methodology for designing and operating databases, including deciding when to split or duplicate data, improving queries, and changing schemas safely.

In plain words
What is it for?
Use it for schema design, normalization decisions, query analysis, safe migrations, rollback scripts, indexing, Supabase patterns, and database changes.
Why use it?
It helps balance data consistency and read speed while reducing the risk of migrations that break existing code or lose data.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/sonature-lab/timsquad/tsq-database
Any agent
npx skills add sonature-lab/timsquad --skill tsq-database
Clone the repo
git clone --depth 1 https://github.com/sonature-lab/timsquad

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 tsq-database

README.md
[![agentmods](https://agentmods.dev/badge/skills/sonature-lab/timsquad/tsq-database.svg)](https://agentmods.dev/skills/sonature-lab/timsquad/tsq-database)
Your own site
<a href="https://agentmods.dev/skills/sonature-lab/timsquad/tsq-database"><img src="https://agentmods.dev/badge/skills/sonature-lab/timsquad/tsq-database.svg" alt="Measured on agentmods" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 670 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00072 $0.00670
Opus 5 $0.00036 $0.00335
Sonnet 5 $0.00014 $0.00134
Haiku 4.5 $0.00007 $0.00067

Measured 5d ago against content hash d0f8fd0e93ca, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tsq-database 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 5d 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.

templates/base/skills/tsq-database/SKILL.md · 85 lines

What it actually says

Database Methodology

Resources

Priority Type Resource Description
HIGH rule supabase-patterns JSONB, RLS, Edge Runtime, USE_MOCK, 커넥션 풀링

정규화 기준

정규형 적용 기준 예외 허용 조건
1NF 필수 없음
2NF 필수 없음
3NF 기본 적용 읽기 성능 요구 시
BCNF 권장 복잡도 증가 시

비정규화 조건

비정규화 결정 시 반드시 ADR 작성:

## ADR-XXX: [테이블명] 비정규화 결정

### Context
- 읽기 빈도: X회/초, 쓰기 빈도: Y회/초, 조인 비용: Z ms

### Decision
[비정규화 결정 내용]

### Consequences
- 장점: 읽기 성능 N% 향상
- 단점: 데이터 중복, 갱신 이상 위험
- 대응: [트리거/애플리케이션 로직]

쿼리 최적화

상세 프로세스(EXPLAIN 분석, 체크리스트, 기법)는 rules/query-optimization.md 참조.

마이그레이션 규칙

파일 명명

{timestamp}_{description}.sql
예: 20260203100000_create_users_table.sql

안전한 마이그레이션

작업 안전 위험 대안
컬럼 추가 (NULL) O
컬럼 추가 (NOT NULL) ! DEFAULT 값 + NULL 허용 후 변경
컬럼 삭제 ! 코드 먼저 수정 -> 삭제
컬럼명 변경 X 새 컬럼 추가 -> 데이터 이동 -> 삭제
인덱스 추가 O CONCURRENTLY 사용
테이블 삭제 X 백업 확인 필수

롤백 전략

모든 마이그레이션에 롤백 스크립트 필수:

-- Up
ALTER TABLE users ADD COLUMN phone VARCHAR(20);
-- Down
ALTER TABLE users DROP COLUMN phone;

관련 스킬

  • tsq-prisma — Prisma ORM 사용 시 스키마·쿼리·마이그레이션은 tsq-prisma 참조
Files

What ships with it

2 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. 5d ago First seen · 85 lines · 72 tokens per session scan A d0f8fd0e93ca

Subscribe to this mod's changes

tsq-database is a skill published in the GitHub repository sonature-lab/timsquad (11 stars, last pushed 5d ago), licensed MIT. It adds 72 tokens to every session and 670 once invoked, about $0.0004 per session on Opus 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-08-30.

Related

Other skills, from other repositories

database-and-schema

Database setup, Drizzle ORM schemas, migrations, and the Ops business logic layer.

actionhero/keryx · 20 tokens

database-testing

Database schema validation, data integrity testing, migration testing, transaction isolation, and query performance. Use when testing data persistence, ensuring referential integrity, or validating database migrations.

summarybotng/summarybot-ng · 37 tokens

database-query

Generate, optimize, and explain SQL queries - supports SQLite, PostgreSQL, MySQL with schema introspection, migration generation, and query performance analysis.

chainlesschain/chainlesschain · 32 tokens

database-review

Database Design & SQL Review: Expert guide for schema design, database migrations, query optimization, indexing strategy, and database performance. Covers relational (PostgreSQL, MySQL) and NoSQL (MongoDB, DynamoDB, Redis). Use whenever the user mentions 'database', 'schema', 'migration', 'SQL', 'query optimization'…

camilooscargbaptista/cto-toolkit · 160 tokens

database-schema-designer

Design production-ready database schemas for SQL and NoSQL databases. Covers normalization, indexing strategy, migration management with rollback safety, query optimization, and multi-tenant patterns. Supports PostgreSQL, MySQL, SQLite, MongoDB, and Vitess.

JPeetz/agent-skills · 54 tokens

oracle

Data intelligence specialist mastering information flow across database landscapes. Query optimization, schema design, and migration safety.

Rikinshah787/clawarmy · 22 tokens