ClaudeKit Engineer

Bắt đầu với Claude Code và ClaudeKit

Từ AI assistant thành development partner. Giải thích cơ chế hoạt động của Claude và hướng dẫn Engineer Kit với real-world use cases và best/bad practices.

Section 01

Claude Code là gì?

Claude Code là môi trường coding agentic từ Anthropic — không chỉ là chatbot trả lời câu hỏi, mà là AI có thể đọc files, chạy commands, sửa code, và tự động giải quyết vấn đề trong khi bạn quan sát hoặc đi làm việc khác.

Khác biệt với tools khác

Traditional AI Claude Code
Bạn viết code, AI review Bạn mô tả ý tưởng, AI implement
Copy-paste từng đoạn AI tự đọc/sửa files trực tiếp
Phải hướng dẫn từng bước AI tự explore, plan, execute
Không có tool use Full access: bash, git, file system

Context Window — Tài nguyên quan trọng nhất

Claude Code có context window chứa toàn bộ conversation: messages, files đã đọc, command outputs. Performance giảm khi context đầy — đây là constraint quan trọng nhất cần quản lý.

Claude "quên" instructions
Không follow những gì bạn đã nói trước đó
Lặp lại công việc
Làm lại những gì đã hoàn thành
Bỏ qua CLAUDE.md
Không follow rules đã định nghĩa

Giải pháp: /clear thường xuyên giữa các tasks không liên quan.

Section 02

ClaudeKit là gì?

ClaudeKit là bộ workflow templates cho Claude Code, gồm 2 kits:

Engineer Kit Development workflows (bài này focus)
Marketing Kit Content & marketing workflows (coming soon)

ClaudeKit là paid product. Mình highly recommend bộ kit này vì độ hiệu quả cũng như sự active trong việc maintenance của các maintainer — giúp tiết kiệm rất nhiều thời gian thay vì phải research quá nhiều configs, workflows đang đầy rẫy trên internet.

Mua ClaudeKit (giảm 20%)

Engineer Kit (claudekit-engineer) biến Claude Code từ AI assistant thành development partner. Không phải app độc lập — là folder .claude/ bạn drop vào project.

Skills
Commands Claude invoke: /ck:cook, /ck:fix, /ck:brainstorm
Hooks
Scripts tự động chạy khi events xảy ra
Agents
Subagent roles: planner, researcher, tester
Rules
Guidelines persistent mỗi session

Philosophy: YAGNI + KISS + DRY

YAGNI
You Aren't Gonna Need It — Không code tính năng chưa cần
KISS
Keep It Simple — Solution đơn giản nhất
DRY
Don't Repeat Yourself — Abstract khi có pattern lặp
Section 03

Cài đặt và Setup

Bước 1: Cài ClaudeKit CLI

Install CLI trước (1 lần duy nhất cho cả máy):

Terminal
npm install -g claudekit-cli
Installer path picker
Chọn options → lấy command phù hợp
1. Project status
2. Config scope
3. Automation level
4. Release channel
5. Existing install advanced
▸ Your command

        

Nếu folder .claude/.claude\ đã tồn tại, backup hoặc merge files thủ công trước khi init.

Project structure sau khi chạy ck init
project/
├── CLAUDE.md              Template (customize after)
├── AGENTS.md              Agent definitions
├── .gitignore
├── .repomixignore         Repomix ignore patterns
├── release-manifest.json  Kit version manifest
├── plans/                 Plans directory
├── .opencode/             OpenCode compatibility
└── .claude/               ClaudeKit config
    ├── .ck.json           Kit metadata
    ├── settings.json      Claude Code settings
    ├── metadata.json      Deletion patterns
    ├── statusline.cjs     Statusline config
    ├── .env.example       Environment template
    ├── .mcp.json.example  MCP config template
    ├── agents/            14+ definitions
    ├── hooks/             22+ hooks
    ├── rules/             Workflow rules
    ├── skills/            90+ commands
    ├── scripts/           Utility scripts
    ├── schemas/           JSON schemas
    ├── output-styles/     Response formats
    └── session-state/     Session tracking
Kit installed successfully

Bước 2: Tuỳ chỉnh CLAUDE.md

ck newck init (mặc định "Update everything: Yes") tự động tạo CLAUDE.md template. Chỉ khi chọn "Update everything: No", CK mới bỏ qua file này.

Sau khi CK tạo template, bạn có thể tuỳ chỉnh thêm theo project:

CLAUDE.md (example)
# Project Name ## Build Commands - `npm install` — install dependencies - `npm run dev` — start dev server - `npm test` — run tests ## Code Style - Use ES modules (import/export) - Prefer async/await over callbacks - TypeScript strict mode

Giữ dưới 200 dòng. File dài tốn context và khiến Claude dễ bỏ sót rule (adherence giảm — tức mức độ tuân thủ chỉ dẫn kém đi). Chỉ ghi những gì quan trọng: build commands, coding standards, quy ước chính. Nếu instructions phình ra, tách bớt sang @import hoặc file trong .claude/rules/.

Bước 3: Set coding level (tuỳ chọn)

Trong Claude Code session, chạy command /ck:coding-level (không có tham số) để mở interactive selector chọn 1 trong 6 levels. Hoặc set trực tiếp: /ck:coding-level 3.

Claude Code
# Mở interactive selector (menu 0-5) /ck:coding-level # Hoặc set level cụ thể /ck:coding-level 1 # Junior mode

Alternative — Output Styles (native): Claude Code có feature Output styles riêng — chạy /config → chọn "Output style" → pick từ menu. Đây là feature độc lập của Claude Code, tình cờ có một số style naming tương tự CK coding levels.

Khác biệt mechanism:

  • /ck:coding-level ghi vào .ck.json, guidelines inject qua SessionStart hook mỗi lần mở session.
  • Output styles thay đổi trực tiếp system prompt (lưu outputStyle trong .claude/settings.local.json, có hiệu lực từ session kế tiếp để giữ prompt cache ổn định).

Chọn 1 trong 2 — dùng /ck:coding-level hoặc native Output styles, không nên bật cả hai cùng lúc để tránh guidelines chồng chéo.

LevelNameStyle
0ELI5Giải thích như nói với người không biết code
1JuniorExplains WHY, mentor style
2Mid-levelDesign patterns, system thinking
3SeniorTrade-offs, architecture decisions
4Tech LeadRisk & business impact
5God ModeZero hand-holding (default, cho 15+ năm kinh nghiệm)
God Mode là gì (default)

God Mode giả định bạn là expert (15+ năm hoặc domain specialist) — biết trước câu trả lời, chỉ cần validation/second opinion/fast typing. Claude hoạt động như force multiplier, không phải teacher.

Sẽ làm
• Default to code, không prose • Production-ready code ngay lập tức • Advanced patterns không explain • Challenge approach nếu thấy flaw nghiêm trọng • Flag chỉ critical issues (security, data loss) • Terse — mỗi từ phải earn its place
Sẽ KHÔNG làm
• KHÔNG explain concepts/patterns/syntax • KHÔNG "Here's how...", "Let me explain..." • KHÔNG add comments trừ khi yêu cầu • KHÔNG "Key Takeaways", summaries, next steps • KHÔNG ask clarifying questions cho ambiguity nhỏ • KHÔNG treat bạn như cần hand-holding

Nếu mới học Claude Code, set level 1 hoặc 2 để có explanations. God Mode tối ưu velocity nhưng giả định bạn tự debug được khi Claude sai.

Section 04

Custom Rules — .claude/rules/

Với projects lớn, split instructions thành nhiều file nhỏ trong .claude/rules/ thay vì nhét tất cả vào một CLAUDE.md. Rules có thể scope theo file paths qua YAML frontmatter — chỉ load vào context khi Claude đụng files match pattern, tiết kiệm context space.

Cấu trúc .claude/ directory

Rules chỉ là 1 phần — .claude/ chứa nhiều loại config. Tóm tắt Project scope (shared với team qua git) vs Global scope (personal, per-machine):

Project scope
Committed qua git · shared với team
./CLAUDE.md              # project instructions (hoặc ./.claude/CLAUDE.md)
./CLAUDE.local.md        # personal — gitignored
./.mcp.json              # MCP servers (team-shared)
./.worktreeinclude       # copy gitignored files vào worktree mới (optional)
./.claude/
├── settings.json        # permissions, hooks, model
├── settings.local.json  # personal — auto-gitignored
├── rules/*.md           # topic rules (path-scopable)
├── skills/<name>/       # /skill-name + bundles
├── commands/*.md        # /command (legacy — prefer skills)
├── agents/*.md          # subagents
├── agent-memory/        # project subagent memory (memory: project)
└── output-styles/*.md   # system-prompt styles
.\CLAUDE.md              # project instructions (hoặc .\.claude\CLAUDE.md)
.\CLAUDE.local.md        # personal — gitignored
.\.mcp.json              # MCP servers (team-shared)
.\.worktreeinclude       # copy gitignored files vào worktree mới (optional)
.\.claude\
├── settings.json        # permissions, hooks, model
├── settings.local.json  # personal — auto-gitignored
├── rules\*.md           # topic rules (path-scopable)
├── skills\<name>\       # /skill-name + bundles
├── commands\*.md        # /command (legacy — prefer skills)
├── agents\*.md          # subagents
├── agent-memory\        # project subagent memory (memory: project)
└── output-styles\*.md   # system-prompt styles
Global scope
Your machine only · never committed
~/.claude.json           # app state, personal MCP, UI prefs
~/.claude/
├── CLAUDE.md            # global instructions
├── settings.json        # default settings
├── keybindings.json     # custom shortcuts
├── rules/*.md           # user-level rules
├── skills/              # personal skills
├── commands/            # personal commands
├── agents/              # personal subagents
├── agent-memory/        # subagent memory (memory: user)
├── output-styles/       # personal styles
├── plugins/             # installed plugins (auto-managed)
└── projects/<project>/memory/   # auto-memory (Claude tự ghi)
%USERPROFILE%\.claude.json  # app state, MCP, UI prefs
%USERPROFILE%\.claude\
├── CLAUDE.md            # global instructions
├── settings.json        # default settings
├── keybindings.json     # custom shortcuts
├── rules\*.md           # user-level rules
├── skills\              # personal skills
├── commands\            # personal commands
├── agents\              # personal subagents
├── agent-memory\        # subagent memory (memory: user)
├── output-styles\       # personal styles
├── plugins\             # installed plugins (auto-managed)
└── projects\<project>\memory\  # auto-memory (Claude tự ghi)

Path-specific rules — scope rule theo file pattern

Chỉ load rule khi cần

Thêm YAML frontmatter vào đầu file rule để giới hạn phạm vi áp dụng. Claude chỉ nạp rule vào context khi đang thao tác với files match glob patterngiảm context bloat mà vẫn giữ guidance chuyên biệt cho từng domain (auth, db, UI, tests…).

.claude/rules/typescript-api.md
--- description: TypeScript API conventions applies_to: - "src/api/**/*.ts" - "src/services/**/*.ts" --- # TypeScript API Rules - Dùng zod schema cho mọi request/response body. - Trả Result<T, E> thay vì throw ở service layer. - Auth middleware phải chạy trước validation middleware.
Rules là guidance, KHÔNG phải enforcement

Rules (và CLAUDE.md) là instructions Claude đọc, không phải config Claude Code enforce. Claude có thể không follow nếu instructions mâu thuẫn hoặc mơ hồ. Cho behavior guaranteed, dùng:

  • Hooks (settings.json) — scripts chạy trước/sau tool calls
  • Permissions — allow/deny specific tools/commands

CLAUDE.md vs Settings: 2 cơ chế merge khác nhau

CLAUDE.md + rulessettings.json
Concatenated vào context — cả global + project + local đều được đọcKey-level override — project override global, local override project
Khi conflict: file load sau thắng (last read)Arrays (permissions.allow) combine; scalars (model) lấy giá trị specific nhất
Commands ≈ Skills
Commands và skills giờ cùng 1 mechanism. Workflows mới nên dùng skills/<name>/SKILL.md — bundle SKILL.md + supporting files (checklist, scripts, reference docs). Nếu skill và command trùng tên, skill thắng.
Auto-memory
Claude tự ghi notes vào ~/.claude/projects/<project>/memory/MEMORY.md (first 200 dòng / 25KB loaded mỗi session). Topic files lazy-load. Toggle: /memory hoặc autoMemoryEnabled setting.

Sự khác biệt: CLAUDE.md vs rules/

CLAUDE.md.claude/rules/*.md
Instructions chung cho toàn projectInstructions modular, chia theo topic/path
Luôn load vào context từ launchKhông paths: load từ launch · Có paths: lazy-load khi match files
Target: under 200 dòngMỗi file một topic (code-style.md, testing.md...)
Build commands, conventions tổng quanDomain rules: API, frontend, security, DB...
Một file duy nhấtNhiều file, subdirectories recursive
Path-specific rules

Dùng YAML frontmatter với field paths để rule chỉ active khi Claude đụng files match:

.claude/rules/api-design.md
--- paths: - "src/api/**/*.ts" - "src/server/**/*.ts" --- # API Development Rules - All endpoints must validate input via Zod - Use standard error response format - Include OpenAPI docs comments

Rules không có paths field load unconditionally. Có paths thì trigger khi Claude read files match pattern.

Best Practices khi tạo rules

DO
• Chia rules theo domain/concern (i18n-rules.md, testing-rules.md...) • Viết ngắn gọn, bullet/checklist — Claude parse nhanh • Kebab-case, tên mô tả rõ (api-error-handling.md) • Include examples (good vs bad) • Reference paths chính xác khi apply cho folder cụ thể
DON'T
• Viết rules dài dòng như documentation • Duplicate content giữa CLAUDE.md và rules/ • Tạo rules cho những thứ YAGNI (1-time use)

Use Cases phổ biến

UC1: Multi-language app (i18n)
Tạo .claude/rules/i18n-rules.md cho app đa ngôn ngữ.
i18n-rules.md
# i18n Rules ## Scope Apply to all user-facing text in src/components/ and src/pages/. ## Rules - Mọi user-visible string PHẢI dùng `t('key')` từ `useTranslation()` - Translation keys tại `src/i18n/{locale}/{namespace}.json` - Support locales: vi (default), en, zh, ja - Key naming: `section.component.element` - KHÔNG i18n: code snippets, entity IDs, technical identifiers ## Khi thêm text mới 1. Thêm key vào `src/i18n/vi/{ns}.json` trước 2. Copy key sang 3 locales còn lại với placeholder 3. Cập nhật `src/i18n/index.ts` nếu tạo namespace mới
UC2: API Error Handling
Enforce pattern discriminated union cho API responses.
api-error-handling.md
# API Error Handling ## Pattern Mọi API call phải wrap trong try/catch, return discriminated union: {ok: true, data} | {ok: false, error} ## Error Types (src/types/errors.ts) - NetworkError, ValidationError, AuthError, ServerError ## UI Display - Toast cho transient errors (NetworkError) - Inline form errors cho ValidationError - Redirect to /login cho AuthError
UC3: Database Migration Safety
Tránh breaking changes khi migrate DB.
db-migration.md
# Database Migration Rules - NEVER drop columns trong migration — mark deprecated trước, drop ở release sau - Mọi migration phải có `up()` VÀ `down()` — rollback-safe - Index concurrent (Postgres: `CONCURRENTLY`) cho tables > 10k rows - Test migration trên copy of prod data trước khi merge
UC4: Testing Standards
Coverage target và conventions cho tests.
testing-rules.md
# Testing Rules ## Coverage - Unit tests cho business logic: > 80% - Integration tests cho API endpoints - E2E tests cho critical user flows (login, checkout) ## Conventions - Test files: `*.test.ts` cạnh source file - Arrange/Act/Assert pattern - Dùng factories thay vì fixtures hardcode - Mock external services, KHÔNG mock internal modules
UC5: Security Baseline
Baseline security rules cho mọi project.
security-rules.md
# Security Rules - NEVER log secrets, tokens, passwords - Input validation: Zod schema at API boundary - SQL: prepared statements only, no string concat - Auth middleware check trên mọi protected route - CORS whitelist từ env, không wildcard - Dependencies: audit weekly với `npm audit`

Thứ tự nạp file (Loading Order)

Khi mở một session, Claude đọc các file memory theo thứ tự từ trên xuống, rồi nối (concatenate) tất cả vào context — không ghi đè lẫn nhau.

1 ~/.claude/CLAUDE.md Global user instructions — áp cho mọi project 2 <project>/CLAUDE.md + CLAUDE.local.md Walk-up từ CWD lên project root, nối tất cả lại 3 ~/.claude/rules/*.md → <project>/.claude/rules/*.md Project rules ưu tiên cao hơn user rules khi trùng topic 4 ~/.claude/projects/<project>/memory/MEMORY.md Auto-memory do Claude tự ghi (200 dòng hoặc 25KB đầu tiên) ⇢ Session context (concatenated)

Rules có paths frontmatter chỉ kích hoạt khi Claude đụng file khớp pattern — không nạp lúc khởi động. Nhờ vậy bạn có thể viết rule riêng cho từng thư mục mà không làm CLAUDE.md phình ra.

Kích thước khuyến nghị

Anthropic khuyến nghị CLAUDE.md nên dưới 200 dòng. File dài hơn sẽ làm adherence giảm — nghĩa là Claude bỏ sót hoặc lờ đi rule của bạn nhiều hơn vì phải đọc quá nhiều thông tin. File rule cũng nên giữ ngắn. Khi CLAUDE.md sắp chạm 200 dòng, hãy tách ra .claude/rules/ theo chủ đề (ví dụ api-design.md, testing.md, security.md). Đặt tên file mô tả rõ nội dung để cả team và chính Claude tìm nhanh bằng Grep.

Cơ chế nạp file nâng cao

Khi project lớn hoặc muốn chia sẻ rule giữa nhiều repo, bạn có 4 cơ chế mở rộng context. Sơ đồ dưới cho thấy mỗi cơ chế kéo thêm file vào CLAUDE.md gốc như thế nào.

CLAUDE.md Session context (điểm neo chính) @import Nhúng file khác (tối đa 5 hop) --add-dir Mở thêm thư mục vào session CLAUDE.local.md Ghi đè cá nhân (git-ignored) Symlinks Chia sẻ rule giữa nhiều repo
@import syntax Nhúng file khác thẳng vào CLAUDE.md

Trong CLAUDE.md, viết @docs/coding-standards.md hoặc @~/.claude/my-prefs.md để nhúng nội dung file đó vào đúng vị trí. Claude hỗ trợ cả đường dẫn tương đối lẫn tuyệt đối, độ sâu tối đa 5 lần nhúng lồng nhau (hop). Dùng để tách content dài ra file riêng mà vẫn giữ CLAUDE.md gọn.

CLAUDE.md
@docs/coding-standards.md @~/.claude/rules/security.md @.claude/rules/testing.md
--add-dir flag Mở thêm thư mục làm việc trong cùng session

Thông thường Claude Code chỉ đọc file trong thư mục bạn khởi chạy (working directory). Flag --add-dir cho phép mở thêm thư mục khác vào cùng một session — tiện khi làm monorepo hoặc cần tham chiếu thư mục ../shared, ../design-system bên ngoài project hiện tại.

Ba cách kích hoạt đều tương đương: flag --add-dir khi chạy lệnh, slash command /add-dir ngay trong session, hoặc khai báo additionalDirectories trong settings.json.

Kích hoạt --add-dir
# Flag khi launch claude --add-dir ../shared --add-dir ../design-system # Hoặc slash command trong session /add-dir ../shared

Lưu ý quan trọng: mặc định Claude không nạp file CLAUDE.md hay CLAUDE.local.md từ các thư mục thêm qua --add-dir — để giữ tương thích ngược với project cũ. Nếu muốn Claude áp dụng memory từ những thư mục đó, bật biến môi trường sau trước khi chạy:

Bật nạp memory cho --add-dir
export CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 claude --add-dir ../shared

Sau khi bật, mọi CLAUDE.md hoặc CLAUDE.local.md trong thư mục được thêm sẽ được nạp cùng với project chính, giúp Claude hiểu quy ước riêng của từng workspace trong cùng một session. Tính năng này có từ phiên bản 2.1.20 và để opt-in vì lý do tương thích ngược.

CLAUDE.local.md Ghi chú cá nhân, không commit vào git

File dành cho sở thích riêng của bạn trong project (URL sandbox, tài khoản test, lệnh debug cá nhân). Thêm CLAUDE.local.md vào .gitignore để không lẫn vào commit. Claude nạp file này cùng với CLAUDE.md nhưng chỉ hiển thị với máy bạn — team khác không thấy.

Symlinks share rules Dùng chung một bộ rule cho nhiều project

Thư mục .claude/rules/ hỗ trợ symlink — bạn giữ bộ rule chuẩn của team ở một nơi duy nhất rồi link vào từng project. Khi cập nhật rule, mọi project đều nhận cùng lúc. Claude tự phát hiện symlink vòng (circular) và bỏ qua, không bị kẹt.

Share rules qua symlinks
ln -s ~/shared-claude-rules .claude/rules/shared ln -s ~/company-standards/security.md .claude/rules/security.md
Section 05

7 Commands cốt lõi cho beginners

/ck:brainstorm
Explore solutions trước khi commit. Output: Trade-off analysis, pros/cons, recommendation.
/ck:brainstorm How should we implement real-time notifications? WebSockets vs SSE vs polling?
/ck:plan
Detailed planning cho features phức tạp. Research → Plan → Files list → Success criteria.
/ck:plan Implement user authentication with OAuth2 (Google, GitHub)
/ck:cook
Command chính để implement. 8-step workflow: Research → Review → Plan → Review → Implement → Review → Test → Finalize.
/ck:cook Add a logout button to the navbar

--fast: Skip research | --auto: Skip all review gates

/ck:fix
7-step process (0-6): Mode Selection → Scout → Diagnose → Complexity → Fix → Verify → Finalize.
/ck:fix Users can't login after session timeout - seeing "Invalid token" error
/ck:ask
Hỏi technical questions. Như có senior engineer bên cạnh.
/ck:ask How does our authentication middleware handle token refresh?
/ck:test
Run tests. Support multiple test runners.
/ck:test src/auth/ # Test specific folder
/ck:watzup
Review session changes. Files modified, git diff analysis, impact assessment.
/ck:watzup
Section 06

Real-World Use Cases

1
Build feature mới (Beginner)
Thêm user settings page với dark mode toggle và notification preferences.
Full Workflow
/ck:brainstorm User settings page: dark mode + notifications. Should we store in localStorage or backend? Component structure? # → Output: plans/reports/brainstorm-260414-user-settings.md /ck:plan Implement per brainstorm report at plans/reports/brainstorm-260414-user-settings.md # → Creates implementation plan with phases /ck:cook plans/260414-xxxx-user-settings/plan.md # Execute: implement → review → test → done /ck:git cm # Commit with message
Feature complete với proper planning. Code reviewed, tested, committed.
2
Fix bug nhanh (Beginner)
Form validation không show error message khi email invalid.
Quick Fix Workflow
/ck:fix Email validation in signup form doesn't show error message. File: src/components/SignupForm.tsx Expected: "Invalid email" appears below input Actual: No message, just red border /ck:test src/components/SignupForm.test.tsx
Bug fixed với regression test. Automated pipeline: scout → diagnose → fix → test → verify.
3
Onboard codebase mới (Intermediate)
Join team mới, cần hiểu codebase nhanh trước khi contribute.
Exploration Workflow
/ck:scout src/ # Explore structure /ck:ask How does the authentication flow work? /ck:ask Explain src/services/auth/token-handler.ts /ck:ask What patterns does this codebase follow?
Hiểu architecture, key flows, patterns trong 30 phút thay vì 2 ngày đọc docs.
4
Refactor an toàn (Intermediate)
Module cũ 500 LOC, needs cleanup nhưng sợ break existing functionality.
Safe Refactor Workflow
/ck:ask Analyze src/legacy/user-manager.js What are the hidden dependencies? Side effects? /ck:plan Refactor user-manager.js into smaller modules. Must maintain all existing behavior. Write tests first. # → Creates implementation plan with phases /ck:cook <plan-path> # Execute: implement → review → test → done /ck:code-review # Verify no regressions
Code modular, có tests, zero regression. Confident refactoring.
5
Dựng UI từ Figma (Intermediate)
PM gửi Figma mockup, cần implement pixel-perfect với animations.
UI Implementation Workflow
/ck:frontend-design [paste Figma URL hoặc screenshot] # Auto-activates /ck:ui-ux-pro-max (design intelligence) # Claude generates với đúng spacing, colors, animations /ck:ui-styling Add dark mode support cho component vừa tạo /ck:test src/components/NewFeature.test.tsx
UI pixel-perfect, responsive, có dark mode. Không cần designer review lại.
Section 07

Best Practices

DO: Cho Claude cách verify kết quả

Single highest-leverage tip.

Bad
implement email validation
Good
write validateEmail function. Test cases: user@example.com → true Run tests after implementing.

DO: Brainstorm → Plan → Cook

/ck:brainstorm [explore options]
/ck:plan [detail implementation]
/ck:cook [implement + test]
/ck:git cm [commit]

/ck:cook đã bao gồm testing. Dùng /ck:test [path] riêng khi cần test specific folder.

Khi nào skip /ck:brainstorm?

Dùng /ck:plan trực tiếp khi:

  • Đã biết rõ approach (fix bug cụ thể, add endpoint theo spec)
  • Task đơn giản, không cần explore alternatives
  • Đã có design/spec từ Figma hoặc PRD

Dùng /ck:brainstorm trước khi: chưa biết approach nào tốt nhất, cần trade-off analysis (WebSockets vs SSE), feature mới chưa có tiền lệ.

UI Features: Mockup trước khi implement

Với UI-heavy features, thêm bước mockup để review trước:

/ck:brainstorm/ck:plan/ck:frontend-design (mockup) → Review → /ck:cook

Mockup HTML với mock data nhanh hơn implement thật. Catch design issues sớm, tránh rework.

DO: Provide specific context

Bad
add tests for auth
Good
write tests for src/auth/token-refresh.ts: - successful refresh with valid token - failure when token expired > 7 days - concurrent refresh requests

DO: Clear context thường xuyên

Khi nào cần /clear:

Section 08

Bad Practices (Tránh!)

Kitchen sink session
Làm nhiều unrelated tasks trong 1 session → context đầy rác, Claude confused.
"Fix login" → "Add dark mode" → "Optimize images" → "Back to login"

Fix: /clear giữa mỗi task không liên quan

Correct the same issue repeatedly
Claude sai → correct → vẫn sai → correct lại... Context polluted với failed approaches.

Fix: After 2 failed corrections → /clear và viết prompt tốt hơn

Skip planning for "simple" tasks
"This is simple, no need to plan" → 3 hours later, still debugging edge cases.

Fix: /ck:plan --fast cho lightweight planning

Trust without verify
Claude: "Done!" → Ship to production → Everything broken.

Fix: /ck:test + manual testing + code review → then ship

Overly vague prompts
"make it better", "fix the bug", "add auth" — không đủ context để Claude làm đúng.

Fix: Specific symptom + location + expected behavior

Section 09

Common Workflow Patterns

Pattern 1: Quick fix (< 5 min)
/ck:cook --fast Fix typo /ck:git cm "fix: typo"
Pattern 2: Standard feature
/ck:brainstorm /ck:plan → /ck:cook /ck:git cm
Pattern 3: Complex (multi-day)
Day 1: /ck:brainstorm → /ck:plan Day 2+: /ck:cook [Phase N] /clear between phases
Pattern 4: Bug investigation
/ck:debug [symptom + logs] Phân tích root cause → fix thủ công hoặc /ck:fix
Section 10

Common Workflow Patterns

Beginner Week 1
/ck:brainstorm /ck:plan /ck:cook /ck:fix /ck:ask /ck:test /ck:git
Intermediate Week 2-4
/ck:scout /ck:code-review /ck:debug /ck:ship /ck:watzup /ck:frontend-design /ck:ui-styling
Advanced Month 2+
/ck:team /ck:autoresearch /ck:predict /ck:security /ck:loop /ck:scenario /ck:xia /ck:bootstrap 70+ skills khác

Cheat sheet này chỉ liệt kê 14 lệnh thường dùng. Xem bảng tra cứu đầy đủ, cú pháp chi tiết và ví dụ thực tế cho mọi command tại vividkit.dev/guides/commands.

Section 11

Cheat Sheet

Situation Command
Explore options/ck:brainstorm [question]
Plan feature/ck:plan [description]
Implement feature/ck:cook [description]
Quick small fix/ck:cook --fast [fix]
Fix bug/ck:fix [symptom]
Technical question/ck:ask [question]
Run tests/ck:test [path]
Explore codebase/ck:scout [path]
Code review/ck:code-review [path|--pr N]
Review changes/ck:watzup
Commit/ck:git cm "message"
Full ship pipeline/ck:ship
Clear context/clear
Set beginner mode/ck:coding-level 1
Cheat sheet này chỉ liệt kê 14 lệnh thường dùng. Xem bảng tra cứu đầy đủ, cú pháp chi tiết và ví dụ thực tế cho mọi command tại vividkit.dev/guides/commands.
Về trang chủ