Codebase Knowledge — Domain Knowledge Reader (v2.0.0)
Load cached domain knowledge before implementing any feature. Reads `_index.json` and affected `domains/<slug>.md` files for fast, targeted context retrieval.
Editor's Note
Before coding, read this skill, then `_index.json`, then the affected `domains/<slug>.md` files. Ensure `documenter` is run to keep `_index.json` up to date with the latest commit information.
When to Use It
- Reviewing domain-specific knowledge before implementing a new feature
- Identifying relevant files and connections based on domain mappings
- Accessing recent commits and attention points for a domain
SKILL.md
SkillsHunter provides this listing for informational purposes only. Review the skill’s source, license, and required permissions before use. You are responsible for deciding whether to install or run it. Terms of Use
Codebase Knowledge — Domain Knowledge Reader (v2.0.0)
ALWAYS invoke BEFORE implementing any feature.
This skill is the read side of the project memory layer maintained by the documenter and domain-updater agents. Its job is to load just enough context for the next change without re-discovering the whole codebase.
Storage layout (maintained by documenter v2.0.0)
.claude/skills/codebase-knowledge/
├── SKILL.md # this file
├── TEMPLATE.md # template for new domain files (no version — it is a template)
├── _INDEX.md # human-readable list of all domains
├── _index.json # machine-readable index — SOURCE OF TRUTH for filter
└── domains/
├── <slug>.md # one file per domain. ≤ 8 KB / ~2k tokens / 200 lines
└── <slug>.archive.md # commits/wisdom older than the cap (read on demand only)
Read protocol (token-efficient)
| # | Step | Tool |
|---|---|---|
| 1 | Resolve which domain(s) you need by glob/grep on the affected file paths against .claude/config/domain-mapping.json |
Bash + jq |
| 2 | Read _index.json first — one query gives you last_commit, tags, connections for every domain |
jq '.domains[] | select(.slug == "auth")' _index.json |
| 3 | Read only the matched domains/<slug>.md files — never cat domains/*.md (that defeats the budget) |
Read |
| 4 | Follow connections if the change crosses a domain boundary; read those neighbours too |
Read |
| 5 | Skip <slug>.archive.md unless _index.json flags status: archived and you actually need history |
Read |
Domain file shape
Defined by documenter v2.0.0 — see TEMPLATE.md in this folder for the canonical layout. Required sections:
- YAML frontmatter (
domain · tags · owner · last_commit · last_date · files_count · connections · status) - TL;DR (≤ 3 lines, front-loads boundary)
- Files table (path → role)
- Connections table (bidirectional: → and ← rows)
- Recent Commits (capped at 20)
- Attention Points (capped at 10)
- Problems & Solutions (capped at 5, append-only)
Workflow
- Before coding — read this skill, then
_index.json, then the affecteddomains/<slug>.mdfiles. - During coding — note any new connection, gotcha, or non-obvious decision (you do not write here directly).
- After commit —
documentermaps files+commits,domain-updaterrecords the wisdom you collected.
Rules
- READ
_index.jsonFIRST — it is regenerated each commit; it is the cheapest way to filter. - NEVER
cat domains/*.md— you will blow the context budget. - BIDIRECTIONAL CONNECTIONS — if
auth.mdlists→ api, thenapi.mdMUST list← auth. If you spot a missing reverse edge, surface it fordomain-updater. - ARCHIVE FILES ARE OPT-IN — read
<slug>.archive.mdonly when_index.jsonshowsstatus: archivedor when you need pre-cap history. - DO NOT EDIT DOMAIN FILES DIRECTLY — only
documenteranddomain-updaterwrite here. If something is wrong, fix the agent or report drift. - TRUST
last_commit— if_index.json#last_commit≠ HEAD, the documenter forgot to run; pause and fix instead of working with stale knowledge.
See Also
documenterv2.0.0 — writes to this layout (after every commit)domain-updaterv2.0.0 — writes session wisdom (Problems & Solutions, Attention Points)docs-trackerv2.0.0 — file → domain mapping rulesclaude-md-compactorv2.0.0 — keepsCLAUDE.md≤ 20 KB; this layer keeps each domain ≤ 8 KB
View original Markdown
---
name: codebase-knowledge
version: 2.0.0
description: "Cached domain knowledge consumed BEFORE implementing any feature. Reads `.claude/skills/codebase-knowledge/_index.json` (machine-readable, regenerated by `documenter`) for fast filter, then reads only the affected `domains/<slug>.md` files. Avoids re-exploring the codebase every session."
---
# Codebase Knowledge — Domain Knowledge Reader (v2.0.0)
**ALWAYS invoke BEFORE implementing any feature.**
This skill is the **read side** of the project memory layer maintained by the `documenter` and `domain-updater` agents. Its job is to load just enough context for the next change without re-discovering the whole codebase.
## Storage layout (maintained by `documenter` v2.0.0)
```
.claude/skills/codebase-knowledge/
├── SKILL.md # this file
├── TEMPLATE.md # template for new domain files (no version — it is a template)
├── _INDEX.md # human-readable list of all domains
├── _index.json # machine-readable index — SOURCE OF TRUTH for filter
└── domains/
├── <slug>.md # one file per domain. ≤ 8 KB / ~2k tokens / 200 lines
└── <slug>.archive.md # commits/wisdom older than the cap (read on demand only)
```
## Read protocol (token-efficient)
| # | Step | Tool |
|---|---|---|
| 1 | **Resolve which domain(s) you need** by glob/grep on the affected file paths against `.claude/config/domain-mapping.json` | Bash + jq |
| 2 | **Read `_index.json` first** — one query gives you `last_commit`, `tags`, `connections` for every domain | `jq '.domains[] \| select(.slug == "auth")' _index.json` |
| 3 | **Read only the matched `domains/<slug>.md`** files — never `cat domains/*.md` (that defeats the budget) | Read |
| 4 | **Follow `connections`** if the change crosses a domain boundary; read those neighbours too | Read |
| 5 | **Skip `<slug>.archive.md`** unless `_index.json` flags `status: archived` and you actually need history | Read |
## Domain file shape
Defined by `documenter` v2.0.0 — see `TEMPLATE.md` in this folder for the canonical layout. Required sections:
- YAML frontmatter (`domain · tags · owner · last_commit · last_date · files_count · connections · status`)
- TL;DR (≤ 3 lines, front-loads boundary)
- Files table (path → role)
- Connections table (bidirectional: → and ← rows)
- Recent Commits (capped at 20)
- Attention Points (capped at 10)
- Problems & Solutions (capped at 5, append-only)
## Workflow
1. **Before coding** — read this skill, then `_index.json`, then the affected `domains/<slug>.md` files.
2. **During coding** — note any new connection, gotcha, or non-obvious decision (you do not write here directly).
3. **After commit** — `documenter` maps files+commits, `domain-updater` records the wisdom you collected.
## Rules
1. **READ `_index.json` FIRST** — it is regenerated each commit; it is the cheapest way to filter.
2. **NEVER `cat domains/*.md`** — you will blow the context budget.
3. **BIDIRECTIONAL CONNECTIONS** — if `auth.md` lists `→ api`, then `api.md` MUST list `← auth`. If you spot a missing reverse edge, surface it for `domain-updater`.
4. **ARCHIVE FILES ARE OPT-IN** — read `<slug>.archive.md` only when `_index.json` shows `status: archived` or when you need pre-cap history.
5. **DO NOT EDIT DOMAIN FILES DIRECTLY** — only `documenter` and `domain-updater` write here. If something is wrong, fix the agent or report drift.
6. **TRUST `last_commit`** — if `_index.json#last_commit` ≠ HEAD, the documenter forgot to run; pause and fix instead of working with stale knowledge.
## See Also
- `documenter` v2.0.0 — writes to this layout (after every commit)
- `domain-updater` v2.0.0 — writes session wisdom (Problems & Solutions, Attention Points)
- `docs-tracker` v2.0.0 — file → domain mapping rules
- `claude-md-compactor` v2.0.0 — keeps `CLAUDE.md` ≤ 20 KB; this layer keeps each domain ≤ 8 KB
Community Reviews & Field Notes
Tried this skill on your own project? Share the model you used and the results you got.