@kaitranntt/ccs 4.3.2 → 4.3.3
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/ccs/continue.md +15 -0
- package/.claude/commands/ccs.md +17 -0
- package/.claude/skills/ccs-delegation/CLAUDE.md.template +11 -1
- package/.claude/skills/ccs-delegation/SKILL.md +135 -45
- package/.claude/skills/ccs-delegation/references/troubleshooting.md +0 -5
- package/README.md +6 -5
- package/VERSION +1 -1
- package/bin/ccs.js +4 -2
- package/bin/delegation/README.md +9 -7
- package/bin/management/doctor.js +5 -5
- package/lib/ccs +5 -3
- package/lib/ccs.ps1 +5 -3
- package/package.json +1 -1
- package/.claude/commands/ccs/glm/continue.md +0 -21
- package/.claude/commands/ccs/glm.md +0 -21
- package/.claude/commands/ccs/kimi/continue.md +0 -21
- package/.claude/commands/ccs/kimi.md +0 -21
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Continue last CCS delegation session [AUTO ENHANCE]
|
|
3
|
+
argument-hint: [follow-up instruction]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Activate `ccs-delegation` skill. The skill contains all execution logic.
|
|
7
|
+
|
|
8
|
+
Task: Detect last-used profile from `~/.ccs/delegation-sessions.json`, parse `$ARGUMENTS`, enhance with previous context, execute continuation via CCS CLI.
|
|
9
|
+
|
|
10
|
+
**Examples:**
|
|
11
|
+
```
|
|
12
|
+
/ccs:continue "also update the examples section" # Use last profile
|
|
13
|
+
/ccs:continue --glm "add unit tests" # Switch profiles
|
|
14
|
+
/ccs:continue "/commit with message" # Nested slash command
|
|
15
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Delegate task with intelligent profile selection [AUTO ENHANCE]
|
|
3
|
+
argument-hint: [task description]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Activate `ccs-delegation` skill. The skill contains all execution logic.
|
|
7
|
+
|
|
8
|
+
Task: Parse `$ARGUMENTS`, select optimal profile from `~/.ccs/config.json`, enhance prompt, execute delegation via CCS CLI.
|
|
9
|
+
|
|
10
|
+
**Examples:**
|
|
11
|
+
```
|
|
12
|
+
/ccs "refactor auth.js to use async/await" # Simple task
|
|
13
|
+
/ccs "analyze entire architecture" # Long-context task
|
|
14
|
+
/ccs "think about caching strategy" # Reasoning task
|
|
15
|
+
/ccs --glm "add tests for UserService" # Force specific profile
|
|
16
|
+
/ccs "/cook create landing page" # Nested slash command
|
|
17
|
+
```
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Activate `ccs-delegation` skill for automatic delegation of eligible tasks.
|
|
4
4
|
|
|
5
|
+
**Commands:**
|
|
6
|
+
- `/ccs "task"` - Auto-select best profile (glm/kimi/custom)
|
|
7
|
+
- `/ccs:continue "follow-up"` - Continue last session
|
|
8
|
+
- `/ccs --glm "task"` - Force specific profile
|
|
9
|
+
|
|
5
10
|
**Auto-delegates:** typo fixes, test additions, refactoring, JSDoc, docs updates
|
|
6
11
|
**Override:** Say "don't delegate" to bypass automation
|
|
7
|
-
|
|
12
|
+
|
|
13
|
+
**Examples:**
|
|
14
|
+
- "use ccs to fix typos in README" → Auto-selects glm
|
|
15
|
+
- "use ccs to analyze architecture" → Auto-selects kimi
|
|
16
|
+
- "use ccs --glm to add tests" → Forces glm
|
|
17
|
+
- "use ccs:continue to commit" → Continues last session
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ccs-delegation
|
|
3
|
-
description:
|
|
4
|
-
version:
|
|
3
|
+
description: Auto-activate CCS CLI delegation for deterministic tasks. Parses user input, auto-selects optimal profile (glm/kimi/custom) from ~/.ccs/config.json, enhances prompts with context, executes via `ccs {profile} -p "task"` or `ccs {profile}:continue`, and reports results. Trigger: "use ccs [task]" patterns, typo/test/refactor keywords. Excludes: complex architecture, security-critical code, performance optimization, breaking changes.
|
|
4
|
+
version: 3.0.0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# CCS Delegation
|
|
@@ -10,50 +10,94 @@ Delegate deterministic tasks to cost-optimized models via CCS CLI.
|
|
|
10
10
|
|
|
11
11
|
## Core Concept
|
|
12
12
|
|
|
13
|
-
Execute tasks via alternative models using
|
|
13
|
+
Execute tasks via alternative models using:
|
|
14
|
+
- **Initial delegation**: `ccs {profile} -p "task"`
|
|
15
|
+
- **Session continuation**: `ccs {profile}:continue -p "follow-up"`
|
|
14
16
|
|
|
15
|
-
**
|
|
17
|
+
**Profile Selection:**
|
|
18
|
+
- Auto-select from `~/.ccs/config.json` via task analysis
|
|
19
|
+
- Profiles: glm (cost-optimized), kimi (long-context/reasoning), custom profiles
|
|
20
|
+
- Override: `--{profile}` flag forces specific profile
|
|
16
21
|
|
|
17
22
|
## User Invocation Patterns
|
|
18
23
|
|
|
19
24
|
Users trigger delegation naturally:
|
|
20
|
-
- "use ccs
|
|
21
|
-
- "use ccs
|
|
22
|
-
- "use ccs
|
|
23
|
-
- "use ccs
|
|
25
|
+
- "use ccs [task]" - Auto-select best profile
|
|
26
|
+
- "use ccs --glm [task]" - Force GLM profile
|
|
27
|
+
- "use ccs --kimi [task]" - Force Kimi profile
|
|
28
|
+
- "use ccs:continue [task]" - Continue last session
|
|
24
29
|
|
|
25
30
|
**Examples:**
|
|
26
|
-
- "use ccs
|
|
27
|
-
- "use ccs
|
|
28
|
-
- "use ccs glm
|
|
31
|
+
- "use ccs to fix typos in README.md"
|
|
32
|
+
- "use ccs to analyze the entire architecture"
|
|
33
|
+
- "use ccs --glm to add unit tests"
|
|
34
|
+
- "use ccs:continue to commit the changes"
|
|
29
35
|
|
|
30
36
|
## Agent Response Protocol
|
|
31
37
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
1. **
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
2. **
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
3. **
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
38
|
+
**For `/ccs [task]`:**
|
|
39
|
+
|
|
40
|
+
1. **Parse override flag**
|
|
41
|
+
- Scan task for pattern: `--(\w+)`
|
|
42
|
+
- If match: `profile = match[1]`, remove flag from task, skip to step 5
|
|
43
|
+
- If no match: continue to step 2
|
|
44
|
+
|
|
45
|
+
2. **Discover profiles**
|
|
46
|
+
- Read `~/.ccs/config.json` using Read tool
|
|
47
|
+
- Extract `Object.keys(config.profiles)` → `availableProfiles[]`
|
|
48
|
+
- If file missing → Error: "CCS not configured. Run: ccs doctor"
|
|
49
|
+
- If empty → Error: "No profiles in config.json"
|
|
50
|
+
|
|
51
|
+
3. **Analyze task requirements**
|
|
52
|
+
- Scan task for keywords:
|
|
53
|
+
- `/(think|analyze|reason|debug|investigate|evaluate)/i` → `needsReasoning = true`
|
|
54
|
+
- `/(architecture|entire|all files|codebase|analyze all)/i` → `needsLongContext = true`
|
|
55
|
+
- `/(typo|test|refactor|update|fix)/i` → `preferCostOptimized = true`
|
|
56
|
+
|
|
57
|
+
4. **Select profile**
|
|
58
|
+
- For each profile in `availableProfiles`: classify by name pattern (see Profile Characteristic Inference table)
|
|
59
|
+
- If `needsReasoning`: filter profiles where `reasoning=true` → prefer kimi
|
|
60
|
+
- Else if `needsLongContext`: filter profiles where `context=long` → prefer kimi
|
|
61
|
+
- Else: filter profiles where `cost=low` → prefer glm
|
|
62
|
+
- `selectedProfile = filteredProfiles[0]`
|
|
63
|
+
- If `filteredProfiles.length === 0`: fallback to `glm` if exists, else first available
|
|
64
|
+
- If no profiles: Error
|
|
65
|
+
|
|
66
|
+
5. **Enhance prompt**
|
|
67
|
+
- If task mentions files: gather context using Read tool
|
|
68
|
+
- Add: file paths, current implementation, expected behavior, success criteria
|
|
69
|
+
- Preserve slash commands at task start (e.g., `/cook`, `/commit`)
|
|
70
|
+
|
|
71
|
+
6. **Execute delegation**
|
|
72
|
+
- Run: `ccs {selectedProfile} -p "$enhancedPrompt"` via Bash tool
|
|
73
|
+
|
|
74
|
+
7. **Report results**
|
|
75
|
+
- Log: "Selected {profile} (reason: {reasoning/long-context/cost-optimized})"
|
|
76
|
+
- Report: Cost (USD), Duration (sec), Session ID, Exit code
|
|
77
|
+
|
|
78
|
+
**For `/ccs:continue [follow-up]`:**
|
|
79
|
+
|
|
80
|
+
1. **Detect profile**
|
|
81
|
+
- Read `~/.ccs/delegation-sessions.json` using Read tool
|
|
82
|
+
- Find most recent session (latest timestamp)
|
|
83
|
+
- Extract profile name from session data
|
|
84
|
+
- If no sessions → Error: "No previous delegation. Use /ccs first"
|
|
85
|
+
|
|
86
|
+
2. **Parse override flag**
|
|
87
|
+
- Scan follow-up for pattern: `--(\w+)`
|
|
88
|
+
- If match: `profile = match[1]`, remove flag from follow-up, log profile switch
|
|
89
|
+
- If no match: use detected profile from step 1
|
|
90
|
+
|
|
91
|
+
3. **Enhance prompt**
|
|
92
|
+
- Review previous work (check what was accomplished)
|
|
93
|
+
- Add: previous context, incomplete tasks, validation criteria
|
|
94
|
+
- Preserve slash commands at start
|
|
95
|
+
|
|
96
|
+
4. **Execute continuation**
|
|
97
|
+
- Run: `ccs {profile}:continue -p "$enhancedPrompt"` via Bash tool
|
|
98
|
+
|
|
99
|
+
5. **Report results**
|
|
100
|
+
- Report: Profile, Session #, Incremental cost, Total cost, Duration, Exit code
|
|
57
101
|
|
|
58
102
|
## Decision Framework
|
|
59
103
|
|
|
@@ -69,18 +113,58 @@ When user says "use ccs {profile} [task]":
|
|
|
69
113
|
- Performance optimization
|
|
70
114
|
- Breaking changes/migrations
|
|
71
115
|
|
|
72
|
-
## Profile Selection
|
|
116
|
+
## Profile Selection Logic
|
|
117
|
+
|
|
118
|
+
**Task Analysis Keywords** (scan task string with regex):
|
|
119
|
+
|
|
120
|
+
| Pattern | Variable | Example |
|
|
121
|
+
|---------|----------|---------|
|
|
122
|
+
| `/(think\|analyze\|reason\|debug\|investigate\|evaluate)/i` | `needsReasoning = true` | "think about caching" |
|
|
123
|
+
| `/(architecture\|entire\|all files\|codebase\|analyze all)/i` | `needsLongContext = true` | "analyze all files" |
|
|
124
|
+
| `/(typo\|test\|refactor\|update\|fix)/i` | `preferCostOptimized = true` | "fix typo in README" |
|
|
125
|
+
|
|
126
|
+
**Profile Characteristic Inference** (classify by name pattern):
|
|
127
|
+
|
|
128
|
+
| Profile Pattern | Cost | Context | Reasoning |
|
|
129
|
+
|----------------|------|---------|-----------|
|
|
130
|
+
| `/^glm/i` | low | standard | false |
|
|
131
|
+
| `/^kimi/i` | medium | long | true |
|
|
132
|
+
| `/^claude/i` | high | standard | false |
|
|
133
|
+
| others | low | standard | false |
|
|
134
|
+
|
|
135
|
+
**Selection Algorithm** (apply filters sequentially):
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
profiles = Object.keys(config.profiles)
|
|
139
|
+
classified = profiles.map(p => ({name: p, ...inferCharacteristics(p)}))
|
|
140
|
+
|
|
141
|
+
if (needsReasoning):
|
|
142
|
+
filtered = classified.filter(p => p.reasoning === true).sort(['kimi'])
|
|
143
|
+
else if (needsLongContext):
|
|
144
|
+
filtered = classified.filter(p => p.context === 'long').sort(['kimi'])
|
|
145
|
+
else:
|
|
146
|
+
filtered = classified.filter(p => p.cost === 'low').sort(['glm', ...])
|
|
147
|
+
|
|
148
|
+
selected = filtered[0] || profiles.find(p => p === 'glm') || profiles[0]
|
|
149
|
+
if (!selected): throw Error("No profiles configured")
|
|
150
|
+
|
|
151
|
+
log("Selected {selected} (reason: {reasoning|long-context|cost-optimized})")
|
|
152
|
+
```
|
|
73
153
|
|
|
74
|
-
|
|
75
|
-
-
|
|
154
|
+
**Override Logic**:
|
|
155
|
+
- Parse task for `/--(\w+)/`. If match: `profile = match[1]`, remove from task, skip selection
|
|
76
156
|
|
|
77
157
|
## Example Delegation Tasks
|
|
78
158
|
|
|
79
159
|
**Good candidates:**
|
|
80
|
-
- "add unit tests for UserService using Jest"
|
|
81
|
-
-
|
|
82
|
-
- "
|
|
83
|
-
-
|
|
160
|
+
- "/ccs add unit tests for UserService using Jest"
|
|
161
|
+
→ Auto-selects: glm (simple task)
|
|
162
|
+
- "/ccs analyze entire architecture in src/"
|
|
163
|
+
→ Auto-selects: kimi (long-context)
|
|
164
|
+
- "/ccs think about the best database schema design"
|
|
165
|
+
→ Auto-selects: kimi (reasoning)
|
|
166
|
+
- "/ccs --glm refactor parseConfig to use destructuring"
|
|
167
|
+
→ Forces: glm (override)
|
|
84
168
|
|
|
85
169
|
**Bad candidates (keep in main):**
|
|
86
170
|
- "implement OAuth" (too complex, needs design)
|
|
@@ -89,9 +173,15 @@ When user says "use ccs {profile} [task]":
|
|
|
89
173
|
|
|
90
174
|
## Execution
|
|
91
175
|
|
|
92
|
-
|
|
176
|
+
**Commands:**
|
|
177
|
+
- `/ccs "task"` - Intelligent delegation (auto-select profile)
|
|
178
|
+
- `/ccs --{profile} "task"` - Force specific profile
|
|
179
|
+
- `/ccs:continue "follow-up"` - Continue last session (auto-detect profile)
|
|
180
|
+
- `/ccs:continue --{profile} "follow-up"` - Continue with profile switch
|
|
93
181
|
|
|
94
|
-
Agent via Bash
|
|
182
|
+
**Agent via Bash:**
|
|
183
|
+
- Auto: `ccs {auto-selected} -p "task"`
|
|
184
|
+
- Continue: `ccs {detected}:continue -p "follow-up"`
|
|
95
185
|
|
|
96
186
|
## References
|
|
97
187
|
|
|
@@ -195,11 +195,6 @@ jq '.glm.turns' ~/.ccs/delegation-sessions.json
|
|
|
195
195
|
rm ~/.ccs/delegation-sessions.json # Fresh start (loses all sessions)
|
|
196
196
|
```
|
|
197
197
|
|
|
198
|
-
**Bypass delegation (use CLI directly):**
|
|
199
|
-
```bash
|
|
200
|
-
claude -p "task" --settings ~/.ccs/{profile}.settings.json
|
|
201
|
-
```
|
|
202
|
-
|
|
203
198
|
**Interactive mode (no -p flag):**
|
|
204
199
|
```bash
|
|
205
200
|
ccs {profile} # Opens interactive session
|
package/README.md
CHANGED
|
@@ -322,7 +322,7 @@ graph LR
|
|
|
322
322
|
```plaintext
|
|
323
323
|
~/.ccs/
|
|
324
324
|
├── .claude/ # CCS items (ships with package, v4.1)
|
|
325
|
-
│ ├── commands/ccs/ # Delegation commands (/ccs
|
|
325
|
+
│ ├── commands/ccs/ # Delegation commands (/ccs, /ccs:continue)
|
|
326
326
|
│ ├── skills/ccs-delegation/ # AI decision framework
|
|
327
327
|
│ └── agents/ccs-delegator.md # Proactive delegation agent
|
|
328
328
|
├── shared/ # Symlinks to ~/.claude/ (for profiles)
|
|
@@ -401,7 +401,7 @@ ccs --help # Show all commands and options
|
|
|
401
401
|
|
|
402
402
|
### What is Delegation?
|
|
403
403
|
|
|
404
|
-
CCS Delegation lets you **send tasks to alternative models** (`glm`, `kimi`) **from your main Claude session** using the `-p` flag or slash commands (`/ccs
|
|
404
|
+
CCS Delegation lets you **send tasks to alternative models** (`glm`, `kimi`) **from your main Claude session** using the `-p` flag or intelligent slash commands (`/ccs`, `/ccs:continue`).
|
|
405
405
|
|
|
406
406
|
**Why use it?**
|
|
407
407
|
- **Token efficiency**: Simple tasks cost 81% less on GLM vs main Claude session
|
|
@@ -426,9 +426,10 @@ ccs glm:continue -p "run the tests and fix any failures"
|
|
|
426
426
|
**Via Slash Commands** (inside Claude sessions):
|
|
427
427
|
```bash
|
|
428
428
|
# In your main Claude session:
|
|
429
|
-
/ccs
|
|
430
|
-
/ccs
|
|
431
|
-
/ccs
|
|
429
|
+
/ccs "refactor auth.js to use async/await" # Auto-selects best profile
|
|
430
|
+
/ccs --glm "fix typo in documentation" # Forces GLM profile
|
|
431
|
+
/ccs --kimi "analyze entire architecture" # Forces Kimi profile
|
|
432
|
+
/ccs:continue "also update the README examples" # Continues last session
|
|
432
433
|
```
|
|
433
434
|
|
|
434
435
|
**Via Natural Language** (Claude auto-delegates):
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.3.
|
|
1
|
+
4.3.3
|
package/bin/ccs.js
CHANGED
|
@@ -172,8 +172,10 @@ function handleHelpCommand() {
|
|
|
172
172
|
|
|
173
173
|
// Delegation (inside Claude Code CLI)
|
|
174
174
|
console.log(colored('Delegation (inside Claude Code CLI):', 'cyan'));
|
|
175
|
-
console.log(` ${colored('/ccs
|
|
176
|
-
console.log(` ${colored('/ccs
|
|
175
|
+
console.log(` ${colored('/ccs "task"', 'yellow')} Delegate task (auto-selects best profile)`);
|
|
176
|
+
console.log(` ${colored('/ccs --glm "task"', 'yellow')} Force GLM-4.6 for simple tasks`);
|
|
177
|
+
console.log(` ${colored('/ccs --kimi "task"', 'yellow')} Force Kimi for long context`);
|
|
178
|
+
console.log(` ${colored('/ccs:continue "follow-up"', 'yellow')} Continue last delegation session`);
|
|
177
179
|
console.log(' Save tokens by delegating simple tasks to cost-optimized models');
|
|
178
180
|
console.log('');
|
|
179
181
|
|
package/bin/delegation/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Enhanced Claude Code delegation system for multi-model task delegation.
|
|
|
25
25
|
|
|
26
26
|
### Session Management
|
|
27
27
|
- Persistence: `~/.ccs/delegation-sessions.json`
|
|
28
|
-
- Resume via `/ccs:
|
|
28
|
+
- Resume via `/ccs:continue` (auto-detects profile)
|
|
29
29
|
- Auto-cleanup expired sessions (>30 days)
|
|
30
30
|
- Cost aggregation across turns
|
|
31
31
|
|
|
@@ -91,12 +91,13 @@ Automatically applied as CLI flags:
|
|
|
91
91
|
The delegation system is invoked via simple slash commands in `.claude/commands/ccs/`:
|
|
92
92
|
|
|
93
93
|
### Basic Commands
|
|
94
|
-
- `/ccs
|
|
95
|
-
- `/ccs
|
|
94
|
+
- `/ccs "task"` - Delegate task (auto-selects best profile)
|
|
95
|
+
- `/ccs --glm "task"` - Force GLM-4.6 delegation
|
|
96
|
+
- `/ccs --kimi "task"` - Force Kimi delegation (long-context)
|
|
96
97
|
|
|
97
|
-
###
|
|
98
|
-
- `/ccs:
|
|
99
|
-
- `/ccs:
|
|
98
|
+
### Session Continuation
|
|
99
|
+
- `/ccs:continue "follow-up"` - Resume last delegation session (auto-detect profile)
|
|
100
|
+
- `/ccs:continue --glm "follow-up"` - Resume with specific profile switch
|
|
100
101
|
|
|
101
102
|
Each command directly invokes:
|
|
102
103
|
```bash
|
|
@@ -143,7 +144,8 @@ node tests/unit/delegation/result-formatter.test.js
|
|
|
143
144
|
## Architecture
|
|
144
145
|
|
|
145
146
|
```
|
|
146
|
-
User → SlashCommand (/ccs
|
|
147
|
+
User → SlashCommand (/ccs)
|
|
148
|
+
→ ccs-delegation skill (auto-selects profile)
|
|
147
149
|
→ Directly invokes: claude -p
|
|
148
150
|
→ HeadlessExecutor (monitors execution)
|
|
149
151
|
→ SessionManager (load last session)
|
package/bin/management/doctor.js
CHANGED
|
@@ -364,12 +364,12 @@ class Doctor {
|
|
|
364
364
|
checkDelegation() {
|
|
365
365
|
const spinner = ora('Checking delegation').start();
|
|
366
366
|
|
|
367
|
-
// Check if delegation commands exist in ~/.ccs/.claude/commands/
|
|
368
|
-
const ccsClaudeCommandsDir = path.join(this.ccsDir, '.claude', 'commands'
|
|
369
|
-
const
|
|
370
|
-
const
|
|
367
|
+
// Check if delegation commands exist in ~/.ccs/.claude/commands/
|
|
368
|
+
const ccsClaudeCommandsDir = path.join(this.ccsDir, '.claude', 'commands');
|
|
369
|
+
const hasCcsCommand = fs.existsSync(path.join(ccsClaudeCommandsDir, 'ccs.md'));
|
|
370
|
+
const hasContinueCommand = fs.existsSync(path.join(ccsClaudeCommandsDir, 'ccs', 'continue.md'));
|
|
371
371
|
|
|
372
|
-
if (!
|
|
372
|
+
if (!hasCcsCommand || !hasContinueCommand) {
|
|
373
373
|
spinner.warn(` ${'Delegation'.padEnd(26)}${colored('[!]', 'yellow')} Not installed`);
|
|
374
374
|
this.results.addCheck(
|
|
375
375
|
'Delegation',
|
package/lib/ccs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
4
|
# Version (updated by scripts/bump-version.sh)
|
|
5
|
-
CCS_VERSION="4.3.
|
|
5
|
+
CCS_VERSION="4.3.3"
|
|
6
6
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
7
|
readonly CONFIG_FILE="${CCS_CONFIG:-$HOME/.ccs/config.json}"
|
|
8
8
|
readonly PROFILES_JSON="$HOME/.ccs/profiles.json"
|
|
@@ -191,8 +191,10 @@ show_help() {
|
|
|
191
191
|
echo ""
|
|
192
192
|
|
|
193
193
|
echo -e "${CYAN}Delegation (inside Claude Code CLI):${RESET}"
|
|
194
|
-
echo -e " ${YELLOW}/ccs
|
|
195
|
-
echo -e " ${YELLOW}/ccs
|
|
194
|
+
echo -e " ${YELLOW}/ccs \"task\"${RESET} Delegate task (auto-selects best profile)"
|
|
195
|
+
echo -e " ${YELLOW}/ccs --glm \"task\"${RESET} Force GLM-4.6 for simple tasks"
|
|
196
|
+
echo -e " ${YELLOW}/ccs --kimi \"task\"${RESET} Force Kimi for long context"
|
|
197
|
+
echo -e " ${YELLOW}/ccs:continue \"follow-up\"${RESET} Continue last delegation session"
|
|
196
198
|
echo -e " Save tokens by delegating simple tasks to cost-optimized models"
|
|
197
199
|
echo ""
|
|
198
200
|
|
package/lib/ccs.ps1
CHANGED
|
@@ -12,7 +12,7 @@ param(
|
|
|
12
12
|
$ErrorActionPreference = "Stop"
|
|
13
13
|
|
|
14
14
|
# Version (updated by scripts/bump-version.sh)
|
|
15
|
-
$CcsVersion = "4.3.
|
|
15
|
+
$CcsVersion = "4.3.3"
|
|
16
16
|
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
17
17
|
$ConfigFile = if ($env:CCS_CONFIG) { $env:CCS_CONFIG } else { "$env:USERPROFILE\.ccs\config.json" }
|
|
18
18
|
$ProfilesJson = "$env:USERPROFILE\.ccs\profiles.json"
|
|
@@ -238,8 +238,10 @@ function Show-Help {
|
|
|
238
238
|
Write-Host ""
|
|
239
239
|
|
|
240
240
|
Write-ColorLine "Delegation (inside Claude Code CLI):" "Cyan"
|
|
241
|
-
Write-ColorLine " /ccs
|
|
242
|
-
Write-ColorLine " /ccs
|
|
241
|
+
Write-ColorLine " /ccs `"task`" Delegate task (auto-selects best profile)" "Yellow"
|
|
242
|
+
Write-ColorLine " /ccs --glm `"task`" Force GLM-4.6 for simple tasks" "Yellow"
|
|
243
|
+
Write-ColorLine " /ccs --kimi `"task`" Force Kimi for long context" "Yellow"
|
|
244
|
+
Write-ColorLine " /ccs:continue `"follow-up`" Continue last delegation session" "Yellow"
|
|
243
245
|
Write-Host " Save tokens by delegating simple tasks to cost-optimized models"
|
|
244
246
|
Write-Host ""
|
|
245
247
|
|
package/package.json
CHANGED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Continue last GLM delegation session [AUTO ENHANCE]
|
|
3
|
-
argument-hint: [follow-up instruction]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Continue last GLM delegation session for iterative refinement.
|
|
7
|
-
|
|
8
|
-
**Workflow:**
|
|
9
|
-
- Review what was accomplished in previous session
|
|
10
|
-
- Analyze the follow-up instruction in `$ARGUMENTS`
|
|
11
|
-
- Enhance prompt with context (reference files, incomplete tasks, next steps)
|
|
12
|
-
- Execute continuation via `ccs glm:continue -p "$ENHANCED_PROMPT"`
|
|
13
|
-
|
|
14
|
-
**Note:** `$ENHANCED_PROMPT` is an enhanced version that references previous work, highlights incomplete tasks, and adds specific validation criteria. If the follow-up contains a slash command (e.g., /commit), keep it at the start of the enhanced prompt.
|
|
15
|
-
|
|
16
|
-
**Usage:**
|
|
17
|
-
```
|
|
18
|
-
/ccs:glm "fix typo in README"
|
|
19
|
-
/ccs:glm:continue "also update the examples section"
|
|
20
|
-
/ccs:glm:continue "/commit with descriptive message"
|
|
21
|
-
```
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Delegate task to GLM-4.6 (cost-optimized model) [AUTO ENHANCE]
|
|
3
|
-
argument-hint: [task description]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Delegate simple, deterministic tasks to GLM-4.6 for token optimization.
|
|
7
|
-
|
|
8
|
-
**Workflow:**
|
|
9
|
-
- Analyze the task description in `$ARGUMENTS`
|
|
10
|
-
- Gather context if needed (read files, check structure)
|
|
11
|
-
- Enhance prompt with specific details (file paths, context, success criteria)
|
|
12
|
-
- Execute delegation via `ccs glm -p "$ENHANCED_PROMPT"`
|
|
13
|
-
|
|
14
|
-
**Note:** `$ENHANCED_PROMPT` is an enhanced version that adds specifics like file paths, current implementation context, expected behavior, and success criteria. If the task contains a slash command (e.g., /cook, /plan), keep it at the start of the enhanced prompt.
|
|
15
|
-
|
|
16
|
-
**Usage:**
|
|
17
|
-
```
|
|
18
|
-
/ccs:glm "refactor auth.js to use async/await"
|
|
19
|
-
/ccs:glm "add tests for UserService"
|
|
20
|
-
/ccs:glm "/cook create a landing page"
|
|
21
|
-
```
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Continue last Kimi delegation session [AUTO ENHANCE]
|
|
3
|
-
argument-hint: [follow-up instruction]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Continue last Kimi delegation session for multi-turn analysis.
|
|
7
|
-
|
|
8
|
-
**Workflow:**
|
|
9
|
-
- Review analysis/work from previous session
|
|
10
|
-
- Analyze the follow-up instruction in `$ARGUMENTS`
|
|
11
|
-
- Enhance prompt with comprehensive context (findings, scope, deliverables, priority)
|
|
12
|
-
- Execute continuation via `ccs kimi:continue -p "$ENHANCED_PROMPT"`
|
|
13
|
-
|
|
14
|
-
**Note:** `$ENHANCED_PROMPT` is an enhanced version that references previous findings, specifies next scope, and adds actionable deliverables with priorities. If the follow-up contains a slash command (e.g., /plan), keep it at the start of the enhanced prompt.
|
|
15
|
-
|
|
16
|
-
**Usage:**
|
|
17
|
-
```
|
|
18
|
-
/ccs:kimi "analyze all files in src/"
|
|
19
|
-
/ccs:kimi:continue "suggest architectural improvements"
|
|
20
|
-
/ccs:kimi:continue "/plan for refactoring with phases"
|
|
21
|
-
```
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Delegate task to Kimi (long-context model) [AUTO ENHANCE]
|
|
3
|
-
argument-hint: [task description]
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Delegate long-context, multi-file tasks to Kimi for comprehensive analysis.
|
|
7
|
-
|
|
8
|
-
**Workflow:**
|
|
9
|
-
- Analyze the task description in `$ARGUMENTS`
|
|
10
|
-
- Gather context across multiple files/directories
|
|
11
|
-
- Enhance prompt with comprehensive details (structure, relationships, scope)
|
|
12
|
-
- Execute delegation via `ccs kimi -p "$ENHANCED_PROMPT"`
|
|
13
|
-
|
|
14
|
-
**Note:** `$ENHANCED_PROMPT` is an enhanced version that adds directory structures, cross-file relationships, architecture context, and deliverables. If the task contains a slash command (e.g., /plan, /commit), keep it at the start of the enhanced prompt.
|
|
15
|
-
|
|
16
|
-
**Usage:**
|
|
17
|
-
```
|
|
18
|
-
/ccs:kimi "analyze all files in src/ and document architecture"
|
|
19
|
-
/ccs:kimi "find all deprecated API usages across codebase"
|
|
20
|
-
/ccs:kimi "/plan for authentication system"
|
|
21
|
-
```
|