tlc-claude-code 2.0.1 → 2.1.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 (86) hide show
  1. package/.claude/commands/tlc/deploy.md +194 -2
  2. package/.claude/commands/tlc/e2e-verify.md +214 -0
  3. package/.claude/commands/tlc/guard.md +191 -0
  4. package/.claude/commands/tlc/help.md +32 -0
  5. package/.claude/commands/tlc/init.md +73 -37
  6. package/.claude/commands/tlc/llm.md +19 -4
  7. package/.claude/commands/tlc/preflight.md +134 -0
  8. package/.claude/commands/tlc/review.md +17 -4
  9. package/.claude/commands/tlc/watchci.md +159 -0
  10. package/.claude/hooks/tlc-block-tools.sh +41 -0
  11. package/.claude/hooks/tlc-capture-exchange.sh +50 -0
  12. package/.claude/hooks/tlc-post-build.sh +38 -0
  13. package/.claude/hooks/tlc-post-push.sh +22 -0
  14. package/.claude/hooks/tlc-prompt-guard.sh +69 -0
  15. package/.claude/hooks/tlc-session-init.sh +123 -0
  16. package/CLAUDE.md +12 -0
  17. package/bin/install.js +171 -2
  18. package/bin/postinstall.js +45 -26
  19. package/dashboard-web/dist/assets/index-CdS5CHqu.css +1 -0
  20. package/dashboard-web/dist/assets/index-CwNPPVpg.js +483 -0
  21. package/dashboard-web/dist/assets/index-CwNPPVpg.js.map +1 -0
  22. package/dashboard-web/dist/index.html +2 -2
  23. package/docker-compose.dev.yml +18 -12
  24. package/package.json +3 -1
  25. package/server/index.js +228 -2
  26. package/server/lib/capture-bridge.js +242 -0
  27. package/server/lib/capture-bridge.test.js +363 -0
  28. package/server/lib/capture-guard.js +140 -0
  29. package/server/lib/capture-guard.test.js +182 -0
  30. package/server/lib/command-runner.js +159 -0
  31. package/server/lib/command-runner.test.js +92 -0
  32. package/server/lib/deploy/runners/dependency-runner.js +106 -0
  33. package/server/lib/deploy/runners/dependency-runner.test.js +148 -0
  34. package/server/lib/deploy/runners/secrets-runner.js +174 -0
  35. package/server/lib/deploy/runners/secrets-runner.test.js +127 -0
  36. package/server/lib/deploy/security-gates.js +11 -24
  37. package/server/lib/deploy/security-gates.test.js +9 -2
  38. package/server/lib/deploy-engine.js +182 -0
  39. package/server/lib/deploy-engine.test.js +147 -0
  40. package/server/lib/docker-api.js +137 -0
  41. package/server/lib/docker-api.test.js +202 -0
  42. package/server/lib/docker-client.js +297 -0
  43. package/server/lib/docker-client.test.js +308 -0
  44. package/server/lib/input-sanitizer.js +86 -0
  45. package/server/lib/input-sanitizer.test.js +117 -0
  46. package/server/lib/launchd-agent.js +225 -0
  47. package/server/lib/launchd-agent.test.js +185 -0
  48. package/server/lib/memory-api.js +3 -1
  49. package/server/lib/memory-api.test.js +3 -5
  50. package/server/lib/memory-bridge-e2e.test.js +160 -0
  51. package/server/lib/memory-committer.js +18 -4
  52. package/server/lib/memory-committer.test.js +21 -0
  53. package/server/lib/memory-hooks-capture.test.js +69 -4
  54. package/server/lib/memory-hooks-integration.test.js +98 -0
  55. package/server/lib/memory-hooks.js +42 -4
  56. package/server/lib/memory-store-adapter.js +105 -0
  57. package/server/lib/memory-store-adapter.test.js +141 -0
  58. package/server/lib/memory-wiring-e2e.test.js +93 -0
  59. package/server/lib/nginx-config.js +114 -0
  60. package/server/lib/nginx-config.test.js +82 -0
  61. package/server/lib/ollama-health.js +91 -0
  62. package/server/lib/ollama-health.test.js +74 -0
  63. package/server/lib/port-guard.js +44 -0
  64. package/server/lib/port-guard.test.js +65 -0
  65. package/server/lib/project-scanner.js +37 -2
  66. package/server/lib/project-scanner.test.js +152 -0
  67. package/server/lib/remember-command.js +2 -0
  68. package/server/lib/remember-command.test.js +23 -0
  69. package/server/lib/security/crypto-utils.test.js +2 -2
  70. package/server/lib/semantic-recall.js +1 -1
  71. package/server/lib/semantic-recall.test.js +17 -0
  72. package/server/lib/ssh-client.js +184 -0
  73. package/server/lib/ssh-client.test.js +127 -0
  74. package/server/lib/vps-api.js +184 -0
  75. package/server/lib/vps-api.test.js +208 -0
  76. package/server/lib/vps-bootstrap.js +124 -0
  77. package/server/lib/vps-bootstrap.test.js +79 -0
  78. package/server/lib/vps-monitor.js +126 -0
  79. package/server/lib/vps-monitor.test.js +98 -0
  80. package/server/lib/workspace-api.js +182 -1
  81. package/server/lib/workspace-api.test.js +474 -0
  82. package/server/package-lock.json +737 -0
  83. package/server/package.json +3 -0
  84. package/dashboard-web/dist/assets/index-Uhc49PE-.css +0 -1
  85. package/dashboard-web/dist/assets/index-W36XHPC5.js +0 -431
  86. package/dashboard-web/dist/assets/index-W36XHPC5.js.map +0 -1
@@ -648,9 +648,199 @@ Add to GitHub deploy keys (read-only):
648
648
  https://github.com/org/repo/settings/keys
649
649
  ```
650
650
 
651
- ### Environment Variables
651
+ ### Secrets Management with HashiCorp Vault
652
652
 
653
- Secrets stored on dev server:
653
+ **Never store secrets in `.env` files, code, or git.** All secrets go through HashiCorp Vault.
654
+
655
+ #### Setup Vault
656
+
657
+ ```
658
+ > /tlc:deploy vault setup
659
+
660
+ HashiCorp Vault Setup
661
+ ════════════════════════════════════════════════
662
+
663
+ Vault address: https://vault.example.com
664
+ Auth method: [token/approle/github] approle
665
+
666
+ Configuring AppRole auth for TLC...
667
+ ✓ Created policy: tlc-deploy-policy
668
+ ✓ Created AppRole: tlc-deploy
669
+ ✓ Role ID: 7c8a9b2d-...
670
+ ✓ Secret ID: (stored in CI secrets)
671
+
672
+ Secrets engine: kv-v2 at secret/tlc/{project}
673
+
674
+ Configuration saved to .tlc.json (no secrets stored)
675
+ ```
676
+
677
+ #### Secret Paths
678
+
679
+ Secrets are organized by environment in Vault:
680
+
681
+ ```
682
+ secret/tlc/{project}/
683
+ ├── dev/
684
+ │ ├── database_url
685
+ │ ├── jwt_secret
686
+ │ ├── slack_webhook
687
+ │ └── github_webhook_secret
688
+ ├── staging/
689
+ │ ├── database_url
690
+ │ ├── jwt_secret
691
+ │ └── api_keys
692
+ └── production/
693
+ ├── database_url
694
+ ├── jwt_secret
695
+ ├── api_keys
696
+ └── ssl_certs
697
+ ```
698
+
699
+ #### Vault Commands
700
+
701
+ ```
702
+ > /tlc:deploy vault set dev/jwt_secret "new-secret-value"
703
+ ✓ Secret stored at secret/tlc/my-app/dev/jwt_secret
704
+
705
+ > /tlc:deploy vault list dev
706
+ Secrets at secret/tlc/my-app/dev/:
707
+ database_url
708
+ jwt_secret
709
+ slack_webhook
710
+ github_webhook_secret
711
+
712
+ > /tlc:deploy vault get dev/jwt_secret
713
+ ✓ Value copied to clipboard (not displayed)
714
+
715
+ > /tlc:deploy vault rotate dev/jwt_secret
716
+ ✓ New secret generated and stored
717
+ ✓ Containers using this secret will be restarted
718
+ ```
719
+
720
+ #### How Containers Get Secrets
721
+
722
+ Secrets are injected at deploy time, never baked into images:
723
+
724
+ ```yaml
725
+ # docker-compose.yml (generated per deployment)
726
+ services:
727
+ app:
728
+ build: ./deployments/${BRANCH}
729
+ environment:
730
+ - VAULT_ADDR=${VAULT_ADDR}
731
+ - VAULT_ROLE_ID=${VAULT_ROLE_ID}
732
+ # Secrets fetched at startup via vault-agent sidecar
733
+ # OR injected via envconsul/consul-template
734
+ ```
735
+
736
+ **Option A: Vault Agent Sidecar (recommended)**
737
+
738
+ ```yaml
739
+ services:
740
+ vault-agent:
741
+ image: hashicorp/vault
742
+ command: vault agent -config=/etc/vault/agent.hcl
743
+ volumes:
744
+ - shared-secrets:/secrets
745
+
746
+ app:
747
+ depends_on: [vault-agent]
748
+ volumes:
749
+ - shared-secrets:/secrets:ro
750
+ environment:
751
+ - ENV_FILE=/secrets/.env
752
+ ```
753
+
754
+ **Option B: envconsul (simpler)**
755
+
756
+ ```dockerfile
757
+ # In app Dockerfile
758
+ RUN curl -fsSL https://releases.hashicorp.com/envconsul/0.13.2/envconsul_0.13.2_linux_amd64.tgz | tar xz
759
+ ENTRYPOINT ["envconsul", "-vault-addr", "$VAULT_ADDR", "-secret", "secret/tlc/${PROJECT}/${ENV}", "npm", "start"]
760
+ ```
761
+
762
+ **Option C: CI-time injection (simplest, for non-production)**
763
+
764
+ ```yaml
765
+ # GitHub Actions
766
+ - name: Fetch secrets from Vault
767
+ uses: hashicorp/vault-action@v3
768
+ with:
769
+ url: ${{ secrets.VAULT_ADDR }}
770
+ method: approle
771
+ roleId: ${{ secrets.VAULT_ROLE_ID }}
772
+ secretId: ${{ secrets.VAULT_SECRET_ID }}
773
+ secrets: |
774
+ secret/data/tlc/${{ env.PROJECT }}/dev database_url | DATABASE_URL;
775
+ secret/data/tlc/${{ env.PROJECT }}/dev jwt_secret | JWT_SECRET;
776
+ ```
777
+
778
+ #### Vault Configuration in .tlc.json
779
+
780
+ ```json
781
+ {
782
+ "deploy": {
783
+ "domain": "project.example.com",
784
+ "vault": {
785
+ "enabled": true,
786
+ "addr": "https://vault.example.com",
787
+ "auth": "approle",
788
+ "secretPath": "secret/tlc/my-app",
789
+ "injection": "vault-agent",
790
+ "environments": ["dev", "staging", "production"]
791
+ }
792
+ }
793
+ }
794
+ ```
795
+
796
+ **No secrets in `.tlc.json`.** Only the Vault address and paths. Role IDs and Secret IDs live in CI secrets or the deploy server's own Vault agent.
797
+
798
+ #### Secret Rotation
799
+
800
+ ```
801
+ > /tlc:deploy vault rotate-all dev
802
+
803
+ Rotating all secrets for dev environment...
804
+ ✓ database_url — rotated (new password generated)
805
+ ✓ jwt_secret — rotated (32-byte random)
806
+ ✓ slack_webhook — skipped (external, rotate manually)
807
+ ✓ github_webhook_secret — rotated
808
+
809
+ Restarting affected containers...
810
+ ✓ dev containers restarted with new secrets
811
+
812
+ Rotation complete. Old secrets invalidated.
813
+ ```
814
+
815
+ #### Migration from .env Files
816
+
817
+ If you have existing `.env` files:
818
+
819
+ ```
820
+ > /tlc:deploy vault migrate
821
+
822
+ Found .env files:
823
+ /opt/tlc-deploy/.env (4 secrets)
824
+ .env.local (2 secrets)
825
+
826
+ Migrating to Vault...
827
+ ✓ JWT_SECRET → secret/tlc/my-app/dev/jwt_secret
828
+ ✓ DATABASE_URL → secret/tlc/my-app/dev/database_url
829
+ ✓ GITHUB_WEBHOOK_SECRET → secret/tlc/my-app/dev/github_webhook_secret
830
+ ✓ SLACK_WEBHOOK_URL → secret/tlc/my-app/dev/slack_webhook
831
+
832
+ Securely deleting .env files...
833
+ ✓ /opt/tlc-deploy/.env shredded
834
+ ✓ .env.local shredded
835
+
836
+ Check .gitignore includes: .env* ✓
837
+
838
+ Migration complete. All secrets now in Vault.
839
+ ```
840
+
841
+ ### Environment Variables (Legacy / Non-Vault)
842
+
843
+ If Vault is not configured, secrets fall back to `.env` files on the deploy server. **This is not recommended for production.**
654
844
 
655
845
  ```bash
656
846
  # /opt/tlc-deploy/.env
@@ -660,6 +850,8 @@ GITHUB_WEBHOOK_SECRET=webhook-secret
660
850
  SLACK_WEBHOOK_URL=https://hooks.slack.com/...
661
851
  ```
662
852
 
853
+ **Warning:** TLC will flag `.env` files containing secrets during `/tlc:security` scans.
854
+
663
855
  ## Cleanup
664
856
 
665
857
  ### Remove old deployments
@@ -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 |