Cook — Implement tính năng

Implement tính năng đầy đủ end-to-end: plan (nếu chưa có) → code → test → review → docs → commit.
Cập nhật bộ claudekit mới: Các lệnh /cook:auto, /cook:auto:fast, /cook:auto:parallel đã bỏ. Thay bằng /cook --auto, /cook --tdd, và /vibe --ship (full autonomous pipeline). Xem cấu trúc skill mới để biết đầy đủ.

Cú pháp


Luồng hoạt động bên trong

Khi bạn gõ /cook "platform listing page", đây là 7 bước xảy ra:
1

Bước 1: Intent Detection

Phân tích input để detect mode:
  • Có path tới plan.md? → mode code (execute plan)
  • Chứa “fast”, “quick”? → mode fast
  • Chứa “trust me”, “auto”? → mode auto
  • Liệt kê 3+ features? → mode parallel
  • Mặc định → mode interactive (có review gates)
2

Bước 2: Research (skip nếu fast/code mode)

Spawn researcher agents song song để tìm hiểu codebase. Dùng /scout hoặc /scout:ext tìm files liên quan. Review Gate: Hỏi user approve findings trước khi plan.
3

Bước 3: Plan

planner subagent tổng hợp research và tạo plan. Nếu có UI work → spawn ui-ux-designer subagent. Review Gate: Hỏi user approve plan trước khi code.
4

Bước 4: Implement

coder subagent viết code theo plan. Chạy typecheck + compile để đảm bảo không lỗi cú pháp. Review Gate: Hỏi user approve code trước khi test.
5

Bước 5: Test (skip nếu --no-test)

tester subagent viết và chạy tests. Nếu fail → debugger subagent tìm root cause → fix → re-test. Gate: 100% tests phải PASS mới tiếp.
6

Bước 6: Code Review

code-reviewer subagent review code. Nếu có critical issues → fix → re-test. Auto-approve nếu score >= 9.5 và 0 critical (chỉ auto mode).
7

Bước 7: Finalize (LUÔN chạy, không skip)

  1. project-manager subagent → sync-back tất cả completed steps vào plan.md
  2. docs-manager subagent → cập nhật ./docs/ nếu cần
  3. Hỏi user commit qua git-manager subagent
  4. Viết journal entry
Hard Gate: KHÔNG được viết code nếu chưa có plan và chưa được review. Dù task có đơn giản đến đâu, phải plan trước.

Ví dụ thực tế


Các chế độ Cook

Implement đầy đủ với review gates ở mỗi bước. User approve trước khi tiếp.
Thời gian: 5-15 phút. Tốt cho: Feature quan trọng, cần kiểm soát chặt.

So sánh với chat trực tiếp


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


Sub-commands


Bảng mode chi tiết


Workflow khuyên dùng

1

Plan trước

2

Review plan

Đọc và chỉnh sửa nếu cần.
3

Cook

4

Verify


Lưu ý & Best Practices

Sai lầm phổ biến:
  • Dùng /cook --auto cho task phức tạp → bỏ qua review gates, code sai hướng
  • Skip plan (“code luôn cho nhanh”) → implement sai, phải rewrite
  • Không đọc plan trước khi cook → implement thiếu hoặc thừa
  • Bỏ test phase → bugs lọt vào staging, QA reject
  • Dùng /vibe --ship cho task chưa làm rõ requirements → end up rewriting
Tips từ team:
  • /cook (default) cho mọi feature quan trọng, cần quality gates
  • /cook --auto chỉ cho task nhỏ, rõ ràng, ít rủi ro
  • /cook --tdd cho code critical (payment, auth, core logic)
  • /vibe --ship cho high-maturity teams + well-scoped features
  • Luôn đọc và confirm plan trước khi approve implementation
→ Xem thêm: Best Practices tổng hợp

Bắt buộc Subagents (MANDATORY)


Chi tiết lệnh Cook (Accordion)

Prefix: /cook "task description" hoặc /cook (sử dụng plan sẵn có)Implement tính năng đầy đủ end-to-end với review gates ở mỗi bước: research → plan → code → test → review → finalize.
Output: Code + tests (100% pass) + code review + updated docs.Thời gian: 5-15 phút.Khi dùng: Feature quan trọng, cần quality gates, team-critical code.
Prefix: /cook --auto "task description"Implement với auto-approval nếu code score >= 9.5/10. Không dừng lại hỏi (trừ khi có critical issues).
Output: Code + tests (auto-merged) + docs.Thời gian: 3-10 phút.Khi dùng: Feature rõ requirements, simple scope, high-confidence automation.
Prefix: /cook --tdd "path/to/plan.md" hoặc /cook --tdd "task"TDD discipline: write tests first, then implement code to pass tests. Ensures 100% test coverage.
Output: Test suite (all green) + implementation + code review.Thời gian: 7-20 phút (longer due to test-first approach).Khi dùng: Critical code paths (payment, auth, core logic), high-risk modules, when quality > speed.
Prefix: /vibe --ship "task description"Complete end-to-end autonomy: worktree creation → plan → cook → PR creation → code review → auto-merge (if passing) → deploy to staging → monitor.
Output: Merged PR + deployed to staging + CI logs + deployment monitoring.Thời gian: 15-40 phút (end-to-end, depends on scope).Khi dùng: High-maturity codebases, well-scoped features, CI/CD pipelines ready, teams comfortable with autonomy.Warning: Requires well-written requirements + passing test suite + clean deploy pipeline.
Prefix: /vibe --beta "task description"Similar to /vibe --ship, but deploys with --beta flag (canary/feature-flag deployment instead of 100% rollout).
Output: Deployed with feature flag, beta monitoring enabled.Khi dùng: Experimental features, uncertain performance impact, gradual rollout preferred.