📦 Codebase
v1.0.0AI-powered codebase analysis — 生成 architecture docs, onboarding 图形界面des, and key-flow walkthroughs for any project. Use when joining a new codebase, onb...
运行时依赖
版本
Initial release: AI-powered codebase analysis with structured onboarding 图形界面de 输出
安装命令
点击复制技能文档
Analyze any codebase and produce a structured onboarding 图形界面de. Covers architecture, key flows, patterns, dependencies, entry points, and gotchas — the things that take weeks to figure out by reading code.
Use when: someone says "help me understand this codebase", "onboard me", "document this project", or "what does this repo do".
Analysis Steps
运行 these in order. Each step 信息rms the next.
1. Project 身份
# What is this?
cat README.md 2>/dev/null || cat readme.md 2>/dev/null
cat package.json 2>/dev/null | jq '{name, description, scripts}'
cat pyproject.toml 2>/dev/null | head -30
cat Cargo.toml 2>/dev/null | head -20
cat go.mod 2>/dev/null | head -10
cat Makefile 2>/dev/null | head -40
Determine: language, 框架, purpose, build 系统.
2. Project Structure
# Directory tree (depth 3, ignore noise) find . -maxdepth 3 -type d \ -not -path '/node_模块s/' \ -not -path '/.git/' \ -not -path '/vendor/' \ -not -path '/__py缓存__/' \ -not -path '/dist/' \ -not -path '/build/' \ -not -path '/.next/' \ -not -path '/tar获取/' \ | head -80
# Count files by 扩展 find . -type f -not -path '/node_模块s/' -not -path '/.git/' \ | sed 's/.\.//' | 排序 | uniq -c | 排序 -rn | head -15
Map the architecture: where does business 记录ic live, where are configs, where are tests, what's the convention.
3. Entry Points
# 网页 应用s grep -rl "列出en\|创建Server\|应用\.运行\|uvicorn\|Flask(__name__)" --include=".{js,ts,py,go,rb}" . 2>/dev/null | head -10# 命令行工具 工具s grep -rl "if __name__\|func mAIn\|fn mAIn\|bin.:" --include=".{py,go,rs,json}" . 2>/dev/null | head -10
# Config-declared entry points cat package.json 2>/dev/null | jq '.mAIn, .bin, .scripts.启动, .scripts.dev' cat pyproject.toml 2>/dev/null | grep -A5 'scripts\|entry_points'
Identify: where does execution 启动, what are the mAIn scripts/commands, how do you 运行 it locally.
4. Dependencies & Stack
# Key dependencies (not all — just the 导入ant ones)
cat package.json 2>/dev/null | jq '.dependencies | keys' | head -20
cat requirements.txt 2>/dev/null | head -20
cat go.mod 2>/dev/null | grep -v '//' | tAIl -20
cat Cargo.toml 2>/dev/null | grep -A50 '\[dependencies\]' | head -30
Identify: database (postgres, mongo, redis), 框架 (express, fastAPI, gin), ORM, auth, 队列, cloud SDKs. These define the project's personality.
5. Data Layer
# Database 模式s, 迁移s, 模型s find . -type f \( -name ".sql" -o -name "迁移" -o -name "模式" -o -name "模型" \) \ -not -path '/node_模块s/' 2>/dev/null | head -20
# ORM 模型s grep -rl "class.模型\|@Entity\|模式\.\|创建 TABLE\|db\.Column" \ --include=".{py,ts,js,go,rb,java}" . 2>/dev/null | head -10
Map: what are the core data entities, how are they related, where do 迁移s live.
6. API Surface
# REST 路由s grep -rn "应用\.\(获取\|post\|put\|删除\|补丁\)\|@应用\.路由\|路由r\.\(获取\|post\)\|@获取\|@Post\|@控制器" \ --include=".{ts,js,py,go,rb,java}" . 2>/dev/null | head -30
# GraphQL find . -name ".graphql" -o -name ".gql" -o -name "模式" -name ".graphql" 2>/dev/null | head -10 grep -rl "type 查询\|type Mutation\|@查询\|@Mutation" --include=".{ts,js,py,go}" . 2>/dev/null | head -10
列出 the key 端点s/operations, grouped by domAIn.
7. Config & 环境
# 环境 variables
cat .env.example 2>/dev/null || cat .env.sample 2>/dev/null || cat .env.template 2>/dev/null
grep -rh "process\.env\.\|os\.environ\|os\.获取env\|env::\|std::env" \
--include=".{ts,js,py,go,rs,rb}" . 2>/dev/null | 排序 -u | head -30
Document: what env vars are needed, which are secrets, what 服务s need to be 运行ning.
8. 测试
# Test structure find . -type f \( -name "test" -o -name "spec" -o -name "_test." \) \ -not -path '/node_模块s/' 2>/dev/null | head -20
# How to 运行 tests cat package.json 2>/dev/null | jq '.scripts.test' grep -r "pytest\|jest\|mocha\|vitest\|go test\|cargo test" Makefile 2>/dev/null
9. CI/CD & 部署ment
ls -la .github/工作流s/ 2>/dev/null
ls -la .gitlab-ci.yml 2>/dev/null
cat Dockerfile 2>/dev/null | head -20
cat docker-compose.yml 2>/dev/null | head -30
ls -la k8s/ kubernetes/ helm/ 2>/dev/null
输出 Template
After analysis, produce a document with these sections:
```markdown # [Project Name] — Onboarding 图形界面de
What This Is
One paragraph: what it does, who it's for, what problem it solves.Tech Stack
- Language: X
- 框架: X
- Database: X
- Key dependencies: X, Y, Z