Codebase Onboarding
Use this skill for fast orientation in a new repository.
Workflow
- Reconnaissance first:
- inspect top-level structure
- detect language, framework, package manager, tests, CI, env files
- Identify:
- entry points
- key directories
- request/data flow
- project conventions
- Read only the files that matter for those findings.
- Xuất kết quả theo hợp đồng ở mục "Bootstrap" bên dưới.
Output Shape
Stack
Architecture
Key directories
Common commands
Conventions
Gotchas
Rules
- Do not read everything.
- Prefer
rg, manifests, config files, and a few representative files.
- Optimize for navigation and execution, not encyclopedic coverage.
Bootstrap (--bootstrap)
Ánh xạ kết quả recon vào đúng file theo D-rules:
| Mục recon |
File đích |
Template |
| Stack, Common commands, Conventions, Gotchas |
AGENTS.md (gốc repo) |
~/.claude/templates/AGENTS.template.md |
| — |
CLAUDE.md (gốc repo) — nội dung là đúng một dòng @AGENTS.md |
— |
| Architecture, request/data flow, Key directories |
docs/internals/overview.md |
~/.claude/templates/internals-overview.template.md |
| — |
docs/README.md — index trỏ tới user/, internals/, operations/ (tầng nào không có thì không liệt kê) |
— |
"Trạng thái hiện tại" (đang làm gì, còn treo gì) KHÔNG sinh file — đó là issue Linear (D0/D4).
Luật khi sinh:
- NEVER ghi đè file đã tồn tại. Đã có → bỏ qua, báo "đã có". Sửa file cũ cho đúng D1/D6 là việc tay riêng, KHÔNG thuộc bootstrap.
- Claim về hành vi trong
AGENTS.md MUST là markdown link tương đối từ chính file chứa link + nhãn ý định (D6). Trong docs/internals/*.md trỏ ra code → bắt đầu bằng ../../; không cần nhãn.
docs/internals/overview.md chỉ giữ điều "maintainer sẽ làm sai nếu thiếu": quyết định + lý do, constraint xuyên module, trap. Không catalog file, không kể lại control-flow (D9).
- Không bịa. Không xác minh được → ghi
unknown.
- Xong thì chạy
bash ~/.claude/scripts/docs-compliance.sh <repo> và bash ~/.claude/scripts/docs-anchors.sh <repo>, dán output.
Quyền thao tác
| write |
approve |
stage |
commit |
| ✅ (không ghi đè) |
✅ trình cho người dùng duyệt |
❌ |
❌ |
KHÔNG git add, KHÔNG git commit (D14).
1---2name: codebase-onboarding3description: Use when entering a new codebase, needing a fast architecture map, or generating onboarding notes from an unfamiliar project. Focuses on reconnaissance first, then targeted reads.4---56# Codebase Onboarding78Use this skill for fast orientation in a new repository.910## Workflow11121. Reconnaissance first:13 - inspect top-level structure14 - detect language, framework, package manager, tests, CI, env files152. Identify:16 - entry points17 - key directories18 - request/data flow19 - project conventions203. Read only the files that matter for those findings.214. Xuất kết quả theo hợp đồng ở mục "Bootstrap" bên dưới.2223## Output Shape2425- `Stack`26- `Architecture`27- `Key directories`28- `Common commands`29- `Conventions`30- `Gotchas`3132## Rules3334- Do not read everything.35- Prefer `rg`, manifests, config files, and a few representative files.36- Optimize for navigation and execution, not encyclopedic coverage.3738## Bootstrap (`--bootstrap`)3940Ánh xạ kết quả recon vào đúng file theo D-rules:4142| Mục recon | File đích | Template |43| -------------------------------------------- | --------------------------------------------------------------- | ---------------------------------------------------- |44| Stack, Common commands, Conventions, Gotchas | `AGENTS.md` (gốc repo) | `~/.claude/templates/AGENTS.template.md` |45| — | `CLAUDE.md` (gốc repo) — nội dung là đúng một dòng `@AGENTS.md` | — |46| Architecture, request/data flow, Key directories | `docs/internals/overview.md` | `~/.claude/templates/internals-overview.template.md` |47| — | `docs/README.md` — index trỏ tới `user/`, `internals/`, `operations/` (tầng nào không có thì không liệt kê) | — |4849"Trạng thái hiện tại" (đang làm gì, còn treo gì) KHÔNG sinh file — đó là issue Linear (D0/D4).5051Luật khi sinh:5253- **NEVER ghi đè file đã tồn tại.** Đã có → bỏ qua, báo "đã có". Sửa file cũ cho đúng D1/D6 là việc tay riêng, KHÔNG thuộc bootstrap.54- Claim về hành vi trong `AGENTS.md` MUST là markdown link **tương đối từ chính file chứa link** + nhãn ý định (D6). Trong `docs/internals/*.md` trỏ ra code → bắt đầu bằng `../../`; không cần nhãn.55- `docs/internals/overview.md` chỉ giữ điều "maintainer sẽ làm sai nếu thiếu": quyết định + lý do, constraint xuyên module, trap. Không catalog file, không kể lại control-flow (D9).56- Không bịa. Không xác minh được → ghi `unknown`.57- Xong thì chạy `bash ~/.claude/scripts/docs-compliance.sh <repo>` và `bash ~/.claude/scripts/docs-anchors.sh <repo>`, dán output.5859## Quyền thao tác6061| write | approve | stage | commit |62| ----------------- | ----------------------------- | ----- | ------ |63| ✅ (không ghi đè) | ✅ trình cho người dùng duyệt | ❌ | ❌ |6465KHÔNG `git add`, KHÔNG `git commit` (D14).