tlc-claude-code 1.5.3 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/tlc/audit.md +129 -0
- package/.claude/commands/tlc/autofix.md +217 -0
- package/.claude/commands/tlc/bug.md +255 -0
- package/.claude/commands/tlc/build.md +731 -0
- package/.claude/commands/tlc/checklist.md +212 -0
- package/.claude/commands/tlc/ci.md +414 -0
- package/.claude/commands/tlc/claim.md +189 -0
- package/.claude/commands/tlc/cleanup.md +187 -0
- package/.claude/commands/tlc/complete.md +160 -0
- package/.claude/commands/tlc/config.md +395 -0
- package/.claude/commands/tlc/coverage.md +222 -0
- package/.claude/commands/tlc/deploy.md +723 -0
- package/.claude/commands/tlc/discuss.md +185 -0
- package/.claude/commands/tlc/docs.md +194 -0
- package/.claude/commands/tlc/edge-cases.md +241 -0
- package/.claude/commands/tlc/export.md +456 -0
- package/.claude/commands/tlc/help.md +169 -0
- package/.claude/commands/tlc/import-project.md +246 -0
- package/.claude/commands/tlc/init.md +443 -0
- package/.claude/commands/tlc/issues.md +376 -0
- package/.claude/commands/tlc/llm.md +111 -0
- package/.claude/commands/tlc/new-milestone.md +172 -0
- package/.claude/commands/tlc/new-project.md +399 -0
- package/.claude/commands/tlc/next.md +129 -0
- package/.claude/commands/tlc/outdated.md +200 -0
- package/.claude/commands/tlc/plan.md +224 -0
- package/.claude/commands/tlc/progress.md +153 -0
- package/.claude/commands/tlc/quality.md +185 -0
- package/.claude/commands/tlc/quick.md +52 -0
- package/.claude/commands/tlc/refactor.md +190 -0
- package/.claude/commands/tlc/release.md +135 -0
- package/.claude/commands/tlc/review-pr.md +184 -0
- package/.claude/commands/tlc/review.md +200 -0
- package/.claude/commands/tlc/security.md +195 -0
- package/.claude/commands/tlc/server.md +19 -0
- package/.claude/commands/tlc/start.md +137 -0
- package/.claude/commands/tlc/status.md +65 -0
- package/.claude/commands/tlc/sync.md +652 -0
- package/.claude/commands/tlc/tlc.md +279 -0
- package/.claude/commands/tlc/verify.md +159 -0
- package/.claude/commands/tlc/who.md +151 -0
- package/bin/postinstall.js +54 -0
- package/package.json +3 -1
|
@@ -0,0 +1,731 @@
|
|
|
1
|
+
# /tlc:build - Build a Phase (Test-First)
|
|
2
|
+
|
|
3
|
+
Write failing tests, then implement to make them pass.
|
|
4
|
+
|
|
5
|
+
## What This Does
|
|
6
|
+
|
|
7
|
+
1. **Write failing tests** for all tasks in the phase
|
|
8
|
+
2. **Verify tests fail** (Red)
|
|
9
|
+
3. **Implement code** one task at a time (Green)
|
|
10
|
+
4. **Verify tests pass** after each task
|
|
11
|
+
5. **Commit** after each passing task
|
|
12
|
+
|
|
13
|
+
This is the core TLC command. Tests before code, one task at a time.
|
|
14
|
+
|
|
15
|
+
**Overdrive Mode:** When tasks are independent, TLC auto-detects and offers parallel execution with multiple agents.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
/tlc:build <phase_number>
|
|
21
|
+
/tlc:build <phase_number> --sequential # Force sequential mode
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Process
|
|
25
|
+
|
|
26
|
+
### Step 1: Load Plans
|
|
27
|
+
|
|
28
|
+
Read all `.planning/phases/{phase}-*-PLAN.md` files for this phase.
|
|
29
|
+
|
|
30
|
+
### Step 1a: Overdrive Detection (Auto-Parallel)
|
|
31
|
+
|
|
32
|
+
After loading plans, analyze task dependencies to determine if parallel execution is possible.
|
|
33
|
+
|
|
34
|
+
**Check for dependencies:**
|
|
35
|
+
```javascript
|
|
36
|
+
// Patterns that indicate dependencies:
|
|
37
|
+
// - "depends on task N"
|
|
38
|
+
// - "after task N"
|
|
39
|
+
// - "requires task N"
|
|
40
|
+
// - "blocked by task N"
|
|
41
|
+
// - "## Dependencies" section with task relationships
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Decision logic:**
|
|
45
|
+
1. Parse all tasks from plan
|
|
46
|
+
2. Look for dependency markers in task descriptions
|
|
47
|
+
3. Check "## Dependencies" section if present
|
|
48
|
+
4. Identify independent tasks (no dependencies)
|
|
49
|
+
|
|
50
|
+
**If 2+ independent tasks found:**
|
|
51
|
+
```
|
|
52
|
+
🚀 Overdrive Mode Available
|
|
53
|
+
|
|
54
|
+
Phase 3 has 4 independent tasks that can run in parallel:
|
|
55
|
+
- Task 1: Create user schema
|
|
56
|
+
- Task 2: Add validation helpers
|
|
57
|
+
- Task 3: Write migration scripts
|
|
58
|
+
- Task 4: Create seed data
|
|
59
|
+
|
|
60
|
+
Recommended: 3 agents (optimal parallelism)
|
|
61
|
+
|
|
62
|
+
Options:
|
|
63
|
+
1) Overdrive mode (parallel agents) [Recommended]
|
|
64
|
+
2) Sequential mode (one task at a time)
|
|
65
|
+
3) Let me pick which tasks to parallelize
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**If tasks have dependencies (waterfall):**
|
|
69
|
+
```
|
|
70
|
+
📋 Sequential Mode
|
|
71
|
+
|
|
72
|
+
Phase 3 tasks have dependencies:
|
|
73
|
+
Task 2 depends on Task 1
|
|
74
|
+
Task 3 depends on Task 2
|
|
75
|
+
|
|
76
|
+
Running in sequential order.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Step 1b: Execute Overdrive (if selected)
|
|
80
|
+
|
|
81
|
+
When overdrive mode is selected, spawn parallel agents:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
🚀 Launching Overdrive Mode
|
|
85
|
+
|
|
86
|
+
Spawning 3 agents in parallel...
|
|
87
|
+
|
|
88
|
+
Agent 1: Task 1 - Create user schema
|
|
89
|
+
Agent 2: Task 2 - Add validation helpers
|
|
90
|
+
Agent 3: Task 3 - Write migration scripts
|
|
91
|
+
|
|
92
|
+
[All agents spawned - working in background]
|
|
93
|
+
[Task 4 queued for next available agent]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Agent execution rules:**
|
|
97
|
+
- Each agent gets one task
|
|
98
|
+
- Agents work autonomously (no confirmation prompts)
|
|
99
|
+
- Each agent commits after completing their task
|
|
100
|
+
- When an agent finishes, it can pick up queued tasks
|
|
101
|
+
- All agents follow test-first methodology
|
|
102
|
+
|
|
103
|
+
**CRITICAL: Spawn all agents in a SINGLE message using multiple Task tool calls.**
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
Task(description="Agent 1: Task 1", prompt="...", subagent_type="general-purpose", run_in_background=true)
|
|
107
|
+
Task(description="Agent 2: Task 2", prompt="...", subagent_type="general-purpose", run_in_background=true)
|
|
108
|
+
Task(description="Agent 3: Task 3", prompt="...", subagent_type="general-purpose", run_in_background=true)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Live Progress Monitoring:**
|
|
112
|
+
|
|
113
|
+
While agents run in background, show live status using the AgentProgressMonitor:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
node -e "
|
|
117
|
+
const { AgentProgressMonitor } = require('./server/lib/agent-progress-monitor.js');
|
|
118
|
+
const monitor = new AgentProgressMonitor('/tmp/claude-1000/-mnt-c-Code-TLC/tasks');
|
|
119
|
+
const agents = ['AGENT_ID_1', 'AGENT_ID_2', 'AGENT_ID_3'];
|
|
120
|
+
console.log(monitor.formatTable(agents));
|
|
121
|
+
"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Display format:
|
|
125
|
+
```
|
|
126
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
127
|
+
🚀 OVERDRIVE STATUS
|
|
128
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
129
|
+
| Agent | Task | Tests | Phase |
|
|
130
|
+
|-------|------|-------|-------|
|
|
131
|
+
| a1b2c3 | README Generator | 29 ✓ | committed |
|
|
132
|
+
| d4e5f6 | Flow Diagrams | 18 ✓ | implementing |
|
|
133
|
+
| g7h8i9 | ADR Generator | - | writing-tests |
|
|
134
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Show status automatically:**
|
|
138
|
+
- When receiving agent progress notifications
|
|
139
|
+
- When user asks "check on agents"
|
|
140
|
+
- After each agent completes
|
|
141
|
+
|
|
142
|
+
**After all agents complete:**
|
|
143
|
+
1. Run full test suite
|
|
144
|
+
2. Verify all tasks pass
|
|
145
|
+
3. Report results
|
|
146
|
+
4. Continue to Step 8 (verification)
|
|
147
|
+
|
|
148
|
+
### Step 1c: Sync and Claim (Multi-User, Sequential Only)
|
|
149
|
+
|
|
150
|
+
**Note:** Skip this step if using Overdrive mode - agents handle claiming automatically.
|
|
151
|
+
|
|
152
|
+
Before starting work, coordinate with teammates:
|
|
153
|
+
|
|
154
|
+
1. **Pull latest:** `git pull --rebase`
|
|
155
|
+
2. **Get user identity:**
|
|
156
|
+
```bash
|
|
157
|
+
if [ -n "$TLC_USER" ]; then
|
|
158
|
+
user=$TLC_USER
|
|
159
|
+
else
|
|
160
|
+
user=$(git config user.name | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
|
|
161
|
+
fi
|
|
162
|
+
```
|
|
163
|
+
3. **Parse task status:** Read `[>@user]` and `[x@user]` markers from plan
|
|
164
|
+
4. **Show availability:**
|
|
165
|
+
```
|
|
166
|
+
Phase 1 Tasks:
|
|
167
|
+
[x@alice] 1. Create schema (done)
|
|
168
|
+
[ ] 2. Add validation (available)
|
|
169
|
+
[>@bob] 3. Write migrations (bob is working)
|
|
170
|
+
[ ] 4. Integration tests (available)
|
|
171
|
+
|
|
172
|
+
Work on task 2? (Y/n)
|
|
173
|
+
```
|
|
174
|
+
5. **Claim selected task:** Update `[ ]` → `[>@{user}]`
|
|
175
|
+
6. **Commit claim:** `git commit -m "claim: task 2 (@{user})"`
|
|
176
|
+
7. **Push:** Prompt user or auto-push
|
|
177
|
+
|
|
178
|
+
If no markers exist in PLAN.md, skip this step (single-user mode).
|
|
179
|
+
|
|
180
|
+
### Step 2: Detect Test Framework
|
|
181
|
+
|
|
182
|
+
#### Check TLC Config First
|
|
183
|
+
|
|
184
|
+
If `.tlc.json` exists, use configured frameworks:
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"testFrameworks": {
|
|
189
|
+
"primary": "mocha",
|
|
190
|
+
"installed": ["mocha", "chai", "sinon", "proxyquire"],
|
|
191
|
+
"run": ["mocha"]
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
#### Auto-Detection (No Config)
|
|
197
|
+
|
|
198
|
+
Check what's already set up:
|
|
199
|
+
- `.tlc.json` → Use configured framework
|
|
200
|
+
- `mocha` in package.json → Mocha (TLC default)
|
|
201
|
+
- `.mocharc.*` or `mocha.opts` → Mocha
|
|
202
|
+
- `vitest.config.*` → Vitest
|
|
203
|
+
- `jest.config.*` → Jest
|
|
204
|
+
- `pytest.ini` or `pyproject.toml` with pytest → pytest
|
|
205
|
+
- `spec/` directory → RSpec
|
|
206
|
+
- None found → Set up mocha stack (TLC default)
|
|
207
|
+
|
|
208
|
+
### Step 3: Plan Tests for Each Task
|
|
209
|
+
|
|
210
|
+
Before writing any tests, create a test plan for each task in the phase.
|
|
211
|
+
|
|
212
|
+
For each task in the plan:
|
|
213
|
+
|
|
214
|
+
1. **Read the task** — understand what behavior is being specified
|
|
215
|
+
2. **Identify test cases:**
|
|
216
|
+
- Happy path (expected inputs → expected outputs)
|
|
217
|
+
- Edge cases mentioned in `<action>`
|
|
218
|
+
- Error conditions from `<verify>`
|
|
219
|
+
3. **Create test plan entry**
|
|
220
|
+
|
|
221
|
+
Create `.planning/phases/{phase}-TEST-PLAN.md`:
|
|
222
|
+
|
|
223
|
+
```markdown
|
|
224
|
+
# Phase {N} Test Plan
|
|
225
|
+
|
|
226
|
+
## Task: {task-id} - {task-title}
|
|
227
|
+
|
|
228
|
+
### File: tests/{feature}.test.ts
|
|
229
|
+
|
|
230
|
+
| Test | Type | Expected Result |
|
|
231
|
+
|------|------|-----------------|
|
|
232
|
+
| user can log in with valid credentials | happy path | returns user object |
|
|
233
|
+
| login rejects invalid password | error | throws AuthError |
|
|
234
|
+
| login rejects empty email | edge case | throws ValidationError |
|
|
235
|
+
|
|
236
|
+
### Dependencies to mock:
|
|
237
|
+
- database connection
|
|
238
|
+
- email service
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Task: {task-id-2} - {task-title-2}
|
|
243
|
+
...
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Step 4: Write Tests One Task at a Time
|
|
247
|
+
|
|
248
|
+
**For each task in the test plan, sequentially:**
|
|
249
|
+
|
|
250
|
+
#### 4a. Write test file for this task
|
|
251
|
+
|
|
252
|
+
Follow the project's test patterns. Test names should describe expected behavior:
|
|
253
|
+
```
|
|
254
|
+
✓ "user can log in with valid credentials"
|
|
255
|
+
✓ "login rejects invalid password with 401"
|
|
256
|
+
✗ "test login" (too vague)
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
**Mocha/Chai (TLC Default):**
|
|
260
|
+
```javascript
|
|
261
|
+
const { expect } = require('chai')
|
|
262
|
+
const sinon = require('sinon')
|
|
263
|
+
const proxyquire = require('proxyquire')
|
|
264
|
+
|
|
265
|
+
describe('login', () => {
|
|
266
|
+
let login, dbStub
|
|
267
|
+
|
|
268
|
+
beforeEach(() => {
|
|
269
|
+
dbStub = sinon.stub()
|
|
270
|
+
login = proxyquire('../src/auth/login', {
|
|
271
|
+
'./db': { findUser: dbStub }
|
|
272
|
+
})
|
|
273
|
+
})
|
|
274
|
+
|
|
275
|
+
afterEach(() => {
|
|
276
|
+
sinon.restore()
|
|
277
|
+
})
|
|
278
|
+
|
|
279
|
+
it('returns user object for valid credentials', async () => {
|
|
280
|
+
dbStub.resolves({ id: 1, email: 'user@test.com' })
|
|
281
|
+
|
|
282
|
+
const result = await login('user@test.com', 'password123')
|
|
283
|
+
|
|
284
|
+
expect(result.user).to.exist
|
|
285
|
+
expect(result.user.email).to.equal('user@test.com')
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
it('throws AuthError for invalid password', async () => {
|
|
289
|
+
dbStub.resolves(null)
|
|
290
|
+
|
|
291
|
+
try {
|
|
292
|
+
await login('user@test.com', 'wrong')
|
|
293
|
+
expect.fail('Should have thrown')
|
|
294
|
+
} catch (err) {
|
|
295
|
+
expect(err.message).to.equal('Invalid credentials')
|
|
296
|
+
}
|
|
297
|
+
})
|
|
298
|
+
})
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**Vitest/Jest (Alternative):**
|
|
302
|
+
```typescript
|
|
303
|
+
import { describe, it, expect } from 'vitest'
|
|
304
|
+
import { login } from '../src/auth/login'
|
|
305
|
+
|
|
306
|
+
describe('login', () => {
|
|
307
|
+
it('returns user object for valid credentials', async () => {
|
|
308
|
+
const result = await login('user@test.com', 'password123')
|
|
309
|
+
expect(result.user).toBeDefined()
|
|
310
|
+
expect(result.user.email).toBe('user@test.com')
|
|
311
|
+
})
|
|
312
|
+
|
|
313
|
+
it('throws AuthError for invalid password', async () => {
|
|
314
|
+
await expect(login('user@test.com', 'wrong'))
|
|
315
|
+
.rejects.toThrow('Invalid credentials')
|
|
316
|
+
})
|
|
317
|
+
})
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
**pytest (Python):**
|
|
321
|
+
```python
|
|
322
|
+
import pytest
|
|
323
|
+
from src.auth import login
|
|
324
|
+
|
|
325
|
+
def test_login_returns_user_for_valid_credentials():
|
|
326
|
+
result = login("user@test.com", "password123")
|
|
327
|
+
assert result["user"]["email"] == "user@test.com"
|
|
328
|
+
|
|
329
|
+
def test_login_raises_for_invalid_password():
|
|
330
|
+
with pytest.raises(AuthError, match="Invalid credentials"):
|
|
331
|
+
login("user@test.com", "wrong")
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
#### 4b. Run this test file
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
npm test -- tests/auth/login.test.ts # vitest
|
|
338
|
+
pytest tests/test_login.py # pytest
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
Verify:
|
|
342
|
+
- ✅ Tests execute (no syntax errors)
|
|
343
|
+
- ✅ Tests FAIL (not pass, not skip)
|
|
344
|
+
- ❌ If import errors, add mocks/stubs and retry
|
|
345
|
+
|
|
346
|
+
#### 4c. Commit this test file
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
git add tests/auth/login.test.ts
|
|
350
|
+
git commit -m "test: add login tests (red) - phase {N}"
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
#### 4d. Move to next task
|
|
354
|
+
|
|
355
|
+
Repeat 4a-4c for each task in the test plan.
|
|
356
|
+
|
|
357
|
+
**Critical Rules:**
|
|
358
|
+
- Tests must be **syntactically valid** and **runnable**
|
|
359
|
+
- Tests must **FAIL** because code doesn't exist yet
|
|
360
|
+
- Tests must NOT **ERROR** from import issues — mock if needed
|
|
361
|
+
- Do NOT write any implementation code
|
|
362
|
+
- Do NOT skip or stub out the actual assertions
|
|
363
|
+
- **One task at a time, verify, commit, then next**
|
|
364
|
+
|
|
365
|
+
### Step 5: Verify All Tests Fail (Red)
|
|
366
|
+
|
|
367
|
+
Run the full test suite:
|
|
368
|
+
```bash
|
|
369
|
+
npm test # or vitest run, pytest, etc.
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
Check output:
|
|
373
|
+
- ✅ All new tests executed (no syntax errors)
|
|
374
|
+
- ✅ All new tests FAILED (not passed, not skipped)
|
|
375
|
+
- ❌ If tests error on imports, add mocks and retry
|
|
376
|
+
- ❌ If tests pass, something's wrong — investigate
|
|
377
|
+
|
|
378
|
+
### Step 6: Create Test Summary
|
|
379
|
+
|
|
380
|
+
Create `.planning/phases/{phase}-TESTS.md`:
|
|
381
|
+
|
|
382
|
+
```markdown
|
|
383
|
+
# Phase {N} Tests
|
|
384
|
+
|
|
385
|
+
Generated: {timestamp}
|
|
386
|
+
Status: ✅ All tests failing (Red)
|
|
387
|
+
|
|
388
|
+
## Test Files
|
|
389
|
+
|
|
390
|
+
| File | Tests | Status |
|
|
391
|
+
|------|-------|--------|
|
|
392
|
+
| tests/auth.test.ts | 4 | ❌ Failing |
|
|
393
|
+
| tests/session.test.ts | 3 | ❌ Failing |
|
|
394
|
+
|
|
395
|
+
## Test Output
|
|
396
|
+
|
|
397
|
+
{test runner output showing failures}
|
|
398
|
+
|
|
399
|
+
## Coverage Map
|
|
400
|
+
|
|
401
|
+
| Test | Task |
|
|
402
|
+
|------|------|
|
|
403
|
+
| user can log in with valid credentials | 01-task-1 |
|
|
404
|
+
| login rejects invalid password | 01-task-1 |
|
|
405
|
+
| session persists across requests | 01-task-2 |
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
### Step 7: Execute Implementation (Green)
|
|
409
|
+
|
|
410
|
+
Now implement the code to make tests pass. Work through each task sequentially:
|
|
411
|
+
|
|
412
|
+
**For each task in the plan:**
|
|
413
|
+
|
|
414
|
+
#### 7a. Read the task
|
|
415
|
+
Review the task's:
|
|
416
|
+
- Goal and expected behavior
|
|
417
|
+
- Acceptance criteria
|
|
418
|
+
- Test cases (now written and failing)
|
|
419
|
+
|
|
420
|
+
#### 7b. Implement the code
|
|
421
|
+
Write the minimum code needed to pass the tests:
|
|
422
|
+
- Create files specified in the task
|
|
423
|
+
- Follow existing project patterns
|
|
424
|
+
- Reference the failing tests for exact expected behavior
|
|
425
|
+
|
|
426
|
+
#### 7c. Run tests for this task
|
|
427
|
+
```bash
|
|
428
|
+
npm test -- tests/auth/login.test.ts # specific file
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
- ✅ Tests pass → Continue
|
|
432
|
+
- ❌ Tests fail → Fix implementation, retry
|
|
433
|
+
|
|
434
|
+
#### 7d. Commit this task
|
|
435
|
+
```bash
|
|
436
|
+
git add src/auth/login.ts tests/auth/login.test.ts
|
|
437
|
+
git commit -m "feat: {task-title} - phase {N}"
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
#### 7e. Mark Task Complete (Multi-User)
|
|
441
|
+
|
|
442
|
+
If using multi-user mode (task had `[>@user]` marker):
|
|
443
|
+
|
|
444
|
+
1. Update marker: `[>@{user}]` → `[x@{user}]`
|
|
445
|
+
2. Commit: `git commit -m "complete: task {N} - {title} (@{user})"`
|
|
446
|
+
3. Push to share progress with team
|
|
447
|
+
|
|
448
|
+
#### 7f. Move to next task
|
|
449
|
+
Repeat 7a-7d for each task in the phase.
|
|
450
|
+
|
|
451
|
+
**Critical Rules:**
|
|
452
|
+
- Implement **one task at a time**
|
|
453
|
+
- Run tests **after each task**
|
|
454
|
+
- Commit **after each passing task**
|
|
455
|
+
- Do NOT batch — sequential execution catches issues early
|
|
456
|
+
|
|
457
|
+
### Step 8: Verify All Tests Pass (Green)
|
|
458
|
+
|
|
459
|
+
After execution completes, run tests again:
|
|
460
|
+
```bash
|
|
461
|
+
npm test
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
Check output:
|
|
465
|
+
- ✅ All tests PASS → Continue to verify
|
|
466
|
+
- ❌ Some tests fail → Report which tasks need fixes
|
|
467
|
+
|
|
468
|
+
### Step 9: Update Test Summary
|
|
469
|
+
|
|
470
|
+
Update `.planning/phases/{phase}-TESTS.md`:
|
|
471
|
+
|
|
472
|
+
```markdown
|
|
473
|
+
Status: ✅ All tests passing (Green)
|
|
474
|
+
|
|
475
|
+
## Final Test Output
|
|
476
|
+
|
|
477
|
+
{test runner output showing all pass}
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
### Step 10: Auto-Review (Mandatory)
|
|
481
|
+
|
|
482
|
+
**This step runs automatically. Do not skip.**
|
|
483
|
+
|
|
484
|
+
Before completing the phase, run a full code review:
|
|
485
|
+
|
|
486
|
+
```bash
|
|
487
|
+
# Review current branch vs main
|
|
488
|
+
git diff --name-status main...HEAD
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
**Checks performed:**
|
|
492
|
+
|
|
493
|
+
1. **Test Coverage** - Every implementation file has a test file
|
|
494
|
+
2. **TDD Compliance** - Commits show test-first pattern (score ≥ 50%)
|
|
495
|
+
3. **Security Scan** - No hardcoded secrets, eval(), innerHTML, etc.
|
|
496
|
+
|
|
497
|
+
**Review output:**
|
|
498
|
+
|
|
499
|
+
```
|
|
500
|
+
───────────────────────────────
|
|
501
|
+
🔍 Auto-Review Results
|
|
502
|
+
|
|
503
|
+
Test Coverage: ✅ 5/5 files covered
|
|
504
|
+
TDD Score: 75% ✅
|
|
505
|
+
Security: ✅ No issues
|
|
506
|
+
|
|
507
|
+
Verdict: ✅ APPROVED
|
|
508
|
+
───────────────────────────────
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
**If review fails:**
|
|
512
|
+
|
|
513
|
+
```
|
|
514
|
+
───────────────────────────────
|
|
515
|
+
🔍 Auto-Review Results
|
|
516
|
+
|
|
517
|
+
Test Coverage: ❌ 2 files missing tests
|
|
518
|
+
├── src/utils.js → needs src/utils.test.js
|
|
519
|
+
└── src/helpers.js → needs src/helpers.test.js
|
|
520
|
+
|
|
521
|
+
TDD Score: 25% ❌ (target: 50%)
|
|
522
|
+
Security: ❌ 1 high severity issue
|
|
523
|
+
└── Hardcoded password in src/config.js
|
|
524
|
+
|
|
525
|
+
Verdict: ❌ CHANGES REQUESTED
|
|
526
|
+
|
|
527
|
+
⚠️ Phase cannot complete until issues are fixed.
|
|
528
|
+
───────────────────────────────
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
**Actions on failure:**
|
|
532
|
+
1. Add missing test files
|
|
533
|
+
2. Fix security issues
|
|
534
|
+
3. Re-run `/tlc:build {phase}` to retry
|
|
535
|
+
|
|
536
|
+
**CRITICAL: Phase is NOT complete until review passes.**
|
|
537
|
+
|
|
538
|
+
## Framework Defaults
|
|
539
|
+
|
|
540
|
+
### TLC Default: Mocha Stack
|
|
541
|
+
|
|
542
|
+
For JavaScript/TypeScript projects, TLC defaults to the mocha ecosystem:
|
|
543
|
+
|
|
544
|
+
| Library | Purpose | Install |
|
|
545
|
+
|---------|---------|---------|
|
|
546
|
+
| **mocha** | Test runner | `npm install -D mocha` |
|
|
547
|
+
| **chai** | Assertions | `npm install -D chai` |
|
|
548
|
+
| **sinon** | Mocks/stubs/spies | `npm install -D sinon` |
|
|
549
|
+
| **proxyquire** | Module mocking | `npm install -D proxyquire` |
|
|
550
|
+
|
|
551
|
+
Full setup:
|
|
552
|
+
```bash
|
|
553
|
+
npm install -D mocha chai sinon proxyquire @types/mocha @types/chai @types/sinon
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
Default `.mocharc.json`:
|
|
557
|
+
```json
|
|
558
|
+
{
|
|
559
|
+
"extension": ["js", "ts"],
|
|
560
|
+
"spec": "test/**/*.test.{js,ts}",
|
|
561
|
+
"require": ["ts-node/register"],
|
|
562
|
+
"timeout": 5000
|
|
563
|
+
}
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
Default `package.json` scripts:
|
|
567
|
+
```json
|
|
568
|
+
{
|
|
569
|
+
"scripts": {
|
|
570
|
+
"test": "mocha",
|
|
571
|
+
"test:watch": "mocha --watch"
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
### Alternative Frameworks
|
|
577
|
+
|
|
578
|
+
| Stack | Framework | Setup |
|
|
579
|
+
|-------|-----------|-------|
|
|
580
|
+
| Vite projects | Vitest | `npm install -D vitest` |
|
|
581
|
+
| React/Meta ecosystem | Jest | `npm install -D jest` |
|
|
582
|
+
| Python | pytest | `pip install pytest` |
|
|
583
|
+
| Go | go test | Built-in |
|
|
584
|
+
| Ruby | RSpec | `gem install rspec` |
|
|
585
|
+
|
|
586
|
+
To use an alternative, run `/tlc:config` to configure.
|
|
587
|
+
|
|
588
|
+
### Multi-Framework Support
|
|
589
|
+
|
|
590
|
+
Projects can have multiple test frameworks. Configure in `.tlc.json`:
|
|
591
|
+
|
|
592
|
+
```json
|
|
593
|
+
{
|
|
594
|
+
"testFrameworks": {
|
|
595
|
+
"primary": "mocha",
|
|
596
|
+
"installed": ["mocha", "chai", "sinon", "jest"],
|
|
597
|
+
"run": ["mocha", "jest"]
|
|
598
|
+
},
|
|
599
|
+
"commands": {
|
|
600
|
+
"mocha": "npx mocha 'test/**/*.test.js'",
|
|
601
|
+
"jest": "npx jest",
|
|
602
|
+
"all": "npm test"
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
When running tests, TLC will execute all frameworks in the `run` array.
|
|
608
|
+
|
|
609
|
+
Default pytest.ini (Python):
|
|
610
|
+
```ini
|
|
611
|
+
[pytest]
|
|
612
|
+
testpaths = tests
|
|
613
|
+
python_files = test_*.py
|
|
614
|
+
python_functions = test_*
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
## Example Run
|
|
618
|
+
|
|
619
|
+
### Sequential Mode (Tasks with Dependencies)
|
|
620
|
+
|
|
621
|
+
```
|
|
622
|
+
User: /tlc:build 1
|
|
623
|
+
|
|
624
|
+
Claude: Loading phase 1 plans...
|
|
625
|
+
Found: 1-PLAN.md (3 tasks)
|
|
626
|
+
|
|
627
|
+
📋 Sequential Mode
|
|
628
|
+
Task 2 depends on Task 1, Task 3 depends on Task 2.
|
|
629
|
+
Running in sequential order.
|
|
630
|
+
|
|
631
|
+
Checking test framework... Vitest detected.
|
|
632
|
+
|
|
633
|
+
Writing tests for Task 1: User schema...
|
|
634
|
+
Created: tests/db/schema.test.ts (4 tests)
|
|
635
|
+
❌ Tests failing (expected)
|
|
636
|
+
Committed: test: add schema tests (red)
|
|
637
|
+
|
|
638
|
+
Implementing Task 1: User schema...
|
|
639
|
+
✅ tests/db/schema.test.ts passing
|
|
640
|
+
Committed: feat: user schema - phase 1
|
|
641
|
+
|
|
642
|
+
Writing tests for Task 2: Validation...
|
|
643
|
+
[continues sequentially...]
|
|
644
|
+
|
|
645
|
+
Phase 1 complete. Ready for /tlc:verify 1
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
### Overdrive Mode (Independent Tasks)
|
|
649
|
+
|
|
650
|
+
```
|
|
651
|
+
User: /tlc:build 2
|
|
652
|
+
|
|
653
|
+
Claude: Loading phase 2 plans...
|
|
654
|
+
Found: 2-PLAN.md (4 tasks)
|
|
655
|
+
|
|
656
|
+
🚀 Overdrive Mode Available
|
|
657
|
+
|
|
658
|
+
Phase 2 has 4 independent tasks:
|
|
659
|
+
- Task 1: Create API routes
|
|
660
|
+
- Task 2: Add input validation
|
|
661
|
+
- Task 3: Write error handlers
|
|
662
|
+
- Task 4: Add rate limiting
|
|
663
|
+
|
|
664
|
+
Recommended: 3 agents
|
|
665
|
+
|
|
666
|
+
Options:
|
|
667
|
+
1) Overdrive mode (parallel) [Recommended]
|
|
668
|
+
2) Sequential mode
|
|
669
|
+
3) Pick tasks to parallelize
|
|
670
|
+
|
|
671
|
+
User: 1
|
|
672
|
+
|
|
673
|
+
Claude: 🚀 Launching Overdrive Mode
|
|
674
|
+
|
|
675
|
+
Spawning 3 agents...
|
|
676
|
+
[Agent 1] Task 1: Create API routes - STARTED
|
|
677
|
+
[Agent 2] Task 2: Add input validation - STARTED
|
|
678
|
+
[Agent 3] Task 3: Write error handlers - STARTED
|
|
679
|
+
[Queued] Task 4: Add rate limiting
|
|
680
|
+
|
|
681
|
+
... agents working in background ...
|
|
682
|
+
|
|
683
|
+
[Agent 2] ✅ Task 2 complete (3 commits)
|
|
684
|
+
[Agent 2] Task 4: Add rate limiting - STARTED
|
|
685
|
+
[Agent 1] ✅ Task 1 complete (4 commits)
|
|
686
|
+
[Agent 3] ✅ Task 3 complete (2 commits)
|
|
687
|
+
[Agent 2] ✅ Task 4 complete (2 commits)
|
|
688
|
+
|
|
689
|
+
All agents complete. Running full test suite...
|
|
690
|
+
✅ 24 tests passing
|
|
691
|
+
|
|
692
|
+
Phase 2 complete. Ready for /tlc:verify 2
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
## Error Recovery
|
|
696
|
+
|
|
697
|
+
**Tests error instead of fail:**
|
|
698
|
+
- Missing imports → Add mocks for dependencies
|
|
699
|
+
- Syntax errors → Fix test code
|
|
700
|
+
- Framework issues → Check config
|
|
701
|
+
|
|
702
|
+
**Tests pass before implementation:**
|
|
703
|
+
- Code already exists? Check if reimplementing
|
|
704
|
+
- Tests too weak? Strengthen assertions
|
|
705
|
+
- Wrong file paths? Check imports
|
|
706
|
+
|
|
707
|
+
**Some tests fail after implementation:**
|
|
708
|
+
- Report specific failures
|
|
709
|
+
- Suggest running `/tlc:build {phase}` again to retry
|
|
710
|
+
- Or manually fix and run `/tlc:status` to verify
|
|
711
|
+
|
|
712
|
+
**Overdrive mode issues:**
|
|
713
|
+
- Agent stuck → Check with `TaskOutput` tool
|
|
714
|
+
- Merge conflicts → Agents working on same files (rare if tasks are truly independent)
|
|
715
|
+
- One agent failed → Other agents continue; fix failed task manually
|
|
716
|
+
- Want sequential instead → Use `--sequential` flag: `/tlc:build 2 --sequential`
|
|
717
|
+
|
|
718
|
+
## Flags
|
|
719
|
+
|
|
720
|
+
| Flag | Description |
|
|
721
|
+
|------|-------------|
|
|
722
|
+
| `--sequential` | Force sequential execution even if tasks are independent |
|
|
723
|
+
| `--agents N` | Set max parallel agents (default: 3, max: 10) |
|
|
724
|
+
|
|
725
|
+
## When Overdrive is NOT Used
|
|
726
|
+
|
|
727
|
+
Overdrive auto-detects but won't activate when:
|
|
728
|
+
- Only 1 task in phase
|
|
729
|
+
- All tasks have dependencies (waterfall)
|
|
730
|
+
- Tasks modify the same files
|
|
731
|
+
- User passes `--sequential`
|