codebase-navigation
Navigate, search, and understand project structures. Use when onboarding to a codebase, locating implementations, tracing dependencies, or understanding architecture. Provides patterns for file searching with Glob, code searching with Grep, and systematic architecture analysis.
- License 许可
- MIT
- 最近更新
- 2026-11-01
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- codebase-navigation
- description
- Navigate, search, and understand project structures. Use when onboarding to a codebase, locating implementations, tracing dependencies, or understanding architecture. Provides patterns for file searching with Glob, code searching with Grep, and systematic architecture analysis.
02 资源文件 1
- 参考文档examples/exploration-patterns.md7.2 KB
03 SKILL.md 正文
Codebase Exploration
Systematic patterns for navigating and understanding codebases efficiently.
When to Use
- Onboarding to a new codebase - Understanding project structure and conventions
- Locating specific implementations - Finding where functionality lives
- Tracing dependencies - Understanding how components connect
- Architecture analysis - Mapping system structure and boundaries
- Finding usage patterns - Discovering how APIs or functions are used
- Investigating issues - Tracing code paths for debugging
Quick Structure Analysis
Start broad, then narrow down. This three-step pattern works for any codebase.
Step 1: Project Layout
# Understand top-level structure
ls -la
# Find configuration files (reveals tech stack)
ls -la *.json *.yaml *.yml *.toml 2>/dev/null
# Check for documentation
ls -la README* CLAUDE.md docs/ 2>/dev/null
Step 2: Source Organization
# Find source directories
Glob: **/src/**/*.{ts,js,py,go,rs,java}
# Find test directories
Glob: **/{test,tests,__tests__,spec}/**/*
# Find entry points
Glob: **/index.{ts,js,py} | **/main.{ts,js,py,go,rs}
Step 3: Configuration Discovery
# Package/dependency files
Glob: **/package.json | **/requirements.txt | **/go.mod | **/Cargo.toml
# Build configuration
Glob: **/{tsconfig,vite.config,webpack.config,jest.config}.*
# Environment/deployment
Glob: **/{.env*,docker-compose*,Dockerfile}
Deep Search Strategies
Finding Implementations
When you need to locate where something is implemented:
# Find function/class definitions
Grep: (function|class|interface|type)\s+TargetName
# Find exports
Grep: export\s+(default\s+)?(function|class|const)\s+TargetName
# Find specific patterns (adjust for language)
Grep: def target_name # Python
Grep: func TargetName # Go
Grep: fn target_name # Rust
Tracing Usage
When you need to find where something is used:
# Find imports of a module
Grep: import.*from\s+['"].*target-module
# Find function calls
Grep: targetFunction\(
# Find references (broad search)
Grep: TargetName
Architecture Mapping
When you need to understand system structure:
# Find all route definitions
Grep: (app\.(get|post|put|delete)|router\.)
# Find database models/schemas
Grep: (Schema|Model|Entity|Table)\s*\(
Glob: **/{models,entities,schemas}/**/*
# Find service boundaries
Glob: **/{services,controllers,handlers}/**/*
Grep: (class|interface)\s+\w+Service
Exploration Patterns by Goal
Goal: Understand Entry Points
# Web application routes
Grep: (Route|path|endpoint)
Glob: **/routes/**/* | **/*router*
# CLI commands
Grep: (command|program\.)
Glob: **/cli/**/* | **/commands/**/*
# Event handlers
Grep: (on|handle|subscribe)\s*\(
Goal: Find Configuration
# Environment variables
Grep: (process\.env|os\.environ|env\.)
# Feature flags
Grep: (feature|flag|toggle)
# Constants/config objects
Grep: (const|let)\s+(CONFIG|config|settings)
Glob: **/{config,constants}/**/*
Goal: Understand Data Flow
# Database queries
Grep: (SELECT|INSERT|UPDATE|DELETE|find|create|update)
Grep: (prisma|sequelize|typeorm|mongoose)\.
# API calls
Grep: (fetch|axios|http\.|request\()
# State management
Grep: (useState|useReducer|createStore|createSlice)
Best Practices
Search Efficiently
- Start with Glob for file discovery - faster than grep for locating files
- Use Grep for content search - supports regex and context
- Narrow scope - search in specific directories when possible
- Check output modes - use
files_with_matchesfor discovery,contentfor analysis
Build Mental Models
- Map the layers - presentation, business logic, data access
- Identify patterns - repository, service, controller, etc.
- Note conventions - naming, file organization, code style
- Document boundaries - where modules connect and separate
Avoid Common Pitfalls
- Do not search entire node_modules/vendor directories
- Do not assume structure without verifying
- Do not skip reading project documentation (README, CLAUDE.md)
- Do not grep for common words without filtering (use glob filters)
Output Format
After exploration, summarize findings:
## Codebase Overview
**Tech Stack:** [Languages, frameworks, tools]
**Architecture:** [Monolith, microservices, modular, etc.]
**Entry Points:** [Main files, routes, handlers]
## Key Directories
- `src/` - [Purpose]
- `lib/` - [Purpose]
- `tests/` - [Purpose]
## Conventions Observed
- Naming: [Pattern]
- File organization: [Pattern]
- Testing: [Pattern]
## Dependencies
- [Key dependency]: [Purpose]
- [Key dependency]: [Purpose]
References
- Exploration Patterns Examples - Detailed practical examples
04 同仓库更多 Skills
seedance-prompt-en
Write effective prompts for Jimeng Seedance 2.0 multimodal AI video generation. Use when users want to create video prompts using text, images, videos, and audio inputs with the @ reference system. Covers camera movements, effects replication, video extension, editing, music beat-matching, e-commerce ads, short dramas, and educational content.
onepage-pdf
Convert an HTML page into a single continuous-page PDF (one tall page, no pagination breaks), preserving desktop layout, backgrounds and selectable text. Use when the user asks to turn an HTML file/report/proposal into a "single-page PDF", "long PDF", "不分页 PDF", "单页 PDF", "长图式 PDF", or complains that an HTML-to-PDF export breaks into pages or cuts content. Supports optional string redaction with leak verification.
native-feel-cross-platform-desktop
Use when the user is designing, prototyping, or rewriting a desktop app that must run on multiple OSes (macOS + Windows, optionally Linux) AND feel indistinguishable from a native app to its users — fast launch, native windowing, native input handling, native materials. Trigger words include "cross-platform desktop", "Electron alternative", "Tauri vs native", "WebView wrapper", "near-native performance", "Raycast architecture", "WebKit/WebView2 quirks", "WKWebView", "system tray app", "global hotkey app", "launcher app". Do NOT trigger this skill for pure web apps, pure mobile apps, or for greenfield projects that have no native-feel requirement.
gstack
Router for the gstack skill suite. (gstack)
fireworks-tech-graph
Use when the user wants to create any technical diagram - architecture, data flow, flowchart, sequence, agent/memory, or concept map - and export as SVG+PNG. Trigger on: "画图" "帮我画" "生成图" "做个图" "架构图" "流程图" "可视化一下" "出图" "generate diagram" "draw diagram" "visualize" or any system/flow description the user wants illustrated.
dbs-video-extract
接收抖音、小红书、微信视频号等短视频链接或分享文案,查询作品/账号数据并提取语音文字稿,按作者和标题归档为 Markdown。用户希望完整解析短视频、取得数据或文字稿时使用;运行前检查 TikHub 与轻抖使用凭证,缺少时用新手能理解的方式引导购买和安全配置。