// Comprehensive codebase understanding through structured documentation and guided learning. Use when Claude needs to help a user understand how a project works by exploring and documenting the codebase architecture, concepts, and modules in a .learning/ directory, then guiding them through understanding the code with adaptive explanations. Triggered by requests like "help me understand this project", "document the architecture", "explain how this codebase works", or "guide me through the code".
| name | top-down-learning |
| description | Comprehensive codebase understanding through structured documentation and guided learning. Use when Claude needs to help a user understand how a project works by exploring and documenting the codebase architecture, concepts, and modules in a .learning/ directory, then guiding them through understanding the code with adaptive explanations. Triggered by requests like "help me understand this project", "document the architecture", "explain how this codebase works", or "guide me through the code". |
Learn any codebase through structured exploration and adaptive guidance.
This skill enables deep understanding of codebases through two complementary workflows:
.learning/The approach follows top-down learning principles: start with architecture and high-level concepts, then progressively dive deeper based on user needs.
When: User wants to understand a new project for the first time
Goal: Create the foundation for top-down learning
Steps:
Create .learning directory structure:
mkdir -p .learning/architecture .learning/concepts .learning/modules
echo '*' > .learning/.gitignore
echo '!.gitignore' >> .learning/.gitignore
Scan project structure using view tool:
view . to see top-level structureIdentify key files by viewing root and key directories:
Read key files to understand:
Generate architecture/overview.md using the Architecture Overview Template (see references/templates.md):
Create index.md with:
Output: .learning/ directory with initial structure and high-level architectural documentation
When: User wants to learn about the codebase (first time or returning)
Goal: Guide user through understanding at the right pace and depth
Steps:
Check if .learning exists:
Assess the learner (see references/guided-learning.md โ Initial Assessment):
To guide you effectively:
1. What's your familiarity with [primary tech]?
- Expert / Intermediate / Beginner / New
2. What's your goal?
- Quick overview / Deep understanding / Specific feature / Architecture
3. Any specific interests or questions?
Start the walkthrough:
.learning/architecture/overview.mdGenerate documentation on demand as user explores:
.learning/concepts/[name].md.learning/modules/[name].md.learning/learning-paths/[topic].mdMaintain conversation flow:
Key principle: Generate documentation incrementally as needed, not all at once
When: User wants detailed understanding of specific areas
Steps:
For concepts - Use Concept Documentation Template (references/templates.md):
.learning/concepts/[concept-name].mdFor modules - Use Module Documentation Template (references/templates.md):
.learning/modules/[module-name].mdFor learning paths - Use Learning Path Template (references/templates.md):
.learning/learning-paths/[topic].mdExploration tips:
view [path] to examine specific filesbash_tool with grep/find to search for patternsMatch documentation detail to user's level (see references/templates.md โ Documentation Depth Levels):
Level 1 (High-level) - For quick understanding:
Level 2 (Conceptual) - For practical understanding:
Level 3 (Detailed) - For contribution-ready knowledge:
Follow these guidelines when guiding users (full details in references/guided-learning.md):
The .learning/ directory structure:
.learning/
โโโ .gitignore # Exclude from version control
โโโ index.md # Project overview and navigation
โโโ architecture/
โ โโโ overview.md # High-level architectural analysis
โโโ concepts/
โ โโโ [concept-1].md # Individual concept documentation
โ โโโ [concept-2].md
โโโ modules/
โ โโโ [module-1].md # Individual module documentation
โ โโโ [module-2].md
โโโ learning-paths/ # Optional: structured learning sequences
โโโ [topic].md
Pattern: User new to the codebase
1. Check if .learning/ exists, create if not
2. Scan project structure with view tool
3. Read key config and entry point files
4. Generate architecture/overview.md
5. Ask about their experience and goals
6. Walk through architecture interactively
7. Generate concept/module docs on demand
Pattern: User wants to understand specific feature
1. Check if .learning/ exists, create if not
2. Ask what they already understand
3. Identify related modules and concepts (by viewing relevant directories)
4. Generate docs for those specific areas
5. Show how components connect to implement the feature
Pattern: User wants to contribute
1. Assess their general familiarity
2. Focus on architectural boundaries and module responsibilities
3. Generate detailed module docs for areas they'll modify
4. Explain testing patterns and conventions
5. Point to related code for reference
Pattern: Returning user
1. Check what documentation exists in .learning/
2. Ask what they want to explore today
3. Build on previous documentation
4. Reference prior topics covered
5. Generate new docs as they explore new areas
Useful bash commands for project exploration:
# Find all file types
find . -type f -name "*.ts" | head -20
# Count files by extension
find . -type f | sed 's/.*\.//' | sort | uniq -c | sort -rn
# Find entry points
find . -name "main.*" -o -name "index.*" -o -name "app.*"
# Find config files
find . -maxdepth 2 -name "*.json" -o -name "*.toml" -o -name "*.yaml"
# Search for patterns
grep -r "export.*function" src/ | head -10