dok3-sqlite

dok3-sqlite is a skill for Claude Code from LeeYudok/agents-scaffold. It costs 80 tokens per session (2,584 once invoked), scanned A, original, MIT.

A guide to SQLite, a database stored in a single file rather than run as a separate server. It covers reading and writing files, read-only access, WAL files, locking, migrations, and safe table-name handling.

In plain words
What is it for?
Use it when inspecting SQLite files, choosing read-only or immutable access, handling concurrent readers and writers, working with WAL and journal files, or applying SQLite-specific migrations and queries.
Why use it?
SQLite's file-based design creates risks that do not occur with server databases, such as changing someone else's data file or opening a live WAL database incorrectly. This guide helps avoid corrupted data, lock errors, and accidental new files.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths.

Part of the yd-skills plugin — 20 skills shipped together

Good fit Use it when inspecting SQLite files, choosing read-only or immutable access, handling concurrent readers and writers, working with WAL and journal files, or applying SQLite-specific migrations and queries.

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

Made for: Claude Code.

Or install yd-skills, the plugin that ships this one along with the rest of its 20 skills.

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 dok3-sqlite

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/leeyudok/agents-scaffold/dok3-sqlite"><img src="https://agentmods.dev/badge/skills/leeyudok/agents-scaffold/dok3-sqlite.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,584 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.00080 $0.02584
Opus 5.5 $0.00032 $0.01034
Sonnet 5.5 $0.00016 $0.00517
Haiku 4.5 $0.00008 $0.00258

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

Security

Grade A, and why

dok3-sqlite 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_sqlite_claims.py, tests/test_sqlite_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.

plugins/yd-skills/skills/dok3-sqlite/SKILL.md · 163 lines

How it starts

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

dok3-sqlite

SQLite 엔진 고유의 문제가 대상이다. 스키마 설계 이론은 dok3-db, PostgreSQL 은 dok3-pg, Go 코드 관용구는 dok3-go 가 맡는다.

SQLite 는 "작은 RDB"가 아니라 파일 하나가 데이터베이스인 라이브러리다. 서버가 없다는 사실에서 이 문서의 거의 모든 항목이 파생된다.

1. 남의 파일을 읽을 때 — 원본을 바꾸지 않는다

앱이 쓰고 있는 캐시·데이터 파일을 조회하는 작업이 흔하다. 원본을 건드리면 그 앱의 데이터가 깨진다. 기본은 읽기 전용이다.

dsn := "file:" + path + "?mode=ro&_pragma=busy_timeout(5000)"
  • mode=ro — 쓰기를 엔진 수준에서 막는다. 애플리케이션 규율에 기대지 않는다.
  • busy_timeout — 다른 프로세스가 쓰는 중이면 즉시 실패하지 않고 기다린다. 없으면 산발적인 database is locked 로 나타난다.
  • URI 파일명에서 ?·# 은 구분자다. 경로에 들어 있으면 퍼센트 인코딩한다. 그냥 이어붙이면 ? 앞까지를 경로로 읽어 엉뚱한 빈 파일을 새로 만들고, 뒤의 mode=ro 도 무시된다. 오류는 no such table 로만 나온다.

곁 파일까지 확인한다

읽기만 해도 -wal·-shm·-journal 이 생기면 원본 폴더를 오염시킨 것이다. 롤백 저널 DB 는 mode=ro 로 조회해도 곁 파일이 생기지 않는다. WAL 모드 DB 는 mode=ro 만으로 안 된다. 곁 파일이 없는 WAL DB 를 mode=ro 로 열면 SQLite 3.51.0 은 열기 자체가 unable to open database file 로 실패하고, 3.53.4 는 열리지만 -wal·-shm 을 만든다 (2026-10-04 실측). 읽기·쓰기 모드로 열면 조회만 해도 둘 다 생긴다.

정말 건드리면 안 되는 파일은 immutable=1 을 고려한다. 곁 파일 없이 읽힌다. 다만 이건 "파일이 변하지 않는다"는 약속이므로 앱이 쓰는 중이면 쓰지 않는다.

가장 안전한 순서: 사본을 떠서 사본을 연다. WAL DB 의 사본은 본 파일만으로는 모자란다 (7장). 그럴 수 없으면 mode=ro + 곁 파일 검사.

이건 테스트로 고정한다

문서에만 적힌 "읽기 전용"은 다음 리팩터링에서 사라진다. 회귀 테스트로 못 박는다.

// 조회란 조회를 다 돌린 뒤 파일 해시가 같은지, 곁 파일이 안 생겼는지
before := sha256sum(path)
// ... Rooms / Messages / Count / Search ...
if after := sha256sum(path); after != before { t.Error("원본이 바뀌었다") }
for _, s := range []string{"-wal", "-shm", "-journal"} {
    if _, err := os.Stat(path + s); !os.IsNotExist(err) { t.Error("곁 파일이 생겼다") }
}

쓰기가 실제로 막히는지도 확인한다 — mode=ro 로 연 뒤 DELETE 가 실패해야 한다.

2. 동적 테이블·컬럼명 — 유일한 방어선

테이블명은 플레이스홀더로 넘길 수 없다. 스키마가 Chat_<방ID> 처럼 데이터에 따라 갈리는 구조면 문자열 조립이 불가피하다. 그러면 검증이 유일한 방어선이 된다.

var roomIDRe = regexp.MustCompile(`^[0-9a-f]{12}-[0-9]{3}$`)

func tableName(id string) (string, error) {
    if !roomIDRe.MatchString(id) {   // 통과 못 하면 절대 쿼리에 넣지 않는다
        return "", fmt.Errorf("%w: %q", ErrInvalidRoomID, id)
    }
    return "Chat_" + id, nil
}
// 조립 시 반드시 인용부호로 감싼다 — 이름의 '-' 가 연산자로 파싱되는 것도 막는다
q := fmt.Sprintf(`SELECT ... FROM %q WHERE Sequence > ?`, table)

Read the full file on GitHub · 163 lines

Files

What ships with it

4 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 · 163 lines · 80 tokens per session scan A b6bca01afa62

Subscribe to this mod's changes

dok3-sqlite is a skill published in the GitHub repository LeeYudok/agents-scaffold (40 stars, last pushed today), licensed MIT. It adds 80 tokens to every session and 2,584 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-11-30.

Related

dok3-sqlite compared with skills from other repositories

dok3-sqlite next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
dok3-sqliteLeeYudok/agents-scaffoldSkill40todayMITA80Claude Code
migrationSpaceMalamute/ai-rulesSkill29mo agononeA7Claude Code
memstack-development-migration-plannercwinvestments/memstackSkill43317d agoMITA73Claude Code
memstack-security-rls-checkercwinvestments/memstackSkill43317d agoMITA80Claude Code
memstack-security-rls-guardiancwinvestments/memstackSkill43317d agoMITA84Claude Code
optimizeFlorianBruniaux/claude-code-ultimate-guideSkill7.5ktodayCC-BY-SA-4.0A15Claude Code
database-experttravisjneuman/.claudeSkill115yesterdayMITA36Claude Code