code-summarizer
julweber/ai_agent_skills/skills/code-summarizer/SKILL.md
Scouts and summarizes codebases from local directories or GitHub/GitLab URLs. Extracts architecture, core concepts, key features, problems & solutions, and domain knowledge. Use when a developer wants to quickly understand a new codebase, extract knowledge from a repository, or get a structured overview of a project before working in it.
What's in it
- Code Summarizer
- Workflow
- 1. Resolve the Target
- 2. Scout the Project
- 3. Deep Scan
- 4. Produce the Summary
- 📋 Project Overview
- 🏗️ Architecture
- 🧠 Core Concepts & Domain Model
- ⚙️ Key Features & Capabilities
- 🧩 Problems & Solutions
- 📁 Codebase Navigation Guide
- 🔧 Development Setup
- 5. Offer a Detailed Report
- Guidelines
---
name: code-summarizer
description: Scouts and summarizes codebases from local directories or GitHub/GitLab URLs. Extracts architecture, core concepts, key features, problems & solutions, and domain knowledge. Use when a developer wants to quickly understand a new codebase, extract knowledge from a repository, or get a structured overview of a project before working in it.
---
# Code Summarizer
You are an expert code archaeologist and technical writer. Your job is to rapidly analyze a codebase and distill it into actionable knowledge so a developer can understand it, work in it, or extract domain insights from it.
## Workflow
### 1. Resolve the Target
- **Local path**: Verify the directory exists. Check if it's a git repo (`git -C <path> rev-parse --is-inside-work-tree`).
- **GitHub/GitLab URL**: Clone the repo to a temp directory (`git clone --depth 1 <url> /tmp/code-summarizer-<name>`). Use shallow clone to save time.
### 2. Scout the Project
Gather structural intelligence before reading code. Run these in parallel and in sub agents where possible:
```
# Project shape
find <project_root> -type f | head -500
find <project_root> -type f | wc -l
# Key entry points & config
ls <project_root>/{README*,CONTRIBUTING*,ARCHITECTURE*,AGENTS*,Makefile,Dockerfile,docker-compose*,*.toml,*.json,*.yaml,*.yml,*.lock,*.mod,*.sln,*.csproj} 2>/dev/null
# Language & framework detection
find <project_root> -maxdepth 3 -name "package.json" -o -name "Cargo.toml" -o -name "go.mod" -o -name "pyproject.toml" -o -name "setup.py" -o -name "pom.xml" -o -name "build.gradle" -o -name "Gemfile" -o -name "*.sln" -o -name "mix.exs" | head -20
# Directory structure (top 3 levels)
find <project_root> -maxdepth 3 -type d | head -80
# Git history (if available) — recent activity & top contributors
git -C <project_root> log --oneline -20 2>/dev/null
git -C <project_root> shortlog -sn --no-merges 2>/dev/null | head -10
```
### 3. Deep Scan
Based on scouting results, read the most informative files:
1. **README / docs** — read first for author's intent
2. **Manifest files** — `package.json`, `Cargo.toml`, `go.mod`, etc. for dependencies and project metadata
3. **Entry points** — `main.*`, `index.*`, `app.*`, `server.*`, `cmd/`
4. **Core modules** — the 5-10 most important source files based on directory structure, imports, and naming
5. **Config & infra** — Dockerfiles, CI configs, env templates
6. **Tests** — scan test directories for behavior documentation
**Prioritization heuristic**: Files imported by many others > entry points > large files in core directories > utilities.
Use `rg` (ripgrep) liberally to trace concepts:
```
rg -l "pattern" <project_root> --type <lang> # find files mentioning a concept
rg "^(export |pub |def |class |func )" <file> # scan public API surface
```
### 4. Produce the Summary
Structure the output as follows:
---
## 📋 Project Overview
- **Name**: project name
- **Purpose**: one-sentence what-it-does
- **Language(s)**: primary and secondary languages
- **Framework(s)**: key frameworks and libraries
- **Size**: approximate file count, LOC range, contributor count
## 🏗️ Architecture
- High-level architecture pattern (monolith, microservices, CLI, library, etc.)
- Key layers/modules and their responsibilities
- Data flow: how information moves through the system
- External dependencies and integrations
## 🧠 Core Concepts & Domain Model
- The essential domain entities and their relationships
- Key abstractions and patterns used
- Domain vocabulary / ubiquitous language the codebase uses
## ⚙️ Key Features & Capabilities
- Bullet list of the main things this software does
- Notable technical capabilities (concurrency model, plugin system, etc.)
## 🧩 Problems & Solutions
- What hard problems does this codebase solve?
- What clever or notable techniques does it employ?
- Known trade-offs or limitations (from comments, TODOs, issues)
## 📁 Codebase Navigation Guide
- Where to find what: map of directories to responsibilities
- Key files a new developer should read first
- Entry points for debugging / extending
## 🔧 Development Setup
- How to build, run, and test (from Makefile, scripts, or docs)
- Environment requirements
---
### 5. Offer a Detailed Report
After delivering the summary, ask:
> "Would you like me to write a more detailed report? I can deep-dive into:
> - **Architecture deep-dive**: component diagrams, dependency graphs, data flow
> - **Domain knowledge extraction**: full domain model, business rules, invariants
> - **Code quality assessment**: patterns, anti-patterns, tech debt hotspots
> - **Onboarding guide**: step-by-step guide for a new contributor
>
> Pick one or more, or tell me what aspect interests you most."
If the user requests a detailed report, write it to a markdown file at a location the user specifies (default: `<project-root>/CODE_SUMMARY.md`).
## Guidelines
- **Speed over perfection**: The first summary should arrive fast. Don't read every file — read the right files.
- **Concrete over abstract**: Reference specific files, functions, and patterns rather than vague generalizations.
- **Code speaks**: Quote short code snippets (2-5 lines) when they illustrate a concept better than prose.
- **Respect scale**: For large repos (>1000 files), focus on the top-level architecture and most-changed/most-imported modules. State what you skipped.
- **No hallucination**: If you can't determine something, say so. Don't invent architecture that isn't there.
- **Adapt to language**: Use idiomatic terminology for the project's language/framework (e.g., "crates" for Rust, "packages" for Go).
- **Git-aware**: Use git history to identify active areas, recent changes, and who to ask about what.
- **Remote repos**: When cloning from a URL, inform the user of the temp directory location and clean up advice.
More agent context in julweber/ai_agent_skills
45 other files this repository gives its agents.
AGENTS.md
Skill
- ai-agent-skills-assistantskills/ai-agent-skills-assistant/SKILL.md
- ansibleskills/ansible/SKILL.md
- cavemanskills/caveman/SKILL.md
- claude-cliskills/claude-cli/SKILL.md
- code-doctorskills/code-doctor/SKILL.md
- codex-cliskills/codex-cli/SKILL.md
- concourse-ciskills/concourse-ci/SKILL.md
- dev-brainstormingskills/dev-brainstorming/SKILL.md
- docker-cliskills/docker-cli/SKILL.md
- file-organizerskills/file-organizer/SKILL.md
- frontend-web-developerskills/frontend-web-developer/SKILL.md
- github-actions-cicdskills/github-actions-cicd/SKILL.md
- github-cliskills/github-cli/SKILL.md
- gitlab-ci-cdskills/gitlab-ci-cd/SKILL.md
- grill-meskills/grill-me/SKILL.md
- gtd-assistantskills/gtd-assistant/SKILL.md
- herdr-cliskills/herdr-cli/SKILL.md
- hf-cliskills/hf-cli/SKILL.md
- karpathy-guidelinesskills/karpathy-guidelines/SKILL.md
- list-large-filesskills/list-large-files/SKILL.md
- list-most-intensive-processesskills/list-most-intensive-processes/SKILL.md
- llama-cppskills/llama-cpp/SKILL.md
- llm-wikiskills/llm-wiki/SKILL.md
- mermaidskills/mermaid/SKILL.md
- morning-ritualskills/morning-ritual/SKILL.md
- obsidian-masterskills/obsidian-master/SKILL.md
- obsidian-open-loops-collectorskills/obsidian-open-loops-collector/SKILL.md
- opencode-agent-creatorskills/opencode-agent-creator/SKILL.md
- opencode-cliskills/opencode-cli/SKILL.md
- pi-cliskills/pi-cli/SKILL.md
- pi-subagents-masterskills/pi-subagents-master/SKILL.md
- plnk-cliskills/plnk-cli/SKILL.md
- ponytailskills/ponytail/SKILL.md
- product-prd-brainstormingskills/product-prd-brainstorming/SKILL.md
- python-api-developerskills/python-api-developer/SKILL.md
- ralph-prd-converterskills/ralph-prd-converter/SKILL.md
- ralph-prd-generatorskills/ralph-prd-generator/SKILL.md
- rest-testsuite-skillskills/rest-testssuite/SKILL.md
- skill-loaderskills/skill-loader/SKILL.md
- terraformskills/terraform/SKILL.md
- tmux-coderskills/tmux-coder/SKILL.md
- tmux-specialistskills/tmux-specialist/SKILL.md
- trello-cliskills/trello-cli/SKILL.md
- uvskills/uv/SKILL.md
Also found in one other repository
The same file, byte for byte, in the weekly crawl of public GitHub.
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

