tlc-claude-code 2.0.1 → 2.2.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.
Files changed (109) hide show
  1. package/.claude/agents/builder.md +144 -0
  2. package/.claude/agents/planner.md +143 -0
  3. package/.claude/agents/reviewer.md +160 -0
  4. package/.claude/commands/tlc/build.md +4 -0
  5. package/.claude/commands/tlc/deploy.md +194 -2
  6. package/.claude/commands/tlc/e2e-verify.md +214 -0
  7. package/.claude/commands/tlc/guard.md +191 -0
  8. package/.claude/commands/tlc/help.md +32 -0
  9. package/.claude/commands/tlc/init.md +73 -37
  10. package/.claude/commands/tlc/llm.md +19 -4
  11. package/.claude/commands/tlc/preflight.md +134 -0
  12. package/.claude/commands/tlc/review-plan.md +363 -0
  13. package/.claude/commands/tlc/review.md +172 -57
  14. package/.claude/commands/tlc/watchci.md +159 -0
  15. package/.claude/hooks/tlc-block-tools.sh +41 -0
  16. package/.claude/hooks/tlc-capture-exchange.sh +50 -0
  17. package/.claude/hooks/tlc-post-build.sh +38 -0
  18. package/.claude/hooks/tlc-post-push.sh +22 -0
  19. package/.claude/hooks/tlc-prompt-guard.sh +69 -0
  20. package/.claude/hooks/tlc-session-init.sh +123 -0
  21. package/CLAUDE.md +13 -0
  22. package/bin/install.js +268 -2
  23. package/bin/postinstall.js +102 -24
  24. package/bin/setup-autoupdate.js +206 -0
  25. package/bin/setup-autoupdate.test.js +124 -0
  26. package/bin/tlc.js +0 -0
  27. package/dashboard-web/dist/assets/index-CdS5CHqu.css +1 -0
  28. package/dashboard-web/dist/assets/index-CwNPPVpg.js +483 -0
  29. package/dashboard-web/dist/assets/index-CwNPPVpg.js.map +1 -0
  30. package/dashboard-web/dist/index.html +2 -2
  31. package/docker-compose.dev.yml +18 -12
  32. package/package.json +4 -2
  33. package/scripts/project-docs.js +1 -1
  34. package/server/index.js +228 -2
  35. package/server/lib/capture-bridge.js +242 -0
  36. package/server/lib/capture-bridge.test.js +363 -0
  37. package/server/lib/capture-guard.js +140 -0
  38. package/server/lib/capture-guard.test.js +182 -0
  39. package/server/lib/command-runner.js +159 -0
  40. package/server/lib/command-runner.test.js +92 -0
  41. package/server/lib/cost-tracker.test.js +49 -12
  42. package/server/lib/deploy/runners/dependency-runner.js +106 -0
  43. package/server/lib/deploy/runners/dependency-runner.test.js +148 -0
  44. package/server/lib/deploy/runners/secrets-runner.js +174 -0
  45. package/server/lib/deploy/runners/secrets-runner.test.js +127 -0
  46. package/server/lib/deploy/security-gates.js +11 -24
  47. package/server/lib/deploy/security-gates.test.js +9 -2
  48. package/server/lib/deploy-engine.js +182 -0
  49. package/server/lib/deploy-engine.test.js +147 -0
  50. package/server/lib/docker-api.js +137 -0
  51. package/server/lib/docker-api.test.js +202 -0
  52. package/server/lib/docker-client.js +297 -0
  53. package/server/lib/docker-client.test.js +308 -0
  54. package/server/lib/input-sanitizer.js +86 -0
  55. package/server/lib/input-sanitizer.test.js +117 -0
  56. package/server/lib/launchd-agent.js +225 -0
  57. package/server/lib/launchd-agent.test.js +185 -0
  58. package/server/lib/memory-api.js +3 -1
  59. package/server/lib/memory-api.test.js +3 -5
  60. package/server/lib/memory-bridge-e2e.test.js +160 -0
  61. package/server/lib/memory-committer.js +18 -4
  62. package/server/lib/memory-committer.test.js +21 -0
  63. package/server/lib/memory-hooks-capture.test.js +69 -4
  64. package/server/lib/memory-hooks-integration.test.js +98 -0
  65. package/server/lib/memory-hooks.js +42 -4
  66. package/server/lib/memory-store-adapter.js +105 -0
  67. package/server/lib/memory-store-adapter.test.js +141 -0
  68. package/server/lib/memory-wiring-e2e.test.js +93 -0
  69. package/server/lib/nginx-config.js +114 -0
  70. package/server/lib/nginx-config.test.js +82 -0
  71. package/server/lib/ollama-health.js +91 -0
  72. package/server/lib/ollama-health.test.js +74 -0
  73. package/server/lib/orchestration/agent-dispatcher.js +114 -0
  74. package/server/lib/orchestration/agent-dispatcher.test.js +110 -0
  75. package/server/lib/orchestration/orchestrator.js +130 -0
  76. package/server/lib/orchestration/orchestrator.test.js +192 -0
  77. package/server/lib/orchestration/tmux-manager.js +101 -0
  78. package/server/lib/orchestration/tmux-manager.test.js +109 -0
  79. package/server/lib/orchestration/worktree-manager.js +132 -0
  80. package/server/lib/orchestration/worktree-manager.test.js +129 -0
  81. package/server/lib/port-guard.js +44 -0
  82. package/server/lib/port-guard.test.js +65 -0
  83. package/server/lib/project-scanner.js +37 -2
  84. package/server/lib/project-scanner.test.js +152 -0
  85. package/server/lib/remember-command.js +2 -0
  86. package/server/lib/remember-command.test.js +23 -0
  87. package/server/lib/review/plan-reviewer.js +260 -0
  88. package/server/lib/review/plan-reviewer.test.js +269 -0
  89. package/server/lib/review/review-schemas.js +173 -0
  90. package/server/lib/review/review-schemas.test.js +152 -0
  91. package/server/lib/security/crypto-utils.test.js +2 -2
  92. package/server/lib/semantic-recall.js +1 -1
  93. package/server/lib/semantic-recall.test.js +17 -0
  94. package/server/lib/ssh-client.js +184 -0
  95. package/server/lib/ssh-client.test.js +127 -0
  96. package/server/lib/vps-api.js +184 -0
  97. package/server/lib/vps-api.test.js +208 -0
  98. package/server/lib/vps-bootstrap.js +124 -0
  99. package/server/lib/vps-bootstrap.test.js +79 -0
  100. package/server/lib/vps-monitor.js +126 -0
  101. package/server/lib/vps-monitor.test.js +98 -0
  102. package/server/lib/workspace-api.js +182 -1
  103. package/server/lib/workspace-api.test.js +474 -0
  104. package/server/package-lock.json +737 -0
  105. package/server/package.json +3 -0
  106. package/server/setup.sh +271 -271
  107. package/dashboard-web/dist/assets/index-Uhc49PE-.css +0 -1
  108. package/dashboard-web/dist/assets/index-W36XHPC5.js +0 -431
  109. package/dashboard-web/dist/assets/index-W36XHPC5.js.map +0 -1
@@ -0,0 +1,214 @@
1
+ # /tlc:e2e-verify - E2E Visual Verification
2
+
3
+ When code is "done", verify it actually works by running e2e tests, taking screenshots, and checking logs. Trust but verify.
4
+
5
+ ## What This Does
6
+
7
+ 1. **Starts the dev server** (if not already running)
8
+ 2. **Runs Playwright e2e tests** to exercise the application
9
+ 3. **Takes screenshots** of key pages/states
10
+ 4. **Reads screenshots visually** to verify UI correctness
11
+ 5. **Checks server and browser console logs** for errors
12
+ 6. **Reports findings** and fixes issues
13
+
14
+ This replaces the manual "let me check if it actually works" step.
15
+
16
+ ## Usage
17
+
18
+ ```
19
+ /tlc:e2e-verify
20
+ /tlc:e2e-verify dashboard # verify specific area
21
+ /tlc:e2e-verify --screenshots # screenshot-heavy mode
22
+ ```
23
+
24
+ ## Process
25
+
26
+ ### Step 1: Ensure Dev Server is Running
27
+
28
+ Check if the server is already up:
29
+
30
+ ```bash
31
+ curl -s http://localhost:3148/health || curl -s http://localhost:3148/ 2>/dev/null
32
+ curl -s http://localhost:4000/ 2>/dev/null
33
+ ```
34
+
35
+ If not running:
36
+ - Start the TLC server: `node server/index.js &` (port from `.tlc.json`)
37
+ - Start the dashboard dev server if needed: `cd dashboard-web && npm run dev &`
38
+ - Wait for both to be ready (poll health endpoints)
39
+
40
+ ### Step 2: Run Existing E2E Tests
41
+
42
+ Check which Playwright config applies:
43
+ - Root: `playwright.config.ts` (server e2e, baseURL `localhost:3147`)
44
+ - Dashboard: `dashboard-web/playwright.config.ts` (dashboard e2e, baseURL `localhost:4000`)
45
+
46
+ Run the relevant tests:
47
+
48
+ ```bash
49
+ npx playwright test --reporter=list
50
+ ```
51
+
52
+ - Capture stdout/stderr
53
+ - Note any failures
54
+
55
+ ### Step 3: Take Screenshots
56
+
57
+ Use Playwright to screenshot key pages. Create a temporary test script if no existing screenshots cover the area:
58
+
59
+ ```bash
60
+ npx playwright test --project=chromium --reporter=list
61
+ ```
62
+
63
+ For targeted screenshots, use Playwright's screenshot API via a quick script:
64
+
65
+ ```javascript
66
+ // Save to /tmp/tlc-screenshots/
67
+ const { chromium } = require('playwright');
68
+ const browser = await chromium.launch();
69
+ const page = await browser.newPage();
70
+
71
+ // Screenshot key pages
72
+ await page.goto('http://localhost:4000');
73
+ await page.screenshot({ path: '/tmp/tlc-screenshots/dashboard-home.png', fullPage: true });
74
+
75
+ // Login flow
76
+ await page.goto('http://localhost:4000/login');
77
+ await page.screenshot({ path: '/tmp/tlc-screenshots/login.png', fullPage: true });
78
+
79
+ // After login
80
+ await page.fill('[data-testid="email"]', 'user@local.com');
81
+ await page.fill('[data-testid="password"]', '2026rocks');
82
+ await page.click('[data-testid="login-btn"]');
83
+ await page.waitForURL('**/dashboard**');
84
+ await page.screenshot({ path: '/tmp/tlc-screenshots/after-login.png', fullPage: true });
85
+ ```
86
+
87
+ Adapt the script based on what was changed — screenshot the areas affected by recent work.
88
+
89
+ ### Step 4: Visual Inspection
90
+
91
+ **Read each screenshot using the Read tool** (Claude is multimodal and can see images).
92
+
93
+ For each screenshot, check:
94
+ - **Layout**: Is the page rendering correctly? No overlapping elements, broken grids?
95
+ - **Content**: Is text readable? Are labels correct? No "undefined" or "[object Object]"?
96
+ - **State**: Are loading states resolved? No spinners stuck? No empty states where data should be?
97
+ - **Errors**: Any visible error messages, red banners, or console error overlays?
98
+ - **Styling**: Does it look intentional? No broken CSS, missing icons, or unstyled elements?
99
+
100
+ ### Step 5: Check Logs
101
+
102
+ **Server logs:**
103
+ ```bash
104
+ # Check for errors in server output
105
+ # If server was started with output capture, read the log file
106
+ cat /tmp/tlc-server.log 2>/dev/null | grep -i "error\|warn\|fail" | tail -20
107
+ ```
108
+
109
+ **Browser console:**
110
+ - Playwright captures console messages — check test output for console errors
111
+ - Look for: uncaught exceptions, failed network requests, React/Vue warnings
112
+
113
+ **Network requests:**
114
+ - Check for failed API calls (4xx, 5xx responses)
115
+ - Check for CORS errors
116
+ - Check for slow responses (>2s)
117
+
118
+ ### Step 6: Report and Fix
119
+
120
+ **If everything looks good:**
121
+ ```
122
+ ✅ E2E Verification Complete
123
+
124
+ Screenshots reviewed:
125
+ - Dashboard home: ✅ Renders correctly
126
+ - Login page: ✅ Form visible, styled correctly
127
+ - After login: ✅ Dashboard loads with data
128
+
129
+ Logs: No errors found
130
+ Tests: 12/12 passing
131
+
132
+ Code is verified.
133
+ ```
134
+
135
+ **If issues found:**
136
+ ```
137
+ ⚠️ E2E Verification Found Issues
138
+
139
+ 1. Dashboard home: Table header misaligned on narrow viewport
140
+ 2. Server log: "Warning: deprecated API endpoint /api/v1/stats called"
141
+ 3. Console: "Failed to load resource: 404 /api/fonts/inter.woff2"
142
+
143
+ Fixing...
144
+ ```
145
+
146
+ Then fix each issue:
147
+ - Read the relevant source files
148
+ - Apply fixes
149
+ - Re-run the verification for the fixed areas
150
+ - Loop until clean
151
+
152
+ ### Step 7: Final Confirmation
153
+
154
+ After all fixes:
155
+ - Re-run full e2e suite
156
+ - Take fresh screenshots of fixed areas
157
+ - Confirm visually
158
+ - Report final status
159
+
160
+ ## Screenshot Locations
161
+
162
+ Screenshots are saved to `/tmp/tlc-screenshots/` for the session. Clean up after verification.
163
+
164
+ ## Guard Rails
165
+
166
+ - **Don't skip failures.** Every visual anomaly and log error gets investigated.
167
+ - **Don't change tests to match broken UI.** Fix the UI.
168
+ - **Clean up temp files.** Remove screenshot scripts and temp screenshots when done.
169
+ - **Respect server state.** Don't kill servers that were already running before verification.
170
+
171
+ ## Example
172
+
173
+ ```
174
+ > /tlc:e2e-verify
175
+
176
+ Checking servers...
177
+ Server (3148): ✅ running
178
+ Dashboard (4000): ✅ running
179
+
180
+ Running e2e tests...
181
+ 12/12 passing ✅
182
+
183
+ Taking screenshots...
184
+ 📸 /dashboard — captured
185
+ 📸 /login — captured
186
+ 📸 /settings — captured
187
+ 📸 /phases — captured
188
+
189
+ Reviewing screenshots...
190
+ /dashboard: ✅ Layout correct, data loading, no errors
191
+ /login: ✅ Form renders, labels correct
192
+ /settings: ⚠️ Theme toggle shows "undefined" label
193
+ /phases: ✅ Phase list renders correctly
194
+
195
+ Checking logs...
196
+ Server: ✅ No errors
197
+ Console: ⚠️ "Cannot read property 'label' of undefined" on /settings
198
+
199
+ Found 1 issue: Theme toggle label is undefined.
200
+ Reading settings component...
201
+
202
+ Fixed: Added fallback label for theme toggle.
203
+ Re-verifying /settings... ✅ Label now shows "Dark Mode"
204
+
205
+ ✅ E2E Verification Complete — all clear.
206
+ ```
207
+
208
+ ## When to Use
209
+
210
+ - After `/tlc:build` completes a phase
211
+ - After `/tlc:watchci` reports green
212
+ - Before marking a phase as verified (`/tlc:verify`)
213
+ - Any time you want visual proof that the app works
214
+ - Combine with `/tlc:watchci`: build → push → watchci → e2e-verify
@@ -0,0 +1,191 @@
1
+ # /tlc:guard - TLC Process Guard
2
+
3
+ Validates that TLC planning and building were done properly. Catches process shortcuts before they become problems.
4
+
5
+ ## What This Does
6
+
7
+ 1. **Checks planning quality** — phase files exist, tasks are properly broken down, acceptance criteria present
8
+ 2. **Checks build quality** — test-first was followed, coverage exists, no implementation without tests
9
+ 3. **Reports violations** with specific fixes
10
+ 4. **Optionally auto-fixes** structural issues
11
+
12
+ Run this before marking anything as "done."
13
+
14
+ ## Usage
15
+
16
+ ```
17
+ /tlc:guard
18
+ /tlc:guard plan 42 # check planning for phase 42
19
+ /tlc:guard build 42 # check build compliance for phase 42
20
+ /tlc:guard --fix # auto-fix what can be fixed
21
+ ```
22
+
23
+ ## Planning Guard
24
+
25
+ ### What Gets Checked
26
+
27
+ Read `.planning/phases/{N}-PLAN.md` and validate:
28
+
29
+ **Structure (required):**
30
+ - [ ] Phase file exists at `.planning/phases/{N}-PLAN.md`
31
+ - [ ] Has a clear title with phase number
32
+ - [ ] Has a goal/objective section
33
+ - [ ] Has task breakdown (not just a wall of text)
34
+
35
+ **Task Quality (required):**
36
+ - [ ] Each task has a checkbox marker (`[ ]`, `[>@user]`, or `[x@user]`)
37
+ - [ ] Tasks are small enough to implement in one sitting (no mega-tasks)
38
+ - [ ] Tasks have acceptance criteria or clear "done" definition
39
+ - [ ] Tasks are ordered by dependency (prerequisites first)
40
+
41
+ **Completeness (recommended):**
42
+ - [ ] Technical approach is specified (not just "build X")
43
+ - [ ] File paths are mentioned where relevant
44
+ - [ ] Edge cases are considered
45
+ - [ ] No vague tasks like "improve performance" or "fix bugs" (too broad)
46
+
47
+ ### Planning Violations
48
+
49
+ ```
50
+ /tlc:guard plan 42
51
+
52
+ Checking phase 42 plan...
53
+
54
+ ❌ VIOLATIONS:
55
+ 1. Task 3 has no acceptance criteria: "Implement auth module"
56
+ → Add: what endpoints, what auth method, what response format?
57
+
58
+ 2. Task 5 is too broad: "Handle all error cases"
59
+ → Break into specific error scenarios
60
+
61
+ 3. No dependency ordering — Task 4 depends on Task 2 but comes first
62
+
63
+ ⚠️ WARNINGS:
64
+ 1. No file paths mentioned — harder to review later
65
+ 2. Task 1 and Task 6 look like they could be one task
66
+
67
+ Fix these before running /tlc:build.
68
+ ```
69
+
70
+ ## Build Guard
71
+
72
+ ### What Gets Checked
73
+
74
+ For a phase that's been (partially) built, verify TLC compliance:
75
+
76
+ **Test-First (critical):**
77
+ - [ ] Test files exist for all implemented source files
78
+ - [ ] Git log shows test commits BEFORE implementation commits (check timestamps and diffs)
79
+ - [ ] No source file was added without a corresponding test file in the same or earlier commit
80
+
81
+ **Coverage:**
82
+ - [ ] Run tests and check they all pass
83
+ - [ ] Coverage meets threshold from `.tlc.json` (default 80%)
84
+ - [ ] New code specifically has coverage (not just overall project average)
85
+
86
+ **Code Quality:**
87
+ - [ ] No `console.log` debugging left in production code
88
+ - [ ] No `TODO` or `FIXME` comments that should be tracked as tasks
89
+ - [ ] No hardcoded secrets, URLs, or credentials (check for patterns)
90
+ - [ ] No skipped tests (`.skip`, `xit`, `xdescribe`)
91
+
92
+ **Process:**
93
+ - [ ] Phase plan exists and tasks are checked off
94
+ - [ ] Implementation matches what was planned (no scope creep)
95
+ - [ ] Commits reference the phase/task they belong to
96
+
97
+ ### Build Violations
98
+
99
+ ```
100
+ /tlc:guard build 42
101
+
102
+ Checking phase 42 build compliance...
103
+
104
+ ❌ VIOLATIONS:
105
+ 1. TEST-FIRST BREACH: server/lib/auth/auth.service.js was committed
106
+ BEFORE server/lib/auth/auth.test.js
107
+ → Commits: abc123 (service) came before def456 (test)
108
+
109
+ 2. MISSING TEST: server/lib/auth/token-utils.js has no test file
110
+ → Expected: server/lib/auth/token-utils.test.js
111
+
112
+ 3. SKIPPED TEST: server/lib/auth/auth.test.js line 45 — test.skip()
113
+ → Either fix the test or remove it
114
+
115
+ ⚠️ WARNINGS:
116
+ 1. console.log found in server/lib/auth/auth.service.js:23
117
+ 2. TODO comment in server/lib/auth/auth.service.js:67
118
+ 3. Coverage for new files: 72% (below 80% threshold)
119
+
120
+ Run /tlc:autofix to resolve skipped tests.
121
+ ```
122
+
123
+ ## Auto-Fix Mode
124
+
125
+ With `--fix`, the guard can resolve some issues automatically:
126
+
127
+ **Can auto-fix:**
128
+ - Remove `console.log` statements (non-intentional ones)
129
+ - Convert `TODO`/`FIXME` to tasks in the phase plan
130
+ - Create skeleton test files for untested source files
131
+ - Fix task checkbox formatting in plan files
132
+
133
+ **Cannot auto-fix (reports only):**
134
+ - Test-first order violations (that ship has sailed)
135
+ - Missing acceptance criteria (needs human input)
136
+ - Scope creep (needs human judgment)
137
+ - Low coverage (needs more test cases written)
138
+
139
+ ## Combined Guard
140
+
141
+ Running `/tlc:guard` without arguments checks everything for the current/latest phase:
142
+
143
+ ```
144
+ /tlc:guard
145
+
146
+ Detecting current phase... Phase 42: Auth Module
147
+
148
+ === PLANNING GUARD ===
149
+ ✅ Plan structure: OK
150
+ ✅ Task breakdown: 6 tasks, all with criteria
151
+ ⚠️ Task 5 seems broad — consider splitting
152
+
153
+ === BUILD GUARD ===
154
+ ✅ Test-first: All tests committed before implementation
155
+ ✅ Coverage: 87% (above 80% threshold)
156
+ ❌ 1 skipped test found
157
+ ⚠️ 2 console.log statements
158
+
159
+ Overall: 1 violation, 3 warnings
160
+
161
+ Run /tlc:guard --fix to auto-resolve what's possible.
162
+ ```
163
+
164
+ ## Integration with Other Commands
165
+
166
+ This guard should be consulted:
167
+ - **Before `/tlc:verify`** — don't verify code that wasn't built properly
168
+ - **Before `/tlc:complete`** — don't complete a milestone with process violations
169
+ - **After `/tlc:build`** — as a final check before moving on
170
+ - **After `/tlc:plan`** — validate the plan before building
171
+
172
+ ## Example Full Flow
173
+
174
+ ```
175
+ /tlc:plan 42 # Create the plan
176
+ /tlc:guard plan 42 # Validate the plan ← catches bad plans early
177
+ /tlc:build 42 # Build test-first
178
+ /tlc:guard build 42 # Validate the build ← catches process shortcuts
179
+ /tlc:e2e-verify # Visual verification
180
+ /tlc:watchci # CI verification
181
+ /tlc:verify 42 # Human acceptance
182
+ /tlc:complete # Mark done
183
+ ```
184
+
185
+ ## When to Use
186
+
187
+ - After planning, before building
188
+ - After building, before verification
189
+ - When you suspect process was skipped
190
+ - As a pre-push check
191
+ - When onboarding — validates that TLC discipline is being followed
@@ -57,6 +57,38 @@ Launches the visual dashboard. Detects where you are, shows what's next.
57
57
  | `/tlc:release` | Release a claimed task |
58
58
  | `/tlc:who` | Show who's working on what |
59
59
 
60
+ ### Plugins (auto-run via hooks)
61
+
62
+ **After `/tlc:build`** (code written):
63
+ guard → preflight → review (Claude + Codex) → if APPROVED → push + PR
64
+
65
+ **After `git push`** (CI triggered):
66
+ watchci (monitor GH Actions) → if green → e2e-verify (screenshots + logs)
67
+
68
+ | Command | What It Does |
69
+ |---------|--------------|
70
+ | `/tlc:guard` | Validates TLC process: plan quality, test-first compliance, coverage thresholds |
71
+ | `/tlc:preflight` | Completeness check — all references, registries, configs, distribution paths |
72
+ | `/tlc:review` | Multi-LLM review gate — Claude + Codex must both APPROVE before push |
73
+ | `/tlc:watchci` | After push: monitors GH Actions, reads failure logs, fixes until green |
74
+ | `/tlc:e2e-verify` | After CI green: Playwright screenshots, visual inspection, log checking |
75
+
76
+ These fire automatically via PostToolUse hooks. You can also invoke them manually.
77
+
78
+ ### Code Quality
79
+
80
+ | Command | What It Does |
81
+ |---------|--------------|
82
+ | `/tlc:review` | Review current branch |
83
+ | `/tlc:review-pr` | Review a pull request |
84
+ | `/tlc:refactor` | Step-by-step standards refactoring |
85
+ | `/tlc:cleanup` | Automatic standards cleanup |
86
+ | `/tlc:audit` | Check coding standards compliance |
87
+ | `/tlc:security` | Security audit |
88
+ | `/tlc:outdated` | Check outdated dependencies |
89
+ | `/tlc:edge-cases` | Generate edge case tests |
90
+ | `/tlc:quality` | Test quality scoring |
91
+
60
92
  ### Enterprise (v1.4+)
61
93
 
62
94
  | Command | What It Does |
@@ -262,9 +262,21 @@ All implementation follows **Red → Green → Refactor**:
262
262
  3. **Refactor**: Clean up while keeping tests green
263
263
  ```
264
264
 
265
- ### 9b. Create Claude Settings for Bash Permissions (Automatic)
265
+ ### 9b. Create Claude Settings with Permissions AND Hooks (Automatic)
266
266
 
267
- **Always create `.claude/settings.json` during init.** This is not optional — TLC requires these permissions to run tests, commit, and build without interruption.
267
+ **Always create `.claude/settings.json` during init.** This is not optional — TLC requires permissions for uninterrupted work AND hooks for the plugin system (enforcement, auto-verification, memory capture).
268
+
269
+ **Also create `.claude/hooks/` directory** and copy all hook scripts from the TLC package. The hooks power the plugin system — without them, TLC is commands-only with no automation.
270
+
271
+ Create `.claude/hooks/` with these scripts (copy from the installed TLC package at `~/.claude/hooks/` or from the npm package):
272
+ - `tlc-block-tools.sh` — Blocks non-TLC planning tools (EnterPlanMode, TaskCreate, etc.)
273
+ - `tlc-prompt-guard.sh` — Smart intent detection: parses user message for plan/build/fix/deploy intent and routes to the correct TLC command
274
+ - `tlc-session-init.sh` — Initializes TLC state and ensures server is running
275
+ - `tlc-post-push.sh` — Auto-triggers CI monitoring after `git push`
276
+ - `tlc-post-build.sh` — Auto-triggers guard + e2e verification after build/plan
277
+ - `tlc-capture-exchange.sh` — Captures conversations to team memory
278
+
279
+ Make all hook scripts executable: `chmod +x .claude/hooks/*.sh`
268
280
 
269
281
  Create `.claude/settings.json`:
270
282
 
@@ -272,46 +284,70 @@ Create `.claude/settings.json`:
272
284
  {
273
285
  "permissions": {
274
286
  "allow": [
275
- "Bash(npm *)",
276
- "Bash(npx *)",
277
- "Bash(node *)",
278
- "Bash(git *)",
279
- "Bash(gh *)",
280
- "Bash(ssh *)",
281
- "Bash(scp *)",
282
- "Bash(rsync *)",
283
- "Bash(curl *)",
284
- "Bash(wget *)",
285
- "Bash(docker *)",
286
- "Bash(docker-compose *)",
287
- "Bash(pytest*)",
288
- "Bash(python *)",
289
- "Bash(pip *)",
290
- "Bash(go *)",
291
- "Bash(cargo *)",
292
- "Bash(make *)",
293
- "Bash(cat *)",
294
- "Bash(ls *)",
295
- "Bash(pwd*)",
296
- "Bash(cd *)",
297
- "Bash(mkdir *)",
298
- "Bash(cp *)",
299
- "Bash(mv *)",
300
- "Bash(which *)",
301
- "Bash(echo *)",
302
- "Bash(jq *)",
303
- "Bash(wc *)",
304
- "Bash(head *)",
305
- "Bash(tail *)",
306
- "Bash(sort *)",
307
- "Bash(uniq *)",
308
- "Bash(xargs *)"
287
+ "Bash(npm *)", "Bash(npx *)", "Bash(node *)", "Bash(git *)",
288
+ "Bash(gh *)", "Bash(ssh *)", "Bash(scp *)", "Bash(rsync *)",
289
+ "Bash(curl *)", "Bash(wget *)", "Bash(docker *)", "Bash(docker-compose *)",
290
+ "Bash(pytest*)", "Bash(python *)", "Bash(pip *)", "Bash(go *)",
291
+ "Bash(cargo *)", "Bash(make *)", "Bash(cat *)", "Bash(ls *)",
292
+ "Bash(pwd*)", "Bash(cd *)", "Bash(mkdir *)", "Bash(cp *)",
293
+ "Bash(mv *)", "Bash(which *)", "Bash(echo *)", "Bash(jq *)",
294
+ "Bash(wc *)", "Bash(head *)", "Bash(tail *)", "Bash(sort *)",
295
+ "Bash(uniq *)", "Bash(xargs *)"
309
296
  ]
297
+ },
298
+ "hooks": {
299
+ "PreToolUse": [{
300
+ "matcher": "EnterPlanMode|TaskCreate|TaskUpdate|TaskList|TaskGet|ExitPlanMode",
301
+ "hooks": [{
302
+ "type": "command",
303
+ "command": "bash $CLAUDE_PROJECT_DIR/.claude/hooks/tlc-block-tools.sh",
304
+ "timeout": 5
305
+ }]
306
+ }],
307
+ "UserPromptSubmit": [{
308
+ "hooks": [{
309
+ "type": "command",
310
+ "command": "bash $CLAUDE_PROJECT_DIR/.claude/hooks/tlc-prompt-guard.sh",
311
+ "timeout": 5
312
+ }]
313
+ }],
314
+ "SessionStart": [{
315
+ "hooks": [{
316
+ "type": "command",
317
+ "command": "bash $CLAUDE_PROJECT_DIR/.claude/hooks/tlc-session-init.sh",
318
+ "timeout": 5
319
+ }]
320
+ }],
321
+ "PostToolUse": [
322
+ {
323
+ "matcher": "Bash",
324
+ "hooks": [{
325
+ "type": "command",
326
+ "command": "bash $CLAUDE_PROJECT_DIR/.claude/hooks/tlc-post-push.sh",
327
+ "timeout": 5
328
+ }]
329
+ },
330
+ {
331
+ "matcher": "Skill",
332
+ "hooks": [{
333
+ "type": "command",
334
+ "command": "bash $CLAUDE_PROJECT_DIR/.claude/hooks/tlc-post-build.sh",
335
+ "timeout": 5
336
+ }]
337
+ }
338
+ ],
339
+ "Stop": [{
340
+ "hooks": [{
341
+ "type": "command",
342
+ "command": "bash \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/tlc-capture-exchange.sh",
343
+ "timeout": 30
344
+ }]
345
+ }]
310
346
  }
311
347
  }
312
348
  ```
313
349
 
314
- If `.claude/settings.json` already exists, merge the permissions (don't overwrite user's existing config).
350
+ If `.claude/settings.json` already exists, merge: preserve existing permissions (union), add hooks section if missing (don't overwrite existing hooks).
315
351
 
316
352
  ### 10. Create or Update PROJECT.md
317
353
 
@@ -28,20 +28,35 @@ Interactive setup to configure providers in `.tlc.json`:
28
28
 
29
29
  ### /tlc:llm status
30
30
 
31
- Show current configuration:
31
+ Read from **`.tlc/.router-state.json`** (persistent state) and `.tlc.json` (config):
32
32
 
33
33
  ```
34
+ LLM Router Status
35
+ ══════════════════════════════════════════════
36
+
37
+ State: .tlc/.router-state.json
38
+ Probed: 2026-03-20T02:15:00Z (12 min ago)
39
+ TTL: 3600s (fresh)
40
+
34
41
  Providers:
35
42
  claude ✓ /usr/local/bin/claude [review, code-gen, refactor]
36
43
  codex ✓ /usr/local/bin/codex [review, code-gen]
37
44
  gemini ✗ not found [design, vision]
38
45
 
39
46
  Capabilities:
40
- review → claude, codex (fallback: claude)
41
- code-gen → claude
42
- vision → gemini (unavailable)
47
+ review → claude, codex (fallback: claude) 2/2 available
48
+ code-gen → claude 1/1 available
49
+ vision → gemini (unavailable) 0/1 available
50
+
51
+ Pipeline Integration:
52
+ Post-build review: claude + codex (consensus required)
53
+ Post-push e2e: claude (in-session)
43
54
  ```
44
55
 
56
+ The state file is written by the `SessionStart` hook and re-probed every hour. All skills read from this file — no ad-hoc `which` calls.
57
+
58
+ **Force re-probe:** `/tlc:llm probe` (deletes state file, next skill invocation re-probes)
59
+
45
60
  ### /tlc:llm models
46
61
 
47
62
  List models available from each provider.