codebase-onboarding by affaan-m/everything-claude-code
npx skills add https://github.com/affaan-m/everything-claude-code --skill codebase-onboarding系统性地分析一个陌生的代码库,并生成结构化的入门指南。专为加入新项目的开发者或首次在现有仓库中设置 Claude Code 而设计。
在不阅读每个文件的情况下收集项目的原始信号。并行运行以下检查:
1. 包清单检测
→ package.json, go.mod, Cargo.toml, pyproject.toml, pom.xml, build.gradle,
Gemfile, composer.json, mix.exs, pubspec.yaml
2. 框架指纹识别
→ next.config.*, nuxt.config.*, angular.json, vite.config.*,
django settings, flask app factory, fastapi main, rails config
3. 入口点识别
→ main.*, index.*, app.*, server.*, cmd/, src/main/
4. 目录结构快照
→ 目录树的前 2 层,忽略 node_modules, vendor,
.git, dist, build, __pycache__, .next
5. 配置和工具检测
→ .eslintrc*, .prettierrc*, tsconfig.json, Makefile, Dockerfile,
docker-compose*, .github/workflows/, .env.example, CI 配置
6. 测试结构检测
→ tests/, test/, __tests__/, *_test.go, *.spec.ts, *.test.js,
pytest.ini, jest.config.*, vitest.config.*
根据侦察数据,识别:
技术栈
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
架构模式
关键目录 将顶级目录映射到其用途:
src/components/ → React UI 组件
src/api/ → API 路由处理器
src/lib/ → 共享工具函数
src/db/ → 数据库模型和迁移
tests/ → 测试套件
scripts/ → 构建和部署脚本
数据流 追踪一个请求从入口到响应的路径:
识别代码库已遵循的模式:
命名约定
*.test.ts、*.spec.ts、*_test.go代码模式
Git 约定
git clone --depth 1),则跳过此部分并注明“Git 历史不可用或太浅,无法检测约定”生成两个输出:
# 入门指南:[项目名称]
## 概述
[2-3 句话:描述项目功能和服务对象]
## 技术栈
<!-- 以 Next.js 项目为例 — 替换为检测到的技术栈 -->
| 层级 | 技术 | 版本 |
|-------|-----------|---------|
| 语言 | TypeScript | 5.x |
| 框架 | Next.js | 14.x |
| 数据库 | PostgreSQL | 16 |
| ORM | Prisma | 5.x |
| 测试 | Jest + Playwright | - |
## 架构
[组件连接方式的图表或描述]
## 关键入口点
<!-- 以 Next.js 项目为例 — 替换为检测到的路径 -->
- **API 路由**:`src/app/api/` — Next.js 路由处理器
- **UI 页面**:`src/app/(dashboard)/` — 认证页面
- **数据库**:`prisma/schema.prisma` — 数据模型单一事实来源
- **配置**:`next.config.ts` — 构建和运行时配置
## 目录映射
[顶级目录 → 用途映射]
## 请求生命周期
[追踪一个 API 请求从入口到响应的过程]
## 约定
- [文件命名模式]
- [错误处理方法]
- [测试模式]
- [Git 工作流]
## 常见任务
<!-- 以 Node.js 项目为例 — 替换为检测到的命令 -->
- **运行开发服务器**:`npm run dev`
- **运行测试**:`npm test`
- **运行代码检查**:`npm run lint`
- **数据库迁移**:`npx prisma migrate dev`
- **生产环境构建**:`npm run build`
## 查找位置
<!-- 以 Next.js 项目为例 — 替换为检测到的路径 -->
| 我想... | 查看... |
|--------------|-----------|
| 添加 API 端点 | `src/app/api/` |
| 添加 UI 页面 | `src/app/(dashboard)/` |
| 添加数据库表 | `prisma/schema.prisma` |
| 添加测试 | `tests/` 中与源码路径匹配的位置 |
| 更改构建配置 | `next.config.ts` |
根据检测到的约定,生成或更新项目特定的 CLAUDE.md。如果 CLAUDE.md 已存在,请先读取并增强它 — 保留现有的项目特定说明,并清晰地指出新增或更改的内容。
# 项目说明
## 技术栈
[检测到的技术栈摘要]
## 代码风格
- [检测到的命名约定]
- [检测到的应遵循的模式]
## 测试
- 运行测试:`[检测到的测试命令]`
- 测试模式:[检测到的测试文件约定]
- 覆盖率:[如果已配置,覆盖率命令]
## 构建与运行
- 开发:`[检测到的开发命令]`
- 构建:`[检测到的构建命令]`
- 代码检查:`[检测到的代码检查命令]`
## 项目结构
[关键目录 → 用途映射]
## 约定
- [如果可检测,提交风格]
- [如果可检测,PR 工作流]
- [错误处理模式]
src/ 不需要解释用户:“引导我入门这个代码库”
操作:运行完整的 4 阶段工作流 → 生成入门指南 + 初始 CLAUDE.md
输出:入门指南直接打印到对话中,同时将 CLAUDE.md 写入项目根目录
用户:“为这个项目生成一个 CLAUDE.md”
操作:运行阶段 1-3,跳过入门指南,仅生成 CLAUDE.md
输出:包含检测到约定的项目特定 CLAUDE.md
用户:“用当前项目约定更新 CLAUDE.md”
操作:读取现有的 CLAUDE.md,运行阶段 1-3,合并新发现
输出:更新后的 CLAUDE.md,并清晰标记新增内容
每周安装量
224
仓库
GitHub 星标数
105.0K
首次出现
5 天前
安全审计
安装于
codex213
cursor195
gemini-cli193
github-copilot193
amp193
cline193
Systematically analyze an unfamiliar codebase and produce a structured onboarding guide. Designed for developers joining a new project or setting up Claude Code in an existing repo for the first time.
Gather raw signals about the project without reading every file. Run these checks in parallel:
1. Package manifest detection
→ package.json, go.mod, Cargo.toml, pyproject.toml, pom.xml, build.gradle,
Gemfile, composer.json, mix.exs, pubspec.yaml
2. Framework fingerprinting
→ next.config.*, nuxt.config.*, angular.json, vite.config.*,
django settings, flask app factory, fastapi main, rails config
3. Entry point identification
→ main.*, index.*, app.*, server.*, cmd/, src/main/
4. Directory structure snapshot
→ Top 2 levels of the directory tree, ignoring node_modules, vendor,
.git, dist, build, __pycache__, .next
5. Config and tooling detection
→ .eslintrc*, .prettierrc*, tsconfig.json, Makefile, Dockerfile,
docker-compose*, .github/workflows/, .env.example, CI configs
6. Test structure detection
→ tests/, test/, __tests__/, *_test.go, *.spec.ts, *.test.js,
pytest.ini, jest.config.*, vitest.config.*
From the reconnaissance data, identify:
Tech Stack
Architecture Pattern
Key Directories Map the top-level directories to their purpose:
src/components/ → React UI components
src/api/ → API route handlers
src/lib/ → Shared utilities
src/db/ → Database models and migrations
tests/ → Test suites
scripts/ → Build and deployment scripts
Data Flow Trace one request from entry to response:
Identify patterns the codebase already follows:
Naming Conventions
*.test.ts, *.spec.ts, *_test.goCode Patterns
Git Conventions
git clone --depth 1), skip this section and note "Git history unavailable or too shallow to detect conventions"Produce two outputs:
# Onboarding Guide: [Project Name]
## Overview
[2-3 sentences: what this project does and who it serves]
## Tech Stack
<!-- Example for a Next.js project — replace with detected stack -->
| Layer | Technology | Version |
|-------|-----------|---------|
| Language | TypeScript | 5.x |
| Framework | Next.js | 14.x |
| Database | PostgreSQL | 16 |
| ORM | Prisma | 5.x |
| Testing | Jest + Playwright | - |
## Architecture
[Diagram or description of how components connect]
## Key Entry Points
<!-- Example for a Next.js project — replace with detected paths -->
- **API routes**: `src/app/api/` — Next.js route handlers
- **UI pages**: `src/app/(dashboard)/` — authenticated pages
- **Database**: `prisma/schema.prisma` — data model source of truth
- **Config**: `next.config.ts` — build and runtime config
## Directory Map
[Top-level directory → purpose mapping]
## Request Lifecycle
[Trace one API request from entry to response]
## Conventions
- [File naming pattern]
- [Error handling approach]
- [Testing patterns]
- [Git workflow]
## Common Tasks
<!-- Example for a Node.js project — replace with detected commands -->
- **Run dev server**: `npm run dev`
- **Run tests**: `npm test`
- **Run linter**: `npm run lint`
- **Database migrations**: `npx prisma migrate dev`
- **Build for production**: `npm run build`
## Where to Look
<!-- Example for a Next.js project — replace with detected paths -->
| I want to... | Look at... |
|--------------|-----------|
| Add an API endpoint | `src/app/api/` |
| Add a UI page | `src/app/(dashboard)/` |
| Add a database table | `prisma/schema.prisma` |
| Add a test | `tests/` matching the source path |
| Change build config | `next.config.ts` |
Generate or update a project-specific CLAUDE.md based on detected conventions. If CLAUDE.md already exists, read it first and enhance it — preserve existing project-specific instructions and clearly call out what was added or changed.
# Project Instructions
## Tech Stack
[Detected stack summary]
## Code Style
- [Detected naming conventions]
- [Detected patterns to follow]
## Testing
- Run tests: `[detected test command]`
- Test pattern: [detected test file convention]
- Coverage: [if configured, the coverage command]
## Build & Run
- Dev: `[detected dev command]`
- Build: `[detected build command]`
- Lint: `[detected lint command]`
## Project Structure
[Key directory → purpose map]
## Conventions
- [Commit style if detectable]
- [PR workflow if detectable]
- [Error handling patterns]
src/ doesn't need an explanationUser : "Onboard me to this codebase" Action : Run full 4-phase workflow → produce Onboarding Guide + Starter CLAUDE.md Output : Onboarding Guide printed directly to the conversation, plus a CLAUDE.md written to the project root
User : "Generate a CLAUDE.md for this project" Action : Run Phases 1-3, skip Onboarding Guide, produce only CLAUDE.md Output : Project-specific CLAUDE.md with detected conventions
User : "Update the CLAUDE.md with current project conventions" Action : Read existing CLAUDE.md, run Phases 1-3, merge new findings Output : Updated CLAUDE.md with additions clearly marked
Weekly Installs
224
Repository
GitHub Stars
105.0K
First Seen
5 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex213
cursor195
gemini-cli193
github-copilot193
amp193
cline193
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
144,300 周安装