tlc-claude-code 1.2.20 → 1.2.22

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.
Files changed (4) hide show
  1. package/config.md +153 -158
  2. package/help.md +1 -0
  3. package/package.json +1 -1
  4. package/update.md +132 -0
package/config.md CHANGED
@@ -1,6 +1,6 @@
1
- # /tlc:config - Configure Test Frameworks
1
+ # /tlc:config - Setup Wizard
2
2
 
3
- Manage test framework settings for your project.
3
+ Interactive setup for TLC. No JSON editing required.
4
4
 
5
5
  ## Usage
6
6
 
@@ -8,229 +8,224 @@ Manage test framework settings for your project.
8
8
  /tlc:config
9
9
  ```
10
10
 
11
- ## Configuration File
11
+ ## Process
12
12
 
13
- TLC stores test preferences in `.tlc.json` at the project root:
13
+ ### Step 1: Welcome & Auto-Detect
14
14
 
15
- ```json
16
- {
17
- "testFrameworks": {
18
- "primary": "mocha",
19
- "installed": ["mocha", "chai", "sinon", "proxyquire"],
20
- "run": ["mocha"]
21
- },
22
- "testCommand": "npm test",
23
- "testDirectory": "test"
24
- }
25
- ```
15
+ First, scan the project and greet the user:
26
16
 
27
- ### Fields
17
+ ```
18
+ ═══════════════════════════════════════════════════════════════
19
+ TLC Setup Wizard
20
+ ═══════════════════════════════════════════════════════════════
28
21
 
29
- | Field | Description |
30
- |-------|-------------|
31
- | `primary` | Main test framework for new tests |
32
- | `installed` | All test libraries available in project |
33
- | `run` | Which frameworks to execute (subset of installed) |
34
- | `testCommand` | Command to run tests |
35
- | `testDirectory` | Where test files live |
22
+ Scanning your project...
36
23
 
37
- ## Supported Frameworks
24
+ Found: package.json (Node.js project)
25
+ ✓ Found: 12 existing test files
26
+ ✓ Detected: Jest is installed
38
27
 
39
- ### Default Stack (Recommended)
28
+ Let's configure TLC for your project!
29
+ ```
40
30
 
41
- TLC defaults to the mocha ecosystem for new projects:
31
+ ### Step 2: Test Framework
42
32
 
43
- | Library | Purpose |
44
- |---------|---------|
45
- | **mocha** | Test runner |
46
- | **chai** | Assertions (expect, should, assert) |
47
- | **sinon** | Mocks, stubs, spies |
48
- | **proxyquire** | Module mocking/dependency injection |
33
+ Ask in plain language:
49
34
 
50
- ```bash
51
- npm install -D mocha chai sinon proxyquire @types/mocha @types/chai @types/sinon
52
35
  ```
36
+ ───────────────────────────────────────────────────────────────
37
+ Question 1 of 4: Test Framework
38
+ ───────────────────────────────────────────────────────────────
53
39
 
54
- ### Alternative Frameworks
40
+ Which test framework do you want to use?
55
41
 
56
- | Framework | Use Case |
57
- |-----------|----------|
58
- | **vitest** | Vite projects, fast, ESM-native |
59
- | **jest** | React/Meta ecosystem, all-in-one |
60
- | **pytest** | Python projects |
61
- | **go test** | Go projects (built-in) |
62
- | **rspec** | Ruby projects |
42
+ [1] Keep Jest (already installed) ← Recommended
43
+ [2] Switch to Mocha (TLC default)
44
+ [3] Use Vitest (fast, modern)
45
+ [4] I'm not sure - choose for me
63
46
 
64
- ## Process
47
+ Choice [1/2/3/4]: _
48
+ ```
65
49
 
66
- ### Step 1: Check for Existing Config
50
+ **If user chooses 4 ("not sure"):**
51
+ - Node.js project → Mocha
52
+ - Vite project → Vitest
53
+ - React/Next.js → Jest
54
+ - Python → pytest
55
+ - Go → go test
67
56
 
68
- Look for `.tlc.json` in project root.
57
+ **After selection, handle installation silently:**
58
+ ```
59
+ Setting up Mocha...
60
+ ✓ Installed mocha, chai, sinon
61
+ ✓ Created test/ folder
62
+ ✓ Added test script to package.json
69
63
 
70
- If exists, display current settings:
64
+ Done!
71
65
  ```
72
- Current TLC Configuration:
73
66
 
74
- Test Framework: mocha
75
- Libraries: mocha, chai, sinon, proxyquire
76
- Run Command: npm test
77
- Test Directory: test/
67
+ ### Step 3: Coverage Target
78
68
 
79
- What would you like to do?
80
- 1) View/edit frameworks to run
81
- 2) Add a new framework
82
- 3) Change primary framework
83
- 4) Reset to defaults
84
69
  ```
70
+ ───────────────────────────────────────────────────────────────
71
+ Question 2 of 4: Code Coverage
72
+ ───────────────────────────────────────────────────────────────
73
+
74
+ How thorough should testing be?
85
75
 
86
- ### Step 2: First-Time Setup
76
+ [1] Relaxed (60%) - Good for prototypes
77
+ [2] Standard (80%) - Recommended for most projects
78
+ [3] Strict (95%) - For critical systems
79
+ [4] Skip coverage checks
87
80
 
88
- If no config exists, check for existing tests:
81
+ Choice [1/2/3/4]: _
82
+ ```
89
83
 
90
- 1. **Detect installed frameworks** from package.json/dependencies
91
- 2. **Detect test files** patterns in use
92
- 3. **Propose configuration** based on findings
84
+ ### Step 4: Team or Solo
93
85
 
94
86
  ```
95
- No TLC config found. Analyzing project...
87
+ ───────────────────────────────────────────────────────────────
88
+ Question 3 of 4: Working Style
89
+ ───────────────────────────────────────────────────────────────
90
+
91
+ Are you working alone or with a team?
96
92
 
97
- Detected:
98
- - jest (installed)
99
- - 47 test files using Jest patterns
93
+ [1] Solo - Just me
94
+ [2] Team - Multiple people on this project
100
95
 
101
- Options:
102
- 1) Keep Jest as primary (detected)
103
- 2) Add mocha alongside Jest
104
- 3) Switch to mocha (TLC default)
105
- 4) Custom configuration
96
+ Choice [1/2]: _
106
97
  ```
107
98
 
108
- ### Step 3: Multi-Framework Setup
99
+ **If Team selected:**
100
+ ```
101
+ Great! Team mode enables:
102
+ • Task claiming (prevent duplicate work)
103
+ • @mentions in plans
104
+ • Team status dashboard
109
105
 
110
- When multiple frameworks coexist:
106
+ Your team name (from git): alice
111
107
 
108
+ Is this correct? [Y/n]: _
112
109
  ```
113
- Multiple test frameworks detected:
114
- - mocha: test/unit/*.test.js (23 files)
115
- - jest: __tests__/*.spec.js (15 files)
116
110
 
117
- Configure which to run:
118
- [x] mocha - run these tests
119
- [x] jest - run these tests
120
- [ ] Run all frameworks
111
+ ### Step 5: Summary & Confirm
121
112
 
122
- Test commands:
123
- mocha: npx mocha 'test/**/*.test.js'
124
- jest: npx jest
125
- combined: npm test (runs both)
126
113
  ```
114
+ ───────────────────────────────────────────────────────────────
115
+ Setup Summary
116
+ ───────────────────────────────────────────────────────────────
127
117
 
128
- ### Step 4: Save Configuration
118
+ Test Framework: Mocha + Chai + Sinon
119
+ Coverage Target: 80%
120
+ Team Mode: Enabled (you: @alice)
121
+ Test Folder: test/
129
122
 
130
- Write `.tlc.json`:
123
+ Apply these settings? [Y/n]: _
124
+ ```
131
125
 
132
- ```json
133
- {
134
- "testFrameworks": {
135
- "primary": "mocha",
136
- "installed": ["mocha", "chai", "sinon", "proxyquire", "jest"],
137
- "run": ["mocha", "jest"]
138
- },
139
- "commands": {
140
- "mocha": "npx mocha 'test/**/*.test.js'",
141
- "jest": "npx jest",
142
- "all": "npm test"
143
- },
144
- "testDirectory": "test",
145
- "patterns": {
146
- "mocha": "test/**/*.test.js",
147
- "jest": "__tests__/**/*.spec.js"
148
- }
149
- }
126
+ **On confirm:**
150
127
  ```
128
+ ═══════════════════════════════════════════════════════════════
129
+ ✓ TLC Configured!
130
+ ═══════════════════════════════════════════════════════════════
151
131
 
152
- ### Step 5: Update package.json
132
+ You're all set. Here's what to do next:
153
133
 
154
- Ensure test scripts are configured:
134
+ /tlc See project status
135
+ /tlc:build Build current phase (writes tests first)
136
+ /tlc:status Check if tests are passing
155
137
 
156
- ```json
157
- {
158
- "scripts": {
159
- "test": "npm run test:mocha && npm run test:jest",
160
- "test:mocha": "mocha 'test/**/*.test.js'",
161
- "test:jest": "jest",
162
- "test:watch": "mocha --watch 'test/**/*.test.js'"
163
- }
164
- }
138
+ Happy coding!
165
139
  ```
166
140
 
167
- ## Example: Adding a Framework
141
+ ## Reconfigure
142
+
143
+ If `.tlc.json` already exists, show current settings first:
168
144
 
169
145
  ```
170
- > /tlc:config
146
+ ═══════════════════════════════════════════════════════════════
147
+ Current TLC Settings
148
+ ═══════════════════════════════════════════════════════════════
171
149
 
172
- Current: mocha (primary)
150
+ Test Framework: Mocha
151
+ Coverage Target: 80%
152
+ Team Mode: Off
173
153
 
174
- What would you like to do?
175
- > 2) Add a new framework
154
+ What would you like to change?
176
155
 
177
- Available frameworks to add:
178
- 1) jest - All-in-one testing (React ecosystem)
179
- 2) vitest - Fast, Vite-native
180
- 3) Other (specify)
156
+ [1] Test framework
157
+ [2] Coverage target
158
+ [3] Enable/disable team mode
159
+ [4] Reset everything
160
+ [5] Exit (keep current settings)
181
161
 
182
- > 1) jest
162
+ Choice [1/2/3/4/5]: _
163
+ ```
183
164
 
184
- Installing jest...
185
- npm install -D jest @types/jest
165
+ ## Advanced Mode
186
166
 
187
- Configure jest test location:
188
- > __tests__/
167
+ For power users who want to edit JSON directly:
189
168
 
190
- Updated .tlc.json:
191
- installed: mocha, chai, sinon, proxyquire, jest
192
- run: mocha, jest
169
+ ```
170
+ /tlc:config --advanced
171
+ ```
193
172
 
194
- Run which tests?
195
- 1) All frameworks (mocha + jest)
196
- 2) Only mocha
197
- 3) Only jest
198
- 4) Let me choose per-run
173
+ Shows the raw `.tlc.json` and allows direct editing. But this is hidden from the main flow.
199
174
 
200
- > 1) All frameworks
175
+ ## Auto-Detection Rules
201
176
 
202
- Done. Run 'npm test' to execute all test suites.
203
- ```
177
+ | What We Find | What We Set Up |
178
+ |--------------|----------------|
179
+ | `jest` in package.json | Jest as primary |
180
+ | `vitest` in package.json | Vitest as primary |
181
+ | `mocha` in package.json | Mocha as primary |
182
+ | `pytest` in requirements.txt | pytest as primary |
183
+ | Vite project (vite.config) | Suggest Vitest |
184
+ | React/Next.js project | Suggest Jest |
185
+ | Nothing detected | Default to Mocha |
204
186
 
205
- ## Example: Project with Existing Jest
187
+ ## Silent Installation
188
+
189
+ When setting up a framework, install everything needed without asking:
190
+
191
+ **Mocha:**
192
+ ```bash
193
+ npm install -D mocha chai sinon proxyquire
194
+ ```
206
195
 
196
+ **Jest:**
197
+ ```bash
198
+ npm install -D jest
207
199
  ```
208
- > /tlc:config
209
200
 
210
- Detected: jest (47 test files)
201
+ **Vitest:**
202
+ ```bash
203
+ npm install -D vitest
204
+ ```
211
205
 
212
- Your project uses Jest. Options:
206
+ **pytest:**
207
+ ```bash
208
+ pip install pytest pytest-cov pytest-mock
209
+ ```
213
210
 
214
- 1) Keep Jest only
215
- 2) Add mocha for new tests, keep Jest for existing
216
- 3) Migrate to mocha (will need to convert tests)
211
+ ## Error Recovery
217
212
 
218
- > 2) Add mocha for new tests
213
+ If something goes wrong:
219
214
 
220
- Setting up mocha alongside Jest...
215
+ ```
216
+ ⚠️ Couldn't install mocha automatically.
221
217
 
222
- New tests will use: mocha + chai + sinon
223
- Existing tests remain: jest
218
+ Try running this manually:
219
+ npm install -D mocha chai sinon proxyquire
224
220
 
225
- Updated scripts:
226
- npm test - runs both
227
- npm run test:new - runs mocha only
228
- npm run test:legacy - runs jest only
221
+ Then run /tlc:config again.
229
222
  ```
230
223
 
231
224
  ## Notes
232
225
 
233
- - TLC defaults to mocha for consistency across projects
234
- - Multiple frameworks can coexist when inheriting codebases
235
- - Use `run` array to control which frameworks execute
236
- - The `primary` framework is used for new test generation
226
+ - Never show JSON to beginners
227
+ - Always provide numbered choices
228
+ - Auto-detect as much as possible
229
+ - Install packages automatically
230
+ - Provide sensible defaults
231
+ - Explain what each choice means in plain English
package/help.md CHANGED
@@ -61,6 +61,7 @@ Launches the visual dashboard. Detects where you are, shows what's next.
61
61
  | `/tlc:new-milestone` | Start next version |
62
62
  | `/tlc:bug` | Log a bug or feedback |
63
63
  | `/tlc:server` | Start dashboard server for QA |
64
+ | `/tlc:update` | Update TLC to latest version |
64
65
 
65
66
  ### Multi-User Collaboration
66
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tlc-claude-code",
3
- "version": "1.2.20",
3
+ "version": "1.2.22",
4
4
  "description": "TLC - Test Led Coding for Claude Code",
5
5
  "bin": {
6
6
  "tlc": "./bin/tlc.js",
package/update.md ADDED
@@ -0,0 +1,132 @@
1
+ # /tlc:update - Update TLC
2
+
3
+ Update TLC to the latest version.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /tlc:update
9
+ ```
10
+
11
+ ## Process
12
+
13
+ ### Step 1: Check Current Version
14
+
15
+ ```
16
+ ═══════════════════════════════════════════════════════════════
17
+ TLC Update
18
+ ═══════════════════════════════════════════════════════════════
19
+
20
+ Current version: v1.2.20
21
+ Checking for updates...
22
+ ```
23
+
24
+ ### Step 2: Check for Updates
25
+
26
+ ```bash
27
+ # Get latest version from npm
28
+ latestVersion=$(npm show tlc-claude-code version)
29
+ currentVersion=$(cat ~/.claude/commands/tlc/package.json | jq -r '.version')
30
+
31
+ if [ "$latestVersion" = "$currentVersion" ]; then
32
+ echo "✓ You're on the latest version (v$currentVersion)"
33
+ exit 0
34
+ fi
35
+ ```
36
+
37
+ ### Step 3: Show What's New
38
+
39
+ ```
40
+ New version available: v1.2.21
41
+
42
+ What's new:
43
+ • Setup wizard - no more JSON editing
44
+ • GitHub Desktop recommended for beginners
45
+ • Fixed wiki links
46
+
47
+ Update now? [Y/n]: _
48
+ ```
49
+
50
+ ### Step 4: Update
51
+
52
+ ```
53
+ Updating TLC...
54
+
55
+ npx tlc-claude-code@latest --global
56
+
57
+ ✓ Updated to v1.2.21
58
+
59
+ Restart Claude Code to load the new commands.
60
+ ```
61
+
62
+ ### Step 5: Show Changes (Optional)
63
+
64
+ If user wants to see full changelog:
65
+
66
+ ```
67
+ Show full changelog? [y/N]: _
68
+ ```
69
+
70
+ If yes, fetch and display:
71
+ ```
72
+ v1.2.21 (2024-01-30)
73
+ • Setup wizard for configuration
74
+ • Beginner-friendly docs
75
+
76
+ v1.2.20 (2024-01-30)
77
+ • Fixed wiki link format
78
+
79
+ v1.2.19 (2024-01-30)
80
+ • GitHub Desktop in noob guide
81
+ ```
82
+
83
+ ## Auto-Update Check
84
+
85
+ When running `/tlc`, check for updates in background:
86
+
87
+ ```bash
88
+ # Silent check (don't block)
89
+ latestVersion=$(npm show tlc-claude-code version 2>/dev/null)
90
+
91
+ if [ "$latestVersion" != "$currentVersion" ]; then
92
+ echo "💡 TLC update available: v$latestVersion (you have v$currentVersion)"
93
+ echo " Run /tlc:update to upgrade"
94
+ fi
95
+ ```
96
+
97
+ ## Force Update
98
+
99
+ Skip confirmation:
100
+
101
+ ```
102
+ /tlc:update --yes
103
+ ```
104
+
105
+ ## Specific Version
106
+
107
+ Install a specific version:
108
+
109
+ ```
110
+ /tlc:update --version 1.2.15
111
+ ```
112
+
113
+ ## Offline / No Update
114
+
115
+ ```
116
+ ═══════════════════════════════════════════════════════════════
117
+ TLC Update
118
+ ═══════════════════════════════════════════════════════════════
119
+
120
+ Current version: v1.2.20
121
+
122
+ ⚠️ Couldn't check for updates (offline or npm unreachable)
123
+
124
+ To update manually:
125
+ npx tlc-claude-code@latest --global
126
+ ```
127
+
128
+ ## Notes
129
+
130
+ - Updates install globally via npm
131
+ - Requires restart of Claude Code to load new commands
132
+ - Check npm for latest: https://www.npmjs.com/package/tlc-claude-code