tlc-claude-code 2.4.7 → 2.4.9

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.
@@ -1,6 +1,6 @@
1
1
  # /tlc:build - Build a Phase (Test-First)
2
2
 
3
- Write failing tests, then implement to make them pass.
3
+ Write failing tests, then implement to make them pass. **Includes auto-review with fix loop** — after implementation, build automatically reviews code (security, coverage, standards), fixes any issues found, and re-reviews until clean (max 5 iterations). You do NOT need to run `/tlc:review` separately after build.
4
4
 
5
5
  ## Routing
6
6
 
@@ -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
@@ -267,7 +304,7 @@ This project uses **TLC (Test-Led Coding)** for all planning and development.
267
304
  |--------|---------|
268
305
  | See status | `/tlc` or `/tlc:progress` |
269
306
  | Plan a phase | `/tlc:plan` |
270
- | Build (test-first) | `/tlc:build` |
307
+ | Build (test-first + auto-review) | `/tlc:build` |
271
308
  | Verify with human | `/tlc:verify` |
272
309
  | Log a bug | `/tlc:bug` |
273
310
  | Remember/log/note | `/tlc:remember` |
@@ -275,10 +312,11 @@ This project uses **TLC (Test-Led Coding)** for all planning and development.
275
312
 
276
313
  ## Test-First Development
277
314
 
278
- All implementation follows **Red → Green → Refactor**:
315
+ All implementation follows **Red → Green → Refactor → Review**:
279
316
  1. **Red**: Write failing tests that define expected behavior
280
317
  2. **Green**: Write minimum code to make tests pass
281
318
  3. **Refactor**: Clean up while keeping tests green
319
+ 4. **Review**: Auto-review checks security, coverage, standards — fixes issues and re-reviews until clean (up to 5 iterations). Built into `/tlc:build`, not a separate step.
282
320
  ```
283
321
 
284
322
  ### 9b. Create Claude Settings with Permissions AND Hooks (Automatic)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tlc-claude-code",
3
- "version": "2.4.7",
3
+ "version": "2.4.9",
4
4
  "description": "TLC - Test Led Coding for Claude Code",
5
5
  "bin": {
6
6
  "tlc-claude-code": "./bin/install.js",