🌱
Greenfield · Project mới
Dự án từ con số 0
Bắt đầu một codebase trống — chưa có file, chưa có repo. OT-Kit lo từ requirements đến deploy.
01
/doctor
Verify OT-Kit MCP đã cài đặt và kết nối. Tự tạo AGENTS.md nếu thiếu.
02
/bootstrap "..."
One-shot end-to-end: requirements → tech stack → docs → plan → code → test → commit. Khuyên dùng nếu muốn AI tự lo toàn bộ.
✓
Done
Codebase chạy được + docs/ đầy đủ + git history sạch + memory bank lưu context.
HOẶC làm thủ công để kiểm soát từng bước:
/docs-init → /plan-hard "feature X" → /code → /test → /git-cp
🏗️
Brownfield · Codebase có sẵn
Dự án đang chạy, kế thừa
Codebase đã có nhiều người làm, có thể thiếu docs hoặc tech debt. Cần "lập bản đồ" trước khi sửa.
01
/doctor
Verify OT-Kit + auto-tạo AGENTS.md/GEMINI.md tại project root.
02
/docs-init
Scan codebase song song qua scout agents → tạo bộ docs/ (overview, architecture, code standards, roadmap).
03
/codebase-review
Multi-agent audit: security + tech debt + duplication → cho ra plan cải thiện.
04
/watzup
Sau mỗi session mới: restore context từ memory bank, xem active plans + drift.
✓
Ready
AI đã hiểu codebase. Tiếp tục với /plan + /code cho feature, /fix cho bug.
Lưu ý quan trọng: Luôn chạy /docs-init trước khi để AI viết code trên codebase lạ. Không có docs → AI đoán convention sai → tạo tech debt mới.
✨Thêm feature mới
Ví dụ: "Thêm OAuth2 login với Google". Cần spec rõ, có research, có test.
/plan-hard "OAuth login"
→
/code
→
/test
→
/git-pr
🐛Fix bug nhỏ (rõ ràng)
Ví dụ: "Submit button không disable khi form invalid". Issue cô lập, dưới 30 phút.
/fix-fast "..."
→
/git-cm "fix: ..."
🔥Fix bug phức tạp
Ví dụ: "Memory leak khi tải nặng — chưa rõ nguyên nhân". Cần debug + plan + review.
/debug "..."
→
/fix-hard
→
/git-cp
🧪Test bị fail sau merge
Ví dụ: "8 Jest tests fail sau khi merge PR #42". Loop fix cho đến khi 100% pass.
/fix-test "..."
→
/git-cm
🔍Review trước khi merge
Ví dụ: review diff hiện tại theo OWASP Top 10 + DRY/KISS + perf trước khi push PR.
/review
→
/fix-fast
→
/git-cp
📚Update docs sau khi merge
Ví dụ: "Đã merge feature OAuth — sync architecture docs + README". Giữ docs không lạc hậu.
/docs-update "..."
→
/git-cm
💭Quyết định kiến trúc
Ví dụ: "Multi-tenant: schema-per-tenant hay row-level?" Cần 2-3 option + trade-off, chưa code.
/brainstorm "..."
→
/plan-two
⏯️Quay lại sau vài ngày nghỉ
Mở project, không nhớ đang làm gì. /watzup restore context từ memory bank.
/watzup
→
/code
→
/save
⚙️GitHub Actions fail
Ví dụ: workflow lỗi pnpm cache miss. Phân tích logs + đề xuất 2 hướng fix.
/plan-ci <run-id>
→
/code
→
/git-cp
🗺️Tìm file trong codebase lớn
Ví dụ: "Tìm hết file liên quan email sending". Không cần đọc — chỉ cần locate.
/scout "..."
Pattern chung: plan (viết spec) → code/fix (thực thi với gate) → test/review (verify) → git-cm/git-cp/git-pr (lưu lại). Mỗi lệnh đều idempotent — chạy lại an toàn.
Điều kiện tiên quyết
- OT-Kit MCP đã cấu hình — chạy
/doctor để verify (xem section MCP Setup ở Hướng Dẫn).
- Có yêu cầu rõ ràng — bạn biết tính năng làm gì, dùng cho ai, success criteria là gì.
- Môi trường dev hoạt động — có thể chạy app + test suite locally.
- Git repository đã init, có branch riêng cho feature (vd:
git checkout -b feature/email-verify).
Quy trình từng bước
Ví dụ xuyên suốt: "Thêm xác minh email khi user đăng ký" — gửi link verify qua email, expire sau 24h, block login nếu chưa verify.
01
Xác định yêu cầu tính năng
Mở session AI tool (Claude Code / Cursor / Antigravity). Viết yêu cầu cụ thể — càng rõ AI đoán càng ít, output càng đúng.
✓ Mô tả tốt
"Thêm email verification cho registration. Gửi link chứa token (UUID v4) qua SendGrid, expire 24h. User chưa verify → block login với 403. Lưu verified_at trong bảng users."
✗ Mô tả mơ hồ
"Làm email verify" · "Thêm tính năng xác minh người dùng" · "Bảo mật tài khoản hơn"
02
Research & Planning
Chạy /plan-hard để AI research best practices + phân tích codebase + tạo plan đa phase. Plan ghi vào plans/{date}-{name}/.
/plan-hard "Email verification cho registration: SendGrid + token UUID v4 + expire 24h + block login nếu chưa verify"
✓ Phase 1: Research (3 queries) — SendGrid best practices, token lifecycle, security
✓ Phase 2: Codebase analysis — tìm src/auth/, prisma/schema.prisma
✓ Phase 3: Plan creation
📁 plans/2026-05-12-email-verify/
├─ plan.md (overview, <80 lines)
├─ phase-01-db-schema.md
├─ phase-02-token-service.md
├─ phase-03-send-mail.md
├─ phase-04-verify-endpoint.md
└─ research/researcher-email-verify-patterns.md
03
Review plan trước khi code
⏸ Bắt buộc đọc plan trước khi /code. Plan sai → code sai. Mở file plan.md và check 4 mục dưới:
▸ Database changes — đã đúng schema migration chiến lược?
▸ Backend implementation — phân chia phase hợp lý?
▸ Security considerations — token expire, rate limit, không log token?
▸ Testing strategy — happy path + 401 invalid token + 410 expired?
Nếu plan thiếu — phản hồi cho AI: "Bổ sung rate-limit cho endpoint /verify (max 5 req/phút/IP) vào phase-04".
04
Audit codebase liên quan Optional
Nếu codebase lớn, dùng /scout để xác định file sẽ bị ảnh hưởng — tránh trùng lặp logic có sẵn.
/scout "email sending, auth middleware, user registration"
📂 Email-related (priority: HIGH)
src/lib/mailer.ts — đã có wrapper SendGrid
src/lib/email-templates/ — có template reset-password, có thể clone
📂 Auth middleware (priority: HIGH)
src/middleware/requireAuth.ts
src/middleware/requireVerified.ts ⚠ chưa tồn tại — cần tạo mới
📂 Registration (priority: MEDIUM)
src/api/auth/register.ts — hook send-mail sau khi tạo user
05
Thực thi (Implementation)
Chạy /code không tham số — auto-detect plan/phase mới nhất. Gate 5 sẽ DỪNG chờ approve trước khi commit.
/code # auto-detect plan + phase tiếp theo
✓ Phase 1/4: db-schema
prisma/migrations/0043_add_email_verify.sql (new)
prisma/schema.prisma (modified)
✓ Phase 2/4: token-service
src/services/verify-token.ts (new, 84 lines)
src/services/verify-token.test.ts (new, 6 tests)
✓ Phase 3/4: send-mail
src/lib/email-templates/verify-email.tsx (new)
✓ Phase 4/4: verify-endpoint
src/api/auth/verify.ts (new)
src/middleware/requireVerified.ts (new)
src/api/auth/register.ts (modified)
⏸ Gate 5: User approval required
Tổng: 6 files mới · 3 files sửa · 84 lines test added
06
Chạy tests
/code đã auto-test trong gate 3 nhưng có thể chạy lại độc lập qua /test. Fail → /fix-test.
/test
Tester Summary
──────────────────────────────────
Unit tests 28/28 passed (token gen, hash, expire)
Integration tests 15/15 passed (register → email → verify flow)
Security tests 10/10 passed (token replay, timing attack, rate-limit)
Coverage: 94.2% lines · 91.7% branches
# Nếu fail:
/fix-test # loop tester → debugger → planner → fix → retest
07
Code review
Trong /code đã có review tự động ở gate 4. Để re-run độc lập (vd: sau sửa thêm), chạy /review.
/review
📋 Code Review · 9 files · +387/-23
🔴 CRITICAL (0)
🟠 HIGH (1)
• src/services/verify-token.ts:42 — token compared with === (timing attack risk)
→ Suggest: crypto.timingSafeEqual(token, stored)
🟡 MEDIUM (2)
• Missing rate-limit on /verify endpoint (plan đã yêu cầu)
• Email template thiếu plain-text fallback
🟢 POSITIVE (3)
• Comprehensive test coverage on token expiry edge cases
• Migration is reversible (down() defined)
• Secret loaded via env, no fallback to default
Status: Approve with fixes · 1 HIGH cần xử lý
08
Cập nhật docs
Code merge mà docs không sync = tech debt. /docs-update scan diff + cập nhật docs/ tự động.
/docs-update "Email verification feature completed"
✓ docs/system-architecture.md — Thêm sequence diagram register → email → verify
✓ docs/project-overview-pdr.md — Thêm feature vào "Completed features"
✓ docs/code-standards.md — Thêm convention: token compare phải dùng timingSafeEqual
✓ docs/project-roadmap.md — Đánh dấu phase auth-mvp DONE (60% → 75%)
✓ README.md — Cập nhật env vars (SENDGRID_API_KEY, VERIFY_URL_BASE)
09
Manual testing Optional
Tests automated chạy đủ, nhưng nên smoke test end-to-end với real services (SendGrid sandbox).
# Start dev server
pnpm dev
# Test register endpoint
curl -X POST http://localhost:3000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"Strong!1"}'
# Expected: 201 Created · email sent · verified_at = null
# Test verify endpoint (token từ email)
curl http://localhost:3000/api/auth/verify?token=<TOKEN>
# Expected: 200 OK · verified_at = NOW()
10
Commit changes
Dùng /git-cm (commit only) hoặc /git-cp (commit + push). git-manager sẽ tạo conventional commit message tự động.
/git-cp "feat(auth): add email verification"
[feature/email-verify a3f9b1c] feat(auth): add email verification
Added:
- UUID v4 token service with 24h expiry
- SendGrid email template (HTML + plain-text)
- GET /api/auth/verify endpoint with rate-limit
- requireVerified middleware
- Migration 0043 (reversible)
Security:
- timingSafeEqual for token comparison
- Rate limit: 5 req/min/IP
- Token never logged
Tests: 53/53 passed · coverage 94.2%
9 files changed, +387/-23
↳ Pushed to origin/feature/email-verify
11
Tạo Pull Request Optional
Khi đã push, dùng /git-pr để tạo PR có body chuẩn (summary, test plan, security).
/git-pr main feature/email-verify
✓ PR created: https://github.com/org/repo/pull/142
Title: feat(auth): add email verification
Base: main ← Head: feature/email-verify
## Summary
- UUID v4 token + 24h expire
- SendGrid integration
- Block login if !verified
## Test plan
- [x] Unit tests: 28/28
- [x] Integration: 15/15
- [x] Security: 10/10
- [ ] Manual smoke test on staging
## Security
- timingSafeEqual for token compare
- Rate limit 5/min/IP
- No token logging
✓
Hoàn thành
Feature đã có code + test + docs + PR. Memory bank đã lưu checkpoint — session sau chỉ cần /watzup là restore được context.
So sánh thời gian
Với chính ví dụ "email verification" ở trên:
Research + design
45 phút
3 phút
Viết code (4 files mới + 3 modified)
90 phút
6 phút
Viết tests (53 tests)
60 phút
2 phút
Code review + fix
30 phút
3 phút
Update docs + commit + PR
25 phút
2 phút
Tổng
~4 giờ 10 phút
~16 phút
↳ Tiết kiệm ~94% thời gian; AI làm phần lặp đi lặp lại, dev tập trung review/decisions.
Best Practices
01
Plan trước, code sau
Không bỏ qua /plan-hard cho feature >1 file. Plan sai = code sai — đập đi xây lại tốn x10 thời gian.
02
Feature phải nhỏ & focused
✓ "Email verification" · ✗ "Full user management" (split thành 5 features).
03
Test ngay, đừng tích lũy
Mỗi phase xong là /test ngay. Tích 4 phase mới test → khó debug ai gây fail.
04
Docs song song
/docs-update ngay khi merge, không "để sau". "Sau" = không bao giờ.
05
Review trước commit
/review ngay cả khi tests pass. Tests verify functional, review bắt security/perf/style.
06
Feature branch, không commit thẳng main
git checkout -b feature/email-verify trước khi chạy /code. Main luôn deployable.
Khắc phục sự cố
Feature quá lớn — plan dài, AI mất context
Chia nhỏ qua /plan-feature với sub-modules. Mỗi sub-module 1 PR riêng. Hoặc dùng /plan-parallel nếu các phần độc lập file.
Tests fail sau /code
Chạy /fix-test để loop tự động (tester → debugger → planner → fix → retest) đến khi 100% pass.
AI bỏ sót edge case
Sửa plan trực tiếp ở Step 3 — thêm bullet vào "Testing strategy". /code sẽ sinh thêm test cases tương ứng.
Code chạy nhưng chậm
Chạy /review — section Performance sẽ flag N+1 query, missing index, blocking IO. Hoặc /fix-hard "perf: ...".
Docs không rõ sau /docs-update
Re-run với scope rõ hơn: /docs-update "rewrite verify flow section in system-architecture.md".
Quay lại sau vài ngày, không nhớ làm tới đâu
/watzup restore context: branch, phase đang dở, drift, blockers, suggested next action.
/bootstrap
10 agents
End-to-end
Khởi tạo project mới từ đầu đến cuối: yêu cầu → research → tech stack → design → implementation → testing → docs → handover.
Step by step
01Git + Memory Bank — kiểm tra git, init .memory-bank/, clarify yêu cầu qua AskUserQuestion.
02Research tech stack → tạo docs/tech-stack.md.
03Init system docs qua /docs-init.
04Progressive planning qua /plan-hard — chia phase chi tiết.
05Design (tuỳ chọn) — UI mockup, assets.
06Implementation theo từng phase qua /code.
07Best-practices + code standards.
08Testing/debug qua /fix-test, /fix-logs.
09Docs finalization qua /docs-update.
10Final report + commit qua /git-cp.
Input mẫu
/bootstrap "E-commerce platform with Next.js + PostgreSQL"
Output mẫu
✓ Git repo + .memory-bank/
✓ docs/tech-stack.md
✓ docs/system-architecture.md
✓ docs/code-standards.md
✓ docs/project-overview-pdr.md
✓ plans/{date}-{project}/ với phase files
✓ Implemented codebase
✓ Finalized README.md
✓ Committed to git
Agents sử dụng
git-manager
researcher
brainstormer
planner
docs-manager
ui-ux-designer
fullstack-developer
tester
debugger
project-manager
/watzup
Read-only
Khôi phục context từ Memory Bank theo INDEX-first, phát hiện drift, và in báo cáo trạng thái project.
Step by step
01Đọc AGENTS.md/GEMINI.md — init rules cho session.
02Detect branch + memory bank dir.
03INDEX-first read — reconcile drift (so INDEX HEAD vs git HEAD).
04Review git changes gần đây.
05Review active plans — pointer-based, gắn drift flags.
06Combined status report — feature, phase, blockers, next action.
Input mẫu
/watzup
# Hoặc restore từ checkpoint cụ thể:
/watzup "checkpoint-phase1-done"
Output mẫu
📍 Branch: feature/auth · Phase: 02/05
✓ Restored: OAuth flow design, JWT secret rotation policy
⚠ Drift: INDEX HEAD a3f9b1 ≠ git HEAD c8d2e4 (3 commits ahead)
Recent commits:
c8d2e4 feat(auth): add refresh token endpoint
b1a0f7 test(auth): cover 401 expired token path
Active plans:
▸ 2026-05-08-oauth/ Phase 02/05 [ok]
▸ 2026-05-10-billing/ Phase 01/03 [drift ⚠]
Next: Run /code phase-03 để continue OAuth.
/save
Idempotent
Lưu context session vào .memory-bank/{branch}/. Regenerate INDEX, ghi đè snapshot mới nhất, archive snapshot cũ.
Step by step
01Detect branch + scaffold thư mục memory bank.
02Route theo argument: none / note / milestone / checkpoint / decision.
03Gather content — context, progress, decisions.
04Write snapshots/latest.md.
05Append decisions.log (nếu có decision).
06Regenerate INDEX.md — recompute plan pointers.
07Archive snapshots > 7 ngày.
08Update context.md + report.
Input mẫu
/save # save mặc định
/save "note" # note nhanh
/save milestone "Phase 1 done" # milestone
/save checkpoint "phase-1-done" # checkpoint restore-able
/save decision "chose Postgres over Mongo" # log decision
Output mẫu
✓ .memory-bank/feature-auth/INDEX.md (regenerated)
✓ .memory-bank/feature-auth/snapshots/latest.md
✓ .memory-bank/feature-auth/snapshots/milestone-phase-1-done.md
✓ .memory-bank/feature-auth/decisions.log (appended)
↳ Archived 3 snapshots older than 7 days
/doctor
Diagnostic
Health check OT-Kit: MCP connectivity, config files, agents/rules/skills, Gemini CLI. Tự động tạo file config thiếu.
Step by step
01Check MCP qua list_agents / list_rules.
02Check config files — AGENTS.md, GEMINI.md tại project root.
03Auto-create file config thiếu.
04Sync CLAUDE.md nếu chạy trong Claude Code.
05Check skills directory + gemini --version.
06Print diagnostic report.
Output mẫu
🩺 OT-Kit Health Check
─────────────────────────────────
MCP Server ✓ Connected (otkit.xutils.dev)
Agents ✓ 14 loaded
Rules ✓ 8 loaded
Workflows ✓ 33 loaded
Config files
AGENTS.md ✓ Found
GEMINI.md ✗ Missing → Created
CLAUDE.md ✓ Synced
Skills ✓ 7 installed
Gemini CLI ✓ v0.4.2
Status: HEALTHY ✓
/help
Inline
Hiển thị hướng dẫn sử dụng theo từng section: agents, workflows, decision matrix, MCP connect, FAQ.
Step by step
01Parse argument — section name hoặc empty.
02Display content: match section, hoặc default 5-step dev loop.
Input mẫu
/help # Tổng quan + dev loop
/help plan # Hướng dẫn /plan*
/help agents | matrix | connect # Sections khác
Output mẫu
Markdown help content displayed inline (no files created).
/refine
Prompt eng.
Refine prompt phát triển thành template có cấu trúc (Feature, Bug Fix, Refactor, Architecture, Integration).
Step by step
01Gather context — README, docs/, tech stack.
03Understand intent của user.
04Enrich với context dự án.
05Define deliverables rõ ràng.
06Structure output theo template phù hợp.
Input mẫu
/refine "add user login"
Output mẫu
# Refined prompt (Feature template)
## Objective
Implement user authentication with email/password + Google OAuth2.
## Context
- Stack: Next.js 14 (App Router), Prisma, PostgreSQL
- Existing: /api/users (CRUD only, no auth)
- Standards: docs/code-standards.md
## Requirements
- Functional: signup, login, logout, session refresh
- Non-functional: bcrypt cost ≥ 12, JWT 15min + refresh 7d
## Expected Output
- /api/auth/* endpoints + middleware
- Tests for happy path + 401/409 cases
- Updated docs/system-architecture.md
/plan
Router
Auto-routing: phân tích độ phức tạp task và delegate sang plan sub-workflow phù hợp (fast/hard/parallel/two/ci).
Step by step
01Analyze task — clarify qua AskUserQuestion nếu cần.
02Select plan type dựa trên complexity.
04Create plan + review với user.
Input mẫu
/plan "add OAuth2 login"
Output mẫu
↳ Delegating to /plan-hard (research-heavy task)
↳ See output of selected sub-workflow.
/plan-fast
plannerNo research
Plan nhanh chỉ từ phân tích codebase, không research bên ngoài. Auto-trigger /code sau khi user approve.
Step by step
01Create plan directory — plans/{date}-{name}/.
02Analyze codebase — đọc docs/, outline/grep/find.
03planner tạo plan + phase files.
05Auto-trigger /code sau khi approve.
Input mẫu
/plan-fast "add CSV export to orders page"
Output mẫu
✓ plans/2026-05-12-csv-export/plan.md (<80 lines)
✓ plans/2026-05-12-csv-export/phase-01-backend-export.md
✓ plans/2026-05-12-csv-export/phase-02-ui-button.md
↳ Awaiting user approval → auto /code
/plan-hard
planner+ web research
Plan toàn diện: research bên ngoài + phân tích codebase → multi-phase plan chi tiết. Có ghi memory bank.
Step by step
00Memory bank init — context.md, evidence.md.
02Research qua search_web (≤5 queries/topic).
04planner tạo plan; append decisions vào evidence.md.
06Save checkpoint + auto-trigger /code.
Input mẫu
/plan-hard "Add OAuth2 login with Google"
Output mẫu
✓ plans/2026-05-12-oauth-google/plan.md (<80 lines)
✓ plans/2026-05-12-oauth-google/phase-01-backend.md
✓ plans/2026-05-12-oauth-google/phase-02-frontend.md
✓ plans/2026-05-12-oauth-google/phase-03-tests.md
✓ plans/2026-05-12-oauth-google/research/researcher-oauth-best-practices.md
✓ .memory-bank/feature-auth/context.md
✓ .memory-bank/feature-auth/evidence.md
↳ Auto /code triggered
/plan-two
planner2 approaches
Plan với ít nhất 2 approach khác biệt + phân tích trade-off + recommendation. Phù hợp khi cần so sánh kỹ thuật.
Step by step
02Research qua search_web / read_url_content.
04planner tạo plan với 2 approach + pros/cons + recommended.
05User review để chốt approach.
Input mẫu
/plan-two "choose between REST and GraphQL for new API"
Output mẫu
✓ plans/2026-05-12-api-design/plan.md
├─ Approach A: REST + OpenAPI (pros/cons)
├─ Approach B: GraphQL + codegen (pros/cons)
└─ Recommended: A — rationale ...
✓ plans/2026-05-12-api-design/phase-01-*.md
✓ plans/2026-05-12-api-design/reports/research-rest-vs-graphql.md
/plan-parallel
plannerNo file overlap
Plan với phases thực thi song song độc lập — không trùng file. Có dependency matrix + file-ownership matrix.
Step by step
04planner tạo plan tối ưu cho parallel execution.
05User review. Phases phải có exclusive file ownership + dependency matrix.
Input mẫu
/plan-parallel "build SaaS with auth + billing + dashboard modules"
Output mẫu
✓ plans/2026-05-12-saas-core/plan.md
├─ Dependency graph: [auth → billing] · [auth → dashboard]
└─ File ownership matrix
✓ phase-01-auth.md (Parallelization: standalone)
✓ phase-02-billing.md (After auth)
✓ phase-03-dashboard.md (After auth, parallel with billing)
└─ Conflict Prevention: lists files claimed exclusively
/plan-feature
+ /interviewGate: select approach
Plan feature module có sub-modules. Phỏng vấn user, đánh giá ranked technical approaches vs current architecture.
Step by step
01Feature intake + scope detection.
02Requirements interview qua /interview --mode=full.
03Architecture assessment → research/architecture-assessment.md.
04Technical evaluation — 2–3 ranked approaches → research/technical-evaluation.md.
05⏸ User selects approach (comparison matrix presented).
07Create plan + phase files.
Input mẫu
/plan-feature "user notifications module with email + push sub-modules"
Output mẫu
✓ plans/2026-05-12-notifications/plan.md (with module map)
✓ plans/2026-05-12-notifications/phase-01..XX-*.md
✓ plans/2026-05-12-notifications/interview-notes.md
✓ plans/2026-05-12-notifications/research/architecture-assessment.md
✓ plans/2026-05-12-notifications/research/technical-evaluation.md
✓ Memory-bank checkpoint saved
/plan-ci
plannerGitHub Actions
Phân tích GitHub Actions failure và đề xuất fix plan với 2+ approaches. User review trước khi implement.
Step by step
01Fetch GHA logs qua gh run view.
02Analyze failing steps + root cause.
03planner tạo plan với multiple approaches.
04⏸ User review trước khi implement.
Input mẫu
/plan-ci 8347912034
# Hoặc URL:
/plan-ci https://github.com/org/repo/actions/runs/8347912034
Output mẫu
✓ plans/2026-05-12-ci-fix-pnpm-cache/plan.md
├─ Approach A: pin pnpm version in actions/setup-node
├─ Approach B: switch to actions/setup-pnpm@v4
└─ Recommended: B
✓ plans/2026-05-12-ci-fix-pnpm-cache/phase-01-*.md
/interview
Iterative Q&A
Phỏng vấn có cấu trúc để rút độ rõ ràng từ plan/idea mơ hồ. Modes: technical, ux, product, full.
Step by step
01Read/analyze input + detect mode.
02Init progress tracker (topics/questions/time est).
03Iterative Q&A loop — 1 question per turn.
04Continue until covered.
4½Cross-check — gap/contradiction detection.
05Generate output — new plan OR enrich existing.
Input mẫu
/interview plans/2026-01-18-auth/plan.md
# Hoặc từ ý tưởng raw:
/interview "build user auth system"
Output mẫu
✓ plans/2026-05-12-auth/plan.md (new) — OR enriched phase files
✓ plans/2026-05-12-auth/phase-01-*.md
✓ plans/2026-05-12-auth/interview-notes.md
Sections: Insights · Decisions · Open Questions
/brainstorm
plannerDecision only
Session kiến trúc/quyết định cộng tác. Khám phá nhiều solution với brutal honesty rồi viết report. KHÔNG implement.
Step by step
01Discovery — clarifying questions.
02Research — docs + search_web + grep similar code.
03Analysis — list 2–3 options với pros/cons.
04Debate — challenge user.
05Consensus — alignment + risk.
06Documentation — viết report.
Input mẫu
/brainstorm "multi-tenant architecture for SaaS app"
Output mẫu
✓ plans/reports/brainstorm-2026-05-12-multi-tenant.md
├─ Problem
├─ Requirements
├─ Constraints
├─ Evaluated Approaches (2-3)
├─ Recommended Solution
├─ Implementation Considerations
├─ Success Metrics
└─ Next Steps
/code
4 agentsGate 5: user approve
Senior-engineer thực thi 1 phase với gated workflow: analysis → implement → test → review → user approval → finalize.
Step by step
00Plan/phase detection + memory bank recall.
01Analysis + TodoWrite init + task extraction.
03Testing — bắt buộc tester, debugger nếu fail.
04Code review — bắt buộc code-reviewer.
05⏸ User approval (BLOCKING).
06Finalize — status update, onboarding check, memory-bank checkpoint, ⏸ git commit confirmation.
Input mẫu
/code "plans/2026-03-26-oauth/phase-01-backend.md"
# Hoặc empty → auto-detect latest plan:
/code
Output mẫu
✓ Implemented files (src/auth/*, src/middleware/*)
✓ Tests: 47/47 passed
✓ Code review report (3 minor suggestions applied)
✓ Plan status: phase-01 → DONE
✓ Memory-bank checkpoint saved
✓ Git commit: "feat(auth): phase-01 backend [oauth-plan]"
Agents sử dụng
tester
debugger
code-reviewer
ui-ux-designer
project-manager
docs-manager
/test
tester
Chạy test suite local và phân tích summary report qua tester. KHÔNG implement fix.
Step by step
01Invoke tester agent — chạy test suite + tổng hợp kết quả.
Output mẫu
Tester Summary
─────────────────
Total: 142
Passed: 139
Failed: 2
Skipped: 1
❌ src/auth/login.test.ts > "401 on bad password"
❌ src/orders/export.test.ts > "CSV with unicode"
Run /fix-test để fix iteratively.
/review
OWASP Top 10Severity-graded
Review toàn diện diff gần đây vs architecture, code standards, security (OWASP), performance.
Step by step
01Define scope — git diff.
02Load architecture/standards docs.
04Code quality — DRY/KISS/naming.
06Security — OWASP Top 10.
08Generate severity-graded report.
09Save vào active plan dir (nếu tồn tại).
Input mẫu
/review # Auto-detects recent diff
Output mẫu
📋 Code Review · 12 files changed · +482/-67
🔴 CRITICAL (1)
• src/auth/jwt.ts:24 — secret loaded from process.env without fallback check
🟠 HIGH (2)
• src/api/users/[id].ts:18 — missing IDOR check
• src/db/migrations/0042.sql — column added NOT NULL without backfill
🟡 MEDIUM (4) ...
🟢 POSITIVE (3) — comprehensive test coverage on auth flow
Saved: plans/2026-05-12-oauth/2026-05-12-code-review.md
/codebase-review
3 agentsMulti-agent scan
Multi-agent codebase scan: research + parallel code review → improvement plan.
Step by step
01Parallel research qua 2× researcher.
02Parallel code-reviewer — tìm issues/dup/security.
03planner tạo progressive-disclosure plan.
04Final report + optional commit.
Input mẫu
/codebase-review "audit security and identify tech debt"
Output mẫu
✓ plans/2026-05-12-codebase-audit/plan.md
✓ plans/2026-05-12-codebase-audit/phase-01-security.md
✓ plans/2026-05-12-codebase-audit/phase-02-tech-debt.md
✓ Research reports + summary report to user
Agents sử dụng
researcher
code-reviewer
planner
git-manager
/scout
Parallel search
Tìm file liên quan trong large codebase nhanh chóng qua parallel search strategies.
Step by step
01Analyze search request.
02Divide codebase thành sections logic.
03Parallel search — find_by_name + grep_search + view_file_outline.
04Synthesize + group results theo category.
Input mẫu
/scout "find all files related to email sending"
Output mẫu
📂 Email-related files
▸ Core utilities
src/lib/mailer.ts
src/lib/email-templates/*
▸ API routes
src/api/auth/verify-email.ts
src/api/notifications/send.ts
▸ Components
src/components/EmailPreview.tsx
/debug
debuggerAnalysis only
Delegate cho debugger agent để root-cause analysis. KHÔNG tự fix.
Step by step
01Invoke debugger với issue context.
02Receive analysis report.
Input mẫu
/debug "POST /api/orders returns 500 when items > 10"
Output mẫu
🔍 Debugger Report
Root cause: Postgres `order_items` table missing index on (order_id) →
sequential scan exceeds statement_timeout when batch > 10.
Evidence:
- EXPLAIN ANALYZE shows seq scan (12.4s)
- Worker logs: "canceling statement due to statement timeout"
Suggested fix: Add index → CREATE INDEX CONCURRENTLY ...
(No code changes applied — run /fix or /code to apply.)
/fix
Router
Phân tích loại issue và route sang fix sub-workflow phù hợp (ui/test/logs/hard/fast/code).
Step by step
01Check existing plan → nếu có, route sang /code.
02Route theo keywords: UI → fix-ui, tests → fix-test, logs → fix-logs, complex → fix-hard, default → fix-fast.
Input mẫu
/fix "Button submit disabled after form validation error"
Output mẫu
↳ Detected: UI issue → Delegating to /fix-ui
/fix-fast
~15-30 minKISS
Fix bug nhanh cho issue nhỏ/rõ. Áp dụng KISS, thay đổi tối thiểu.
Step by step
01Analyze issue — reproduce + isolate scope.
02Debug & root cause — logs, git history, trace, grep, hypothesis.
03Implement fix theo code standards.
04Test — chạy suite, verify, edge cases.
05Report — Issue/Root cause/Fix/Verification/Next steps.
Input mẫu
/fix-fast "submit button doesn't disable on validation error"
Output mẫu
Issue: Submit btn vẫn enabled khi form invalid
Root cause: handleSubmit thiếu check formState.isValid trước khi setSubmitting
Fix: Thêm guard early-return + disable cond từ formState.isSubmitting || !isValid
Verification: ✓ 8/8 form tests pass · manual reproduce OK
Next: Consider extract useSubmitGuard hook nếu pattern lặp lại
/fix-hard
SystematicPlan + review
Tiếp cận hệ thống cho bug phức tạp (architecture, perf, integration).
Step by step
01Initial analysis + clarify.
02Root cause investigation — debug/trace/research.
03Solution planning → implementation_plan.md.
05Validation + code review.
06Documentation + final report.
Input mẫu
/fix-hard "memory leak under high load — root cause unknown"
Output mẫu
✓ implementation_plan.md (root cause + 3 approaches)
✓ Code changes (event listeners cleanup in useEffect)
✓ Regression tests for high-load scenario
✓ Updated docs/project-changelog.md
✓ Final report with heap profiles before/after
/fix-test
4 agentsIterative loop
Loop sửa test failure đến khi 100% pass.
Step by step
01tester compile/syntax check.
03debugger root cause khi fail.
07code-reviewer quick review.
08Repeat từ step 2 nếu còn issue.
Input mẫu
/fix-test "Jest: 8 tests fail after merging PR #42"
Output mẫu
Iteration 1: 8 fail → 3 fail (5 mock fixtures stale)
Iteration 2: 3 fail → 0 fail (timing race in async hook)
✓ Final: 142/142 passed
✓ Summary: 2 code files + 1 fixture updated; root cause = mock drift after PR #42 schema change.
/fix-logs
Log capture
Capture/analyze logs để tìm root cause, rồi fix.
Step by step
01Log capture — verify/configure logs.txt, generate.
02Analyze — grep Error/Exception/Fatal.
03Planning — implementation_plan.md nếu complex.
05Verification — test + re-check logs.
Input mẫu
/fix-logs "Nginx errors in 2026-03-26.log"
Output mẫu
✓ logs.txt captured
✓ Pattern: 502 upstream timeout × 47 hits, all on /api/reports
✓ Fix in src/api/reports/handler.ts (stream large CSV instead of buffer)
✓ Optional: implementation_plan.md
✓ Re-run: 0 errors in fresh logs
/fix-ui
Design guidelinesAuto commit
Sửa UI/UX bug có hệ thống, align với docs/design-guidelines.md.
Step by step
01Analysis + design review — screenshots, guidelines, CSS/tailwind config.
02Implementation — CSS classes preferred, reusable.
03Verification — browser screenshot hoặc user verify, lint/build.
04Documentation + finalize + commit fix(ui): [desc].
Input mẫu
/fix-ui "navbar overlaps content on mobile <768px"
Output mẫu
✓ Modified src/components/Navbar.tsx + tailwind.config.js
✓ Screenshots (before/after) captured
✓ Updated docs/design-guidelines.md — z-index scale doc
✓ Commit: fix(ui): mobile navbar overlap below 768px
/docs-init
scout + docs-manager
Scout codebase song song và tạo bộ documentation ban đầu qua docs-manager.
Step by step
01ls -la để identify dirs.
02Spawn 2-4 scout agents song song (scout-external preferred).
04Call docs-manager tạo initial docs.
Output mẫu
✓ docs/project-overview-pdr.md
✓ docs/codebase-summary.md
✓ docs/code-standards.md
✓ docs/system-architecture.md
✓ docs/project-roadmap.md
✓ docs/design-guidelines.md (optional)
✓ README.md updated (<300 lines)
/docs-update
scout + docs-manager
Scout codebase song song và update existing documentation qua docs-manager.
Step by step
02Spawn 2-4 scout agents song song (no browser).
04Call docs-manager update docs.
Input mẫu
/docs-update "OAuth2 Google login completed"
Output mẫu
✓ README.md (<300 lines)
✓ docs/project-overview-pdr.md
✓ docs/codebase-summary.md
✓ docs/code-standards.md
✓ docs/system-architecture.md — OAuth flow added
✓ docs/project-roadmap.md
✓ docs/deployment-guide.md (optional)
✓ docs/design-guidelines.md (optional)
/docs-summarize
docs-manager
Phân tích docs/ và sinh summary report. Tùy chọn scan codebase.
Step by step
01Call docs-manager phân tích dựa trên docs/codebase-summary.md.
Input mẫu
/docs-summarize "auth, payments" false
# args: topics(optional) · scan_codebase(true|false)
Output mẫu
Summary report from docs-manager (inline, no files written by default).
/git-cm
git-manager
Stage all files + tạo commit. KHÔNG push.
Step by step
01Invoke git-manager với commit-only task.
Input mẫu
/git-cm
# Hoặc với message gợi ý:
/git-cm "feat(auth): add refresh token"
Output mẫu
[feature/auth a3f9b1c] feat(auth): add refresh token endpoint
3 files changed, 87 insertions(+), 12 deletions(-)
↳ Local commit (no AI attribution, no push)
/git-cp
git-manager
Stage, commit (meaningful message), và push lên remote.
Step by step
01Invoke git-manager — commit + push.
Input mẫu
/git-cp "feat(auth): add Google OAuth2"
Output mẫu
[feature/auth c8d2e4f] feat(auth): add Google OAuth2
12 files changed, +482 / -67
↳ Pushed to origin/feature/auth (no AI attribution)
/git-merge
git-manager
Merge FROM_BRANCH vào TO_BRANCH và resolve conflicts.
Step by step
01Invoke git-manager với merge task.
Input mẫu
/git-merge main feature/oauth
# defaults: TO=main, FROM=current branch
Output mẫu
↳ Resolving conflicts in 2 files (.env.example, package-lock.json)
✓ Merge commit: f1e8a92 — Merge feature/oauth into main
↳ 0 conflicts remaining
/git-pr
git-managergh CLI
Tạo pull request từ FROM_BRANCH sang TO_BRANCH qua gh CLI.
Step by step
01Invoke git-manager với PR creation task.
Input mẫu
/git-pr main feature/oauth
Output mẫu
✓ PR created: https://github.com/org/repo/pull/142
Title: feat(auth): add Google OAuth2
Base: main ← Head: feature/oauth
/ui-ux-pro-max
UIPRO KITPython search
UI/UX workflow dùng UIPRO KIT. Search design database (styles/colors/typography/charts/UX rules) trước khi implement.
Step by step
01Verify uipro-cli + Python installed.
02Analyze request — product type, style, industry, stack.
03Search domains qua search.py (product → style → typography → color → landing → chart → ux → stack).
04Apply stack guidelines (default: html-tailwind).
05Implement với checklist: SVG icons, hover, contrast 4.5:1, layout, a11y.
Input mẫu
/ui-ux-pro-max "Landing page for professional skincare service"
Output mẫu
✓ Implemented UI files theo pre-delivery checklist:
• SVG icons (no emoji)
• cursor-pointer on interactive
• Contrast ≥ 4.5:1
• Responsive breakpoints
• a11y (alt text, aria-label, focus rings)