tlc-claude-code 1.5.2 → 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.
Files changed (44) hide show
  1. package/.claude/commands/tlc/audit.md +129 -0
  2. package/.claude/commands/tlc/autofix.md +217 -0
  3. package/.claude/commands/tlc/bug.md +255 -0
  4. package/.claude/commands/tlc/build.md +731 -0
  5. package/.claude/commands/tlc/checklist.md +212 -0
  6. package/.claude/commands/tlc/ci.md +414 -0
  7. package/.claude/commands/tlc/claim.md +189 -0
  8. package/.claude/commands/tlc/cleanup.md +187 -0
  9. package/.claude/commands/tlc/complete.md +160 -0
  10. package/.claude/commands/tlc/config.md +395 -0
  11. package/.claude/commands/tlc/coverage.md +222 -0
  12. package/.claude/commands/tlc/deploy.md +723 -0
  13. package/.claude/commands/tlc/discuss.md +185 -0
  14. package/.claude/commands/tlc/docs.md +194 -0
  15. package/.claude/commands/tlc/edge-cases.md +241 -0
  16. package/.claude/commands/tlc/export.md +456 -0
  17. package/.claude/commands/tlc/help.md +169 -0
  18. package/.claude/commands/tlc/import-project.md +246 -0
  19. package/.claude/commands/tlc/init.md +443 -0
  20. package/.claude/commands/tlc/issues.md +376 -0
  21. package/.claude/commands/tlc/llm.md +111 -0
  22. package/.claude/commands/tlc/new-milestone.md +172 -0
  23. package/.claude/commands/tlc/new-project.md +399 -0
  24. package/.claude/commands/tlc/next.md +129 -0
  25. package/.claude/commands/tlc/outdated.md +200 -0
  26. package/.claude/commands/tlc/plan.md +224 -0
  27. package/.claude/commands/tlc/progress.md +153 -0
  28. package/.claude/commands/tlc/quality.md +185 -0
  29. package/.claude/commands/tlc/quick.md +52 -0
  30. package/.claude/commands/tlc/refactor.md +190 -0
  31. package/.claude/commands/tlc/release.md +135 -0
  32. package/.claude/commands/tlc/review-pr.md +184 -0
  33. package/.claude/commands/tlc/review.md +200 -0
  34. package/.claude/commands/tlc/security.md +195 -0
  35. package/.claude/commands/tlc/server.md +19 -0
  36. package/.claude/commands/tlc/start.md +137 -0
  37. package/.claude/commands/tlc/status.md +65 -0
  38. package/.claude/commands/tlc/sync.md +652 -0
  39. package/.claude/commands/tlc/tlc.md +279 -0
  40. package/.claude/commands/tlc/verify.md +159 -0
  41. package/.claude/commands/tlc/who.md +151 -0
  42. package/bin/install.js +11 -0
  43. package/bin/postinstall.js +54 -0
  44. package/package.json +3 -1
@@ -0,0 +1,129 @@
1
+ # /tlc:audit - Check Coding Standards Compliance
2
+
3
+ Run a comprehensive audit of the codebase against TLC coding standards.
4
+
5
+ ## What This Does
6
+
7
+ 1. Checks that standards files exist (CLAUDE.md, CODING-STANDARDS.md)
8
+ 2. Detects architectural violations:
9
+ - Flat services/, interfaces/, controllers/ folders
10
+ - Inline interfaces in service files
11
+ - Hardcoded URLs and ports
12
+ - Magic strings without constants
13
+ - Flat seed folders
14
+ 3. Checks code quality:
15
+ - JSDoc coverage on exported functions
16
+ - Import style (no deep relative imports)
17
+ 4. Generates report to `.planning/AUDIT-REPORT.md`
18
+
19
+ ## Usage
20
+
21
+ ```
22
+ /tlc:audit
23
+ ```
24
+
25
+ ## Process
26
+
27
+ ### Step 1: Load Audit Module
28
+
29
+ ```javascript
30
+ const { auditProject, generateReport } = require('./lib/standards/audit-checker');
31
+ ```
32
+
33
+ ### Step 2: Run All Checks
34
+
35
+ Run `auditProject(projectPath)` which executes:
36
+
37
+ | Check | What It Finds |
38
+ |-------|---------------|
39
+ | Standards Files | Missing CLAUDE.md or CODING-STANDARDS.md |
40
+ | Flat Folders | Files in src/services/, src/interfaces/, src/controllers/ |
41
+ | Inline Interfaces | `interface X {` inside *.service.ts files |
42
+ | Hardcoded URLs | http:// or https:// URLs in code |
43
+ | Hardcoded Ports | `const port = 3000` patterns |
44
+ | Magic Strings | `=== 'active'` comparisons without constants |
45
+ | Flat Seeds | Seed files in src/seeds/ instead of src/{entity}/seeds/ |
46
+ | Missing JSDoc | Exported functions without `/**` comments |
47
+ | Deep Imports | `../../../` style imports (3+ levels) |
48
+
49
+ ### Step 3: Generate Report
50
+
51
+ Create `.planning/AUDIT-REPORT.md` with:
52
+
53
+ ```markdown
54
+ # Audit Report
55
+
56
+ Generated: {timestamp}
57
+ Status: {PASSED | FAILED}
58
+
59
+ ## Summary
60
+
61
+ - Total Issues: {count}
62
+ - Standards Files: {✓ | ✗}
63
+ - Architecture: {✓ | ✗}
64
+ - Code Quality: {✓ | ✗}
65
+
66
+ ## Issues Found
67
+
68
+ ### Flat Folders
69
+ - src/services/user.service.ts → Move to src/user/user.service.ts
70
+
71
+ ### Hardcoded URLs
72
+ - src/api.ts:15 - http://localhost:3000
73
+
74
+ ...
75
+ ```
76
+
77
+ ### Step 4: Display Results
78
+
79
+ ```
80
+ TLC Audit Results
81
+ ═══════════════════════════════════════════════════════════════
82
+
83
+ Status: ✗ FAILED (12 issues found)
84
+
85
+ Standards Files: ✓ PASSED
86
+ Flat Folders: ✗ 3 issues
87
+ Inline Interfaces: ✗ 2 issues
88
+ Hardcoded URLs: ✗ 4 issues
89
+ Magic Strings: ✗ 2 issues
90
+ JSDoc Coverage: ✗ 1 issue
91
+ Import Style: ✓ PASSED
92
+
93
+ Report saved to: .planning/AUDIT-REPORT.md
94
+
95
+ Fix automatically? Run /tlc:cleanup
96
+ Fix step-by-step? Run /tlc:refactor
97
+ ```
98
+
99
+ ## Example Output
100
+
101
+ ```
102
+ > /tlc:audit
103
+
104
+ Running TLC audit...
105
+
106
+ Checking standards files... ✓
107
+ Checking folder structure... ✗ Found 3 flat folders
108
+ Checking inline interfaces... ✗ Found 2 violations
109
+ Checking hardcoded config... ✗ Found 4 hardcoded URLs
110
+ Checking magic strings... ✗ Found 2 magic strings
111
+ Checking JSDoc coverage... ✓
112
+ Checking import style... ✓
113
+
114
+ ═══════════════════════════════════════════════════════════════
115
+ AUDIT FAILED - 11 issues found
116
+ ═══════════════════════════════════════════════════════════════
117
+
118
+ Report: .planning/AUDIT-REPORT.md
119
+
120
+ Next steps:
121
+ /tlc:cleanup - Fix all issues automatically
122
+ /tlc:refactor - Fix step-by-step with previews
123
+ ```
124
+
125
+ ## Exit Codes
126
+
127
+ - `0` - All checks passed
128
+ - `1` - Issues found (report generated)
129
+ - `2` - Error running audit
@@ -0,0 +1,217 @@
1
+ # /tlc:autofix - Automatic Test Failure Recovery
2
+
3
+ Run tests, analyze failures, and automatically apply fixes for common error patterns.
4
+
5
+ ## What This Does
6
+
7
+ 1. Runs test suite and captures failures
8
+ 2. Matches errors against known patterns
9
+ 3. Generates fix proposals
10
+ 4. Applies fixes (with user confirmation)
11
+ 5. Re-runs tests to verify
12
+ 6. Offers to commit fixes
13
+
14
+ ## Usage
15
+
16
+ ```
17
+ /tlc:autofix
18
+ ```
19
+
20
+ ## Process
21
+
22
+ ### Step 1: Run Tests
23
+
24
+ Execute test suite to capture current state:
25
+
26
+ ```bash
27
+ npm test 2>&1
28
+ ```
29
+
30
+ ### Step 2: Parse Failures
31
+
32
+ For each failing test, extract:
33
+ - Test name
34
+ - Error message
35
+ - File and line number
36
+
37
+ ### Step 3: Match Patterns
38
+
39
+ Known error patterns:
40
+
41
+ | Pattern | Example | Fix |
42
+ |---------|---------|-----|
43
+ | null-property-access | `Cannot read properties of null` | Add null check |
44
+ | undefined-property-access | `Cannot read properties of undefined` | Add undefined check |
45
+ | module-not-found | `Cannot find module './utils'` | Add/fix import |
46
+ | function-not-defined | `validateEmail is not defined` | Add import/export |
47
+ | expected-value-mismatch | `expected undefined to equal` | Check return value |
48
+ | timeout | `Timeout of 5000ms exceeded` | Add await/increase timeout |
49
+
50
+ ### Step 4: Display Analysis
51
+
52
+ ```
53
+ Test Failures: 4
54
+
55
+ 1) src/auth.test.ts > login > rejects invalid password
56
+ Error: Cannot read properties of null (reading 'email')
57
+ Fix: Add null check before accessing 'email'
58
+ Confidence: HIGH
59
+
60
+ 2) src/user.test.ts > getUser > returns user object
61
+ Error: Cannot find module '../utils/helper'
62
+ Fix: Add missing import
63
+ Confidence: HIGH
64
+
65
+ 3) src/api.test.ts > paginate > handles page 0
66
+ Error: expected undefined to equal []
67
+ Fix: Check function return value
68
+ Confidence: LOW
69
+
70
+ 4) src/complex.test.ts > integration > complex flow
71
+ Error: Some unusual error
72
+ Fix: Unable to auto-fix
73
+ Confidence: NONE
74
+
75
+ Fixable: 3 (2 high, 1 low)
76
+ Unfixable: 1
77
+
78
+ Apply fixes? (Y/n)
79
+ ```
80
+
81
+ ### Step 5: Apply Fixes
82
+
83
+ For each fixable failure:
84
+
85
+ 1. Read source file
86
+ 2. Apply suggested fix
87
+ 3. Show progress:
88
+ ```
89
+ [████████░░░░░░░░░░░░] 2/4 (50%)
90
+ Fixing null check in auth.ts
91
+ ```
92
+
93
+ ### Step 6: Verify Fixes
94
+
95
+ Re-run tests after fixes:
96
+
97
+ ```bash
98
+ npm test 2>&1
99
+ ```
100
+
101
+ Check results:
102
+ - ✅ Test passes → Mark as fixed
103
+ - ❌ Still fails → Rollback change, mark as unfixable
104
+
105
+ ### Step 7: Display Summary
106
+
107
+ ```
108
+ AutoFix Summary
109
+ ═══════════════
110
+
111
+ Total: 4
112
+ fixed: 3 ✓
113
+ failed: 1 ✗
114
+
115
+ Successfully fixed:
116
+ ✓ src/auth.test.ts > login > rejects invalid password
117
+ Added null check
118
+ ✓ src/user.test.ts > getUser > returns user object
119
+ Added missing import
120
+ ✓ src/api.test.ts > paginate > handles page 0
121
+ Fixed return value
122
+
123
+ Could not fix:
124
+ ✗ src/complex.test.ts > integration > complex flow
125
+ Reason: Unknown error pattern
126
+
127
+ Commit fixes?
128
+ 1) Yes - commit all fixes
129
+ 2) No - review changes first
130
+ ```
131
+
132
+ ### Step 8: Commit (Optional)
133
+
134
+ If user chooses to commit:
135
+
136
+ ```bash
137
+ git add -A
138
+ git commit -m "fix: auto-fix test failures (3 fixed)"
139
+ ```
140
+
141
+ ## Configuration
142
+
143
+ In `.tlc.json`:
144
+
145
+ ```json
146
+ {
147
+ "autofix": {
148
+ "maxAttempts": 5,
149
+ "strategies": ["null-check", "import", "return-value"],
150
+ "confirmBeforeApply": true
151
+ }
152
+ }
153
+ ```
154
+
155
+ ## Confidence Levels
156
+
157
+ | Level | Meaning | Behavior |
158
+ |-------|---------|----------|
159
+ | HIGH | Known pattern, reliable fix | Apply automatically |
160
+ | MEDIUM | Likely fix, may need review | Apply with confirmation |
161
+ | LOW | Suggested fix, uncertain | Show suggestion only |
162
+ | NONE | Unknown pattern | Skip, suggest manual fix |
163
+
164
+ ## Error Patterns
165
+
166
+ Supported patterns for auto-fixing:
167
+
168
+ 1. **null-property-access**: Accessing property on null
169
+ 2. **undefined-property-access**: Accessing property on undefined
170
+ 3. **module-not-found**: Missing import statement
171
+ 4. **function-not-defined**: Function not exported/imported
172
+ 5. **function-not-a-function**: Wrong export type
173
+ 6. **timeout**: Missing async/await or slow test
174
+
175
+ ## Example Session
176
+
177
+ ```
178
+ User: /tlc:autofix
179
+
180
+ Claude: Running tests...
181
+ ❌ 4 tests failing
182
+
183
+ Analyzing failures...
184
+
185
+ 1) login > rejects invalid password
186
+ → null-property-access: 'email'
187
+ → Fix: Add null check (HIGH confidence)
188
+
189
+ 2) getUser > returns user object
190
+ → module-not-found: '../utils/helper'
191
+ → Fix: Add import (HIGH confidence)
192
+
193
+ 3) paginate > handles page 0
194
+ → expected-value-mismatch
195
+ → Fix: Check return (LOW confidence)
196
+
197
+ 4) complex flow
198
+ → Unknown pattern
199
+ → Cannot auto-fix
200
+
201
+ Apply fixes? (Y/n)
202
+
203
+ User: y
204
+
205
+ Claude: [████████████████████] 3/3 (100%)
206
+
207
+ Re-running tests...
208
+ ✅ 3 tests now passing
209
+ ❌ 1 still failing (requires manual fix)
210
+
211
+ AutoFix Summary
212
+ ═══════════════
213
+ fixed: 3 ✓
214
+ failed: 1 ✗
215
+
216
+ Commit fixes? (Y/n)
217
+ ```
@@ -0,0 +1,255 @@
1
+ # /tlc:bug - Log a Bug or Feedback
2
+
3
+ Report issues discovered during development or QA verification.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /tlc:bug [description]
9
+ ```
10
+
11
+ Or interactive:
12
+ ```
13
+ /tlc:bug
14
+ ```
15
+
16
+ ## Process
17
+
18
+ ### Step 1: Gather Bug Information
19
+
20
+ If description provided as argument, use it. Otherwise prompt:
21
+
22
+ ```
23
+ What's the issue?
24
+ > Login fails when email contains a + symbol
25
+
26
+ Where did you find this?
27
+ 1) During development
28
+ 2) During /tlc:verify (QA)
29
+ 3) From automated tests
30
+ 4) User reported
31
+ > 2
32
+
33
+ Severity?
34
+ 1) Critical - blocks release
35
+ 2) High - major feature broken
36
+ 3) Medium - workaround exists
37
+ 4) Low - cosmetic/minor
38
+ > 2
39
+ ```
40
+
41
+ ### Step 2: Identify Context
42
+
43
+ Automatically detect:
44
+ - Current user: `git config user.name` or `$TLC_USER`
45
+ - Current phase: from `.planning/ROADMAP.md`
46
+ - Current task: from any `[>@user]` marker in PLAN.md
47
+ - Git branch: `git branch --show-current`
48
+ - Last commit: `git log -1 --oneline`
49
+
50
+ ### Step 3: Generate Bug ID
51
+
52
+ Format: `BUG-{NNN}` where NNN is sequential.
53
+
54
+ Read `.planning/BUGS.md` to find highest existing ID, increment.
55
+
56
+ ### Step 4: Create Bug Entry
57
+
58
+ Append to `.planning/BUGS.md`:
59
+
60
+ ```markdown
61
+ ---
62
+
63
+ ### BUG-007: Login fails with + symbol in email
64
+
65
+ **Status:** Open
66
+ **Severity:** High
67
+ **Reporter:** @alice
68
+ **Date:** 2024-01-26
69
+ **Phase:** 2 - Authentication
70
+ **Task:** Task 3 - Email validation
71
+ **Branch:** feature/auth
72
+ **Commit:** a1b2c3d
73
+
74
+ **Description:**
75
+ Login fails when email contains a + symbol (e.g., user+test@example.com)
76
+
77
+ **Steps to Reproduce:**
78
+ 1. Go to login page
79
+ 2. Enter email: user+test@example.com
80
+ 3. Enter valid password
81
+ 4. Click Login
82
+
83
+ **Expected:** Should accept valid email and log in
84
+ **Actual:** Shows "Invalid email format" error
85
+
86
+ **Notes:**
87
+ Plus addressing is valid per RFC 5321. Regex validation is too strict.
88
+ ```
89
+
90
+ ### Step 5: Commit Bug Report
91
+
92
+ ```bash
93
+ git add .planning/BUGS.md
94
+ git commit -m "bug: BUG-007 - Login fails with + symbol (@alice)"
95
+ ```
96
+
97
+ ### Step 6: Link to Task (Optional)
98
+
99
+ If bug relates to a specific task, offer to add reference:
100
+
101
+ ```
102
+ Link this bug to Task 3 in the current phase? (Y/n)
103
+ ```
104
+
105
+ If yes, add to task in PLAN.md:
106
+ ```markdown
107
+ ### Task 3: Email validation [>@bob]
108
+
109
+ **Bugs:** BUG-007
110
+ ```
111
+
112
+ ### Step 7: Notify
113
+
114
+ ```
115
+ Bug logged: BUG-007
116
+ File: .planning/BUGS.md
117
+ Committed: bug: BUG-007 - Login fails with + symbol (@alice)
118
+
119
+ Push to share with team? (Y/n)
120
+ ```
121
+
122
+ ## Bug Status Workflow
123
+
124
+ | Status | Meaning |
125
+ |--------|---------|
126
+ | Open | New, not yet addressed |
127
+ | In Progress | Someone is fixing |
128
+ | Fixed | Code fixed, needs verification |
129
+ | Verified | Fix confirmed working |
130
+ | Closed | Resolved |
131
+ | Won't Fix | Declined with reason |
132
+
133
+ ## Updating Bug Status
134
+
135
+ To update an existing bug:
136
+
137
+ ```
138
+ /tlc:bug --update BUG-007 --status "Fixed"
139
+ ```
140
+
141
+ Or interactive:
142
+ ```
143
+ /tlc:bug --update
144
+
145
+ Which bug?
146
+ BUG-005: Session timeout too short (Open)
147
+ BUG-006: Missing loading spinner (Open)
148
+ BUG-007: Login fails with + symbol (Open)
149
+ > BUG-007
150
+
151
+ New status?
152
+ 1) In Progress
153
+ 2) Fixed
154
+ 3) Verified
155
+ 4) Closed
156
+ 5) Won't Fix
157
+ > 2
158
+
159
+ Add resolution notes?
160
+ > Fixed regex in src/auth/validate.ts to allow + in local part
161
+
162
+ Updated BUG-007: Open → Fixed
163
+ ```
164
+
165
+ ## Viewing Bugs
166
+
167
+ To see all open bugs:
168
+
169
+ ```
170
+ /tlc:bug --list
171
+
172
+ Open Bugs (3):
173
+
174
+ | ID | Severity | Description | Reporter | Phase |
175
+ |----|----------|-------------|----------|-------|
176
+ | BUG-005 | Medium | Session timeout too short | @alice | 2 |
177
+ | BUG-006 | Low | Missing loading spinner | @bob | 2 |
178
+ | BUG-007 | High | Login fails with + symbol | @alice | 2 |
179
+
180
+ Critical: 0 | High: 1 | Medium: 1 | Low: 1
181
+ ```
182
+
183
+ ## Integration with /tlc:verify
184
+
185
+ During `/tlc:verify`, QA is prompted to log bugs:
186
+
187
+ ```
188
+ Testing Task 3: Email validation
189
+
190
+ Did you find any issues? (Y/n) y
191
+
192
+ /tlc:bug (interactive mode)
193
+ ...
194
+ ```
195
+
196
+ ## Example Session
197
+
198
+ ```
199
+ > /tlc:bug "Button color doesn't match design spec"
200
+
201
+ Gathering context...
202
+ User: @alice
203
+ Phase: 3 - Dashboard
204
+ Branch: feature/dashboard
205
+
206
+ Severity?
207
+ 1) Critical
208
+ 2) High
209
+ 3) Medium
210
+ 4) Low
211
+ > 4
212
+
213
+ BUG-008 created:
214
+ "Button color doesn't match design spec"
215
+ Severity: Low
216
+ Phase: 3 - Dashboard
217
+
218
+ Committed: bug: BUG-008 - Button color doesn't match design spec (@alice)
219
+
220
+ Push? (Y/n) y
221
+ Pushed to origin/feature/dashboard
222
+ ```
223
+
224
+ ## BUGS.md Format
225
+
226
+ The bugs file has a header and entries:
227
+
228
+ ```markdown
229
+ # Bug Tracker
230
+
231
+ ## Summary
232
+
233
+ | Status | Count |
234
+ |--------|-------|
235
+ | Open | 3 |
236
+ | In Progress | 1 |
237
+ | Fixed | 2 |
238
+ | Closed | 5 |
239
+
240
+ ## Open Bugs
241
+
242
+ ### BUG-007: Login fails with + symbol in email
243
+ ...
244
+
245
+ ### BUG-006: Missing loading spinner
246
+ ...
247
+
248
+ ## Closed Bugs
249
+
250
+ ### BUG-001: App crashes on startup
251
+ **Status:** Closed
252
+ **Resolution:** Fixed null check in main.ts
253
+ **Closed:** 2024-01-25 by @bob
254
+ ...
255
+ ```