Best Practices — Hướng dẫn thực hành
Tổng hợp kinh nghiệm sử dụng Claude Code skills hiệu quả — từ nguyên tắc cơ bản đến workflow nâng cao cho team./fix:test, /cook:auto, /plan:fast, /design:good) đã bỏ. Skill giờ tự route — chỉ cần gõ /fix, /cook, /plan, /stitch. Xem tools-overview mapping.1. Nguyên tắc vàng
5 nguyên tắc bất di bất dịch khi dùng Claude Code:2. Anti-patterns — Sai lầm phổ biến
Bảng suy nghĩ sai → thực tế
Sai lầm theo từng nhóm lệnh (bộ mới)
- Plan
- Cook
- Fix
- Design
- QA
- Deploy
- Skip validation → assumptions sai, phải rewrite
- Plan quá rộng (8+ files trong 1 phase) → khó review, dễ conflict
- Dùng
/plan:fast(không còn tồn tại) — bộ mới chỉ còn/plan
/plan "mô tả"— skill tự chọn depth (fast/deep) theo task- Mỗi phase nên dưới 5 files
/vibetự run validate + red-team plan trước khi cook
3. Skill Combos — Workflow hiệu quả
Workflow theo tình huống
Chi tiết từng workflow (bộ mới)
Feature mới — Pipeline autonomous (khuyến nghị)
Feature mới — Pipeline autonomous (khuyến nghị)
- Task cross-team cần Design handoff riêng
- Refactor lớn cần Eng Manager approve trước → dùng
/plan-eng-review - Task chưa rõ scope → dùng
/plan-ceo-reviewtrước
Feature mới — Manual step-by-step
Feature mới — Manual step-by-step
Fix bug — Root cause first
Fix bug — Root cause first
Trước release
Trước release
Refactor lớn
Refactor lớn
Task cross-team (PM → Design → Dev → QA → DevOps)
Task cross-team (PM → Design → Dev → QA → DevOps)
4. Quy tắc an toàn
Safety skills mới trong bộ claudekit
Khi nào dùng autonomous vs manual
Hard Gates — Không skip được
Rollback Strategy
Khi có vấn đề sau deploy:- Nếu biết nguyên nhân: Hotfix branch →
/investigateprove →/fix→/land-and-deploy - Nếu chưa rõ: Revert commit →
/canaryverify version cũ →/investigate - Nếu data bị ảnh hưởng: Rollback migration (nếu có) → notify stakeholders → post-mortem
5. Team Adoption — Áp dụng cho team
Onboarding checklist cho thành viên mới
Cài đặt Claude Code CLI
Đọc tài liệu
- Tổng quan workflow — hiểu quy trình team
- Tools Overview — bảng skills đầy đủ
- Dev Overview — decision tree chọn lệnh
- QA Overview — quy trình QA
- Trang này — best practices
Thực hành với task nhỏ
Tham gia sprint
Sprint workflow integration (bộ mới)
Cross-team handoff (bộ mới)
6. Troubleshooting — Xử lý sự cố
Khi context hết giữa chừng
Khi skill output không như mong đợi
Khi tests flaky
Khi deploy bị lỗi
/investigate tự làm bước này.7. Giới hạn cần biết
Hiểu giới hạn để tránh bẫy — skills KHÔNG phải magic.Claude có thể skip instructions
Skills là markdown text. Claude đọc nhưng có thể không làm (~20% skip rate). Cách giảm thiểu:- Dùng markers
MANDATORY,KHÔNG SKIPtrong instructions - Check output xem có đủ bước không
- Nếu skip → gõ lại lệnh, nhắc cụ thể bước bị thiếu
- Dùng
/vibe— pipeline có gate checks tự enforce từng bước
Skill gọi skill khác → hay bị skip
Khi skill A gọi/ck-scenario bên trong, Claude hay dùng Agent tool thay vì Skill tool → skill không chạy đúng.
Giải pháp: Luôn gõ TRỰC TIẾP mỗi skill:
Context window dilution
Plan lớn (4 sprints) → output ít chi tiết hơn per-sprint. Giải pháp:- Dùng
--sprint Ncho per-sprint output - Scout TRƯỚC rồi mới spawn agents (truyền context)
- KHÔNG dùng
/cleargiữa chừng (mất context) - Nếu context gần hết →
/watzupđể save state →/clear→ resume với plan path /checkpointđể save decision + remaining work
8. Checklists thực hành
Trước khi bắt đầu feature mới
-
cdvào đúng project folder - Đang dùng Claude Code CLI (không phải web/desktop)
- Đã có GitHub issue (nếu dùng
/vibe) - Đã có plan/PRD hoặc description rõ ràng
- Branch đúng convention (
feat/FXX-YY-*) hoặc dùng/worktree
Trước khi /cook
- Có plan file (
plans/*.md) đã review - PRD, QA, UI specs đã link trong plan
- Database migration sẵn sàng (nếu schema change)
- Đã chạy
/plan validate(hoặc/vibetự làm)
Trước khi /qa-full
- Đã chạy
/ck-scenario "feature"TRỰC TIẾP - Code pass lint + typecheck
- Unit tests đã viết (TDD:
/qa-full:tddtrước) - PRD path sẵn sàng (cho
:accept)
Trước khi /ship
- Đã chạy
/code-review - Đã chạy
/verify— xác nhận feature work thật - CI pass (lint + typecheck + test)
- Test trên staging OK
- PR title đúng Conventional Commits
- No secrets in code (
/security-scan)
Trước khi Design handoff → Dev
- Figma link có đầy đủ screens + states
- Component specs (spacing, colors, typography)
- Responsive breakpoints defined
- Error/empty/loading states có
-
DESIGN.mdcho project mới (/design-consultation) - PM đã review + approve design
Trước khi /land-and-deploy
- PR đã merged hoặc đã enable auto-merge
- CI checks xanh (Vercel/GitHub Actions)
-
/canaryđã cấu hình (screenshot baseline) -
/setup-deployđã chạy 1 lần (config platform) - Rollback plan sẵn sàng
9. So sánh skills hay nhầm lẫn
10. Skills mới cần biết (bộ claudekit mới)
/vibe — Autonomous pipeline
/vibe — Autonomous pipeline
/vibe, /vibe --ship, /vibe --beta, /vibe --ship --beta/investigate — Debug with iron law
/investigate — Debug with iron law
/ck-debug khi cần iron law enforce./verify + /run — Confirm change works
/verify + /run — Confirm change works
/ghpm — GitHub project management
/ghpm — GitHub project management
/land-and-deploy — Merge + deploy + canary
/land-and-deploy — Merge + deploy + canary
/stitch + /design-shotgun — AI design
/stitch + /design-shotgun — AI design
/design:good, /design:screenshot cũ./watzup + /checkpoint — Handoff / resume
/watzup + /checkpoint — Handoff / resume
/cso + /cti-expert — Security
/cso + /cti-expert — Security