一键导入
codebase-onboarding
Analyze an unfamiliar codebase and produce a structured onboarding guide with architecture map, conventions, and a starter AGENTS.md.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyze an unfamiliar codebase and produce a structured onboarding guide with architecture map, conventions, and a starter AGENTS.md.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Plan a huge chunk of work — more than one agent session can hold — as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way is clear. On ticket close, may offer ADRs (promotion into docs/adr/) when ADR-POLICY criteria hold.
Sharpen a plan or design against this codebase via grilling + domain-modeling (CONTEXT.md / ADR offers). May offer /wayfinder when fog appears. Invoke with `/grill-with-docs`.
Applies Dockerfile, Docker Compose, BuildKit, and container security patterns for local development and hardened deployable images. Use when authoring Dockerfiles or compose files, wiring secrets (runtime vs build-time), reproducible bases, PID 1 and healthchecks, volumes and networking, supply-chain hygiene, or troubleshooting compose stacks.
Routes Go work to the right reference guides and conventions for the task. Use when working on Go architecture, implementation, refactoring, concurrency, error handling, testing, performance, or code review.
PostgreSQL database patterns for query optimization, schema design, indexing, and security. Use when writing SQL or migrations, designing schemas, troubleshooting slow queries, implementing Row Level Security, tuning connection pooling, or reviewing database changes. Based on Supabase-leaning Postgres practice.
Applies Python idioms, PEP 8 norms, typing, packaging, concurrency, tooling, and performance discipline to everyday Python code. Use when writing, reviewing, refactoring, or packaging Python; when the user names type hints, dataclasses, pytest, ruff/black/mypy, asyncio, concurrency, EAFP vs LBYL, or Python idioms; or asks for a Python-specific code-quality pass.
| name | codebase-onboarding |
| description | Analyze an unfamiliar codebase and produce a structured onboarding guide with architecture map, conventions, and a starter AGENTS.md. |
| disable-model-invocation | true |
Systematically analyze an unfamiliar codebase and produce a structured onboarding guide. Designed for developers joining a new project or using Cursor (or similar agents) in an existing repo for the first time.
CLAUDE.md if the team already standardizes on it)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 AGENTS.md at the repo root based on detected conventions. This file is the primary place for agent instructions in Cursor. If AGENTS.md already exists, read it first and enhance it — preserve existing project-specific instructions and clearly call out what was added or changed.
If the repository already uses CLAUDE.md for another tool or team convention, you may add a short pointer in AGENTS.md or maintain CLAUDE.md in parallel — do not delete team-owned CLAUDE.md content without explicit user direction.
# 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]
CLAUDE.md) — enhance rather than blindly replacing. Call out what's new vs existing.src/ doesn't need an explanationUser: "Onboard me to this codebase"
Action: Run full 4-phase workflow → produce Onboarding Guide + Starter AGENTS.md
Output: Onboarding Guide printed directly to the conversation, plus AGENTS.md written to the project root
User: "Generate an AGENTS.md for this project"
Action: Run Phases 1-3, skip Onboarding Guide, produce only AGENTS.md
Output: Project-specific AGENTS.md with detected conventions
User: "Update the AGENTS.md with current project conventions"
Action: Read existing AGENTS.md, run Phases 1-3, merge new findings
Output: Updated AGENTS.md with additions clearly marked