tlc-claude-code 0.6.0

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/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "tlc-claude-code",
3
+ "version": "0.6.0",
4
+ "description": "TLC - Test Led Coding for Claude Code",
5
+ "bin": {
6
+ "tlc-claude-code": "./bin/install.js"
7
+ },
8
+ "files": [
9
+ "bin/",
10
+ "*.md",
11
+ "install.sh"
12
+ ],
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/jurgencalleja/TLC.git"
16
+ },
17
+ "keywords": [
18
+ "claude",
19
+ "claude-code",
20
+ "tlc",
21
+ "test-led-coding",
22
+ "tdd",
23
+ "testing"
24
+ ],
25
+ "author": "Jurgen Calleja",
26
+ "license": "MIT"
27
+ }
package/plan.md ADDED
@@ -0,0 +1,210 @@
1
+ # /tlc:plan - Plan a Phase
2
+
3
+ Research and create implementation plans with clear tasks.
4
+
5
+ ## What This Does
6
+
7
+ 1. Researches how to implement the phase
8
+ 2. Breaks work into discrete tasks
9
+ 3. Creates PLAN.md with actionable steps
10
+ 4. Prepares for test writing
11
+
12
+ ## Usage
13
+
14
+ ```
15
+ /tlc:plan [phase_number]
16
+ ```
17
+
18
+ If no phase number, auto-detect current phase from ROADMAP.md.
19
+
20
+ ## Process
21
+
22
+ ### Step 1: Load Context
23
+
24
+ Read:
25
+ - `.planning/ROADMAP.md` - phase goal
26
+ - `.planning/phases/{N}-DISCUSSION.md` - implementation preferences
27
+ - `PROJECT.md` - tech stack, constraints
28
+
29
+ ### Step 2: Research (if needed)
30
+
31
+ For phases requiring external knowledge:
32
+ - Look up library documentation
33
+ - Check best practices
34
+ - Identify patterns
35
+
36
+ Create `.planning/phases/{N}-RESEARCH.md` with findings.
37
+
38
+ ### Step 3: Break Into Tasks
39
+
40
+ Each task should be:
41
+ - **Small** - completable in one focused session
42
+ - **Testable** - has clear pass/fail criteria
43
+ - **Independent** - minimal dependencies on other tasks
44
+
45
+ ```markdown
46
+ ## Task 1: Create user schema
47
+
48
+ **Goal:** Define database schema for users table
49
+
50
+ **Files:**
51
+ - src/db/schema/users.ts
52
+
53
+ **Acceptance Criteria:**
54
+ - [ ] Schema has id, email, passwordHash, createdAt
55
+ - [ ] Email is unique
56
+ - [ ] Timestamps auto-populate
57
+
58
+ **Test Cases:**
59
+ - Schema validates correct user data
60
+ - Schema rejects duplicate emails
61
+ - Schema rejects missing required fields
62
+ ```
63
+
64
+ ### Step 4: Create Plan File
65
+
66
+ Create `.planning/phases/{N}-PLAN.md`:
67
+
68
+ ```markdown
69
+ # Phase {N}: {Name} - Plan
70
+
71
+ ## Overview
72
+
73
+ {Brief description of what this phase delivers}
74
+
75
+ ## Prerequisites
76
+
77
+ - [ ] {Any setup or prior work needed}
78
+
79
+ ## Tasks
80
+
81
+ ### Task 1: {Title}
82
+
83
+ **Goal:** {What this accomplishes}
84
+
85
+ **Files:**
86
+ - {files to create/modify}
87
+
88
+ **Acceptance Criteria:**
89
+ - [ ] {Testable criterion 1}
90
+ - [ ] {Testable criterion 2}
91
+
92
+ **Test Cases:**
93
+ - {Test description 1}
94
+ - {Test description 2}
95
+
96
+ ---
97
+
98
+ ### Task 2: {Title}
99
+
100
+ ...
101
+
102
+ ## Dependencies
103
+
104
+ {Task dependencies if any - e.g., Task 3 requires Task 1}
105
+
106
+ ## Estimated Scope
107
+
108
+ - Tasks: {N}
109
+ - Files: {N}
110
+ - Tests: ~{N} (estimated)
111
+ ```
112
+
113
+ ### Step 5: Review Plan
114
+
115
+ Present plan summary:
116
+
117
+ ```
118
+ Phase 2: User Dashboard - Plan
119
+
120
+ Tasks: 4
121
+ 1. Create dashboard layout component
122
+ 2. Implement data fetching hook
123
+ 3. Build stat cards
124
+ 4. Add loading/error states
125
+
126
+ Estimated tests: 12
127
+
128
+ Proceed with this plan? (Y/n)
129
+ ```
130
+
131
+ Allow refinement if needed.
132
+
133
+ ### Step 6: Save and Continue
134
+
135
+ ```
136
+ Plan saved to .planning/phases/{N}-PLAN.md
137
+
138
+ Ready to build?
139
+ 1) Yes, run /tlc:build (writes tests first)
140
+ 2) No, I'll build later
141
+ ```
142
+
143
+ ## Task Guidelines
144
+
145
+ **Good tasks:**
146
+ ```
147
+ Task: Create login API endpoint
148
+ - POST /api/auth/login
149
+ - Validates email/password
150
+ - Returns JWT token
151
+ - Handles invalid credentials
152
+ ```
153
+
154
+ **Bad tasks:**
155
+ ```
156
+ Task: Build auth system <- too big
157
+ Task: Add login <- too vague
158
+ ```
159
+
160
+ ## Example Output
161
+
162
+ ```markdown
163
+ # Phase 1: Authentication - Plan
164
+
165
+ ## Overview
166
+
167
+ User registration and login with JWT tokens.
168
+
169
+ ## Tasks
170
+
171
+ ### Task 1: Create user schema
172
+
173
+ **Goal:** Database schema for users
174
+
175
+ **Files:**
176
+ - src/db/schema/users.ts
177
+ - src/db/migrations/001_users.sql
178
+
179
+ **Acceptance Criteria:**
180
+ - [ ] Has id, email, passwordHash, createdAt, updatedAt
181
+ - [ ] Email unique constraint
182
+ - [ ] Password hashed with bcrypt
183
+
184
+ **Test Cases:**
185
+ - Schema accepts valid user data
186
+ - Schema rejects duplicate email
187
+ - Password is hashed, not plain text
188
+
189
+ ---
190
+
191
+ ### Task 2: Registration endpoint
192
+
193
+ **Goal:** POST /api/auth/register
194
+
195
+ **Files:**
196
+ - src/api/auth/register.ts
197
+ - src/lib/auth/password.ts
198
+
199
+ **Acceptance Criteria:**
200
+ - [ ] Creates user with hashed password
201
+ - [ ] Returns user without password
202
+ - [ ] Rejects existing email with 409
203
+ - [ ] Validates email format
204
+
205
+ **Test Cases:**
206
+ - Register with valid data returns user
207
+ - Register with existing email returns 409
208
+ - Register with invalid email returns 400
209
+ - Password stored as hash
210
+ ```
package/progress.md ADDED
@@ -0,0 +1,136 @@
1
+ # /tlc:progress - Where Am I?
2
+
3
+ Show current project state and what to do next.
4
+
5
+ ## What This Does
6
+
7
+ Scans project state and presents:
8
+ 1. Current milestone and phase
9
+ 2. What's done, what's next
10
+ 3. Test status
11
+ 4. Suggested action
12
+
13
+ ## Usage
14
+
15
+ ```
16
+ /tlc:progress
17
+ ```
18
+
19
+ ## Process
20
+
21
+ ### Step 1: Check Project Exists
22
+
23
+ Look for:
24
+ - `PROJECT.md` - project exists
25
+ - `.planning/ROADMAP.md` - has roadmap
26
+
27
+ If neither exists:
28
+ ```
29
+ No project found.
30
+
31
+ Run /tlc:new-project to start, or /tlc:init to add TLC to existing code.
32
+ ```
33
+
34
+ ### Step 2: Parse Roadmap
35
+
36
+ Read `.planning/ROADMAP.md` and identify:
37
+ - Total phases
38
+ - Completed phases (marked `[x]` or `[completed]`)
39
+ - Current phase (marked `[>]` or `[current]`)
40
+ - Pending phases
41
+
42
+ ### Step 3: Check Current Phase State
43
+
44
+ For the current/next phase, check what exists:
45
+
46
+ | File | Meaning |
47
+ |------|---------|
48
+ | `{N}-DISCUSSION.md` | Discussed |
49
+ | `{N}-PLAN.md` | Planned |
50
+ | `{N}-TESTS.md` | Tests written |
51
+ | `{N}-VERIFIED.md` | Human verified |
52
+
53
+ ### Step 4: Run Tests
54
+
55
+ Execute test suite and capture:
56
+ - Total tests
57
+ - Passing
58
+ - Failing
59
+ - Skipped
60
+
61
+ ### Step 5: Present Status
62
+
63
+ ```
64
+ Project: My App
65
+ Milestone: v1.0
66
+
67
+ Progress: ████████░░░░ 3/5 phases
68
+
69
+ Completed:
70
+ ✓ Phase 1: Project Setup
71
+ ✓ Phase 2: Authentication
72
+ ✓ Phase 3: User Dashboard
73
+
74
+ Current:
75
+ → Phase 4: Reports (planned, not built)
76
+
77
+ Pending:
78
+ ○ Phase 5: Settings
79
+
80
+ Tests: 47 total | 45 passing | 2 failing
81
+
82
+ Suggested: /tlc:build 4
83
+ ```
84
+
85
+ ### Step 6: Suggest Next Action
86
+
87
+ Based on state:
88
+
89
+ | State | Suggestion |
90
+ |-------|------------|
91
+ | No discussion | `/tlc:discuss {N}` |
92
+ | Discussed, no plan | `/tlc:plan {N}` |
93
+ | Planned, no tests | `/tlc:build {N}` |
94
+ | Tests failing | Fix failures, then `/tlc:build {N}` |
95
+ | Tests passing, not verified | `/tlc:verify {N}` |
96
+ | Verified | Move to next phase |
97
+ | All phases done | `/tlc:complete` |
98
+
99
+ Or just:
100
+ ```
101
+ Run /tlc to continue.
102
+ ```
103
+
104
+ ## Example Output
105
+
106
+ ```
107
+ > /tlc:progress
108
+
109
+ ╭─────────────────────────────────────╮
110
+ │ My App - v1.0 │
111
+ ╰─────────────────────────────────────╯
112
+
113
+ Phases: ████████░░░░ 3/5 complete
114
+
115
+ ✓ 1. Project Setup
116
+ ✓ 2. Authentication
117
+ ✓ 3. User Dashboard
118
+ → 4. Reports (ready to build)
119
+ ○ 5. Settings
120
+
121
+ Tests: 47 passing | 2 failing
122
+
123
+ Next: /tlc:build 4 (or just /tlc)
124
+ ```
125
+
126
+ ## Compact Mode
127
+
128
+ For quick checks:
129
+ ```
130
+ > /tlc:progress
131
+
132
+ Phase 4/5: Reports
133
+ Status: Planned
134
+ Tests: 47/49 passing
135
+ Next: /tlc:build
136
+ ```
package/quick.md ADDED
@@ -0,0 +1,52 @@
1
+ # /tlc:quick - Quick Task with Tests
2
+
3
+ For ad-hoc tasks that don't need full phase planning, but still deserve tests.
4
+
5
+ ## What This Does
6
+
7
+ 1. **Ask what you want to do**
8
+ 2. **Write a failing test** for it
9
+ 3. **Implement** to pass the test
10
+ 4. **Verify** test passes
11
+
12
+ Lighter weight than `/tlc:build`, but still test-first.
13
+
14
+ ## Usage
15
+
16
+ ```
17
+ /tlc:quick
18
+ ```
19
+
20
+ ## Example
21
+
22
+ ```
23
+ User: /tlc:quick
24
+
25
+ Claude: What do you want to do?
26
+
27
+ User: Add a dark mode toggle to settings
28
+
29
+ Claude: Writing test...
30
+
31
+ Created: tests/settings/dark-mode.test.ts
32
+ - toggles dark mode on click
33
+ - persists preference to localStorage
34
+ - applies dark class to document
35
+
36
+ Running test... ❌ Failing (expected)
37
+
38
+ Implementing...
39
+
40
+ Running test... ✅ Passing
41
+
42
+ Done. Dark mode toggle added with test coverage.
43
+ ```
44
+
45
+ ## When to Use
46
+
47
+ - Bug fixes
48
+ - Small features
49
+ - Config changes
50
+ - One-off tasks
51
+
52
+ For anything bigger, use the full flow: `/tlc:plan` → `/tlc:build` → `/tlc:verify`
package/status.md ADDED
@@ -0,0 +1,65 @@
1
+ # /tlc:status - Check Test Status
2
+
3
+ Quick check on test status for current or specified phase.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /tlc:status [phase_number]
9
+ ```
10
+
11
+ If no phase specified, shows overall test status.
12
+
13
+ ## Process
14
+
15
+ 1. **Detect test framework** (Vitest, Jest, pytest, etc.)
16
+ 2. **Run the test suite**
17
+ 3. **Report results** with next action
18
+
19
+ ## Output Examples
20
+
21
+ **All tests passing:**
22
+ ```
23
+ Test Status
24
+ ───────────
25
+ ✅ 18 passing, 0 failing, 0 errors
26
+
27
+ Ready for: /tlc:verify
28
+ ```
29
+
30
+ **Some failing:**
31
+ ```
32
+ Test Status
33
+ ───────────
34
+ 🔄 12 passing, 6 failing, 0 errors
35
+
36
+ Failing:
37
+ • tests/auth.test.ts: login rejects invalid password
38
+ • tests/auth.test.ts: login returns httpOnly cookie
39
+ • tests/session.test.ts: session expires after timeout
40
+ ...
41
+
42
+ Action: Fix implementation or run /tlc:build to retry
43
+ ```
44
+
45
+ **Tests erroring:**
46
+ ```
47
+ Test Status
48
+ ───────────
49
+ ⚠️ 10 passing, 0 failing, 3 errors
50
+
51
+ Errors:
52
+ • tests/auth.test.ts:45 - Cannot find module '../src/auth'
53
+ • tests/session.test.ts:12 - TypeError: x is not a function
54
+
55
+ Action: Fix test errors before continuing
56
+ ```
57
+
58
+ **No tests found:**
59
+ ```
60
+ Test Status
61
+ ───────────
62
+ No tests found.
63
+
64
+ Run /tlc:build to write tests and implement.
65
+ ```
package/tlc.md ADDED
@@ -0,0 +1,217 @@
1
+ # /tlc - Smart Entry Point
2
+
3
+ One command. Context-aware. Tells you what to do next.
4
+
5
+ ## What This Does
6
+
7
+ Detects project state and suggests the right action. No memorizing commands.
8
+
9
+ ## Process
10
+
11
+ ### Step 1: Detect Project State
12
+
13
+ Check what exists:
14
+
15
+ ```
16
+ □ PROJECT.md exists?
17
+ □ .planning/ directory exists?
18
+ □ .planning/ROADMAP.md exists?
19
+ □ Test framework configured? (vitest.config.*, pytest.ini, etc.)
20
+ □ Test files exist?
21
+ □ Source files exist?
22
+ ```
23
+
24
+ ### Step 2: Route Based on State
25
+
26
+ **No PROJECT.md → New or Init**
27
+ ```
28
+ No project detected.
29
+
30
+ 1) Start new project (/tlc:new-project)
31
+ 2) Add TLC to existing code (/tlc:init)
32
+ ```
33
+
34
+ **PROJECT.md exists, no roadmap → Need Planning**
35
+ ```
36
+ Project exists but no roadmap.
37
+
38
+ Let's break your project into phases.
39
+
40
+ What's the first feature to build?
41
+ ```
42
+ Then create ROADMAP.md with phases based on discussion.
43
+
44
+ **Roadmap exists → Check Phase Status**
45
+
46
+ Parse ROADMAP.md to find:
47
+ - Completed phases: `[x]` or `[completed]`
48
+ - Current phase: `[>]` or `[in progress]` or `[current]`
49
+ - Next pending phase: first without marker
50
+
51
+ ### Step 3: Determine Current Phase Action
52
+
53
+ For the current/next phase, check what exists:
54
+
55
+ ```
56
+ Phase {N}: {Name}
57
+ □ DISCUSSION.md exists? (.planning/phases/{N}-DISCUSSION.md)
58
+ □ PLAN.md exists? (.planning/phases/{N}-*-PLAN.md)
59
+ □ Tests written? (.planning/phases/{N}-TESTS.md or test files)
60
+ □ Implementation done? (check if tests pass)
61
+ □ Verified? (.planning/phases/{N}-VERIFIED.md)
62
+ ```
63
+
64
+ ### Step 4: Present Contextual Action
65
+
66
+ Based on phase state, show ONE clear action:
67
+
68
+ **Phase not discussed:**
69
+ ```
70
+ Phase 2: User Dashboard
71
+
72
+ Ready to discuss implementation approach.
73
+
74
+ → Continue? (Y/n)
75
+ ```
76
+ Then run discuss flow.
77
+
78
+ **Discussed but not planned:**
79
+ ```
80
+ Phase 2: User Dashboard
81
+
82
+ Discussion complete. Ready to create task plan.
83
+
84
+ → Continue? (Y/n)
85
+ ```
86
+ Then run plan flow.
87
+
88
+ **Planned but no tests:**
89
+ ```
90
+ Phase 2: User Dashboard
91
+
92
+ Plan ready. 4 tasks to implement.
93
+
94
+ Next: Write tests, then build.
95
+
96
+ → Continue? (Y/n)
97
+ ```
98
+ Then run build flow (tests first).
99
+
100
+ **Tests written, not implemented:**
101
+ ```
102
+ Phase 2: User Dashboard
103
+
104
+ Tests ready (12 tests, all failing - expected).
105
+
106
+ Next: Implement to make tests pass.
107
+
108
+ → Continue? (Y/n)
109
+ ```
110
+ Then run implementation.
111
+
112
+ **Implemented, not verified:**
113
+ ```
114
+ Phase 2: User Dashboard
115
+
116
+ Tests passing (12/12 ✓)
117
+
118
+ Next: Human verification.
119
+
120
+ → Continue? (Y/n)
121
+ ```
122
+ Then run verify flow.
123
+
124
+ **Phase complete:**
125
+ ```
126
+ Phase 2: User Dashboard ✓ Complete
127
+
128
+ Moving to Phase 3: Reports
129
+
130
+ → Continue? (Y/n)
131
+ ```
132
+
133
+ ### Step 5: Check for Untested Code
134
+
135
+ If project has source files without tests:
136
+
137
+ ```
138
+ Found 5 files without tests:
139
+ - src/utils/helpers.ts
140
+ - src/api/users.ts
141
+ - src/services/email.ts
142
+ ...
143
+
144
+ Add tests for existing code? (Y/n)
145
+ ```
146
+
147
+ If yes, run `/tlc:coverage` flow.
148
+
149
+ ### Step 6: All Phases Complete
150
+
151
+ ```
152
+ All phases complete! 🎉
153
+
154
+ Milestone ready for release.
155
+
156
+ 1) Tag release (/tlc:complete)
157
+ 2) Start next milestone (/tlc:new-milestone)
158
+ 3) Check test coverage (/tlc:coverage)
159
+ ```
160
+
161
+ ## Examples
162
+
163
+ **Fresh directory:**
164
+ ```
165
+ > /tlc
166
+
167
+ No project detected.
168
+
169
+ What would you like to do?
170
+ 1) Start new project
171
+ 2) Add TLC to existing code
172
+ ```
173
+
174
+ **Mid-project:**
175
+ ```
176
+ > /tlc
177
+
178
+ Phase 2: User Dashboard
179
+ Status: Planned, not built
180
+
181
+ 4 tasks ready. Tests will be written first.
182
+
183
+ → Build phase 2? (Y/n)
184
+ ```
185
+
186
+ **Has untested code:**
187
+ ```
188
+ > /tlc
189
+
190
+ Phase 3: Reports [current]
191
+
192
+ Also found: 3 files without test coverage
193
+ - src/utils/format.ts
194
+ - src/api/health.ts
195
+ - src/middleware/auth.ts
196
+
197
+ 1) Continue with Phase 3
198
+ 2) Add tests to existing code first
199
+ ```
200
+
201
+ ## Usage
202
+
203
+ ```
204
+ /tlc
205
+ ```
206
+
207
+ No arguments. Auto-detects everything.
208
+
209
+ ## Why This Exists
210
+
211
+ Instead of remembering:
212
+ - `/tlc:discuss 2`
213
+ - `/tlc:plan 2`
214
+ - `/tlc:build 2`
215
+ - `/tlc:verify 2`
216
+
217
+ Just run `/tlc`. It knows where you are.