tlc-claude-code 2.3.0 → 2.4.1
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.
- package/.claude/commands/tlc/autofix.md +31 -0
- package/.claude/commands/tlc/build.md +31 -0
- package/.claude/commands/tlc/coverage.md +31 -0
- package/.claude/commands/tlc/discuss.md +31 -0
- package/.claude/commands/tlc/docs.md +31 -0
- package/.claude/commands/tlc/edge-cases.md +31 -0
- package/.claude/commands/tlc/plan.md +31 -0
- package/.claude/commands/tlc/quick.md +31 -0
- package/.claude/commands/tlc/review.md +31 -0
- package/.claude/hooks/tlc-session-init.sh +14 -3
- package/bin/setup-autoupdate.js +316 -87
- package/bin/setup-autoupdate.test.js +454 -34
- package/package.json +1 -1
- package/scripts/project-docs.js +1 -1
- package/server/lib/cli-dispatcher.js +98 -0
- package/server/lib/cli-dispatcher.test.js +249 -0
- package/server/lib/command-router.js +171 -0
- package/server/lib/command-router.test.js +336 -0
- package/server/lib/prompt-packager.js +98 -0
- package/server/lib/prompt-packager.test.js +185 -0
- package/server/lib/routing-command.js +159 -0
- package/server/lib/routing-command.test.js +290 -0
- package/server/lib/task-router-config.js +146 -0
- package/server/lib/task-router-config.test.js +493 -0
- package/server/setup.sh +271 -271
|
@@ -2,6 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
Run tests, analyze failures, and automatically apply fixes for common error patterns.
|
|
4
4
|
|
|
5
|
+
## Routing
|
|
6
|
+
|
|
7
|
+
This command supports multi-model routing via `~/.tlc/config.json`.
|
|
8
|
+
|
|
9
|
+
**Before executing this command:**
|
|
10
|
+
|
|
11
|
+
1. Read routing config:
|
|
12
|
+
```bash
|
|
13
|
+
node -e "
|
|
14
|
+
const { resolveRouting } = require('./server/lib/task-router-config');
|
|
15
|
+
const flagModel = (process.argv.find(a => a.startsWith("--model")) || "").replace("--model=", "").replace("--model ", "") || null;
|
|
16
|
+
const r = resolveRouting({ command: 'autofix', flagModel, projectDir: process.cwd(), homeDir: process.env.HOME });
|
|
17
|
+
console.log(JSON.stringify(r));
|
|
18
|
+
" 2>/dev/null
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
2. If `models[0]` is NOT `claude` (i.e., routed to external model):
|
|
22
|
+
- Read PROJECT.md, current phase PLAN.md, CODING-STANDARDS.md
|
|
23
|
+
- Package the agent prompt below with project context using `prompt-packager`
|
|
24
|
+
- Dispatch to the target CLI using `cli-dispatcher`
|
|
25
|
+
- Display the CLI output and stop — do NOT execute the agent prompt below
|
|
26
|
+
|
|
27
|
+
3. If `models[0]` IS `claude` (or no routing config exists):
|
|
28
|
+
- Execute the agent prompt below as normal (current behavior)
|
|
29
|
+
|
|
30
|
+
4. If `strategy` is `parallel`:
|
|
31
|
+
- Execute inline (Claude) AND dispatch to CLI models simultaneously
|
|
32
|
+
- Collect and merge results
|
|
33
|
+
|
|
34
|
+
**Override:** Pass `--model <name>` to route this specific run to a different model.
|
|
35
|
+
|
|
5
36
|
## What This Does
|
|
6
37
|
|
|
7
38
|
1. Runs test suite and captures failures
|
|
@@ -2,6 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
Write failing tests, then implement to make them pass.
|
|
4
4
|
|
|
5
|
+
## Routing
|
|
6
|
+
|
|
7
|
+
This command supports multi-model routing via `~/.tlc/config.json`.
|
|
8
|
+
|
|
9
|
+
**Before executing this command:**
|
|
10
|
+
|
|
11
|
+
1. Read routing config:
|
|
12
|
+
```bash
|
|
13
|
+
node -e "
|
|
14
|
+
const { resolveRouting } = require('./server/lib/task-router-config');
|
|
15
|
+
const flagModel = (process.argv.find(a => a.startsWith("--model")) || "").replace("--model=", "").replace("--model ", "") || null;
|
|
16
|
+
const r = resolveRouting({ command: 'build', flagModel, projectDir: process.cwd(), homeDir: process.env.HOME });
|
|
17
|
+
console.log(JSON.stringify(r));
|
|
18
|
+
" 2>/dev/null
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
2. If `models[0]` is NOT `claude` (i.e., routed to external model):
|
|
22
|
+
- Read PROJECT.md, current phase PLAN.md, CODING-STANDARDS.md
|
|
23
|
+
- Package the agent prompt below with project context using `prompt-packager`
|
|
24
|
+
- Dispatch to the target CLI using `cli-dispatcher`
|
|
25
|
+
- Display the CLI output and stop — do NOT execute the agent prompt below
|
|
26
|
+
|
|
27
|
+
3. If `models[0]` IS `claude` (or no routing config exists):
|
|
28
|
+
- Execute the agent prompt below as normal (current behavior)
|
|
29
|
+
|
|
30
|
+
4. If `strategy` is `parallel`:
|
|
31
|
+
- Execute inline (Claude) AND dispatch to CLI models simultaneously
|
|
32
|
+
- Collect and merge results
|
|
33
|
+
|
|
34
|
+
**Override:** Pass `--model <name>` to route this specific run to a different model.
|
|
35
|
+
|
|
5
36
|
## Engineering Standards
|
|
6
37
|
|
|
7
38
|
**Code like a senior engineer with 15+ years experience.** Every line should reflect:
|
|
@@ -2,6 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
Scan existing code, identify what's untested, and offer to write retrospective tests.
|
|
4
4
|
|
|
5
|
+
## Routing
|
|
6
|
+
|
|
7
|
+
This command supports multi-model routing via `~/.tlc/config.json`.
|
|
8
|
+
|
|
9
|
+
**Before executing this command:**
|
|
10
|
+
|
|
11
|
+
1. Read routing config:
|
|
12
|
+
```bash
|
|
13
|
+
node -e "
|
|
14
|
+
const { resolveRouting } = require('./server/lib/task-router-config');
|
|
15
|
+
const flagModel = (process.argv.find(a => a.startsWith("--model")) || "").replace("--model=", "").replace("--model ", "") || null;
|
|
16
|
+
const r = resolveRouting({ command: 'coverage', flagModel, projectDir: process.cwd(), homeDir: process.env.HOME });
|
|
17
|
+
console.log(JSON.stringify(r));
|
|
18
|
+
" 2>/dev/null
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
2. If `models[0]` is NOT `claude` (i.e., routed to external model):
|
|
22
|
+
- Read PROJECT.md, current phase PLAN.md, CODING-STANDARDS.md
|
|
23
|
+
- Package the agent prompt below with project context using `prompt-packager`
|
|
24
|
+
- Dispatch to the target CLI using `cli-dispatcher`
|
|
25
|
+
- Display the CLI output and stop — do NOT execute the agent prompt below
|
|
26
|
+
|
|
27
|
+
3. If `models[0]` IS `claude` (or no routing config exists):
|
|
28
|
+
- Execute the agent prompt below as normal (current behavior)
|
|
29
|
+
|
|
30
|
+
4. If `strategy` is `parallel`:
|
|
31
|
+
- Execute inline (Claude) AND dispatch to CLI models simultaneously
|
|
32
|
+
- Collect and merge results
|
|
33
|
+
|
|
34
|
+
**Override:** Pass `--model <name>` to route this specific run to a different model.
|
|
35
|
+
|
|
5
36
|
## When to Use
|
|
6
37
|
|
|
7
38
|
- After `/tlc:init` to add tests to existing code
|
|
@@ -2,6 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
Capture implementation preferences before planning.
|
|
4
4
|
|
|
5
|
+
## Routing
|
|
6
|
+
|
|
7
|
+
This command supports multi-model routing via `~/.tlc/config.json`.
|
|
8
|
+
|
|
9
|
+
**Before executing this command:**
|
|
10
|
+
|
|
11
|
+
1. Read routing config:
|
|
12
|
+
```bash
|
|
13
|
+
node -e "
|
|
14
|
+
const { resolveRouting } = require('./server/lib/task-router-config');
|
|
15
|
+
const flagModel = (process.argv.find(a => a.startsWith("--model")) || "").replace("--model=", "").replace("--model ", "") || null;
|
|
16
|
+
const r = resolveRouting({ command: 'discuss', flagModel, projectDir: process.cwd(), homeDir: process.env.HOME });
|
|
17
|
+
console.log(JSON.stringify(r));
|
|
18
|
+
" 2>/dev/null
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
2. If `models[0]` is NOT `claude` (i.e., routed to external model):
|
|
22
|
+
- Read PROJECT.md, current phase PLAN.md, CODING-STANDARDS.md
|
|
23
|
+
- Package the agent prompt below with project context using `prompt-packager`
|
|
24
|
+
- Dispatch to the target CLI using `cli-dispatcher`
|
|
25
|
+
- Display the CLI output and stop — do NOT execute the agent prompt below
|
|
26
|
+
|
|
27
|
+
3. If `models[0]` IS `claude` (or no routing config exists):
|
|
28
|
+
- Execute the agent prompt below as normal (current behavior)
|
|
29
|
+
|
|
30
|
+
4. If `strategy` is `parallel`:
|
|
31
|
+
- Execute inline (Claude) AND dispatch to CLI models simultaneously
|
|
32
|
+
- Collect and merge results
|
|
33
|
+
|
|
34
|
+
**Override:** Pass `--model <name>` to route this specific run to a different model.
|
|
35
|
+
|
|
5
36
|
## What This Does
|
|
6
37
|
|
|
7
38
|
Gathers your preferences for HOW a phase should be built through adaptive questioning. Saves decisions to guide planning and test writing.
|
|
@@ -2,6 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
Automatically maintain your project's documentation, screenshots, and wiki.
|
|
4
4
|
|
|
5
|
+
## Routing
|
|
6
|
+
|
|
7
|
+
This command supports multi-model routing via `~/.tlc/config.json`.
|
|
8
|
+
|
|
9
|
+
**Before executing this command:**
|
|
10
|
+
|
|
11
|
+
1. Read routing config:
|
|
12
|
+
```bash
|
|
13
|
+
node -e "
|
|
14
|
+
const { resolveRouting } = require('./server/lib/task-router-config');
|
|
15
|
+
const flagModel = (process.argv.find(a => a.startsWith("--model")) || "").replace("--model=", "").replace("--model ", "") || null;
|
|
16
|
+
const r = resolveRouting({ command: 'docs', flagModel, projectDir: process.cwd(), homeDir: process.env.HOME });
|
|
17
|
+
console.log(JSON.stringify(r));
|
|
18
|
+
" 2>/dev/null
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
2. If `models[0]` is NOT `claude` (i.e., routed to external model):
|
|
22
|
+
- Read PROJECT.md, current phase PLAN.md, CODING-STANDARDS.md
|
|
23
|
+
- Package the agent prompt below with project context using `prompt-packager`
|
|
24
|
+
- Dispatch to the target CLI using `cli-dispatcher`
|
|
25
|
+
- Display the CLI output and stop — do NOT execute the agent prompt below
|
|
26
|
+
|
|
27
|
+
3. If `models[0]` IS `claude` (or no routing config exists):
|
|
28
|
+
- Execute the agent prompt below as normal (current behavior)
|
|
29
|
+
|
|
30
|
+
4. If `strategy` is `parallel`:
|
|
31
|
+
- Execute inline (Claude) AND dispatch to CLI models simultaneously
|
|
32
|
+
- Collect and merge results
|
|
33
|
+
|
|
34
|
+
**Override:** Pass `--model <name>` to route this specific run to a different model.
|
|
35
|
+
|
|
5
36
|
## Usage
|
|
6
37
|
|
|
7
38
|
```bash
|
|
@@ -2,6 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
Analyze code and generate comprehensive edge case tests to improve test coverage.
|
|
4
4
|
|
|
5
|
+
## Routing
|
|
6
|
+
|
|
7
|
+
This command supports multi-model routing via `~/.tlc/config.json`.
|
|
8
|
+
|
|
9
|
+
**Before executing this command:**
|
|
10
|
+
|
|
11
|
+
1. Read routing config:
|
|
12
|
+
```bash
|
|
13
|
+
node -e "
|
|
14
|
+
const { resolveRouting } = require('./server/lib/task-router-config');
|
|
15
|
+
const flagModel = (process.argv.find(a => a.startsWith("--model")) || "").replace("--model=", "").replace("--model ", "") || null;
|
|
16
|
+
const r = resolveRouting({ command: 'edge-cases', flagModel, projectDir: process.cwd(), homeDir: process.env.HOME });
|
|
17
|
+
console.log(JSON.stringify(r));
|
|
18
|
+
" 2>/dev/null
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
2. If `models[0]` is NOT `claude` (i.e., routed to external model):
|
|
22
|
+
- Read PROJECT.md, current phase PLAN.md, CODING-STANDARDS.md
|
|
23
|
+
- Package the agent prompt below with project context using `prompt-packager`
|
|
24
|
+
- Dispatch to the target CLI using `cli-dispatcher`
|
|
25
|
+
- Display the CLI output and stop — do NOT execute the agent prompt below
|
|
26
|
+
|
|
27
|
+
3. If `models[0]` IS `claude` (or no routing config exists):
|
|
28
|
+
- Execute the agent prompt below as normal (current behavior)
|
|
29
|
+
|
|
30
|
+
4. If `strategy` is `parallel`:
|
|
31
|
+
- Execute inline (Claude) AND dispatch to CLI models simultaneously
|
|
32
|
+
- Collect and merge results
|
|
33
|
+
|
|
34
|
+
**Override:** Pass `--model <name>` to route this specific run to a different model.
|
|
35
|
+
|
|
5
36
|
## What This Does
|
|
6
37
|
|
|
7
38
|
1. Analyzes target file/function
|
|
@@ -2,6 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
Research and create implementation plans with clear tasks.
|
|
4
4
|
|
|
5
|
+
## Routing
|
|
6
|
+
|
|
7
|
+
This command supports multi-model routing via `~/.tlc/config.json`.
|
|
8
|
+
|
|
9
|
+
**Before executing this command:**
|
|
10
|
+
|
|
11
|
+
1. Read routing config:
|
|
12
|
+
```bash
|
|
13
|
+
node -e "
|
|
14
|
+
const { resolveRouting } = require('./server/lib/task-router-config');
|
|
15
|
+
const flagModel = (process.argv.find(a => a.startsWith("--model")) || "").replace("--model=", "").replace("--model ", "") || null;
|
|
16
|
+
const r = resolveRouting({ command: 'plan', flagModel, projectDir: process.cwd(), homeDir: process.env.HOME });
|
|
17
|
+
console.log(JSON.stringify(r));
|
|
18
|
+
" 2>/dev/null
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
2. If `models[0]` is NOT `claude` (i.e., routed to external model):
|
|
22
|
+
- Read PROJECT.md, current phase PLAN.md, CODING-STANDARDS.md
|
|
23
|
+
- Package the agent prompt below with project context using `prompt-packager`
|
|
24
|
+
- Dispatch to the target CLI using `cli-dispatcher`
|
|
25
|
+
- Display the CLI output and stop — do NOT execute the agent prompt below
|
|
26
|
+
|
|
27
|
+
3. If `models[0]` IS `claude` (or no routing config exists):
|
|
28
|
+
- Execute the agent prompt below as normal (current behavior)
|
|
29
|
+
|
|
30
|
+
4. If `strategy` is `parallel`:
|
|
31
|
+
- Execute inline (Claude) AND dispatch to CLI models simultaneously
|
|
32
|
+
- Collect and merge results
|
|
33
|
+
|
|
34
|
+
**Override:** Pass `--model <name>` to route this specific run to a different model.
|
|
35
|
+
|
|
5
36
|
## Architectural Standards
|
|
6
37
|
|
|
7
38
|
**Plan like a principal engineer designing for scale:**
|
|
@@ -2,6 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
For ad-hoc tasks that don't need full phase planning, but still deserve tests.
|
|
4
4
|
|
|
5
|
+
## Routing
|
|
6
|
+
|
|
7
|
+
This command supports multi-model routing via `~/.tlc/config.json`.
|
|
8
|
+
|
|
9
|
+
**Before executing this command:**
|
|
10
|
+
|
|
11
|
+
1. Read routing config:
|
|
12
|
+
```bash
|
|
13
|
+
node -e "
|
|
14
|
+
const { resolveRouting } = require('./server/lib/task-router-config');
|
|
15
|
+
const flagModel = (process.argv.find(a => a.startsWith("--model")) || "").replace("--model=", "").replace("--model ", "") || null;
|
|
16
|
+
const r = resolveRouting({ command: 'quick', flagModel, projectDir: process.cwd(), homeDir: process.env.HOME });
|
|
17
|
+
console.log(JSON.stringify(r));
|
|
18
|
+
" 2>/dev/null
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
2. If `models[0]` is NOT `claude` (i.e., routed to external model):
|
|
22
|
+
- Read PROJECT.md, current phase PLAN.md, CODING-STANDARDS.md
|
|
23
|
+
- Package the agent prompt below with project context using `prompt-packager`
|
|
24
|
+
- Dispatch to the target CLI using `cli-dispatcher`
|
|
25
|
+
- Display the CLI output and stop — do NOT execute the agent prompt below
|
|
26
|
+
|
|
27
|
+
3. If `models[0]` IS `claude` (or no routing config exists):
|
|
28
|
+
- Execute the agent prompt below as normal (current behavior)
|
|
29
|
+
|
|
30
|
+
4. If `strategy` is `parallel`:
|
|
31
|
+
- Execute inline (Claude) AND dispatch to CLI models simultaneously
|
|
32
|
+
- Collect and merge results
|
|
33
|
+
|
|
34
|
+
**Override:** Pass `--model <name>` to route this specific run to a different model.
|
|
35
|
+
|
|
5
36
|
## Engineering Standards
|
|
6
37
|
|
|
7
38
|
Even quick tasks follow senior engineer standards:
|
|
@@ -2,6 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
Review changes on current branch before pushing. **Runs in a loop until clean.**
|
|
4
4
|
|
|
5
|
+
## Routing
|
|
6
|
+
|
|
7
|
+
This command supports multi-model routing via `~/.tlc/config.json`.
|
|
8
|
+
|
|
9
|
+
**Before executing this command:**
|
|
10
|
+
|
|
11
|
+
1. Read routing config:
|
|
12
|
+
```bash
|
|
13
|
+
node -e "
|
|
14
|
+
const { resolveRouting } = require('./server/lib/task-router-config');
|
|
15
|
+
const flagModel = (process.argv.find(a => a.startsWith("--model")) || "").replace("--model=", "").replace("--model ", "") || null;
|
|
16
|
+
const r = resolveRouting({ command: 'review', flagModel, projectDir: process.cwd(), homeDir: process.env.HOME });
|
|
17
|
+
console.log(JSON.stringify(r));
|
|
18
|
+
" 2>/dev/null
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
2. If `models[0]` is NOT `claude` (i.e., routed to external model):
|
|
22
|
+
- Read PROJECT.md, current phase PLAN.md, CODING-STANDARDS.md
|
|
23
|
+
- Package the agent prompt below with project context using `prompt-packager`
|
|
24
|
+
- Dispatch to the target CLI using `cli-dispatcher`
|
|
25
|
+
- Display the CLI output and stop — do NOT execute the agent prompt below
|
|
26
|
+
|
|
27
|
+
3. If `models[0]` IS `claude` (or no routing config exists):
|
|
28
|
+
- Execute the agent prompt below as normal (current behavior)
|
|
29
|
+
|
|
30
|
+
4. If `strategy` is `parallel`:
|
|
31
|
+
- Execute inline (Claude) AND dispatch to CLI models simultaneously
|
|
32
|
+
- Collect and merge results
|
|
33
|
+
|
|
34
|
+
**Override:** Pass `--model <name>` to route this specific run to a different model.
|
|
35
|
+
|
|
5
36
|
## What This Does
|
|
6
37
|
|
|
7
38
|
1. Compares current branch to main/master
|
|
@@ -10,6 +10,17 @@ fi
|
|
|
10
10
|
|
|
11
11
|
echo "TLC project detected. All work goes through /tlc commands. Run /tlc for current status and next action."
|
|
12
12
|
|
|
13
|
+
# ─── TLC Update Notification ─────────────────────────────
|
|
14
|
+
UPDATE_FILE="$HOME/.tlc/.update-available"
|
|
15
|
+
if [ -f "$UPDATE_FILE" ]; then
|
|
16
|
+
CURRENT=$(grep '^current=' "$UPDATE_FILE" | cut -d= -f2)
|
|
17
|
+
LATEST=$(grep '^latest=' "$UPDATE_FILE" | cut -d= -f2)
|
|
18
|
+
CMD=$(grep '^command=' "$UPDATE_FILE" | cut -d= -f2-)
|
|
19
|
+
if [ -n "$CURRENT" ] && [ -n "$LATEST" ]; then
|
|
20
|
+
echo "TLC update available: ${CURRENT} → ${LATEST}. Run: ${CMD}"
|
|
21
|
+
fi
|
|
22
|
+
fi
|
|
23
|
+
|
|
13
24
|
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(pwd)}"
|
|
14
25
|
|
|
15
26
|
# ─── TLC Server ───────────────────────────────────────────
|
|
@@ -53,9 +64,9 @@ fi
|
|
|
53
64
|
|
|
54
65
|
if [ "$STALE" = true ]; then
|
|
55
66
|
# Probe each provider
|
|
56
|
-
CLAUDE_PATH=$(
|
|
57
|
-
CODEX_PATH=$(
|
|
58
|
-
GEMINI_PATH=$(
|
|
67
|
+
CLAUDE_PATH=$(command -v claude 2>/dev/null || echo "")
|
|
68
|
+
CODEX_PATH=$(command -v codex 2>/dev/null || echo "")
|
|
69
|
+
GEMINI_PATH=$(command -v gemini 2>/dev/null || echo "")
|
|
59
70
|
|
|
60
71
|
CLAUDE_OK="false"
|
|
61
72
|
CODEX_OK="false"
|