codebase-digest
Skill0 starsChanged 2 months agoMITView on GitHub
Generates and maintains a high-density, AI-first CODEBASE.md index of the project. Optimized specifically for LLM context injection to understand architecture, public symbols, signatures, and module dependencies in a single file without reading individual source files. Mandates automated synchronization at the end of every code modification iteration.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- rules/AGENTS.mdAGENTS.md
- kurokoSkill
- tayoriSkill
- xerjSkill
- aesthetic-readme-craftSkill
- cli-builderSkill
- git-release-craftSkill
- git-repo-craftSkill
- karakuriSkill
- python-clean-codeSkill
- rust-clean-codeSkill
- rust-style-pythonSkill
- systematic-code-verificationSkill
- compose-clean-codeSkill
- bash-clean-codeSkill
- tui-designSkill
- frontend-designSkill
- web-design-guidelinesSkill
- unslopSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Maximum Information Density: No conversational prose, marketing adjectives, or narrative filler.
- Distinctive: line 22
Living Synchronization: Must be updated at the end of every iteration where codebase files change.
- Very specific: line 31
When an agent first touches a repository that lacks CODEBASE.md, it must generate it immediately as part of the initial task.
- Very specific: line 37
Every CODEBASE.md file must strictly follow this dense structure:
- Very specific: line 101
When a function signature changes in code, reflect the exact new signature in CODEBASE.md.
- Distinctive: line 103
Keep approximate file line counts up to date so the LLM knows file weight and complexity.
- Very specific: line 105
When files are deleted or renamed, immediately prune them from CODEBASE.md.
- Very specific: line 107
Commit CODEBASE.md alongside the code changes in the same atomic commit whenever possible.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
codebase-digest Skill: AI-First Semantic Codebase Index
Maintains a single-file, token-dense architectural and semantic index of the project called CODEBASE.md. Designed specifically for AI and LLM agents to achieve 100% codebase comprehension in a single read without burning tool calls or reading raw source files.
1. Core Philosophy: AI-First, Zero Fluff
CODEBASE.md is not documentation for end users or a marketing README. It is an executable mental model for AI agents:
- Maximum Information Density: No conversational prose, marketing adjectives, or narrative filler.
- Type & Signature Accuracy: Exact struct fields, enum variants, and function signatures.
- Dependency & Call Graph: Clear mapping of what imports what and who calls whom.
- Living Synchronization: Must be updated at the end of every iteration where codebase files change.
2. Mandatory End-of-Iteration Update Protocol
Whenever an agent adds, edits, refactors, renames, or deletes any code file:
- Never end the turn without updating
CODEBASE.md. - The agent must update the corresponding file entries, symbol signatures, and line counts before declaring the task complete.
- When an agent first touches a repository that lacks
CODEBASE.md, it must generate it immediately as part of the initial task.
3. Standard CODEBASE.md Schema
Every CODEBASE.md file must strictly follow this dense structure:
# CODEBASE.md: <Project Name> Semantic Digest
> **Notice**: This file is an AI-optimized semantic index. Do not write narrative prose. Keep token density high.
## 1. System Topology & Data Flow
\`\`\`text
<Entrypoint> ──> <Parser/CLI> ──> <Core/Dispatcher> ──> <Domain Logic> ──> <Infra/IO>
\`\`\`
## 2. Global Constraints & Architecture Patterns
- **Primary Language & Edition**: (e.g. Rust 2021 edition / Python 3.12 uv)
- **Architectural Paradigm**: (e.g. Role-based: domain/, infra/, api/)
- **Hard Constraints**: <400 lines/file, <60 lines/fn, zero production unwrap(), 0 warnings.
- **Target Distribution**: (e.g. Linux x86_64 standalone binary via GitHub Releases)
## 3. Module & Interface Skeleton
### `<relative/path/to/file>` (Role: <domain|infra|api|cli|tui>, Lines: <count>)
- **Responsibility**: Single concise sentence.
- **Imports**: `crate::...`, `external_crate::...`
- **Types & Enums**:
\`\`\`<lang>
pub struct Example { pub field: Type }
pub enum Mode { VariantA, VariantB(String) }
\`\`\`
- **Public Functions & Signatures**:
\`\`\`<lang>
pub fn process_input(arg: &Arg) -> Result<Output, Error>
\`\`\`
- **Consumers**: (modules/functions that invoke this file)
- **Side Effects / I/O**: (filesystem writes, network requests, env vars)
## 4. Execution Lifecycle Trace
1. **Startup**: Entrypoint (`main.rs`) initializes logger and parses CLI arguments.
2. **Dispatch**: CLI arguments route to specific command handlers in `cli/`.
3. **Execution**: Command handlers call domain logic in `domain/`.
4. **I/O & Persistence**: Domain logic delegates to `infra/` for disk/network I/O.
5. **Exit**: Graceful shutdown with typed error codes.
## 5. Verification Commands
\`\`\`bash
# Build
cargo build --release --target x86_64-unknown-linux-gnu
# Test
cargo test --all-targets
# Lint & Format
cargo clippy --all-targets -- -D warnings
cargo fmt --check
\`\`\`
## 6. Recent Iteration Changes
- **YYYY-MM-DD**: Concise delta of what files were added, modified, or removed.4. Updating Guidelines for Agents
- Keep Signatures Exact:
When a function signature changes in code, reflect the exact new signature in
CODEBASE.md. - Update Line Counts: Keep approximate file line counts up to date so the LLM knows file weight and complexity.
- Prune Stale Entries:
When files are deleted or renamed, immediately prune them from
CODEBASE.md. - Atomic Commits:
Commit
CODEBASE.mdalongside the code changes in the same atomic commit whenever possible.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

