Sourcebook — AI skill for Claude Code
Generate AI context files from your codebase's actual conventions.
How to install Sourcebook
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open maroondlabs/sourcebook and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Sourcebook does
Generate AI context files from your codebase's actual conventions. Not what agents already know — what they keep missing.
Alternatives in AI
- Internal Safety Collapse — We built an adversarial codespace setup 1.2k ★
- Update Branch Name — by giselles-ai - Updates branch names with proper prefixes and formats, enforcing naming conventions, supporti 502 ★
- SpexFlow — Node-based workflow for orchestrating codebase context and specifications for AI agents 164 ★
README
sourcebook
**Catches the files your AI agent forgot to change.**
A safety layer for code changes. sourcebook analyzes git diffs for completeness — flags files that should've been modified but weren't. Rules-based structural detection plus AI-powered semantic analysis. Zero false positives on clean diffs.
npx sourcebook init # sets up Claude Code hooks + generates CLAUDE.md
npx sourcebook check # check your current diff for missing files
npx sourcebook scan-history # see what you've been missing
What It Catches
Your AI agent changed the handler. Did it update the test? The sibling module? The config that references the old value?
sourcebook checks your diff against the repo's actual structure:
- Missing test files — source file changed, test file didn't
- Sibling modules — files that import or are imported by what you changed
- Co-change companions — files that historically change together in git commits
- Hub file blast radius — you touched something with 50+ dependents
With `--ai`: cross-module semantic relationships, field renames that need migrations, stale validation logic.
Key Stats
| Metric | Result |
|---|---|
| Completeness gate | 100% accurate (30/30 diffs) |
| False positive rate | 0% on clean diffs |
| Test file detection | 73% |
| Sibling detection | 71% |
| AI analysis cost | ~$0.012/run |
Four Surfaces
1. CLI
Run it on any diff. No setup required.
npx sourcebook check # check staged/unstaged changes
npx sourcebook check --ai # add AI semantic analysis (requires ANTHROPIC_API_KEY)
npx sourcebook check --quiet # exit code only (for CI/scripts)
npx sourcebook check --branch main # compare vs a branch
2. Claude Code Hooks
One command wires up pre-commit hooks. Agent edits a file, sourcebook checks the diff, agent sees what's missing — all before the c
Related Skills
Claude Project Setup
A template system for Claude-assisted client engagement folders. Drop a new client into a folder and every Cla
Style DNA Ghostwriter
Learn a codebase's unwritten conventions (Python, React, Next.js, TypeScript, Tailwind) and condition AI codin
Claude Session Kit
Mine your Claude Code sessions for patterns. Incremental backup + LLM summaries + cross-session finding detect
Skills Wiki Opensource
Manage the AI skills you already installed for Claude Code, Codex and Antigravity: route each request to the r
Rails AI Context
45 MCP tools that give AI coding agents ground truth about your Rails app: schema, models, routes, controllers
PM Second Brain
A second-brain context system for PMs using Claude Code daily — folder structure, file conventions, and CLAUDE
Related Agents
Scout
You are a specialized internal research agent. Your job is to explore the codebase, find patterns, discover co
Pam
Gather product context for a ticket from the product wiki. Use when a ticket has been classified and written t
Doc Polisher
Updates and polishes project documentation files by (1) refreshing code snippets to match actual .kt file patt