| name | sourcebase-knowledge-codebase-exploration |
| description | null |
Codebase Exploration
Category: sourcebase-knowledge · Status: 🟢 Active
When to use
Khi bắt đầu làm việc với codebase lạ, trước khi thêm hoặc sửa code.
Steps
- Đọc
package.json/README để xác định framework, scripts, dependency chính.
- Map cấu trúc thư mục: tìm entry (
main, index, App), routing, layout.
- Nhận diện convention: cách đặt tên file, alias import, barrel
index.ts.
- Tìm tầng shared:
components/, hooks/, services/, utils/, types/.
- Đọc 1-2 feature tiêu biểu để hiểu data flow end-to-end.
- Ghi lại pattern phát hiện được trước khi viết code mới.
Template
cat package.json | jq '.scripts, .dependencies'
fd -e ts -e tsx . src | head -50
rg -l "createBrowserRouter|<Routes>" src
rg "export \* from" src/**/index.ts
Example
Good: Đọc config + 1 feature, nắm convention rồi mới sửa, theo đúng alias @/.
Avoid: Sửa ngay file đầu tiên thấy, đặt tên/đường dẫn lệch convention sẵn có.
Checklist