tlc-claude-code 0.6.4 → 0.7.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/claim.md ADDED
@@ -0,0 +1,189 @@
1
+ # /tlc:claim - Claim a Task
2
+
3
+ Reserve a task so teammates know you're working on it.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /tlc:claim [task-number]
9
+ ```
10
+
11
+ ## Process
12
+
13
+ ### Step 1: Identify User
14
+
15
+ Get current user identity:
16
+
17
+ ```bash
18
+ # Check TLC_USER environment variable first
19
+ if [ -n "$TLC_USER" ]; then
20
+ user=$TLC_USER
21
+ else
22
+ # Fall back to git username, normalized to lowercase
23
+ user=$(git config user.name | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
24
+ fi
25
+ ```
26
+
27
+ ### Step 2: Sync Latest State
28
+
29
+ Pull latest changes to get current task claims:
30
+
31
+ ```bash
32
+ git pull --rebase
33
+ ```
34
+
35
+ If pull fails due to conflicts, abort and notify user to resolve manually.
36
+
37
+ ### Step 3: Find Current Phase Plan
38
+
39
+ Locate the active phase PLAN.md:
40
+
41
+ 1. Read `.planning/ROADMAP.md`
42
+ 2. Find phase marked `[>]` or `[current]`
43
+ 3. Load `.planning/phases/{N}-*-PLAN.md`
44
+
45
+ ### Step 4: Parse Task Status
46
+
47
+ Read task headings and their status markers:
48
+
49
+ | Pattern | Status | Available |
50
+ |---------|--------|-----------|
51
+ | `### Task N: Title [ ]` | Available | Yes |
52
+ | `### Task N: Title [>@user]` | Claimed | No (unless by you) |
53
+ | `### Task N: Title [x@user]` | Completed | No |
54
+
55
+ ### Step 5: Show Available Tasks
56
+
57
+ Display tasks with their status:
58
+
59
+ ```
60
+ Phase 2: User Dashboard
61
+
62
+ Tasks:
63
+ 1. Create layout component [x@alice] (done)
64
+ 2. Fetch data hook [ ] (available)
65
+ 3. Add charts [>@bob] (bob is working)
66
+ 4. Loading states [ ] (available)
67
+
68
+ Available: 2, 4
69
+ ```
70
+
71
+ ### Step 6: Claim Task
72
+
73
+ If task-number provided:
74
+ - Verify task exists and is available
75
+ - If not available, show error
76
+
77
+ If not provided:
78
+ - Prompt user to select from available tasks
79
+
80
+ Update the task heading:
81
+
82
+ ```markdown
83
+ ### Task 2: Fetch data hook [ ]
84
+ ```
85
+
86
+ becomes:
87
+
88
+ ```markdown
89
+ ### Task 2: Fetch data hook [>@alice]
90
+ ```
91
+
92
+ ### Step 7: Commit Claim
93
+
94
+ ```bash
95
+ git add .planning/phases/{N}-PLAN.md
96
+ git commit -m "claim: task {N} - {title} (@{user})"
97
+ ```
98
+
99
+ ### Step 8: Push
100
+
101
+ Prompt to push:
102
+
103
+ ```
104
+ Committed. Push now? (Y/n)
105
+ ```
106
+
107
+ If yes:
108
+ ```bash
109
+ git push
110
+ ```
111
+
112
+ If push fails (someone else pushed):
113
+ ```
114
+ Push failed - someone else updated the plan.
115
+ Run: git pull --rebase
116
+ Then try /tlc:claim again
117
+ ```
118
+
119
+ ## Example Session
120
+
121
+ ```
122
+ > /tlc:claim 2
123
+
124
+ Syncing latest...
125
+ ✓ Up to date
126
+
127
+ Phase 1: Authentication
128
+
129
+ Tasks:
130
+ 1. Create user schema [x@bob] (done)
131
+ 2. Add validation [ ] → [>@alice]
132
+ 3. Write migrations [>@bob] (bob is working)
133
+ 4. Integration tests [ ] (available)
134
+
135
+ Claiming task 2: Add validation
136
+
137
+ ✓ Committed: claim: task 2 - Add validation (@alice)
138
+
139
+ Push now? (Y/n) y
140
+ ✓ Pushed
141
+
142
+ Task 2 is yours. Run /tlc:build to start.
143
+ ```
144
+
145
+ ## Error Handling
146
+
147
+ **Task already claimed:**
148
+ ```
149
+ Task 2 is being worked on by @bob.
150
+ Available tasks: 4
151
+
152
+ Choose a different task, or ask @bob to /tlc:release 2
153
+ ```
154
+
155
+ **Task already completed:**
156
+ ```
157
+ Task 2 was completed by @alice.
158
+ Available tasks: 4
159
+ ```
160
+
161
+ **No available tasks:**
162
+ ```
163
+ All tasks in Phase 1 are claimed or completed.
164
+
165
+ [x@alice] 1. Create schema
166
+ [>@bob] 2. Add validation
167
+ [x@alice] 3. Write migrations
168
+ [>@bob] 4. Integration tests
169
+
170
+ Wait for a task to be released, or help review completed work.
171
+ ```
172
+
173
+ **Merge conflict on push:**
174
+ ```
175
+ Push rejected - concurrent claim detected.
176
+
177
+ Someone else claimed a task while you were claiming.
178
+ Run: git pull --rebase
179
+
180
+ If conflict on YOUR task: resolve and push
181
+ If conflict on different task: auto-resolved, just push
182
+ ```
183
+
184
+ ## Notes
185
+
186
+ - Claims are advisory - they don't prevent others from editing files
187
+ - Claims help coordinate, not enforce
188
+ - Use `/tlc:who` to see full team status
189
+ - Use `/tlc:release` to give up a claim
package/config.md ADDED
@@ -0,0 +1,236 @@
1
+ # /tlc:config - Configure Test Frameworks
2
+
3
+ Manage test framework settings for your project.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /tlc:config
9
+ ```
10
+
11
+ ## Configuration File
12
+
13
+ TLC stores test preferences in `.tlc.json` at the project root:
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
+ ```
26
+
27
+ ### Fields
28
+
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 |
36
+
37
+ ## Supported Frameworks
38
+
39
+ ### Default Stack (Recommended)
40
+
41
+ TLC defaults to the mocha ecosystem for new projects:
42
+
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 |
49
+
50
+ ```bash
51
+ npm install -D mocha chai sinon proxyquire @types/mocha @types/chai @types/sinon
52
+ ```
53
+
54
+ ### Alternative Frameworks
55
+
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 |
63
+
64
+ ## Process
65
+
66
+ ### Step 1: Check for Existing Config
67
+
68
+ Look for `.tlc.json` in project root.
69
+
70
+ If exists, display current settings:
71
+ ```
72
+ Current TLC Configuration:
73
+
74
+ Test Framework: mocha
75
+ Libraries: mocha, chai, sinon, proxyquire
76
+ Run Command: npm test
77
+ Test Directory: test/
78
+
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
+ ```
85
+
86
+ ### Step 2: First-Time Setup
87
+
88
+ If no config exists, check for existing tests:
89
+
90
+ 1. **Detect installed frameworks** from package.json/dependencies
91
+ 2. **Detect test files** patterns in use
92
+ 3. **Propose configuration** based on findings
93
+
94
+ ```
95
+ No TLC config found. Analyzing project...
96
+
97
+ Detected:
98
+ - jest (installed)
99
+ - 47 test files using Jest patterns
100
+
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
106
+ ```
107
+
108
+ ### Step 3: Multi-Framework Setup
109
+
110
+ When multiple frameworks coexist:
111
+
112
+ ```
113
+ Multiple test frameworks detected:
114
+ - mocha: test/unit/*.test.js (23 files)
115
+ - jest: __tests__/*.spec.js (15 files)
116
+
117
+ Configure which to run:
118
+ [x] mocha - run these tests
119
+ [x] jest - run these tests
120
+ [ ] Run all frameworks
121
+
122
+ Test commands:
123
+ mocha: npx mocha 'test/**/*.test.js'
124
+ jest: npx jest
125
+ combined: npm test (runs both)
126
+ ```
127
+
128
+ ### Step 4: Save Configuration
129
+
130
+ Write `.tlc.json`:
131
+
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
+ }
150
+ ```
151
+
152
+ ### Step 5: Update package.json
153
+
154
+ Ensure test scripts are configured:
155
+
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
+ }
165
+ ```
166
+
167
+ ## Example: Adding a Framework
168
+
169
+ ```
170
+ > /tlc:config
171
+
172
+ Current: mocha (primary)
173
+
174
+ What would you like to do?
175
+ > 2) Add a new framework
176
+
177
+ Available frameworks to add:
178
+ 1) jest - All-in-one testing (React ecosystem)
179
+ 2) vitest - Fast, Vite-native
180
+ 3) Other (specify)
181
+
182
+ > 1) jest
183
+
184
+ Installing jest...
185
+ npm install -D jest @types/jest
186
+
187
+ Configure jest test location:
188
+ > __tests__/
189
+
190
+ Updated .tlc.json:
191
+ installed: mocha, chai, sinon, proxyquire, jest
192
+ run: mocha, jest
193
+
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
199
+
200
+ > 1) All frameworks
201
+
202
+ Done. Run 'npm test' to execute all test suites.
203
+ ```
204
+
205
+ ## Example: Project with Existing Jest
206
+
207
+ ```
208
+ > /tlc:config
209
+
210
+ Detected: jest (47 test files)
211
+
212
+ Your project uses Jest. Options:
213
+
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)
217
+
218
+ > 2) Add mocha for new tests
219
+
220
+ Setting up mocha alongside Jest...
221
+
222
+ New tests will use: mocha + chai + sinon
223
+ Existing tests remain: jest
224
+
225
+ Updated scripts:
226
+ npm test - runs both
227
+ npm run test:new - runs mocha only
228
+ npm run test:legacy - runs jest only
229
+ ```
230
+
231
+ ## Notes
232
+
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