tlc-claude-code 1.2.8 → 1.2.10
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/bin/install.js +1 -0
- package/checklist.md +212 -0
- package/help.md +1 -0
- package/init.md +93 -5
- package/new-project.md +73 -2
- package/package.json +1 -1
- package/tlc.md +170 -165
package/bin/install.js
CHANGED
package/checklist.md
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# /tlc:checklist - Full Project Checklist
|
|
2
|
+
|
|
3
|
+
**TLC v{{VERSION}}**
|
|
4
|
+
|
|
5
|
+
Shows the complete project status across all phases with best practices checklist.
|
|
6
|
+
|
|
7
|
+
## What This Does
|
|
8
|
+
|
|
9
|
+
Displays a comprehensive view of:
|
|
10
|
+
1. Project setup status
|
|
11
|
+
2. All phases with workflow completion
|
|
12
|
+
3. Skipped steps across the project
|
|
13
|
+
4. Quality metrics summary
|
|
14
|
+
5. Recommended actions
|
|
15
|
+
|
|
16
|
+
## Output Format
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
TLC v{{VERSION}} Project Checklist
|
|
20
|
+
═══════════════════════════════════════════════════════════════════════════
|
|
21
|
+
|
|
22
|
+
PROJECT SETUP
|
|
23
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
24
|
+
[x] PROJECT.md exists
|
|
25
|
+
[x] .tlc.json configured
|
|
26
|
+
[x] Git repository initialized
|
|
27
|
+
[x] Main branch: main
|
|
28
|
+
|
|
29
|
+
Test Infrastructure:
|
|
30
|
+
[x] Unit test framework: mocha
|
|
31
|
+
[x] E2E framework: playwright
|
|
32
|
+
[ ] CI/CD configured
|
|
33
|
+
|
|
34
|
+
Quality Gates:
|
|
35
|
+
[x] Coverage threshold: 80%
|
|
36
|
+
[x] Quality score threshold: 75
|
|
37
|
+
|
|
38
|
+
═══════════════════════════════════════════════════════════════════════════
|
|
39
|
+
|
|
40
|
+
PHASE OVERVIEW
|
|
41
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
42
|
+
|
|
43
|
+
Phase 1: Authentication [COMPLETE] ✓
|
|
44
|
+
─────────────────────────────────────────────────────
|
|
45
|
+
[x] Discussed [x] Planned [x] Unit Tests
|
|
46
|
+
[x] E2E Tests [x] Implemented [x] Verified
|
|
47
|
+
|
|
48
|
+
Phase 2: User Dashboard [IN PROGRESS]
|
|
49
|
+
─────────────────────────────────────────────────────
|
|
50
|
+
[x] Discussed [x] Planned [ ] Unit Tests
|
|
51
|
+
[ ] E2E Tests [ ] Implemented [ ] Verified
|
|
52
|
+
|
|
53
|
+
⚠️ Skipped: E2E scenarios not in plan
|
|
54
|
+
|
|
55
|
+
Phase 3: Reports [PENDING]
|
|
56
|
+
─────────────────────────────────────────────────────
|
|
57
|
+
[ ] Discussed [ ] Planned [ ] Unit Tests
|
|
58
|
+
[ ] E2E Tests [ ] Implemented [ ] Verified
|
|
59
|
+
|
|
60
|
+
Phase 4: Admin Panel [PENDING]
|
|
61
|
+
─────────────────────────────────────────────────────
|
|
62
|
+
[ ] Discussed [ ] Planned [ ] Unit Tests
|
|
63
|
+
[ ] E2E Tests [ ] Implemented [ ] Verified
|
|
64
|
+
|
|
65
|
+
═══════════════════════════════════════════════════════════════════════════
|
|
66
|
+
|
|
67
|
+
QUALITY SUMMARY
|
|
68
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
69
|
+
|
|
70
|
+
Test Coverage:
|
|
71
|
+
──────────────
|
|
72
|
+
Overall: 72% (target: 80%) ⚠️ BELOW TARGET
|
|
73
|
+
|
|
74
|
+
Phase 1: 89% ✓
|
|
75
|
+
Phase 2: 45% ⚠️
|
|
76
|
+
Phase 3: --
|
|
77
|
+
Phase 4: --
|
|
78
|
+
|
|
79
|
+
Test Counts:
|
|
80
|
+
────────────
|
|
81
|
+
Unit tests: 47 passing, 0 failing
|
|
82
|
+
E2E tests: 12 passing, 0 failing
|
|
83
|
+
|
|
84
|
+
Quality Score: 78/100 (target: 75) ✓
|
|
85
|
+
|
|
86
|
+
═══════════════════════════════════════════════════════════════════════════
|
|
87
|
+
|
|
88
|
+
SKIPPED STEPS (ACTION NEEDED)
|
|
89
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
90
|
+
|
|
91
|
+
1. Phase 2: No E2E scenarios defined
|
|
92
|
+
→ Add E2E section to .planning/phases/2-PLAN.md
|
|
93
|
+
|
|
94
|
+
2. Phase 2: Coverage below threshold (45%)
|
|
95
|
+
→ Run /tlc:coverage to identify gaps
|
|
96
|
+
|
|
97
|
+
3. Project: No CI/CD configured
|
|
98
|
+
→ Run /tlc:ci to generate pipeline
|
|
99
|
+
|
|
100
|
+
═══════════════════════════════════════════════════════════════════════════
|
|
101
|
+
|
|
102
|
+
RECOMMENDED WORKFLOW
|
|
103
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
104
|
+
|
|
105
|
+
For each phase, follow this order:
|
|
106
|
+
|
|
107
|
+
1. /tlc:discuss Shape the implementation approach
|
|
108
|
+
2. /tlc:plan Break into tasks with test cases + E2E scenarios
|
|
109
|
+
3. /tlc:build Write tests → implement → run E2E
|
|
110
|
+
4. /tlc:verify Human acceptance testing
|
|
111
|
+
5. /tlc:coverage Check test coverage meets threshold
|
|
112
|
+
|
|
113
|
+
Before release:
|
|
114
|
+
6. /tlc:quality Ensure quality score meets threshold
|
|
115
|
+
7. /tlc:complete Tag release
|
|
116
|
+
|
|
117
|
+
═══════════════════════════════════════════════════════════════════════════
|
|
118
|
+
|
|
119
|
+
Quick Actions:
|
|
120
|
+
[1] Continue current phase → /tlc
|
|
121
|
+
[2] Fix skipped steps → Shows fix menu
|
|
122
|
+
[3] Run coverage check → /tlc:coverage
|
|
123
|
+
[4] Show all commands → /tlc:help
|
|
124
|
+
|
|
125
|
+
Choice [1/2/3/4]: _
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Process
|
|
129
|
+
|
|
130
|
+
### Step 1: Load Project Config
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Read .tlc.json
|
|
134
|
+
config=$(cat .tlc.json)
|
|
135
|
+
|
|
136
|
+
# Extract settings
|
|
137
|
+
unitFramework=$(echo $config | jq -r '.testFrameworks.primary // "not configured"')
|
|
138
|
+
e2eFramework=$(echo $config | jq -r '.e2e.framework // "not configured"')
|
|
139
|
+
coverageThreshold=$(echo $config | jq -r '.quality.coverageThreshold // 80')
|
|
140
|
+
qualityThreshold=$(echo $config | jq -r '.quality.qualityScoreThreshold // 75')
|
|
141
|
+
mainBranch=$(echo $config | jq -r '.git.mainBranch // "main"')
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Step 2: Scan All Phases
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Parse ROADMAP.md for all phases
|
|
148
|
+
phases=$(grep -E '^\s*-\s*\[' .planning/ROADMAP.md)
|
|
149
|
+
|
|
150
|
+
# For each phase, check artifacts
|
|
151
|
+
for phase in 1 2 3 4 5; do
|
|
152
|
+
discussion=".planning/phases/${phase}-DISCUSSION.md"
|
|
153
|
+
plan=".planning/phases/${phase}-PLAN.md"
|
|
154
|
+
tests=".planning/phases/${phase}-TESTS.md"
|
|
155
|
+
e2e="tests/e2e/phase-${phase}.spec.ts"
|
|
156
|
+
verified=".planning/phases/${phase}-VERIFIED.md"
|
|
157
|
+
|
|
158
|
+
# Check existence
|
|
159
|
+
[ -f "$discussion" ] && discussed="[x]" || discussed="[ ]"
|
|
160
|
+
[ -f "$plan" ] && planned="[x]" || planned="[ ]"
|
|
161
|
+
# ... etc
|
|
162
|
+
done
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Step 3: Collect Skipped Steps
|
|
166
|
+
|
|
167
|
+
Build list of all skipped/missing steps across project:
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
Skipped Step Categories:
|
|
171
|
+
─────────────────────────
|
|
172
|
+
|
|
173
|
+
1. Missing artifacts (DISCUSSION.md, PLAN.md, etc.)
|
|
174
|
+
2. E2E scenarios not defined in plans
|
|
175
|
+
3. Coverage below threshold
|
|
176
|
+
4. Quality score below threshold
|
|
177
|
+
5. CI/CD not configured
|
|
178
|
+
6. Phases not verified
|
|
179
|
+
7. Tests written after code (detected by commit order)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Step 4: Calculate Quality Metrics
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Run test coverage
|
|
186
|
+
npm run test:coverage 2>/dev/null
|
|
187
|
+
|
|
188
|
+
# Parse coverage report
|
|
189
|
+
coverage=$(cat coverage/coverage-summary.json | jq '.total.lines.pct')
|
|
190
|
+
|
|
191
|
+
# Run quality scorer
|
|
192
|
+
qualityScore=$(node -e "require('./server/lib/quality-scorer').score()" 2>/dev/null)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Step 5: Display and Prompt
|
|
196
|
+
|
|
197
|
+
Show the full checklist and offer actions.
|
|
198
|
+
|
|
199
|
+
## Usage
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
/tlc:checklist
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
No arguments. Shows complete project status.
|
|
206
|
+
|
|
207
|
+
## When to Use
|
|
208
|
+
|
|
209
|
+
- Starting a work session (see overall status)
|
|
210
|
+
- Before release (ensure nothing skipped)
|
|
211
|
+
- Onboarding new team member (show project health)
|
|
212
|
+
- Sprint planning (identify gaps to address)
|
package/help.md
CHANGED
|
@@ -19,6 +19,7 @@ Launches the visual dashboard. Detects where you are, shows what's next.
|
|
|
19
19
|
| Command | What It Does |
|
|
20
20
|
|---------|--------------|
|
|
21
21
|
| `/tlc` | **Visual dashboard. Context-aware. Knows what to do next.** |
|
|
22
|
+
| `/tlc:checklist` | Full project checklist - all phases, skipped steps, quality gates |
|
|
22
23
|
|
|
23
24
|
### Setup & Sync
|
|
24
25
|
|
package/init.md
CHANGED
|
@@ -88,10 +88,17 @@ Create `.tlc.json`:
|
|
|
88
88
|
"run": ["mocha"]
|
|
89
89
|
},
|
|
90
90
|
"testCommand": "npm test",
|
|
91
|
-
"testDirectory": "test"
|
|
91
|
+
"testDirectory": "test",
|
|
92
|
+
"e2e": {
|
|
93
|
+
"framework": null,
|
|
94
|
+
"directory": "tests/e2e",
|
|
95
|
+
"command": null
|
|
96
|
+
}
|
|
92
97
|
}
|
|
93
98
|
```
|
|
94
99
|
|
|
100
|
+
(E2E framework is configured in Step 11)
|
|
101
|
+
|
|
95
102
|
Add test scripts to package.json:
|
|
96
103
|
```json
|
|
97
104
|
"scripts": {
|
|
@@ -283,15 +290,96 @@ This branch is used by:
|
|
|
283
290
|
- `/tlc:build` - suggests merging back to this branch
|
|
284
291
|
- PR reviews - compares against this branch
|
|
285
292
|
|
|
286
|
-
### 11.
|
|
293
|
+
### 11. Set Up E2E Testing
|
|
294
|
+
|
|
295
|
+
Check for existing E2E setup:
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
# Detect existing E2E
|
|
299
|
+
if [ -f "playwright.config.ts" ] || [ -f "playwright.config.js" ]; then
|
|
300
|
+
e2e="playwright"
|
|
301
|
+
elif [ -f "cypress.config.ts" ] || [ -f "cypress.config.js" ]; then
|
|
302
|
+
e2e="cypress"
|
|
303
|
+
elif [ -d "tests/e2e" ] || [ -d "e2e" ]; then
|
|
304
|
+
e2e="detected"
|
|
305
|
+
fi
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
**If no E2E found:**
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
No E2E testing detected.
|
|
312
|
+
|
|
313
|
+
Set up E2E tests for full user flow verification?
|
|
314
|
+
[1] Yes - Playwright (recommended)
|
|
315
|
+
[2] Yes - Cypress
|
|
316
|
+
[3] No - skip for now
|
|
317
|
+
|
|
318
|
+
Choice [1/2/3]: _
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
**If Playwright selected:**
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
npm init playwright@latest
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
Create `playwright.config.ts`:
|
|
328
|
+
```typescript
|
|
329
|
+
import { defineConfig } from '@playwright/test';
|
|
330
|
+
|
|
331
|
+
export default defineConfig({
|
|
332
|
+
testDir: './tests/e2e',
|
|
333
|
+
baseURL: process.env.BASE_URL || 'http://localhost:5001',
|
|
334
|
+
use: {
|
|
335
|
+
screenshot: 'only-on-failure',
|
|
336
|
+
video: 'retain-on-failure',
|
|
337
|
+
},
|
|
338
|
+
});
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
Update `.tlc.json`:
|
|
342
|
+
```json
|
|
343
|
+
{
|
|
344
|
+
"e2e": {
|
|
345
|
+
"framework": "playwright",
|
|
346
|
+
"directory": "tests/e2e",
|
|
347
|
+
"command": "npx playwright test"
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
Add to `package.json`:
|
|
353
|
+
```json
|
|
354
|
+
{
|
|
355
|
+
"scripts": {
|
|
356
|
+
"test:e2e": "playwright test",
|
|
357
|
+
"test:e2e:ui": "playwright test --ui"
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
**If E2E already exists:**
|
|
363
|
+
|
|
364
|
+
```
|
|
365
|
+
Detected E2E framework: playwright
|
|
366
|
+
E2E directory: tests/e2e
|
|
367
|
+
Existing E2E tests: 5 files
|
|
368
|
+
|
|
369
|
+
Keeping existing E2E setup.
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### 12. Report Summary
|
|
287
373
|
|
|
288
374
|
```
|
|
289
375
|
TLC initialized for [project name]
|
|
290
376
|
|
|
291
377
|
Stack: [detected]
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
378
|
+
Unit tests: [framework] (existing/newly configured)
|
|
379
|
+
Unit test directory: [path]
|
|
380
|
+
E2E tests: [framework] (existing/newly configured)
|
|
381
|
+
E2E test directory: [path]
|
|
382
|
+
Existing tests: [count] unit, [count] E2E
|
|
295
383
|
Untested files: [count] identified
|
|
296
384
|
|
|
297
385
|
Next steps:
|
package/new-project.md
CHANGED
|
@@ -252,7 +252,12 @@ Create `.tlc.json` with default test settings:
|
|
|
252
252
|
"run": ["mocha"]
|
|
253
253
|
},
|
|
254
254
|
"testCommand": "npm test",
|
|
255
|
-
"testDirectory": "test"
|
|
255
|
+
"testDirectory": "test",
|
|
256
|
+
"e2e": {
|
|
257
|
+
"framework": "playwright",
|
|
258
|
+
"directory": "tests/e2e",
|
|
259
|
+
"command": "npx playwright test"
|
|
260
|
+
}
|
|
256
261
|
}
|
|
257
262
|
```
|
|
258
263
|
|
|
@@ -271,10 +276,13 @@ Scaffold based on chosen stack:
|
|
|
271
276
|
```
|
|
272
277
|
project/
|
|
273
278
|
├── src/
|
|
274
|
-
├── test/
|
|
279
|
+
├── test/ # Unit tests
|
|
280
|
+
├── tests/
|
|
281
|
+
│ └── e2e/ # E2E tests (Playwright)
|
|
275
282
|
├── .env.example
|
|
276
283
|
├── .tlc.json
|
|
277
284
|
├── .mocharc.json
|
|
285
|
+
├── playwright.config.ts # E2E config
|
|
278
286
|
├── docker-compose.yml
|
|
279
287
|
├── Dockerfile
|
|
280
288
|
├── [package.json | pyproject.toml | go.mod]
|
|
@@ -309,6 +317,69 @@ Add to `package.json`:
|
|
|
309
317
|
}
|
|
310
318
|
```
|
|
311
319
|
|
|
320
|
+
### Step 9: Set Up E2E Testing
|
|
321
|
+
|
|
322
|
+
E2E tests verify full user flows in the browser.
|
|
323
|
+
|
|
324
|
+
```
|
|
325
|
+
Set up E2E testing?
|
|
326
|
+
[1] Playwright (recommended)
|
|
327
|
+
[2] Cypress
|
|
328
|
+
[3] Skip for now
|
|
329
|
+
|
|
330
|
+
Choice [1/2/3]: _
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
**If Playwright (default):**
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
npm init playwright@latest
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
Create `playwright.config.ts`:
|
|
340
|
+
```typescript
|
|
341
|
+
import { defineConfig } from '@playwright/test';
|
|
342
|
+
|
|
343
|
+
export default defineConfig({
|
|
344
|
+
testDir: './tests/e2e',
|
|
345
|
+
baseURL: process.env.BASE_URL || 'http://localhost:5001',
|
|
346
|
+
use: {
|
|
347
|
+
screenshot: 'only-on-failure',
|
|
348
|
+
video: 'retain-on-failure',
|
|
349
|
+
},
|
|
350
|
+
});
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Create `tests/e2e/.gitkeep` to establish the directory.
|
|
354
|
+
|
|
355
|
+
Add to `package.json`:
|
|
356
|
+
```json
|
|
357
|
+
{
|
|
358
|
+
"scripts": {
|
|
359
|
+
"test": "mocha",
|
|
360
|
+
"test:watch": "mocha --watch",
|
|
361
|
+
"test:e2e": "playwright test",
|
|
362
|
+
"test:e2e:ui": "playwright test --ui"
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
**If Cypress:**
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
npm install -D cypress
|
|
371
|
+
npx cypress open
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
**Summary output:**
|
|
375
|
+
```
|
|
376
|
+
✓ Unit tests: mocha + chai + sinon
|
|
377
|
+
✓ E2E tests: playwright
|
|
378
|
+
✓ Test directories: test/ (unit), tests/e2e/ (E2E)
|
|
379
|
+
|
|
380
|
+
Ready to build. Run /tlc:plan to create your first phase.
|
|
381
|
+
```
|
|
382
|
+
|
|
312
383
|
## Usage
|
|
313
384
|
|
|
314
385
|
```
|
package/package.json
CHANGED
package/tlc.md
CHANGED
|
@@ -2,272 +2,287 @@
|
|
|
2
2
|
|
|
3
3
|
**TLC v{{VERSION}}**
|
|
4
4
|
|
|
5
|
-
One command. Context-aware.
|
|
5
|
+
One command. Context-aware. Shows exactly where you are and what's next.
|
|
6
6
|
|
|
7
7
|
## First Response
|
|
8
8
|
|
|
9
|
-
Always start by showing the version:
|
|
9
|
+
Always start by showing the version and phase checklist:
|
|
10
10
|
|
|
11
11
|
```
|
|
12
12
|
TLC v{{VERSION}}
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Then
|
|
16
|
-
|
|
17
|
-
## What This Does
|
|
18
|
-
|
|
19
|
-
Launches the TLC dashboard - a visual interface showing project state, phases, tests, and next actions.
|
|
15
|
+
Then show the Phase Checklist (Step 1) before anything else.
|
|
20
16
|
|
|
21
17
|
## Process
|
|
22
18
|
|
|
23
19
|
### Step 0: Auto-Sync Check (ALWAYS FIRST)
|
|
24
20
|
|
|
25
|
-
Before anything else, check if sync is needed
|
|
21
|
+
Before anything else, check if sync is needed:
|
|
26
22
|
|
|
27
23
|
```bash
|
|
28
24
|
# Check if .tlc.json exists
|
|
29
25
|
if [ ! -f ".tlc.json" ]; then
|
|
30
|
-
# No TLC config - need first-time setup
|
|
31
26
|
echo "Welcome to TLC!"
|
|
32
27
|
echo ""
|
|
33
28
|
echo "No configuration found. Let's set up your project."
|
|
34
|
-
echo "This configures test framework, team settings, quality gates, and more."
|
|
35
29
|
echo ""
|
|
36
30
|
echo "Run setup now? (Y/n)"
|
|
37
|
-
# If yes → Run sync.md "Scenario 1: First-Time Adoption"
|
|
38
|
-
|
|
39
|
-
# Then continue to Step 1
|
|
40
|
-
exit # Don't fall through to other checks
|
|
31
|
+
# If yes → Run sync.md "Scenario 1: First-Time Adoption"
|
|
32
|
+
exit
|
|
41
33
|
fi
|
|
42
34
|
|
|
43
|
-
#
|
|
35
|
+
# Check sync state
|
|
44
36
|
lastSync=$(jq -r '.lastSync // ""' .tlc.json)
|
|
45
37
|
currentHead=$(git rev-parse HEAD 2>/dev/null)
|
|
46
38
|
|
|
47
|
-
#
|
|
39
|
+
# Initialize lastSync if missing
|
|
48
40
|
if [ -z "$lastSync" ]; then
|
|
49
|
-
echo "Initializing sync tracking..."
|
|
50
41
|
jq ".lastSync = \"$currentHead\"" .tlc.json > .tlc.json.tmp && mv .tlc.json.tmp .tlc.json
|
|
51
|
-
echo "✓ Synced (initialized
|
|
52
|
-
# Continue to Step 1 - NO sync needed
|
|
42
|
+
echo "✓ Synced (initialized)"
|
|
53
43
|
fi
|
|
54
44
|
|
|
55
|
-
# Check for rebase
|
|
45
|
+
# Check for rebase/changes
|
|
56
46
|
if [ -f ".tlc-rebase-marker" ] || [ "$lastSync" != "$currentHead" ]; then
|
|
57
47
|
echo "⚠️ Codebase changed since last sync."
|
|
58
|
-
echo " Last sync: ${lastSync:0:7}"
|
|
59
|
-
echo " Current: ${currentHead:0:7}"
|
|
60
|
-
changedCount=$(git diff --name-only $lastSync $currentHead 2>/dev/null | wc -l)
|
|
61
|
-
echo " $changedCount files changed"
|
|
62
|
-
echo ""
|
|
63
48
|
echo "Run sync now? (Y/n)"
|
|
64
|
-
# If yes → Run sync.md "Scenario 2: Post-Rebase
|
|
65
|
-
|
|
66
|
-
# Then continue to Step 1
|
|
67
|
-
exit # Don't fall through to main-ahead check
|
|
49
|
+
# If yes → Run sync.md "Scenario 2: Post-Rebase"
|
|
50
|
+
exit
|
|
68
51
|
fi
|
|
69
52
|
|
|
70
|
-
# Check if main is ahead
|
|
53
|
+
# Check if main is ahead
|
|
71
54
|
mainBranch=$(jq -r '.git.mainBranch // "main"' .tlc.json)
|
|
72
55
|
git fetch origin $mainBranch 2>/dev/null
|
|
73
56
|
behindCount=$(git rev-list HEAD..origin/$mainBranch --count 2>/dev/null)
|
|
74
57
|
|
|
75
58
|
if [ "$behindCount" -gt 0 ]; then
|
|
76
|
-
echo "⚠️ Main
|
|
77
|
-
echo ""
|
|
78
|
-
|
|
79
|
-
echo " [1] Integrate changes (read & rebuild without rebase)"
|
|
80
|
-
echo " [2] Skip for now"
|
|
81
|
-
echo ""
|
|
82
|
-
# If 1 → Run sync.md "Scenario 3: Integrate Main" ONLY
|
|
83
|
-
# If 2 → Continue to dashboard
|
|
59
|
+
echo "⚠️ Main is $behindCount commits ahead."
|
|
60
|
+
echo "[1] Integrate [2] Skip"
|
|
61
|
+
# If 1 → Run sync.md "Scenario 3: Integrate Main"
|
|
84
62
|
fi
|
|
85
63
|
|
|
86
|
-
# If we get here, sync is current
|
|
87
64
|
echo "✓ Synced"
|
|
88
65
|
```
|
|
89
66
|
|
|
90
|
-
|
|
67
|
+
### Step 1: Show Phase Checklist (ALWAYS SHOW THIS)
|
|
91
68
|
|
|
92
|
-
|
|
93
|
-
|-----------|--------|
|
|
94
|
-
| No `.tlc.json` | Run sync.md **Scenario 1** (questionnaire) |
|
|
95
|
-
| `.tlc.json` exists, HEAD changed | Run sync.md **Scenario 2** (reconciliation only, NO questionnaire) |
|
|
96
|
-
| Main is ahead of current branch | Run sync.md **Scenario 3** (integrate without rebase) |
|
|
97
|
-
| `.tlc.json` exists, all synced | Already synced, skip to dashboard |
|
|
69
|
+
**This is the core of `/tlc` - always show the current phase status:**
|
|
98
70
|
|
|
99
|
-
|
|
71
|
+
```
|
|
72
|
+
TLC v{{VERSION}} ✓ Synced
|
|
73
|
+
═══════════════════════════════════════════════════════════════
|
|
100
74
|
|
|
101
|
-
|
|
75
|
+
Phase 2: User Dashboard
|
|
76
|
+
───────────────────────────────────────────────────────────────
|
|
102
77
|
|
|
103
|
-
|
|
78
|
+
Workflow Status:
|
|
79
|
+
────────────────
|
|
80
|
+
[x] 1. Discussed .planning/phases/2-DISCUSSION.md
|
|
81
|
+
[x] 2. Planned .planning/phases/2-PLAN.md (4 tasks)
|
|
82
|
+
[ ] 3. Unit tests not written
|
|
83
|
+
[ ] 4. E2E tests not written
|
|
84
|
+
[ ] 5. Implemented 0/4 tasks
|
|
85
|
+
[ ] 6. Verified pending
|
|
104
86
|
|
|
105
|
-
|
|
87
|
+
⚠️ Skipped Steps:
|
|
88
|
+
──────────────────
|
|
89
|
+
• E2E scenarios not defined in plan (recommended)
|
|
106
90
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
91
|
+
Quality Gates:
|
|
92
|
+
──────────────
|
|
93
|
+
[ ] Coverage: --% (target: 80%)
|
|
94
|
+
[ ] Quality score: --/100 (target: 75)
|
|
110
95
|
|
|
111
|
-
|
|
112
|
-
tlc-dashboard
|
|
113
|
-
```
|
|
96
|
+
───────────────────────────────────────────────────────────────
|
|
114
97
|
|
|
115
|
-
|
|
116
|
-
- Project overview (from PROJECT.md)
|
|
117
|
-
- Phase progress (from ROADMAP.md)
|
|
118
|
-
- Test status (pass/fail counts)
|
|
119
|
-
- Available actions
|
|
98
|
+
→ Next: /tlc:build 2 (writes tests, then implements)
|
|
120
99
|
|
|
121
|
-
|
|
100
|
+
Quick Actions:
|
|
101
|
+
[1] Continue with recommended action
|
|
102
|
+
[2] Go back and fix skipped steps
|
|
103
|
+
[3] Show all commands (/tlc:help)
|
|
104
|
+
[4] Full project checklist (/tlc:checklist)
|
|
122
105
|
|
|
123
|
-
|
|
106
|
+
Choice [1/2/3/4]: _
|
|
107
|
+
```
|
|
124
108
|
|
|
125
|
-
|
|
109
|
+
### Step 2: Detect Current Phase
|
|
126
110
|
|
|
127
|
-
|
|
128
|
-
□ PROJECT.md exists?
|
|
129
|
-
□ .planning/ directory exists?
|
|
130
|
-
□ .planning/ROADMAP.md exists?
|
|
131
|
-
□ Test framework configured? (vitest.config.*, pytest.ini, etc.)
|
|
132
|
-
□ Test files exist?
|
|
133
|
-
□ Source files exist?
|
|
134
|
-
```
|
|
111
|
+
Parse `.planning/ROADMAP.md` to find current phase:
|
|
135
112
|
|
|
136
|
-
|
|
113
|
+
```bash
|
|
114
|
+
# Find current phase marker
|
|
115
|
+
currentPhase=$(grep -n '\[>\]\|\[current\]\|\[in.progress\]' .planning/ROADMAP.md | head -1)
|
|
137
116
|
|
|
138
|
-
|
|
117
|
+
# If no current, find first incomplete
|
|
118
|
+
if [ -z "$currentPhase" ]; then
|
|
119
|
+
currentPhase=$(grep -n '^\s*-\s*\[ \]' .planning/ROADMAP.md | head -1)
|
|
120
|
+
fi
|
|
139
121
|
```
|
|
140
|
-
No project detected.
|
|
141
122
|
|
|
142
|
-
|
|
143
|
-
2) Add TLC to existing code (/tlc:init)
|
|
144
|
-
```
|
|
123
|
+
### Step 3: Check Phase Artifacts
|
|
145
124
|
|
|
146
|
-
|
|
147
|
-
```
|
|
148
|
-
Project exists but no roadmap.
|
|
125
|
+
For the current phase N, check what exists:
|
|
149
126
|
|
|
150
|
-
|
|
127
|
+
| Artifact | Check | Status |
|
|
128
|
+
|----------|-------|--------|
|
|
129
|
+
| Discussion | `.planning/phases/{N}-DISCUSSION.md` exists | [x] or [ ] |
|
|
130
|
+
| Plan | `.planning/phases/{N}-PLAN.md` exists | [x] or [ ] |
|
|
131
|
+
| Unit Tests | `.planning/phases/{N}-TESTS.md` exists OR test files created | [x] or [ ] |
|
|
132
|
+
| E2E Tests | `tests/e2e/phase-{N}.spec.ts` exists | [x] or [ ] |
|
|
133
|
+
| Implementation | All tasks marked `[x@user]` in PLAN.md | [x] or [ ] |
|
|
134
|
+
| Verification | `.planning/phases/{N}-VERIFIED.md` exists | [x] or [ ] |
|
|
135
|
+
|
|
136
|
+
### Step 4: Identify Skipped Steps
|
|
137
|
+
|
|
138
|
+
Check for common skipped steps and warn:
|
|
151
139
|
|
|
152
|
-
What's the first feature to build?
|
|
153
140
|
```
|
|
154
|
-
|
|
141
|
+
Skipped Steps Detection:
|
|
142
|
+
─────────────────────────
|
|
155
143
|
|
|
156
|
-
|
|
144
|
+
1. Discussion skipped?
|
|
145
|
+
- PLAN.md exists but no DISCUSSION.md
|
|
146
|
+
→ "Phase planned without discussion - approach may not be optimal"
|
|
157
147
|
|
|
158
|
-
|
|
159
|
-
-
|
|
160
|
-
|
|
161
|
-
- Next pending phase: first without marker
|
|
148
|
+
2. E2E not defined?
|
|
149
|
+
- PLAN.md has no E2E scenarios section
|
|
150
|
+
→ "No E2E scenarios in plan - user flows won't be tested"
|
|
162
151
|
|
|
163
|
-
|
|
152
|
+
3. Tests skipped?
|
|
153
|
+
- Implementation started but TESTS.md missing
|
|
154
|
+
→ "Code written before tests - not TDD!"
|
|
164
155
|
|
|
165
|
-
|
|
156
|
+
4. Verification skipped?
|
|
157
|
+
- Next phase started but current not verified
|
|
158
|
+
→ "Phase 2 not verified - bugs may slip through"
|
|
166
159
|
|
|
167
|
-
|
|
168
|
-
Phase
|
|
169
|
-
|
|
170
|
-
□ PLAN.md exists? (.planning/phases/{N}-*-PLAN.md)
|
|
171
|
-
□ Tests written? (.planning/phases/{N}-TESTS.md or test files)
|
|
172
|
-
□ Implementation done? (check if tests pass)
|
|
173
|
-
□ Verified? (.planning/phases/{N}-VERIFIED.md)
|
|
160
|
+
5. Coverage not checked?
|
|
161
|
+
- Phase complete but no coverage report
|
|
162
|
+
→ "Test coverage not measured"
|
|
174
163
|
```
|
|
175
164
|
|
|
176
|
-
### Step 5:
|
|
165
|
+
### Step 5: Show Quality Gates
|
|
177
166
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
**Phase not discussed:**
|
|
181
|
-
```
|
|
182
|
-
Phase 2: User Dashboard
|
|
167
|
+
If `.tlc.json` has quality thresholds, show them:
|
|
183
168
|
|
|
184
|
-
|
|
169
|
+
```bash
|
|
170
|
+
coverageTarget=$(jq -r '.quality.coverageThreshold // 80' .tlc.json)
|
|
171
|
+
qualityTarget=$(jq -r '.quality.qualityScoreThreshold // 75' .tlc.json)
|
|
185
172
|
|
|
186
|
-
|
|
173
|
+
# Get current values (from last test run)
|
|
174
|
+
currentCoverage=$(jq -r '.lastCoverage // "--"' .tlc.json)
|
|
175
|
+
currentQuality=$(jq -r '.lastQualityScore // "--"' .tlc.json)
|
|
187
176
|
```
|
|
188
|
-
Then run discuss flow.
|
|
189
177
|
|
|
190
|
-
|
|
178
|
+
Display:
|
|
179
|
+
```
|
|
180
|
+
Quality Gates:
|
|
181
|
+
[ ] Coverage: 72% (target: 80%) ⚠️ BELOW TARGET
|
|
182
|
+
[x] Quality score: 78/100 (target: 75) ✓
|
|
191
183
|
```
|
|
192
|
-
Phase 2: User Dashboard
|
|
193
184
|
|
|
194
|
-
|
|
185
|
+
### Step 6: Recommend Next Action
|
|
195
186
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
187
|
+
Based on phase state, recommend ONE action:
|
|
188
|
+
|
|
189
|
+
| State | Recommendation |
|
|
190
|
+
|-------|----------------|
|
|
191
|
+
| No discussion | `/tlc:discuss {N}` |
|
|
192
|
+
| Discussed, no plan | `/tlc:plan {N}` |
|
|
193
|
+
| Planned, no tests | `/tlc:build {N}` |
|
|
194
|
+
| Tests written, not passing | `/tlc:build {N}` (continue) |
|
|
195
|
+
| Tests passing, not verified | `/tlc:verify {N}` |
|
|
196
|
+
| Verified | Move to next phase |
|
|
197
|
+
| All phases done | `/tlc:complete` |
|
|
198
|
+
|
|
199
|
+
### Step 7: Handle User Choice
|
|
199
200
|
|
|
200
|
-
**Planned but no tests:**
|
|
201
201
|
```
|
|
202
|
-
|
|
202
|
+
[1] Continue with recommended action
|
|
203
|
+
→ Run the recommended command
|
|
203
204
|
|
|
204
|
-
|
|
205
|
+
[2] Go back and fix skipped steps
|
|
206
|
+
→ Show list of skipped steps with fix commands:
|
|
205
207
|
|
|
206
|
-
|
|
208
|
+
Skipped steps to fix:
|
|
209
|
+
1. Add E2E scenarios → Edit .planning/phases/2-PLAN.md
|
|
210
|
+
2. Run coverage check → /tlc:coverage
|
|
207
211
|
|
|
208
|
-
|
|
209
|
-
```
|
|
210
|
-
Then run build flow (tests first).
|
|
212
|
+
Which to fix? [1/2]: _
|
|
211
213
|
|
|
212
|
-
|
|
214
|
+
[3] Show all commands
|
|
215
|
+
→ Run /tlc:help
|
|
216
|
+
|
|
217
|
+
[4] Full project checklist
|
|
218
|
+
→ Run /tlc:checklist
|
|
213
219
|
```
|
|
214
|
-
Phase 2: User Dashboard
|
|
215
220
|
|
|
216
|
-
|
|
221
|
+
### Step 8: Validation Gates
|
|
217
222
|
|
|
218
|
-
|
|
223
|
+
**Before allowing certain actions, validate prerequisites:**
|
|
219
224
|
|
|
220
|
-
→ Continue? (Y/n)
|
|
221
225
|
```
|
|
222
|
-
|
|
226
|
+
Validation Rules:
|
|
227
|
+
─────────────────
|
|
223
228
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
Phase 2: User Dashboard
|
|
229
|
+
/tlc:build without /tlc:plan:
|
|
230
|
+
→ "⚠️ No plan found. Run /tlc:plan first? (Y/n)"
|
|
227
231
|
|
|
228
|
-
|
|
232
|
+
/tlc:verify without tests passing:
|
|
233
|
+
→ "⚠️ Tests not passing. Cannot verify. Run /tlc:build first."
|
|
229
234
|
|
|
230
|
-
|
|
235
|
+
/tlc:complete without all phases verified:
|
|
236
|
+
→ "⚠️ Phase 3 not verified. Complete verification first."
|
|
231
237
|
|
|
232
|
-
|
|
238
|
+
Moving to next phase without E2E:
|
|
239
|
+
→ "⚠️ No E2E tests for Phase 2. Add them? (Y/n)"
|
|
233
240
|
```
|
|
234
|
-
Then run verify flow.
|
|
235
241
|
|
|
236
|
-
|
|
237
|
-
```
|
|
238
|
-
Phase 2: User Dashboard - Complete
|
|
242
|
+
## No Project Detected
|
|
239
243
|
|
|
240
|
-
|
|
244
|
+
If no `.tlc.json` and no `PROJECT.md`:
|
|
241
245
|
|
|
242
|
-
→ Continue? (Y/n)
|
|
243
246
|
```
|
|
247
|
+
TLC v{{VERSION}}
|
|
248
|
+
═══════════════════════════════════════════════════════════════
|
|
244
249
|
|
|
245
|
-
|
|
250
|
+
No TLC project detected.
|
|
246
251
|
|
|
247
|
-
|
|
252
|
+
Options:
|
|
253
|
+
[1] Start new project → /tlc:new-project
|
|
254
|
+
[2] Add TLC to existing → /tlc:init
|
|
248
255
|
|
|
256
|
+
Choice [1/2]: _
|
|
249
257
|
```
|
|
250
|
-
Found 5 files without tests:
|
|
251
|
-
- src/utils/helpers.ts
|
|
252
|
-
- src/api/users.ts
|
|
253
|
-
- src/services/email.ts
|
|
254
|
-
...
|
|
255
258
|
|
|
256
|
-
|
|
259
|
+
## All Phases Complete
|
|
260
|
+
|
|
257
261
|
```
|
|
262
|
+
TLC v{{VERSION}} ✓ Synced
|
|
263
|
+
═══════════════════════════════════════════════════════════════
|
|
258
264
|
|
|
259
|
-
|
|
265
|
+
🎉 All Phases Complete!
|
|
266
|
+
───────────────────────────────────────────────────────────────
|
|
260
267
|
|
|
261
|
-
|
|
268
|
+
Phase 1: Authentication [x] Verified
|
|
269
|
+
Phase 2: User Dashboard [x] Verified
|
|
270
|
+
Phase 3: Reports [x] Verified
|
|
262
271
|
|
|
263
|
-
|
|
264
|
-
|
|
272
|
+
Quality Summary:
|
|
273
|
+
────────────────
|
|
274
|
+
[x] Coverage: 87% (target: 80%)
|
|
275
|
+
[x] Quality score: 82/100 (target: 75)
|
|
276
|
+
[x] All E2E tests passing
|
|
277
|
+
|
|
278
|
+
───────────────────────────────────────────────────────────────
|
|
265
279
|
|
|
266
|
-
|
|
280
|
+
Next Steps:
|
|
281
|
+
[1] Tag release → /tlc:complete
|
|
282
|
+
[2] Start next version → /tlc:new-milestone
|
|
283
|
+
[3] Review coverage → /tlc:coverage
|
|
267
284
|
|
|
268
|
-
1
|
|
269
|
-
2) Start next milestone (/tlc:new-milestone)
|
|
270
|
-
3) Check test coverage (/tlc:coverage)
|
|
285
|
+
Choice [1/2/3]: _
|
|
271
286
|
```
|
|
272
287
|
|
|
273
288
|
## Usage
|
|
@@ -276,14 +291,4 @@ Milestone ready for release.
|
|
|
276
291
|
/tlc
|
|
277
292
|
```
|
|
278
293
|
|
|
279
|
-
No arguments.
|
|
280
|
-
|
|
281
|
-
## Why This Exists
|
|
282
|
-
|
|
283
|
-
Instead of remembering:
|
|
284
|
-
- `/tlc:discuss 2`
|
|
285
|
-
- `/tlc:plan 2`
|
|
286
|
-
- `/tlc:build 2`
|
|
287
|
-
- `/tlc:verify 2`
|
|
288
|
-
|
|
289
|
-
Just run `/tlc`. It knows where you are.
|
|
294
|
+
No arguments. Shows exactly where you are, what's done, what's skipped, and what's next.
|