codebase

Maps a task to the most relevant repository files using a generated CODEBASE.md index.

Updated Nov 25, 2024
One-click install
npx skills add https://github.com/cbrostrom/dotfiles --skill codebase-cbrostrom
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: codebase
Source: https://github.com/cbrostrom/dotfiles/tree/main/stow/agents/.agents/skills/codebase
Command: npx skills add https://github.com/cbrostrom/dotfiles --skill codebase-cbrostrom

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When entering an unfamiliar repository, agents and developers waste time searching for the right files to read. This Skill orients you by routing the current task to the 2-3 files that matter, using a lightweight CODEBASE.md map of the repo. ## Core Features & Use Cases - Task-to-file routing: Reads CODEBASE.md and outputs at most 3 files to read next, each with a reason, plus an explicit skip list. - Deterministic fast path: Runs the repo-orient.py script when available to return verified, existence-checked paths without reading file bodies. - Map generation with staleness checks: Generates CODEBASE.md from the directory tree when missing, and regenerates it if routed entries no longer exist. - Use Case: You open a new project and ask "where is the authentication logic?" The Skill checks the repo map, verifies the paths exist, and tells you exactly which files to read and what to skip. ## Quick Start Ask the agent to orient you in this repository and identify which files to read for your current task.

Frequently Asked Questions about codebase

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find which files to read for a task in a new repo?▼

Use the codebase router: it reads CODEBASE.md in the repository root and returns at most three files relevant to your task, each with a reason. If no map exists, it can generate one from the directory tree in seconds.

What is CODEBASE.md and how is it generated?▼

CODEBASE.md is a repository map listing root files and key directories with one-line purposes. It is generated from a find command over the tree, inferring purpose from filenames only, skipping lockfiles, build output, and dot-directories without meaningful config.

Does the codebase router work without the repo-orient.py script?▼

Yes. The script is a preferred fast path that returns verified paths deterministically, but the Skill falls back to a manual workflow that reads CODEBASE.md and routes based on the task description.

What happens if CODEBASE.md is outdated or lists missing files?▼

Before routing, each target path is checked with ls. If an entry is missing or the map looks wrong for the current tree, the map is regenerated from scratch and routing is retried, so the agent never routes to a nonexistent file.

When should I not rely on a generated codebase map?▼

The map infers purpose from filenames only and never reads file contents, so it can misjudge ambiguous files. For deep semantic questions about implementation details, read the routed files directly rather than trusting the map summaries.