SKILL.md--- name: ccs-delegation 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. Triggers on "use ccs [task]" patterns, typo/test/refactor keywords. Excludes complex architecture, security-critical code, performance optimization, breaking changes. version: 3.0.0 --- # CCS Delegation Delegate deterministic tasks to cost-optimized models via CCS CLI. ## Core Concept Execute tasks via alternative models using: - **Initial delegation**: `ccs {profile} -p "task"` - **Session continuation**: `ccs {profile}:continue -p "follow-up"` **Profile Selection:** - Auto-select from `~/.ccs/config.json` via task analysis - Profiles: glm (cost-optimized), kimi (long-context/reasoning), custom profiles - Override: `--{profile}` flag forces specific profile ## User Invocation Patterns Users trigger delegation naturally: - "use ccs [task]" - Auto-select best profile - "use ccs --glm [task]" - Force GLM profile - "use ccs --kimi [task]" - Force Kimi profile - "use ccs:continue [task]" - Continue last session **Examples:** - "use ccs to fix typos in README.md" - "use ccs to analyze the entire architecture" - "use ccs --glm to add unit tests" - "use ccs:continue to commit the changes" ## Agent Response Protocol **For `/ccs [task]`:** 1. **Parse override flag** - Scan task for pattern: `--(\w+)` - If match: `profile = match[1]`, remove flag from task, skip to step 5 - If no match: continue to step 2 2. **Discover profiles** - Read `~/.ccs/config.json` using Read tool - Extract `Object.keys(config.profiles)` → `availableProfiles[]` - If file missing → Error: "CCS not configured. Run: ccs doctor" - If empty → Error: "No profiles in config.json" 3. **Analyze task requirements** - Scan task for keywords: - `/(think|analyze|reason|debug|investigate|evaluate)/i` → `needsReasoning = true` - `/(architecture|entire|all files|codebase|analyze all)/i` → `needsLongContext = true` - `/(typo|test|refactor|update|fix)/i` → `preferCostOptimized = true` 4. **Select profile** - For each profile in `availableProfiles`: classify by name pattern (see Profile Characteristic Inference table) - If `needsReasoning`: filter profiles where `reasoning=true` → prefer kimi - Else if `needsLongContext`: filter profiles where `context=long` → prefer kimi - Else: filter profiles where `cost=low` → prefer glm - `selectedProfile = filteredProfiles[0]` - If `filteredProfiles.length === 0`: fallback to `glm` if exists, else first available - If no profiles: Error 5. **Enhance prompt** - If task mentions files: gather context using Read tool - Add: file paths, current implementation, expected behavior, success criteria - Preserve slash commands at task start (e.g., `/cook`, `/commit`)