agentleFS
KubementatKubementat/ai_agent_skills/skills/code-summarizer/SKILL.md

code-summarizer

Skill2 starsChanged 8 months agoMITView on GitHub

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.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Local path: Verify the directory exists.

    line 14
  2. Very specific:

    Use rg (ripgrep) liberally to trace concepts:

    line 53
  3. Distinctive:

    After delivering the summary, ask:

    line 105
  4. Very specific:

    If the user requests a detailed report, write it to a markdown file at a location the user specifies (default: …

    line 115
  5. Distinctive:

    No hallucination: If you can't determine something, say so.

    line 123
  6. Distinctive:

    Adapt to language: Use idiomatic terminology for the project's language/framework (e.g., "crates" for Rust, "packages" for Go).

    line 124
  7. Distinctive:

    Git-aware: Use git history to identify active areas, recent changes, and who to ask about what.

    line 125
  8. Distinctive:

    Remote repos: When cloning from a URL, inform the user of the temp directory location and clean up advice.

    line 126

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.