
Codebase Knowledge Builder
From unfamiliar repository to working knowledge.
Codebase Knowledge Builder is an open Agent Skill for codebase understanding and developer onboarding. It studies a repository or subsystem and produces source-cited Markdown knowledge artifacts that explain architecture, behavior, error paths, edge cases, constraints, and unknowns.
It does not build an index, run a server, or hide uncertainty. The result is a portable document that a developer or another coding agent can review, version, and reuse.
Quick start
Install the standalone skill with the current verified Skills CLI release:
npx --yes [email protected] add OthmanAdi/codebase-knowledge-builder --skill codebase-knowledge-builder -g
Then ask your agent a normal question:
Study the authentication subsystem in this repository. Build a source-cited
knowledge artifact for a new maintainer. Keep the repository read-only and mark
anything the source does not prove as unknown.
See a real result: how this repository packages one canonical skill across six distribution surfaces, generated against fixed commit 50aa5b8504d9a8a253f1a8507544d77562a611e3.
The skill resolves the repository revision and scope, follows relevant code paths, distinguishes evidence from inference, and validates the artifact before delivery.
Understand an unfamiliar codebase before you edit it
A quick repository scan can tell you where files live. It rarely explains how a subsystem behaves, where errors travel, which assumptions are verified, or what is still unclear.
Codebase Knowledge Builder turns exploration into a reviewable handoff:
| Before | After |
|---|
| Scattered file reads | One scoped, revision-specific artifact |
| Architecture guessed from folder names | Boundaries supported by source citations |
| Happy path only | Happy, error, and relevant edge paths |
| Confident prose with hidden gaps | observed, inferred, unknown, and not applicable labels |
| Scratch notes inside the target | Task-scoped output outside the target by default |
| Context that disappears with the session | Portable Markdown for people and agents |
What each knowledge artifact contains
- Repository identity, inspected revision, timestamp, scope, exclusions, and budget
- An executive answer to the research question
- Architecture and ownership boundaries relevant to that question
- Happy-path, error-path, and evidenced edge-case traces
- Key interfaces, data contracts, configuration surfaces, and extension points
- Source references in
relative/path:line form
- Explicit reasoning and confidence for inferred claims
- Unknowns, contradictions, and the evidence needed to resolve them
- Optional Mermaid diagrams when a visual model adds real clarity
- A final validation and redaction record
The bundled artifact template makes those expectations explicit without forcing empty sections or invented “gotchas.”
How the four-phase process works
flowchart LR
A["Repository or subsystem"] --> B["1. Reconnaissance<br/>trust, scope, revision"]
B --> C["2. Deep dive<br/>bounded behavior traces"]
C --> D["3. Authoring<br/>evidence and unknowns"]
D --> E["4. Validation<br/>redaction and delivery"]
1. Reconnaissance
Resolve the canonical root, applicable instructions, revision, initial worktree state, research question, exclusions, and budget. Inventory version-controlled files first. Do not execute repository content.
2. Deep-dive study
Start from an evidenced entry surface, then follow calls, imports, registrations, data transformations, or build relationships. Trace only the paths that answer the scoped question.
3. Artifact authoring
Synthesize findings into the provided template. Consequential claims need a source location or a clearly labeled inference. Missing evidence stays visible as unknown.
4. Validation and delivery
Check citations, scope, confidence, redaction, Markdown and Mermaid rendering, output location, and the target's final worktree state. Deliver through the path or channel the user approved.
Evidence and safety contract
Repository analysis is a trust-boundary problem. This skill makes the boundary part of the workflow: