tlc-claude-code 2.4.8 → 2.4.10
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.
|
@@ -57,6 +57,11 @@ Run `auditProject(projectPath)` which executes:
|
|
|
57
57
|
| **Secrets in Responses** | Response objects containing fields named `apiKey`, `secret`, `token`, `password` | error |
|
|
58
58
|
| **Manual Instantiation** | `new .*Provider(` or `new .*Service(` in application code | warning |
|
|
59
59
|
| **Missing Ownership Check** | Controller methods with `@Param('id')` but no ownership/authorization guard | warning |
|
|
60
|
+
| **Empty Catch Blocks** | `catch (e) {}` or `catch { }` with no logging or rethrow | error |
|
|
61
|
+
| **Silent Error Returns** | `catch (e) { return null/undefined/false }` without logging | error |
|
|
62
|
+
| **Missing Error Handling** | External calls (HTTP, DB, Docker, file I/O, spawn) without try/catch | error |
|
|
63
|
+
| **No Connection Logging** | DB/Redis/WebSocket/Docker connections without connect/disconnect/error logging | warning |
|
|
64
|
+
| **Bare console.log Errors** | `console.log(error)` instead of structured logging with context | warning |
|
|
60
65
|
|
|
61
66
|
### Step 3: Generate Report
|
|
62
67
|
|
|
@@ -210,19 +210,25 @@ function processOrder(order) {
|
|
|
210
210
|
- **JSDoc for public API**: Parameters, returns, throws, examples.
|
|
211
211
|
- **No obvious comments**: `// increment i` before `i++` is noise.
|
|
212
212
|
|
|
213
|
-
### Error Handling
|
|
213
|
+
### Error Handling (Zero Silent Failures)
|
|
214
|
+
- **Every catch block must be visible**: Log with context OR rethrow. No exceptions.
|
|
214
215
|
- **Specific error types**: `UserNotFoundError` not generic `Error`.
|
|
215
|
-
- **Actionable messages**: "User 'abc123' not found" not "Not found".
|
|
216
|
-
- **Don't swallow errors**: Log or rethrow, never empty catch blocks.
|
|
216
|
+
- **Actionable messages**: "User 'abc123' not found in database 'users'" not "Not found".
|
|
217
|
+
- **Don't swallow errors**: Log or rethrow, never empty catch blocks. This is the #1 cause of production bugs.
|
|
217
218
|
- **Error boundaries**: Catch at appropriate level, not everywhere.
|
|
218
219
|
- **User vs developer errors**: Different messages for each audience.
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
- **
|
|
223
|
-
- **
|
|
220
|
+
- **External calls MUST have error handling**: HTTP, DB, Docker, file I/O, CLI spawn — every one gets try/catch with logging.
|
|
221
|
+
|
|
222
|
+
### Observability (CRITICAL — silent failures are unacceptable)
|
|
223
|
+
- **No empty catch blocks**: Every `catch` must log with context OR rethrow. `catch (e) {}` is never acceptable.
|
|
224
|
+
- **No silent returns**: `catch (e) { return null }` without logging is a bug. Log first, then return.
|
|
225
|
+
- **Structured logging**: JSON format: `{ level, message, context, error, timestamp }`.
|
|
226
|
+
- **Log levels**: ERROR (failures needing attention), WARN (degraded but working), INFO (business events), DEBUG (troubleshooting).
|
|
227
|
+
- **Context in every log**: Include what operation failed, what inputs caused it, what the caller should know.
|
|
228
|
+
- **Connection state logging**: Every external connection (DB, Redis, Docker, WebSocket, HTTP client, queue) must log: connect, disconnect, reconnect, and failure. Connection state changes are INFO level, not DEBUG.
|
|
229
|
+
- **Startup health**: Log the state of every dependency on startup. "Connected to Postgres", "Docker socket accessible", "Redis: connection refused". Never start silently.
|
|
224
230
|
- **No sensitive data**: Never log passwords, tokens, PII.
|
|
225
|
-
- **Performance**: Don't log in tight loops.
|
|
231
|
+
- **Performance**: Don't log in tight loops. Do log every error, even in loops.
|
|
226
232
|
|
|
227
233
|
### Performance Awareness
|
|
228
234
|
- **O(n) thinking**: Know the complexity of your algorithms. Avoid nested loops on large datasets.
|
|
@@ -868,20 +874,22 @@ git diff --name-status main...HEAD
|
|
|
868
874
|
|
|
869
875
|
**Checks performed:**
|
|
870
876
|
|
|
871
|
-
1. **
|
|
872
|
-
2. **
|
|
873
|
-
3. **
|
|
874
|
-
4. **
|
|
875
|
-
5. **
|
|
876
|
-
6. **
|
|
877
|
-
7. **
|
|
878
|
-
8. **
|
|
879
|
-
9. **
|
|
880
|
-
10. **
|
|
881
|
-
11. **
|
|
882
|
-
12. **
|
|
883
|
-
13. **
|
|
884
|
-
14. **
|
|
877
|
+
1. **Silent Failure Scan (CRITICAL)** - No empty catch blocks. Every catch must log with context OR rethrow. `catch (e) {}` and `catch (e) { return null }` without logging are **auto-rejected**. Every external call (HTTP, DB, Docker, CLI, file I/O) must have error handling that produces an observable signal (log, metric, or rethrow).
|
|
878
|
+
2. **Error Logging** - Every error path must use structured logging: `{ level, message, context, error }`. No bare `console.log` for errors — use a logger with level + context. No `console.error` without identifying WHAT failed and WHERE.
|
|
879
|
+
3. **Test Coverage** - Every implementation file has a test file
|
|
880
|
+
4. **TDD Compliance** - Commits show test-first pattern (score ≥ 50%)
|
|
881
|
+
5. **Security Scan** - No hardcoded secrets, eval(), innerHTML, etc.
|
|
882
|
+
6. **Authorization** - Every data-access endpoint has ownership checks, not just auth guards
|
|
883
|
+
7. **Secrets Exposure** - No API keys, tokens, or passwords returned in responses/HTML
|
|
884
|
+
8. **Config Hygiene** - No `process.env` outside config module; config validated at startup
|
|
885
|
+
9. **Output Encoding** - No unescaped `${...}` interpolation in HTML template strings
|
|
886
|
+
10. **Sensitive Data** - OTPs, reset tokens, session secrets are hashed before storage
|
|
887
|
+
11. **DI Compliance** - No manual `new Service()` / `new Provider()` in application code
|
|
888
|
+
12. **File Size** - No file exceeds 1000 lines (warning at 500+)
|
|
889
|
+
13. **Folder Size** - No folder exceeds 15 files (warning at 8+)
|
|
890
|
+
14. **Strict Typing** - No `any` types in new/changed files
|
|
891
|
+
15. **Return Types** - All exported functions have explicit return types
|
|
892
|
+
16. **Module Structure** - Files grouped by domain entity, not by type
|
|
885
893
|
|
|
886
894
|
**Review output:**
|
|
887
895
|
|
|
@@ -19,6 +19,42 @@ For brand new projects with no code, use `/tlc:new-project` instead.
|
|
|
19
19
|
|
|
20
20
|
## Process
|
|
21
21
|
|
|
22
|
+
### 0. Upgrade Check (runs first, always)
|
|
23
|
+
|
|
24
|
+
**Before anything else**, check if this is already a TLC project:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Check for existing TLC markers
|
|
28
|
+
if [ -f ".tlc.json" ] || [ -f "CLAUDE.md" ] || [ -d ".claude/hooks" ]; then
|
|
29
|
+
# This is an existing TLC project — run upgrade path
|
|
30
|
+
fi
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**If `.tlc.json` exists**, this is a **re-init / upgrade**. Do the following automatically:
|
|
34
|
+
|
|
35
|
+
1. **Compare hook versions**: Read the installed `tlc-claude-code` version (`npm ls -g tlc-claude-code --json 2>/dev/null`). Compare against the hooks currently in `.claude/hooks/`. If the package is newer, **re-copy all hooks** from the package to `.claude/hooks/`, overwriting stale copies.
|
|
36
|
+
|
|
37
|
+
2. **Update CLAUDE.md**: Re-generate the CLAUDE.md template from the latest init template. If the user has customized CLAUDE.md (check for a `<!-- TLC-MANAGED -->` marker at the top), replace only the TLC-managed sections. If no marker, append missing sections (like the memory routing rules) without overwriting user content.
|
|
38
|
+
|
|
39
|
+
3. **Update `.claude/settings.json`**: Merge any new hook entries (like the memory routing enforcement) into the existing settings. Don't remove user-added permissions or hooks.
|
|
40
|
+
|
|
41
|
+
4. **Report what changed**:
|
|
42
|
+
```
|
|
43
|
+
TLC Upgrade (v2.4.5 → v2.4.8)
|
|
44
|
+
───────────────────────────────
|
|
45
|
+
✓ Updated 6 hooks (memory routing, review loop)
|
|
46
|
+
✓ Updated CLAUDE.md (added memory routing rules)
|
|
47
|
+
✓ Updated settings.json (added new hook matchers)
|
|
48
|
+
○ .tlc.json unchanged
|
|
49
|
+
○ PROJECT.md unchanged
|
|
50
|
+
|
|
51
|
+
All up to date. Run /tlc:progress to continue.
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
5. **Then stop** — do not run the full init flow. The project is already set up, we just needed to upgrade the TLC tooling.
|
|
55
|
+
|
|
56
|
+
**If `.tlc.json` does NOT exist**, continue with the full init flow below.
|
|
57
|
+
|
|
22
58
|
### 1. Scan for Existing Code
|
|
23
59
|
|
|
24
60
|
Check for source files:
|
|
@@ -223,6 +259,7 @@ const results = await injectStandards(projectPath);
|
|
|
223
259
|
Create `CLAUDE.md` to enforce TLC workflow over Claude's default behaviors:
|
|
224
260
|
|
|
225
261
|
```markdown
|
|
262
|
+
<!-- TLC-MANAGED: Do not remove this marker. TLC uses it to upgrade this file. -->
|
|
226
263
|
# CLAUDE.md - TLC Project Instructions
|
|
227
264
|
|
|
228
265
|
## Planning System: TLC
|