Docs — Quản lý documentation

Tạo, cập nhật, và tóm tắt documentation tự động từ codebase.

Cú pháp

/docs                      # Menu chính — init, update, summarize
/docs:init                 # Tạo documentation ban đầu từ codebase
/docs:update               # Cập nhật docs theo thay đổi code
/docs:summarize            # Tóm tắt codebase hiện tại
/llms                      # Generate llms.txt cho LLM-friendly docs

Bảng tham chiếu nhanh

LệnhMô tảUse case
/docs:initScan codebase + tạo docs ban đầuProject mới, chưa có docs
/docs:updatePhân tích changes + update docsSau khi implement features
/docs:summarizeTóm tắt codebaseCần overview nhanh
/llmsGenerate llms.txt (llmstxt.org spec)Cho AI tools đọc docs dễ hơn

Luồng hoạt động

/docs:init

1

Bước 1: Scan codebase

Phân tích project structure, frameworks, dependencies.
2

Bước 2: Generate docs

Tạo docs/ folder với: README, API docs, architecture overview, setup guide.
3

Bước 3: Review

Người dùng review và chỉnh sửa.

/docs:update

1

Bước 1: Detect changes

So sánh code hiện tại với docs hiện có.
2

Bước 2: Identify gaps

Tìm functions/APIs mới chưa được document.
3

Bước 3: Update

Cập nhật docs để phản ánh state mới nhất.

/llms — Generate llms.txt

Tạo file llms.txt theo spec llmstxt.org — giúp AI tools (Claude, GPT) hiểu codebase nhanh hơn.
/llms                      # Generate từ codebase
Output: File llms.txt chứa structured summary của project: architecture, key files, API endpoints, conventions.

Docs-seeker — Tìm docs thư viện

/docs-seeker "next.js app router"     # Tìm docs Next.js
/docs-seeker "prisma relations"       # Tìm docs Prisma
Tìm kiếm documentation của library/framework qua context7.com (llms.txt registry).

Ví dụ thực tế

DOCUMENTATION GENERATED
├── docs/
│   ├── README.md — Project overview + setup
│   ├── architecture.md — System design
│   ├── api/ — API reference (12 endpoints)
│   └── guides/ — Dev guides (auth, deployment)
└── 4 files created, 450 lines total

Khi nào dùng / không dùng

DùngKhông dùng
Project mới cần docsViết blog/marketing content (dùng /write)
Sau sprint, cập nhật docsTạo PRD (dùng /prd)
Tạo llms.txt cho AI consumptionViết test plan (dùng /test-plan)
Tìm docs thư viện bên ngoàiTìm code trong project (dùng /scout)