Skip to content

Buổi 04: CodyMaster Skill System — Chỉ Huy 68+ Đồng Đội Ảo

Mục tiêu buổi này: Hiểu hệ thống 68+ CodyMaster skills, học cách dùng Skill Chain để tự động hóa multi-step workflows, và tối ưu hóa skill selection để tránh overload. Sau buổi này, bạn sẽ biết "ai chịu trách nhiệm" cho từng task QA.


Phần 1: Lý Thuyết — QA Skill Map & Intelligent Selection

CodyMaster Là Gì?

CodyMaster là bộ 68+ AI Skills — mỗi skill là một "AI teammate" chuyên về một công việc QA cụ thể:

🏭 Factory Floor
┌─────────────────────────────────────────────┐
│ cm-tdd          (Viết test trước)          │ TEST Group
│ cm-test-gate    (5-layer test validation)  │
├─────────────────────────────────────────────┤
│ cm-debugging    (4-phase debug)            │ DEBUG Group
│ cm-continuity   (Memory protocol)          │
├─────────────────────────────────────────────┤
│ cm-code-review  (Auto code review)         │ REVIEW Group
│ cm-clean-code   (Code smell detection)     │
├─────────────────────────────────────────────┤
│ cm-safe-deploy  (8-gate deploy pipeline)   │ DEPLOY Group
│ cm-security-gate (Vulnerability scan)      │
│ cm-secret-shield (Secret leak scan)        │
├─────────────────────────────────────────────┤
│ cm-continuity, cm-notebooklm               │ MEMORY Group
│ cm-dashboard, cm-skill-chain               │
└─────────────────────────────────────────────┘

Nguyên Tắc: Skill Chain Over Skill Monolith

Cũ (Monolith = tồi):

User: "Fix this bug"
→ AI loads 68 skills at once (2,000+ tokens)
→ Decides what to do (slow, confused)
→ Result: low quality, high latency

Mới (Skill Chain = tốt):

User: "Fix this bug"
→ Task Detection: "This is debugging work"
→ selectTopSkills() → Pick 2-3 most relevant
→ Chain: cm-debugging (score 105) → cm-tdd (score 101) → cm-quality-gate (score 100)
→ Load only 3 skills (~600 tokens)
→ Result: high quality, fast execution

Benchmark (SkillsBench):

2-3 focused skills   → +18.6pp performance gain
4+ mixed skills      → +5.9pp (diminishing returns)
All 68 skills        → -2.9pp (overload, confusion)

Giải thích: Quando bạn dùng quá nhiều skills, AI phải quyết định "cái nào dùng?". Thời gian think → time to execute mà chất lượng giảm.

QA Skill Map — 4 Nhóm Chính

Hãy hiểu mỗi nhóm có vai trò gì:

Nhóm 1: TEST (Viết & Chạy Test)

SkillVai TròDùng Khi
cm-tddRed-Green-Refactor cycleImplement feature mới hoặc fix bug (LUÔN LUÔN)
cm-test-gate5-Layer validation: Unit → Integration → E2E → Security → VisualCần chắc code chất lượng trước ship

Layer 1 (Unit): Test function độc lập Layer 2 (Integration): Test functions cộng lại Layer 3 (E2E): Test flow từ user action → response Layer 4 (Security): Scan leaks, injection, auth issues Layer 5 (Visual): Screenshot regression

Nhóm 2: DEBUG (Tìm Root Cause)

SkillVai TròDùng Khi
cm-debugging4-Phase systematic debuggingCode fail ở production, need root cause
cm-continuityWorking memory + learning logEvery session (background protocol)

4 Phase Debugging:

  1. Reproduce: Tạo reproducible test case
  2. Isolate: Trace code path → find root cause
  3. Fix: Minimal change để fix root cause
  4. Verify: Confirm fix + add regression test

Nhóm 3: REVIEW (Code Quality & Standards)

SkillVai TròDùng Khi
cm-code-reviewAI code review — logic, performance, securityBefore PR merge
cm-clean-codeCode smell detection — DRY, SOLID, readabilityRefactoring phase

Nhóm 4: DEPLOY (Ship Safely)

SkillVai TròDùng Khi
cm-safe-deploy8-Gate pipeline: lint → test → security → performance → staging → canary → prod → monitorShipping to production
cm-security-gateVulnerability scanner (Snyk, Aikido integration)Deploy pipeline gate #5
cm-secret-shieldSecrets leak scanner (hardcoded API keys, creds)Deploy pipeline gate #3

8 Gates Pipeline:

  1. Lint check (code style)
  2. Unit test (code works)
  3. Secret scan (no leaks)
  4. Dependency audit (no vuln deps)
  5. Security scan (code vuln)
  6. Performance test (no regression)
  7. Staging deploy (test in staging env)
  8. Canary deploy + monitoring (gradual prod rollout)

Nhóm 5: MEMORY (Learn & Remember)

SkillVai TròDùng Khi
cm-continuityWorking memory protocol (Tier 2)Session start & end
cm-notebooklmCloud brain (convert learnings → searchable notebook)Team knowledge base
cm-dashboardVisualize goals, progress, memory healthDaily standup
cm-skill-indexBrowse all 68 skills with descriptionsLearning, planning

Phần 2: Skill Chain Architecture

Skill Chain là gì?

Skill Chain = Pipeline của Skills

Thay vì chạy 1 skill, chạy chuỗi skills với:

  • Handoff tự động giữa các steps
  • Shared context bus (output của skill N → input của skill N+1)
  • Progress tracking
  • Ability to skip/retry steps

Built-in Chains trong QA

Chain 1: bug-fix (3 steps)

cm-debugging → cm-tdd → cm-quality-gate

Flow:
1. cm-debugging: Reproduce bug + find root cause (output: root cause + fix approach)
2. cm-tdd: Write test để repro bug, write minimal fix (output: test + code)
3. cm-quality-gate: Verify fix + check no regression (output: approval ✓ or ✗)

Khi dùng: "Bug #2: DELETE không check task tồn tại"

Chain 2: feature-development (up to 6 steps)

brainstorm-idea* → planning → tdd → execution → quality-gate → safe-deploy*
(*optional steps)

Flow:
1. cm-brainstorm-idea: Ideate features (optional)
2. cm-planning: Write spec + test plan
3. cm-tdd: Write test + code
4. cm-execution: Implement remaining logic
5. cm-quality-gate: Review + approve
6. cm-safe-deploy: Deploy safely (optional)

Khi dùng: "Add recurring tasks feature"

Chain 3: code-review (3 steps)

cm-code-review → cm-quality-gate → cm-safe-deploy

Flow:
1. cm-code-review: Review PR logic, performance, security
2. cm-quality-gate: Verify tests pass + coverage OK
3. cm-safe-deploy: Merge + deploy

Khi dùng: "Review PR #42 before merge"

Context Bus — Inter-Skill Handoff

Context Bus = Shared State Giữa Skills

File: .cm/context-bus.json

json
{
  "pipeline": "bug-fix",
  "session_id": "sess-abc123",
  "current_step": "cm-debugging",
  "shared_context": {
    "cm-debugging": {
      "bug_id": "bug-2",
      "bug_title": "DELETE không check task tồn tại",
      "root_cause": "Routes/tasks.js:45 — deleteTask() not checking if task exists",
      "fix_approach": "Add db.get() before delete, return 404 if not found"
    },
    "cm-tdd": null  // Will fill when step completes
  },
  "resource_state": {
    "skeleton_generated": true,
    "learnings_indexed": true,
    "test_file_created": true
  }
}

Khi step hoàn thành:

bash
# cm-debugging output → context bus
cm_bus_write skill=cm-debugging \
  root_cause="Routes/tasks.js:45 deleteTask()" \
  fix_approach="Add db.get() check"

# cm-tdd reads from context bus
cm_bus_read
# → cm-debugging output available để cm-tdd sử dụng

Intelligent Skill Selection (SkillsBench)

typescript
// Pseudocode: selectTopSkills() algorithm

function selectTopSkills(taskDescription: string, availableChain: Chain) {
  const scores = new Map();
  
  // Step 1: Score each step by keyword match
  for (const step of availableChain.steps) {
    const skillDesc = getSkillDescription(step.skill);
    const keywordMatches = countKeywordMatches(taskDescription, skillDesc);
    scores.set(step.skill, keywordMatches);
  }
  
  // Step 2: Always include mandatory steps (condition='always')
  const mandatory = availableChain.steps.filter(s => s.condition === 'always');
  
  // Step 3: Rank optional steps by score, cap at 3 total
  const optional = availableChain.steps
    .filter(s => s.condition !== 'always')
    .sort((a, b) => scores.get(b.skill) - scores.get(a.skill))
    .slice(0, Math.max(0, 3 - mandatory.length));
  
  return [...mandatory, ...optional];
}

// Example
task = "Fix login timeout bug in authentication flow"
chain = feature-development

selectTopSkills(task, chain)
// Result:
// 1. cm-tdd (score 105) — "timeout" + "bug" high match
// 2. cm-execution (score 95) — "authentication" matches
// 3. cm-quality-gate (score 92) — "bug fix" needs verification
// Skipped: cm-brainstorm-idea, cm-planning (low score for bug fix context)

Why Cap at 3?

Penelitian menunjukkan:

  • 2-3 skills tập trung → Chất lượng cao, execution nhanh
  • 4+ skills → Confusion, latency tăng, quality giảm
  • All 68 skills → Catastrophic (AI overload)

Phần 3: Thực Hành — Dùng Skill Chain

Setup: Ensure cm-continuity Active

Vì buổi 03 đã setup, kiểm tra:

bash
# Check CONTINUITY.md
cat .cm/CONTINUITY.md | head -20

# Check context.db exists
ls -la .cm/context.db

# Show current context bus
cm continuity bus

Practice 1: List All Skills (5 phút)

bash
# View all 68+ skills
cm skill-index

# Or search by name
cm skill-search debugging
cm skill-search test

# View specific skill
cm skill-info cm-tdd
cm skill-info cm-debugging

Expected output:

CM-TDD (cm-tdd)
  Description: Test-Driven Development — write test first, watch fail, minimal code
  Category: TEST
  Prerequisites: vitest, Node.js
  Output: test file + implementation
  
CM-DEBUGGING (cm-debugging)
  Description: 4-Phase debugging — reproduce, isolate, fix, verify
  Category: DEBUG
  Prerequisites: test suite, logging
  Output: root cause analysis + fix

Practice 2: Chain Auto-Detect (10 phút)

Scenario: "Bug #2 — DELETE /tasks/:id doesn't check if task exists"

bash
# Auto-detect best chain for this task
cm chain auto "DELETE /tasks/:id fails silently if task not found. Need to return 404."

# Output: Suggests "bug-fix" chain
# Reason: Keywords match — "bug", "fix", "error handling"

Expected output:

CHAIN SUGGESTION
  Name: bug-fix
  Description: Debugging + Test + Quality gate
  Steps:
    1. cm-debugging    (score 105) — find root cause
    2. cm-tdd          (score 101) — write test + fix
    3. cm-quality-gate (score 100) — verify + approve

Suggested? (y/n) > y

Practice 3: Start Chain Manually (15 phút)

bash
# Option A: Start suggested chain
cm chain start bug-fix "Bug #2: DELETE doesn't check task exists"

# Option B: Start specific chain
cm chain start bug-fix "DELETE /tasks/:id returns 200 even when task not found"

# Check status
cm chain status

Expected output:

CHAIN EXECUTION
  ID: chain-exec-12345
  Pipeline: bug-fix
  Status: in-progress
  Current Step: 1/3 (cm-debugging)
  
  Timeline:
    1. cm-debugging (in-progress)
    2. cm-tdd (waiting)
    3. cm-quality-gate (waiting)
  
  Context Bus:
    - Pipeline: bug-fix
    - Task: "DELETE doesn't check task exists"
    - Shared state: {}

Practice 4: Manual Skill Chain (30 phút)

Simulate 3 skills running in sequence. We'll call them manually to show the flow:

Step 1: cm-debugging (Find Root Cause)

Create file: src/__tests__/bug-2-debug.md

markdown
# Bug #2 Debug Log
## Task
DELETE /tasks/:id returns 200 even if task doesn't exist

## Phase 1: Reproduce
```bash
curl -X DELETE http://localhost:3000/tasks/9999
# Expected: 404 (task not found)
# Actual: 200 OK

# Root cause found!

Phase 2: Isolate

File: src/routes/tasks.js, line 45

javascript
app.delete('/tasks/:id', (req, res) => {
  const id = req.params.id;
  const task = db.prepare('SELECT * FROM tasks WHERE id = ?').get(id);
  
  // BUG: No check if task exists!
  // Just delete and return 200
  db.prepare('DELETE FROM tasks WHERE id = ?').run(id);
  res.json({ success: true });
});

Phase 3: Root Cause

  • deleteTask() doesn't check if task exists before delete
  • Should return 404 if task not found

Phase 4: Fix Approach

Add check:

javascript
if (!task) {
  return res.status(404).json({ error: 'Task not found' });
}

Output

  • Root cause: Missing task existence check
  • Fix: Add db.get() + 404 response
  • Confidence: 100% (code review confirms)

**Simulate Step Completion:**

```bash
# After cm-debugging completes
cm chain advance chain-exec-12345 "Root cause found: deleteTask missing 404 check"

# Update context bus
cm_bus_write skill=cm-debugging \
  root_cause="deleteTask() missing existence check" \
  fix_approach="add if (!task) return 404"

Step 2: cm-tdd (Write Test + Fix)

Create test file: src/__tests__/routes/tasks.test.ts

typescript
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
import request from 'supertest';
import app from '../../server.js';
import db from '../../db.js';

describe('DELETE /tasks/:id', () => {
  let taskId: number;

  beforeAll(() => {
    // Create a task for testing
    const stmt = db.prepare('INSERT INTO tasks (title) VALUES (?)');
    const result = stmt.run('Test Task');
    taskId = result.lastInsertRowid;
  });

  afterAll(() => {
    db.prepare('DELETE FROM tasks').run();
  });

  // ========== RED TEST ==========
  it('should return 404 when task does not exist', async () => {
    const fakeId = 9999; // Task that doesn't exist
    
    const response = await request(app)
      .delete(`/tasks/${fakeId}`)
      .expect(404); // RED: Currently returns 200, we expect 404
    
    expect(response.body.error).toBe('Task not found');
  });

  it('should return 200 and delete task when it exists', async () => {
    const response = await request(app)
      .delete(`/tasks/${taskId}`)
      .expect(200);
    
    expect(response.body.success).toBe(true);

    // Verify task was deleted
    const deletedTask = db.prepare('SELECT * FROM tasks WHERE id = ?').get(taskId);
    expect(deletedTask).toBeUndefined();
  });
});

Run Red Test (expect to fail):

bash
npm test -- src/__tests__/routes/tasks.test.ts

# Expected output:
# ✗ should return 404 when task does not exist
#   AssertionError: expected 200 to equal 404

GREEN - Implement Fix:

File: src/routes/tasks.js

javascript
app.delete('/tasks/:id', (req, res) => {
  const id = req.params.id;
  
  // ===== FIX: Check if task exists =====
  const task = db.prepare('SELECT * FROM tasks WHERE id = ?').get(id);
  if (!task) {
    return res.status(404).json({ error: 'Task not found' });
  }
  
  db.prepare('DELETE FROM tasks WHERE id = ?').run(id);
  res.json({ success: true });
});

Run Green Test (expect to pass):

bash
npm test -- src/__tests__/routes/tasks.test.ts

# Expected output:
# ✓ should return 404 when task does not exist
# ✓ should return 200 and delete task when it exists
# 
# Tests: 2 passed (2)

Simulate Step Completion:

bash
cm chain advance chain-exec-12345 "Test written (RED), fix implemented (GREEN), all tests passing"

cm_bus_write skill=cm-tdd \
  test_file="src/__tests__/routes/tasks.test.ts" \
  fix_file="src/routes/tasks.js" \
  tests_passing=true

Step 3: cm-quality-gate (Verify + Approve)

bash
# Run full test suite
npm test

# Check coverage
npm run test:coverage

# Expected: All tests pass, coverage >= 80%

File: src/__tests__/verification.md

markdown
# Quality Gate Verification

## Tests
- Unit tests: PASS (12/12)
- Integration tests: PASS (8/8)
- E2E tests: PASS (5/5)

## Coverage
- Lines: 87%
- Branches: 85%
- Functions: 90%

## Code Review
- Logic: PASS — 404 check is correct
- Performance: PASS — no N+1 queries
- Security: PASS — no injection risk
- Error Handling: PASS — proper error response

## Regression
- All existing tests: PASS
- No breaking changes: CONFIRMED

## Approval
APPROVED ✓ — Ready for deployment

Simulate Final Completion:

bash
cm chain advance chain-exec-12345 "Quality gate passed, bug #2 fixed"

# Chain automatically completes
cm chain status
# Status: completed ✓

Practice 5: Create docs/qa-skill-map.md (10 phút)

Document your understanding:

File: docs/qa-skill-map.md

markdown
# QA Skill Map — TaskFlow Project

## Skill Groups Overview

### TEST: Write & Run Tests
- **cm-tdd** — Red-Green-Refactor cycle
  - Used for: Every new feature or bug fix
  - Outputs: Test file + implementation
  - Buổi 05: Learn deep + practice with Bug #1, #2

- **cm-test-gate** — 5-Layer validation
  - Layer 1: Unit tests (individual functions)
  - Layer 2: Integration tests (functions together)
  - Layer 3: E2E tests (full user flow)
  - Layer 4: Security tests (OWASP, injection)
  - Layer 5: Visual regression (screenshot comparison)
  - Buổi 06-08: Implement each layer

### DEBUG: Find Root Cause
- **cm-debugging** — 4-Phase systematic debugging
  - Phase 1: Reproduce (write test)
  - Phase 2: Isolate (trace code path)
  - Phase 3: Fix (minimal change)
  - Phase 4: Verify (regression test)
  - Buổi 17: Deep dive + practice with Bug #6, #7

- **cm-continuity** — Working memory protocol
  - Used every session (background)
  - Tier 2: CONTINUITY.md (working memory)
  - Tier 3: context.db (long-term learnings)
  - Prevents repeating same mistakes

### REVIEW: Code Quality
- **cm-code-review** — AI code review
  - Checks: Logic, performance, security
  - Buổi 15: Learn + integrate into PR workflow

- **cm-clean-code** — Code smell detection
  - Checks: DRY, SOLID, readability
  - Suggests: Refactoring opportunities

### DEPLOY: Ship Safely
- **cm-safe-deploy** — 8-Gate pipeline
  1. Lint (code style)
  2. Unit test (functionality)
  3. Secret scan (no hardcoded keys)
  4. Dependency audit (no vulnerable deps)
  5. Security scan (code vulnerabilities)
  6. Performance test (no regression)
  7. Staging deploy (test in staging)
  8. Canary + monitoring (gradual prod)
  - Buổi 10: Setup 8-gate pipeline

- **cm-security-gate** — Vulnerability scanner
  - Integrates: Snyk, Aikido
  - Buổi 12: Security scanning deep dive

- **cm-secret-shield** — Secrets leak detection
  - Detects: API keys, credentials, tokens
  - Buổi 08: Catch hardcoded secrets

### MEMORY: Learn & Share
- **cm-continuity** — Working memory
- **cm-notebooklm** — Cloud brain for team knowledge
- **cm-dashboard** — Visualize goals + memory health
- **cm-skill-index** — Browse all skills

## TaskFlow Bug Labs Mapping

| Bug # | Description | Skills Used | Buổi |
|-------|-------------|-------------|------|
| #1 | Allow empty task title | cm-tdd → cm-test-gate | 05 |
| #2 | DELETE no 404 check | cm-tdd, cm-debugging | 05, 17 |
| #3 | i18n sync issue | cm-test-gate, cm-safe-i18n | 08 |
| #4 | Template literal bug | cm-test-gate Layer 1 | 06 |
| #5 | Hardcoded API key | cm-secret-shield | 08 |
| #6 | Magic number 86400000 | cm-debugging, cm-clean-code | 17 |
| #7 | 4-level nesting | cm-clean-code, cm-debugging | 17 |

## Skill Chain Workflows

### Workflow 1: Bug Fix (bug-fix chain)

Trigger: "Bug X found in production" → cm-debugging (find root cause) → cm-tdd (write test + fix) → cm-quality-gate (verify) → cm-safe-deploy (ship fix)


### Workflow 2: Feature Development

Trigger: "Add recurring tasks feature" → cm-planning (spec + test plan) → cm-tdd (test + code) → cm-code-review (review) → cm-quality-gate (verify) → cm-safe-deploy (deploy)


### Workflow 3: Code Review

Trigger: "Review PR #42" → cm-code-review (review logic/perf/security) → cm-quality-gate (verify tests) → merge + deploy


## Running Skill Chains

```bash
# List all available chains
cm chain list

# Auto-detect best chain
cm chain auto "Bug #2: DELETE returns 200 for missing task"

# Start specific chain
cm chain start bug-fix "DELETE missing 404 check"

# Check progress
cm chain status

# Move to next step
cm chain advance <chain-id> "Summary of completion"

Next Steps

After Session 04:

  1. Session 05: Deep dive cm-tdd, fix Bug #1 & #2
  2. Session 06: cm-test-gate Layer 1, fix Bug #4
  3. Session 08: cm-secret-shield, catch hardcoded key (Bug #5)
  4. Session 17: cm-debugging + cm-clean-code, fix Bug #6 & #7

---

## Phần 4: Checkpoint & Validation

### ✅ Checklist Buổi 04

```bash
# 1. Can list all skills
cm skill-index | head -10
# ✓ Should show list of skills

# 2. Can search skills
cm skill-search tdd | grep "cm-tdd"
# ✓ Should find cm-tdd

# 3. Can view specific skill
cm skill-info cm-tdd | grep "Test-Driven"
# ✓ Should show TDD description

# 4. Can check available chains
cm chain list | grep "bug-fix"
# ✓ Should list bug-fix, feature-development, etc.

# 5. Can view context bus
cm continuity bus
# ✓ Should show pipeline state (may be empty if no chain active)

# 6. qa-skill-map.md created
test -f docs/qa-skill-map.md && echo "✓ Found" || echo "✗ Missing"

# 7. All tests still passing
npm test
# ✓ Should pass

Git Commit

bash
# Add all changes
git add -A

# Commit
git commit -m "feat(skills): document QA skill map + chain workflows"

# Optional: View changes
git log --oneline | head -1

Phần 5: 5 Câu Quiz

Quiz 1: Skill Groups

Q: Buổi tới (buổi 05), bạn sẽ dùng skills từ nhóm nào để viết test cho Bug #1 & #2? A: Nhóm TEST: cm-tdd (viết test) → cm-test-gate (kiểm tra). Buổi 17 thêm cm-debugging (4-phase) để tìm root cause.

Quiz 2: Context Bus

Q: Context Bus được dùng để làm gì trong Skill Chain? A: Chia sẻ output giữa skills. Ví dụ: cm-debugging output (root cause) → context bus → cm-tdd đọc và biết cần fix cái gì.

Quiz 3: Intelligent Selection

Q: Tại sao cần "Intelligent Skill Selection" thay vì chạy tất cả 68 skills? A: 2-3 focused skills → +18.6pp performance. 68 skills → -2.9pp (overload, AI bị confuse, execution chậm, quality thấp).

Quiz 4: Bug-Fix Chain

Q: Chain nào sẽ chạy khi bạn gõ cm chain start bug-fix "DELETE returns 200"? A: bug-fix chain: cm-debugging (find root cause) → cm-tdd (test + fix) → cm-quality-gate (verify).

Quiz 5: QA Skill Map

Q: Tại sao phải tạo docs/qa-skill-map.md? A: Team reference document. When new teammate joins, they read skill map để hiểu: "Cái gì là TEST? DEBUG? Khi nào dùng cái nào?"


Homework Buổi 04

Task 1: Explore All 68 Skills (20 phút)

bash
# List all skills
cm skill-index

# Đọc 10 ngẫu nhiên skill descriptions
# Pick 5 and write down: 
#   - Skill name
#   - What it does
#   - When you'd use it

Create file: docs/skills-explored.md

markdown
# Explored Skills

## 1. cm-tdd
- What: Red-Green-Refactor test-driven development
- When: Implement any feature or fix bug

## 2. cm-debugging
- What: 4-phase systematic debugging
- When: Production bug or test failure

[... continue for 5-10 skills]

Task 2: Simulate Complete Bug-Fix Chain (30 phút)

(Already done in Practice 4, but document it properly)

Create file: BUG-2-CHAIN-LOG.md

markdown
# Bug #2 Chain Execution Log

## Task
DELETE /tasks/:id returns 200 instead of 404

## Chain Used
bug-fix: cm-debugging → cm-tdd → cm-quality-gate

## Timeline

### Step 1: cm-debugging
- Time: 2026-04-24 15:00
- Root cause: deleteTask() missing task existence check
- Fix: Add if (!task) return 404
- Status: COMPLETE

### Step 2: cm-tdd
- Time: 2026-04-24 15:15
- Test written: RED (expected 404, got 200)
- Code changed: src/routes/tasks.js
- Test result: GREEN (all passing)
- Status: COMPLETE

### Step 3: cm-quality-gate
- Time: 2026-04-24 15:30
- Tests passed: 20/20
- Coverage: 87%
- Code review: PASS
- Status: APPROVED ✓

## Result
Bug #2 fixed. Ready for deployment.

Task 3: Write Session Summary in CONTINUITY.md (10 phút)

Update .cm/CONTINUITY.md:

markdown
## Just Completed (Buổi 04)
- Learned 5-tier memory architecture (Tier 1-5)
- Understood QA Skill Groups (TEST, DEBUG, REVIEW, DEPLOY, MEMORY)
- Practiced Skill Chain: cm-debugging → cm-tdd → cm-quality-gate
- Created docs/qa-skill-map.md
- Simulated bug-2 chain fix

## Next Actions (Priority Order)
1. Buổi 05: Deep dive cm-tdd, fix Bug #1 (empty title validation)
2. Buổi 05: Fix Bug #2 (DELETE 404 check) using chain
3. Review Ebbinghaus decay + learnings.json format
4. Practice TDD Red-Green-Refactor cycle daily

Task 4: Final Commit (5 phút)

bash
git add -A
git commit -m "docs(session-4): skill map, bug-2 chain simulation, homework completion"
git push origin main (if setup)

Tài Liệu Tham Khảo


Key Takeaways

  1. 68+ Skills, 5 Groups: TEST, DEBUG, REVIEW, DEPLOY, MEMORY — each has a role
  2. Intelligent Selection: 2-3 focused skills > all 68 (SkillsBench +18.6pp)
  3. Skill Chain: Pipeline of skills with context bus for handoff
  4. QA Bug-Fix Workflow: cm-debugging → cm-tdd → cm-quality-gate
  5. Context Bus: Shared state between skills, enables handoff without re-reading

Sau buổi 04, bạn sẽ:

  • Hiểu tất cả skill groups ✓
  • Biết khi nào dùng skill nào ✓
  • Chạy được skill chain tự động ✓
  • Ready cho buổi 05 TDD deep dive ✓

Powered by CodyMaster × VitePress