tlc-claude-code 2.4.2 → 2.4.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 (66) hide show
  1. package/.claude/commands/tlc/build.md +75 -5
  2. package/.claude/commands/tlc/discuss.md +174 -123
  3. package/.claude/commands/tlc/e2e-verify.md +1 -1
  4. package/.claude/commands/tlc/plan.md +77 -2
  5. package/.claude/commands/tlc/recall.md +59 -87
  6. package/.claude/commands/tlc/remember.md +76 -71
  7. package/.claude/commands/tlc/review.md +76 -21
  8. package/.claude/commands/tlc/tlc.md +204 -473
  9. package/.claude/hooks/tlc-capture-exchange.sh +50 -21
  10. package/.claude/hooks/tlc-session-init.sh +30 -0
  11. package/CLAUDE.md +6 -5
  12. package/bin/init.js +12 -3
  13. package/package.json +4 -1
  14. package/scripts/dev-link.sh +29 -0
  15. package/scripts/test-package.sh +54 -0
  16. package/scripts/version-sync.js +42 -0
  17. package/scripts/version-sync.test.js +100 -0
  18. package/server/lib/capture/classifier.js +71 -0
  19. package/server/lib/capture/classifier.test.js +71 -0
  20. package/server/lib/capture/claude-capture.js +140 -0
  21. package/server/lib/capture/claude-capture.test.js +152 -0
  22. package/server/lib/capture/codex-capture.js +79 -0
  23. package/server/lib/capture/codex-capture.test.js +161 -0
  24. package/server/lib/capture/codex-event-parser.js +76 -0
  25. package/server/lib/capture/codex-event-parser.test.js +83 -0
  26. package/server/lib/capture/ensure-ready.js +56 -0
  27. package/server/lib/capture/ensure-ready.test.js +135 -0
  28. package/server/lib/capture/envelope.js +77 -0
  29. package/server/lib/capture/envelope.test.js +169 -0
  30. package/server/lib/capture/extractor.js +51 -0
  31. package/server/lib/capture/extractor.test.js +92 -0
  32. package/server/lib/capture/generic-capture.js +96 -0
  33. package/server/lib/capture/generic-capture.test.js +171 -0
  34. package/server/lib/capture/index.js +117 -0
  35. package/server/lib/capture/index.test.js +263 -0
  36. package/server/lib/capture/redactor.js +68 -0
  37. package/server/lib/capture/redactor.test.js +93 -0
  38. package/server/lib/capture/spool-processor.js +155 -0
  39. package/server/lib/capture/spool-processor.test.js +278 -0
  40. package/server/lib/health-check.js +255 -0
  41. package/server/lib/health-check.test.js +243 -0
  42. package/server/lib/model-router.js +11 -2
  43. package/server/lib/model-router.test.js +27 -1
  44. package/server/lib/orchestration/cli-dispatch.js +200 -0
  45. package/server/lib/orchestration/cli-dispatch.test.js +242 -0
  46. package/server/lib/orchestration/codex-orchestrator.js +185 -0
  47. package/server/lib/orchestration/codex-orchestrator.test.js +221 -0
  48. package/server/lib/orchestration/dep-linker.js +61 -0
  49. package/server/lib/orchestration/dep-linker.test.js +174 -0
  50. package/server/lib/orchestration/prompt-builder.js +118 -0
  51. package/server/lib/orchestration/prompt-builder.test.js +200 -0
  52. package/server/lib/orchestration/standalone-compat.js +39 -0
  53. package/server/lib/orchestration/standalone-compat.test.js +144 -0
  54. package/server/lib/orchestration/worktree-manager.js +43 -0
  55. package/server/lib/orchestration/worktree-manager.test.js +50 -0
  56. package/server/lib/router-config.js +18 -3
  57. package/server/lib/router-config.test.js +57 -1
  58. package/server/lib/routing/index.js +34 -0
  59. package/server/lib/routing/index.test.js +33 -0
  60. package/server/lib/routing-command.js +11 -2
  61. package/server/lib/routing-command.test.js +39 -1
  62. package/server/lib/routing-preamble.integration.test.js +319 -0
  63. package/server/lib/routing-preamble.js +34 -11
  64. package/server/lib/routing-preamble.test.js +11 -0
  65. package/server/lib/task-router-config.js +35 -14
  66. package/server/lib/task-router-config.test.js +77 -13
@@ -1,87 +1,59 @@
1
- # /tlc:recall - Semantic Memory Search
2
-
3
- Search your project's memory by meaning. "What did we decide about X?"
4
-
5
- ## Usage
6
-
7
- ```
8
- /tlc:recall <query>
9
- ```
10
-
11
- ## What This Does
12
-
13
- 1. Searches the vector memory store using semantic similarity
14
- 2. Ranks results by: similarity (50%) + recency (25%) + project relevance (25%)
15
- 3. Returns top-5 results with scores, types, and excerpts
16
- 4. Permanent memories get a 1.2x boost in scoring
17
-
18
- ## Options
19
-
20
- ```
21
- /tlc:recall database architecture
22
- /tlc:recall --scope workspace authentication approach
23
- /tlc:recall --type decision deployment strategy
24
- /tlc:recall --limit 10 API design
25
- ```
26
-
27
- | Flag | Values | Default | Description |
28
- |------|--------|---------|-------------|
29
- | `--scope` | `project`, `workspace`, `global` | `project` | Search scope (auto-widens if few results) |
30
- | `--type` | `decision`, `gotcha`, `conversation`, `all` | `all` | Filter by memory type |
31
- | `--limit` | 1-20 | 5 | Maximum results |
32
-
33
- ## Process
34
-
35
- ### Step 1: Parse Query
36
-
37
- Extract the search query and any flags from the arguments.
38
-
39
- ### Step 2: Semantic Search
40
-
41
- 1. Generate embedding for the query
42
- 2. Search vector store for nearest neighbors
43
- 3. Score results: `similarity * 0.5 + recency * 0.25 + projectRelevance * 0.25`
44
- 4. Boost permanent memories by 1.2x
45
- 5. Apply scope, type, and limit filters
46
-
47
- ### Step 3: Display Results
48
-
49
- ```
50
- ## Memory Recall: "database architecture"
51
-
52
- 1. **Use SQLite for vector storage** (92% match) [decision]
53
- Date: 2026-02-09
54
- Zero infrastructure, single file, ships with TLC
55
- Source: memory/decisions/2026-02-09-use-sqlite-for-vector-storage.md
56
-
57
- 2. **[PERMANENT] Always use WAL mode** (87% match) [gotcha]
58
- Date: 2026-02-08
59
- WAL mode required for concurrent reads during indexing
60
- Source: memory/gotchas/2026-02-08-always-use-wal-mode.md
61
-
62
- 3. **Database migration strategy** (81% match) [conversation]
63
- Date: 2026-02-07
64
- Discussed migration approach, decided on schema-first
65
- Source: memory/conversations/2026-02-07-database-migration.md
66
- ```
67
-
68
- ### Step 4: Fallback
69
-
70
- If the vector store is unavailable (Ollama not running, no embeddings):
71
- - Falls back to keyword-based text search
72
- - Shows a notice that semantic search is unavailable
73
-
74
- ## Examples
75
-
76
- ```
77
- /tlc:recall what database should we use
78
- /tlc:recall deployment strategy --scope global
79
- /tlc:recall --type decision authentication
80
- /tlc:recall testing approach --limit 10
81
- ```
82
-
83
- ## Graceful Degradation
84
-
85
- - **No Ollama**: Falls back to text search with keyword matching
86
- - **Empty store**: Shows "No memories indexed yet" with guidance to run `/tlc:remember`
87
- - **No results**: Shows "No matching memories" with search suggestions
1
+ # /tlc:recall - Team Memory Search
2
+
3
+ Search TLC team memory using plain grep. This is intentional: no vector search, no extra services.
4
+
5
+ ## Usage
6
+
7
+ ```text
8
+ /tlc:recall <query>
9
+ ```
10
+
11
+ ## What This Does
12
+
13
+ 1. Searches `.tlc/memory/team/` with `grep -rl "query" .tlc/memory/team/`.
14
+ 2. Looks in both `.tlc/memory/team/decisions/` and `.tlc/memory/team/gotchas/`.
15
+ 3. Shows the file path, date from the filename, and a matching excerpt.
16
+ 4. Uses grep only because it works everywhere.
17
+
18
+ ## Search Rules
19
+
20
+ - Search both `decisions/` and `gotchas/`.
21
+ - Do not use vector search.
22
+ - Do not depend on embeddings, databases, or external services.
23
+ - Prefer simple recursive grep so the command works across projects.
24
+
25
+ ## Process
26
+
27
+ ### Step 1: Find matching files
28
+
29
+ ```bash
30
+ grep -rl "query" .tlc/memory/team/
31
+ ```
32
+
33
+ ### Step 2: Display matches
34
+
35
+ For each matching file, show:
36
+
37
+ - File path
38
+ - Date parsed from the filename prefix
39
+ - A short matching excerpt from the file body
40
+
41
+ ## Example Output
42
+
43
+ ```text
44
+ Memory recall: "utc"
45
+
46
+ File: .tlc/memory/team/decisions/2026-03-28-use-utc-timestamps.md
47
+ Date: 2026-03-28
48
+ Excerpt: Always use UTC timestamps in the database and in exported logs.
49
+
50
+ File: .tlc/memory/team/gotchas/2026-03-21-local-time-breaks-reporting.md
51
+ Date: 2026-03-21
52
+ Excerpt: Local timezone conversion caused reporting drift in scheduled jobs.
53
+ ```
54
+
55
+ ## Notes
56
+
57
+ - If there are no matches, say so directly.
58
+ - Keep excerpts short and relevant.
59
+ - Search TLC memory under `.tlc/memory/team/`, not Claude-managed memory.
@@ -1,71 +1,76 @@
1
- # /tlc:remember - Permanent Memory Capture
2
-
3
- Save important context permanently so it survives context compaction.
4
-
5
- ## Usage
6
-
7
- ```
8
- /tlc:remember <text>
9
- ```
10
-
11
- Or without arguments to capture recent exchanges:
12
- ```
13
- /tlc:remember
14
- ```
15
-
16
- ## What This Does
17
-
18
- 1. Captures the provided text (or recent conversation) as a **permanent memory**
19
- 2. Writes it to `memory/conversations/` with `[PERMANENT]` prefix and `permanent: true` frontmatter
20
- 3. Indexes it in the vector store for semantic recall
21
- 4. Permanent memories are **never pruned** and get a **1.2x boost** in recall scoring
22
-
23
- ## Process
24
-
25
- ### Step 1: Determine What to Remember
26
-
27
- **With text argument:**
28
- - Use the provided text as the memory content
29
-
30
- **Without arguments:**
31
- - Capture the recent conversation exchanges from the current session
32
- - Generate a summary from the exchanges
33
-
34
- ### Step 2: Write Permanent Memory
35
-
36
- 1. Create a conversation chunk with `permanent: true`
37
- 2. Title prefixed with `[PERMANENT]`
38
- 3. Write to `memory/conversations/YYYY-MM-DD-{slug}.md`
39
- 4. YAML frontmatter includes `permanent: true`
40
-
41
- ### Step 3: Index in Vector Store
42
-
43
- 1. Generate embedding for the memory content
44
- 2. Store in vector database with `permanent = 1` flag
45
- 3. This memory will be boosted 1.2x in future recall searches
46
-
47
- ### Step 4: Confirm
48
-
49
- ```
50
- Remembered permanently: {summary}
51
- File: memory/conversations/2026-02-09-always-use-utc.md
52
- ```
53
-
54
- ## Examples
55
-
56
- ```
57
- /tlc:remember Always use UTC timestamps in the database, never local time
58
-
59
- /tlc:remember The API rate limit is 100 requests per minute per user
60
-
61
- /tlc:remember
62
- (captures recent conversation context)
63
- ```
64
-
65
- ## When to Use
66
-
67
- - **Architecture decisions** that should never be forgotten
68
- - **Environment gotchas** that are hard to rediscover
69
- - **Team conventions** that must be consistent
70
- - **Critical constraints** from stakeholders
71
- - Any knowledge you want to survive across sessions and context compaction
1
+ # /tlc:remember - Team Decision Capture
2
+
3
+ Save an important decision into TLC's shared team memory.
4
+
5
+ ## Usage
6
+
7
+ ```text
8
+ /tlc:remember <decision text>
9
+ ```
10
+
11
+ Or without arguments:
12
+
13
+ ```text
14
+ /tlc:remember
15
+ ```
16
+
17
+ ## What This Does
18
+
19
+ 1. Captures the provided decision text, or extracts decisions from the recent conversation context if no argument is given.
20
+ 2. Writes a markdown file to `.tlc/memory/team/decisions/{date}-{slug}.md`.
21
+ 3. Stores TLC-owned frontmatter for later grep-based recall.
22
+ 4. Never writes to `~/.claude/projects/.../memory/` because that is Claude memory, not TLC memory.
23
+
24
+ ## Write Format
25
+
26
+ Write the decision as a markdown file with YAML frontmatter:
27
+
28
+ ```yaml
29
+ ---
30
+ provider: claude
31
+ source: manual
32
+ timestamp: 2026-03-28T12:34:56Z
33
+ type: decision
34
+ scope: team
35
+ ---
36
+ ```
37
+
38
+ The filename must be:
39
+
40
+ ```text
41
+ .tlc/memory/team/decisions/{date}-{slug}.md
42
+ ```
43
+
44
+ Example:
45
+
46
+ ```text
47
+ .tlc/memory/team/decisions/2026-03-28-use-utc-timestamps.md
48
+ ```
49
+
50
+ ## Process
51
+
52
+ ### With an argument
53
+
54
+ - Use the argument as the decision content.
55
+ - Generate a short slug from the decision.
56
+ - Write the file under `.tlc/memory/team/decisions/`.
57
+
58
+ ### Without an argument
59
+
60
+ - Review the recent conversation context.
61
+ - Extract concrete decisions, conventions, or constraints worth preserving.
62
+ - Summarize them clearly.
63
+ - Write one decision file under `.tlc/memory/team/decisions/`.
64
+
65
+ ## Confirmation
66
+
67
+ ```text
68
+ Remembered: {summary}
69
+ File: .tlc/memory/team/decisions/2026-03-28-use-utc-timestamps.md
70
+ ```
71
+
72
+ ## Notes
73
+
74
+ - Prefer concise, durable statements over raw transcript dumps.
75
+ - Record decisions, not general chatter.
76
+ - Use `.tlc/memory/team/gotchas/` for gotchas, not this command.
@@ -127,7 +127,7 @@ TLC automatically uses ALL providers configured for the `review` capability in `
127
127
 
128
128
  **With this config, `/tlc:review` will:**
129
129
  1. Run Claude's review (current session)
130
- 2. Invoke Codex CLI for second opinion: `codex "Review this diff: ..."`
130
+ 2. Invoke Codex CLI for second opinion: `codex exec review --base main -m gpt-5.4 --json --ephemeral`
131
131
  3. Combine verdicts - both must approve for APPROVED
132
132
 
133
133
  ## Usage
@@ -295,31 +295,86 @@ Coding Standards:
295
295
 
296
296
  **Fail if:** Any `any` types in new code, or files >1000 lines.
297
297
 
298
- ### Step 6: Invoke External Providers (Codex, Gemini)
298
+ ### Step 6: Invoke External Providers (Codex, Gemini)
299
299
 
300
300
  **CRITICAL: This step runs automatically when providers are configured.**
301
301
 
302
302
  For each provider in `reviewProviders` (except `claude` which is the current session):
303
303
 
304
- **How to invoke:**
305
-
306
- **Codex** — use its built-in `review` subcommand. It reads the git diff natively, no need to pipe files:
307
-
308
- ```bash
309
- # Review current branch against main (default)
310
- codex review --base main "Focus on: bugs, security issues, missing edge cases, test coverage gaps. End with APPROVED or CHANGES_REQUESTED."
311
-
312
- # Review uncommitted changes only
313
- codex review --uncommitted
314
-
315
- # Review a specific commit
316
- codex review --commit <sha>
317
-
318
- # Custom instructions via prompt
319
- codex review --base main "Check for TDD compliance: were tests written before implementation? Flag any implementation without corresponding test files."
320
- ```
321
-
322
- `codex review` outputs a structured review to stdout. No `--print` flag needed — it's already non-interactive.
304
+ **How to invoke:**
305
+
306
+ **Codex** — use `codex exec review` with explicit model selection, JSON output, and `--ephemeral` for CI-style stateless runs. It reads the git diff natively, no need to pipe files.
307
+
308
+ Before invoking Codex, compute diff stats:
309
+
310
+ ```bash
311
+ FILES=$(git diff --name-only main...HEAD | wc -l)
312
+ LINES=$(git diff --stat main...HEAD | tail -1 | grep -oE '[0-9]+ insertion|[0-9]+ deletion' | grep -oE '[0-9]+' | paste -sd+ | bc)
313
+ ```
314
+
315
+ **Size-aware Codex review strategy:**
316
+
317
+ **Small diff (`<=15` files, `<=1200` lines):**
318
+
319
+ Single pass:
320
+
321
+ ```bash
322
+ codex exec review --base main -m gpt-5.4 --json --ephemeral
323
+ ```
324
+
325
+ **Medium diff (`15-25` files, `1200-2500` lines):**
326
+
327
+ Two passes:
328
+
329
+ 1. Broad pass:
330
+ ```bash
331
+ codex exec review --base main -m gpt-5.4 --json --ephemeral
332
+ ```
333
+ 2. Focused pass on the highest-risk area via `codex exec` with a targeted prompt:
334
+ ```bash
335
+ codex exec -m gpt-5.4 --json --ephemeral "Review the changes against main. Focus only on these files: <highest-risk file list>. Focus only on: correctness bugs, behavioral regressions, broken assumptions across module boundaries, missing validation/auth/error handling, schema/API compatibility. Do not spend time on style or naming. Prefer findings with: severity, why it is a bug, exact file/line, minimal breaking scenario."
336
+ ```
337
+
338
+ **Large diff (`25+` files, `2500+` lines):**
339
+
340
+ Multi-pass:
341
+
342
+ 1. Per-commit:
343
+ ```bash
344
+ codex exec review --commit <sha> -m gpt-5.4 --json --ephemeral
345
+ ```
346
+ Run once for each non-merge commit.
347
+ 2. Per-area:
348
+ Chunk by directory, then run `codex exec` with a prompt listing the chunk files:
349
+ ```bash
350
+ codex exec -m gpt-5.4 --json --ephemeral "Review the changes against main. Focus only on these files: <chunk file list>. Focus only on: correctness bugs, behavioral regressions, broken assumptions across module boundaries, missing validation/auth/error handling, schema/API compatibility. Do not spend time on style or naming. Prefer findings with: severity, why it is a bug, exact file/line, minimal breaking scenario."
351
+ ```
352
+ 3. Integration sweep:
353
+ ```bash
354
+ codex exec -m gpt-5.4 --json --ephemeral "Review the full diff against main but do not re-check every local edit. Focus only on cross-file regressions: changed call sites vs function contracts, schema changes vs readers/writers, auth/permission drift, partial migrations."
355
+ ```
356
+
357
+ **Confidence escalation:**
358
+
359
+ - Finding repeated across passes -> high confidence
360
+ - Finding from only one broad pass -> medium confidence
361
+ - Zero findings on huge diff -> LOW CONFIDENCE (not "clean"); flag for human review
362
+
363
+ **Prompt templates:**
364
+
365
+ Per-commit/per-area prompt:
366
+
367
+ ```text
368
+ Review the changes against main. Focus only on: correctness bugs, behavioral regressions, broken assumptions across module boundaries, missing validation/auth/error handling, schema/API compatibility. Do not spend time on style or naming. Prefer findings with: severity, why it is a bug, exact file/line, minimal breaking scenario.
369
+ ```
370
+
371
+ Integration sweep prompt:
372
+
373
+ ```text
374
+ Review the full diff against main but do not re-check every local edit. Focus only on cross-file regressions: changed call sites vs function contracts, schema changes vs readers/writers, auth/permission drift, partial migrations.
375
+ ```
376
+
377
+ Use `codex exec review`, not plain `codex review`, for better automation controls. Always include `-m gpt-5.4`, `--json`, and `--ephemeral` in automated runs.
323
378
 
324
379
  **Gemini** — no built-in review command, so save diff and invoke:
325
380