Fix
Sửa lỗi nhanh chóng và chính xác với pipeline tự động: diagnose → fix → test → verify.
Kỹ Năng Này Làm Gì
Skill ckm:fix xử lý bug fixing thông minh — từ phân tích stack trace, xác định root cause, implement fix đến chạy tests xác nhận. Tự động định tuyến đến specialist agent phù hợp dựa trên loại lỗi.
Bắt Đầu Nhanh
/ckm:fix
Hoặc mô tả lỗi:
/ckm:fix TypeError: Cannot read property 'map' of undefined tại UserList component
Quy Trình Sửa Lỗi
- Diagnose: Phân tích error message, stack trace và context
- Root cause: Xác định nguyên nhân gốc rễ (không chỉ triệu chứng)
- Fix: Implement giải pháp tối thiểu và chính xác
- Test: Chạy tests liên quan để xác nhận fix
- Verify: Đảm bảo không gây regression
Loại Lỗi Được Hỗ Trợ
| Loại | Ví Dụ | Approach |
|---|---|---|
| Runtime errors | TypeError, ReferenceError | Stack trace analysis |
| Build errors | TS compile, module not found | Dependency check |
| Logic bugs | Wrong output, edge cases | Test case creation |
| Performance | Memory leak, slow queries | Profiling |
| Integration | API failures, webhook errors | Request/response trace |
Ví Dụ Sử Dụng
Bug từ error log:
/ckm:fix Error: ENOENT: no such file or directory, open '/tmp/upload-123'
Fix upload handler để tạo thư mục nếu chưa tồn tại
Logic bug:
/ckm:fix Hàm calculateDiscount trả về giá trị âm khi discount > 100%
Performance issue:
/ckm:fix Dashboard load mất 8 giây — query chậm, cần optimize
Regression:
/ckm:fix Sau khi update auth middleware, social login không hoạt động
Flags
/ckm:fix --quick # Chỉ fix, không chạy full test suite
/ckm:fix --safe # Thêm test case trước khi fix
/ckm:fix --explain # Giải thích root cause chi tiết