Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Codebase Archaeology

ASecurity

Systematically explore unfamiliar codebases to build working mental models. Use when onboarding to new project, "what does this do", or understanding legacy code.

22 stars
0 votes
0 copies
0 views
Added 9/20/2026
developmenttypescriptpythonrustgobashsqlexpressfastapiflaskapi

Works with

cliapi

Security Analysis

A100/100

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add lev-os/agents --skill codebase-archaeology --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Codebase Archaeology?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Codebase Archaeology
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lev-os-codebase-archaeology/badge)](https://www.skillsdirectory.com/skills/lev-os-codebase-archaeology)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: codebase-archaeology
description: >-
  Systematically explore unfamiliar codebases to build working mental models.
  Use when onboarding to new project, "what does this do", or understanding legacy code.
---

<!-- TOC: Problem | THE EXACT PROMPT | Documentation First | Quick Start | The Layers | Agent-Assisted | Critical Searches | Output Template | Anti-Patterns | Checklist | References -->

# Codebase Archaeology

> **Core Insight:** Don't read randomly. Documentation first, then follow data flow from entry points outward.

## The Problem

You land in an unfamiliar codebase. Where do you start? Random file reading wastes context. You need a systematic approach that builds understanding efficiently and produces a reusable "mental model" of the architecture.

---

## THE EXACT PROMPT

### For Deep Investigation (Spawning Explore Agent)

```
Thoroughly explore this codebase. I need to understand:

1. Overall architecture and module structure
2. How data flows through the system (input → processing → output)
3. Key data structures (the 3-5 types everything revolves around)
4. The integration points (external APIs, databases, file I/O)
5. Configuration system (env vars, config files, CLI flags)
6. Test infrastructure

Focus on src/ directory structure and main modules. Map out how the pieces fit together.
Be very thorough - I need a complete mental model of how this codebase works.
```

### For Self-Directed Exploration

```
I want you to sort of randomly explore the code files in this project, choosing
code files to deeply investigate and trace their functionality through related
files. Build a comprehensive mental model of the architecture.
```

---

## Documentation First (Critical!)

**Before touching code, ALWAYS read:**

```bash
cat AGENTS.md     # Project-specific rules and architecture notes
cat README.md     # Purpose, installation, usage
```

**Why this matters:**
- AGENTS.md often contains architecture diagrams, key decisions, gotchas
- README.md reveals the project's purpose and main workflows
- Skipping this wastes time rediscovering documented knowledge

---

## Quick Start

```bash
# Phase 1: Orientation (2 min)
cat AGENTS.md README.md | head -200    # DOCUMENTATION FIRST!
ls -la src/ lib/ cmd/ pkg/             # Directory structure
cat Cargo.toml package.json pyproject.toml  # Dependencies

# Phase 2: Entry Points (5 min)
rg "fn main|async fn main" --type rust   # Rust entry
rg "clap|structopt|argparse|commander" . # CLI frameworks
rg "Router|routes|@app\." .              # HTTP routers

# Phase 3: Core Types (5 min)
rg "^(pub )?struct |^class |^interface " --type rust --type ts --type py
rg "impl .* for" --type rust             # Trait implementations

# Phase 4: Data Flow (10 min)
# Trace from entry → handler → service → storage
```

---

## The Layers

```
┌─────────────────────────────────────┐
│ ENTRY POINTS (start here)           │
│ main(), CLI commands, HTTP routes   │
└─────────────┬───────────────────────┘
              │
              ▼
┌─────────────────────────────────────┐
│ HANDLERS / CONTROLLERS              │
│ Request parsing, orchestration      │
└─────────────┬───────────────────────┘
              │
              ▼
┌─────────────────────────────────────┐
│ CORE DOMAIN                         │
│ Business logic, key types           │
└─────────────┬───────────────────────┘
              │
              ▼
┌─────────────────────────────────────┐
│ STORAGE / INTEGRATION               │
│ Database, files, external APIs      │
└─────────────────────────────────────┘
```

---

## Agent-Assisted Exploration

For large codebases, spawn an Explore agent:

```
Task tool → subagent_type: "Explore"
Prompt: "Analyze the [project] codebase to provide a deep technical understanding.
Focus on:
1. Architecture Overview — how components interact
2. Key Data Structures — core types and their relationships
3. Data Flow — trace from ingestion to storage to output
4. Integration Points — external dependencies, APIs, databases"
```

**Why agents help:**
- They can read many files without filling your context
- They return a synthesized summary, not raw data
- You get architecture insights without the noise

---

## Language-Specific Entry Points

| Language | Entry Point | CLI Framework | HTTP Router |
|----------|-------------|---------------|-------------|
| Rust | `fn main()` in main.rs | clap, structopt | axum, actix |
| TypeScript | index.ts, main.ts | commander, yargs | express, fastify |
| Python | `__main__.py`, main.py | argparse, click, typer | flask, fastapi |
| Go | main.go in cmd/ | cobra, flag | chi, gin, echo |

---

## Critical Searches

```bash
# Find entry points
rg "fn main|def main|function main|export default" .

# Find configuration
rg "env\.|process\.env|os\.environ|std::env" .
rg "config|settings|options" --type-add 'cfg:*.{toml,yaml,json}' -t cfg

# Find key types (the 3-5 everything revolves around)
rg "^(pub )?(struct|class|interface|type) \w+" --type rust --type ts --type py

# Find external integrations
rg "fetch\(|reqwest|aiohttp|requests\." .          # HTTP clients
rg "query|execute|SELECT|INSERT" .                  # Database
rg "open\(|File::|fs\." .                           # File I/O

# Find error handling (reveals edge cases)
rg "Error|Exception|panic|unwrap|expect" .
```

---

## Output Template

After exploration, produce a **Comprehensive Technical Summary**:

```markdown
## [Project Name] - Technical Architecture Summary

### Executive Summary
**[Project]** is a [type] that [purpose]. It implements [key patterns].

**Key Statistics:**
- ~X lines of code across Y modules
- Language: [lang] [version]
- Key dependencies: [list]

---

### Entry Points
- `src/main.rs:15` — CLI entry, parses args via clap
- `src/routes/mod.rs:1` — HTTP router (axum)

### Key Types
| Type | Location | Purpose |
|------|----------|---------|
| `Project` | src/model.rs:10 | Core domain object |
| `Config` | src/config.rs:5 | Runtime configuration |
| `Storage` | src/storage.rs:1 | Persistence layer |

### Data Flow
```
CLI args → Config::load() → Project::process() → Storage::save()
```

### External Dependencies
- SQLite via rusqlite (persistence)
- reqwest (HTTP client)
- tokio (async runtime)

### Configuration
| Source | Example |
|--------|---------|
| Env var | `CONFIG_PATH=/etc/tool.toml` |
| Config file | `~/.config/tool/config.toml` |
| CLI flag | `--verbose` |
```

---

## Anti-Patterns

| Don't | Do |
|-------|-----|
| Skip AGENTS.md/README | Documentation first, always |
| Read files randomly | Follow entry point → data flow |
| Read entire files | Skim structure, dive into key functions |
| Ignore tests | Tests reveal intended behavior |
| Get lost in details | Build high-level map first |
| Fill context with raw code | Use Explore agent for synthesis |

---

## When to Use What

| Situation | Approach |
|-----------|----------|
| Brand new codebase | Full archaeology (all phases) |
| Adding a feature | Trace similar existing feature |
| Fixing a bug | Trace from symptom to root |
| Understanding one module | Start from module's public API |
| Large codebase (>10K LOC) | Spawn Explore agent first |

---

## Checklist

- [ ] **Read AGENTS.md/README.md** — Documentation first!
- [ ] **Orientation:** Directory structure, dependencies
- [ ] **Entry points:** main(), CLI commands, HTTP routes
- [ ] **Key types:** The 3-5 structs/classes everything uses
- [ ] **Data flow:** Entry → processing → storage
- [ ] **Config:** Env vars, config files, defaults
- [ ] **Integration:** External APIs, databases, file I/O
- [ ] **Tests:** What do tests reveal about intended behavior?
- [ ] **Produce summary:** Create reusable architecture doc

---

## References

| Need | File |
|------|------|
| Language-specific patterns | [LANGUAGES.md](references/LANGUAGES.md) |
| Common architecture patterns | [PATTERNS.md](references/PATTERNS.md) |
| Example exploration sessions | [EXAMPLES.md](references/EXAMPLES.md) |

Attribution

lev-oslev-os
View sourceMore from lev-os →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

281612 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2132 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →