Skills for Real Engineers. Straight from my .agents directory.
code-explanation
Agent skill fromLeanmcp/gateway-skills
Generate a complete, beginner-friendly explanation of an entire code repository as a set of markdown files. Maps the repo structure with `treecap` (installing it if missing), studies the actual source, then writes a `CODE_EXPLANATION/` folder containing an `OVERVIEW.md` plus numbered deep-dive files (01_architecture.md, 02_models.md, ...) that explain how the code is built, what it does, and how the pieces fit together — illustrated with real code excerpts. Use this skill whenever the user wants to understand, document, onboard onto, or get a walkthrough of a codebase: phrases like "explain this repo", "explain the code", "code explanation", "walk me through this codebase", "help me understand how this is built", "document the architecture", or "what does this project do" — even if they don't say the word "skill". Prefer this over ad-hoc summaries whenever the goal is a durable, written explanation of a whole repo.
How to install code-explanation
npx skills add Leanmcp/gateway-skills# or add only this skill to Claude Code: copy the folder
skills/code-explanation/
# into
~/.claude/skills/code-explanation/ (all projects)
.claude/skills/code-explanation/ (one project)
1# Code Explanation23Produce a thorough written explanation of an entire repository so someone new4can understand **what it does, how it is built, and how the pieces fit5together**. The output is a `CODE_EXPLANATION/` folder of markdown files: one6`OVERVIEW.md` and a series of numbered deep-dive documents.78The goal is genuine understanding, not a file inventory. A good explanation9reads like a knowledgeable engineer walking a new teammate through the codebase:10it names the important abstractions, shows real code, and explains *why* things11are shaped the way they are.1213## Workflow1415### 1. Establish the structural map with `treecap`1617Before reading any code, get a bird's-eye view of the repo layout. Use18`treecap`, a tree viewer that caps how many entries it shows per folder so large19repos stay readable.2021Resolve the tool in this order:22231. **`treecap`** — preferred. Check with `which treecap`.242. If it is missing, **install it**: `pip install treecap` (it is a PyPI25 package: https://pypi.org/project/treecap/). If `pip` isn't available, try26 `pip3 install treecap` or `python -m pip install treecap`.273. If installation fails or is declined, **fall back to `tree`**28 (`which tree`).294. If neither exists, fall back to a manual listing (e.g. `find . -type f`30 filtered sensibly), but prefer the real tools.3132Run it on the target repo. Sensible defaults:3334```bash35treecap -W 0 -L 3 # full width (all entries), 3 levels deep36```37…
Excerpt shown under the repository's MIT license.
More skills in gateway-skills
Similar skill repositories
An agentic skills framework & software development methodology that works.
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
Public repository for Agent Skills
Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
An AI skill that provides design intelligence for building professional UI/UX across multiple platforms.
