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 j4flmao/agent-skills --skill database-internalsgit clone --depth 1 https://github.com/j4flmao/agent-skillsWrote 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/j4flmao/agent-skills/database-internals)<a href="https://agentmods.dev/skills/j4flmao/agent-skills/database-internals"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/database-internals/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/j4flmao/agent-skills/database-internals"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/database-internals.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00085 | $0.01740 |
| Opus 5.5 | $0.00034 | $0.00696 |
| Sonnet 5.5 | $0.00017 | $0.00348 |
| Haiku 4.5 | $0.00009 | $0.00174 |
Grade A, and why
database-internals-mechanics 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 16d 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.
How it starts
The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Database Internals
Purpose
Explain why a database behaves the way it does under a workload: why random-key inserts hurt a B-tree, why an LSM store has read and space amplification, what a commit actually waits for, and which anomalies each isolation level permits in a specific engine. Use this to choose engines, keys and isolation levels from mechanism rather than folklore.
Agent Protocol
Trigger
"database internals", "b-tree", "lsm", "storage engine", "write amplification", "compaction", "wal", "fsync", "mvcc", "isolation level", "phantom", "write skew", "ssi", "vacuum", "bloat".
Input Context
- Engine and version (PostgreSQL, MySQL/InnoDB, RocksDB, Cassandra/ScyllaDB, SQLite...).
- Workload: read/write ratio, key pattern (sequential vs random), row size, update vs append, consistency needs.
Output Artifact
Mechanism explanation + recommendation (engine, key, isolation, settings). No file unless requested.
Response Format
Mechanism: {what the engine does}
Impact on workload: {amplification/anomaly/latency}
Recommendation: {change}
Verify: {metric or query}
Completion Criteria
- Claims tied to the specific engine (isolation semantics differ between engines).
- Recommendation has a measurable check (e.g.
pg_stat_*, RocksDB stats, compaction metrics).
Storage Structures
| B+tree | LSM-tree | |
|---|---|---|
| Write path | Find leaf page, modify page (in buffer pool), WAL record | Append to WAL + insert into in-memory memtable; flush as immutable sorted file (SSTable) |
| Read path | Root→leaf, O(log_B N) pages; typically 3-4 levels | Memtable + several SSTables per level; Bloom filters skip files |
| Write amplification | Page writes + WAL (+ full-page images after checkpoints in PostgreSQL) | Rewrites during compaction (leveled: high, tiered: lower) |
| Read amplification | Low | Higher, mitigated by Bloom filters, block cache |
| Space amplification | Page free space, fragmentation | Obsolete versions/tombstones until compaction |
| Typical engines | PostgreSQL indexes, InnoDB, SQLite | RocksDB, LevelDB, Cassandra, ScyllaDB, CockroachDB (Pebble) |
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.
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.
- 16d ago Changed · +4 lines · -73 tokens per session b3f8e517f108
- 17d ago Changed · +6 lines 1f7d271046c2
- 1mo ago Changed · +63 lines · +133 tokens per session e1fef53e5487
- 3mo ago First seen · 43 lines · 25 tokens per session scan A bd2de1d0dbc0
database-internals-mechanics is a skill published in the GitHub repository j4flmao/agent-skills (47 stars, last pushed 17d ago), licensed MIT. It adds 85 tokens to every session and 1,740 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-09-03.
database-internals-mechanics compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| database-internals-mechanicsj4flmao/agent-skills | Skill | 47 | 17d ago | MIT | A | 85 | Claude Code, Codex |
| PostgreSQLpledgeandgrow/pledge-skills | Skill | 11 | 4mo ago | MIT | B | 34 | Claude Code, Codex |
| storage-engine-selectorbookforge-ai/bookforge-skills | Skill | 43 | 7mo ago | CC-BY-SA-4.0 | A | 216 | Claude Code |
| build-with-tinybasetinyplex/tinybase | Skill | 5.2k | today | MIT | A | 90 | Claude Code, Codex |
| performing-sqlite-database-forensicsxalgorix/xalgorix | Skill | 1.6k | yesterday | Apache-2.0 | A | 46 | Claude Code, Codex |
| dataframe-performancemakifbaysal/tasktrooper | Skill | 123 | 2d ago | Apache-2.0 | A | 60 | Claude Code, Codex |
| flux-migratetonone-ai/tonone | Skill | 85 | 2d ago | MIT | A | 51 | Claude Code |