sourcebook — Summary
sourcebook is an npm CLI tool and MCP server that generates AI context files (CLAUDE.md, AGENTS.md, Cursor rules) from a codebase's actual git history and import graph — capturing conventions, constraints, and hidden couplings that agents consistently miss. It operates in two layers: Layer A (rules-based, <1 second, zero cost) mines git co-change history and static import graphs to identify test file mappings, sibling modules, and hub files with high fan-in; Layer B (AI-powered, ~$0.012/run) uses Claude Sonnet to catch semantic cross-module dependencies invisible to static analysis. The sourcebook check command flags files that should have been changed alongside a given diff — a completeness gate for AI agent edits. With 3 stars, BSL-1.1 license (converts to MIT in 2030), and research-backed accuracy claims (0% false positives on clean diffs), it is the most rigorous "context quality" tool in the corpus.
Compared to seeds: no seed generates CLAUDE.md from codebase analysis. The closest seed is agent-os (which ships conventions as pre-written markdown) but agent-os's content is generic templates; sourcebook generates project-specific content from actual git history. The sourcebook check completeness gate is architecturally similar to spec-kit's PostToolUse hooks that run tests after edits, but applied to change completeness rather than test passage.