Automates task delegation to cost-optimized LLM profiles (like GLM or Kimi) through the CCS CLI.

Install

mkdir -p .claude/skills/ccs-delegation && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2770" && unzip -o skill.zip -d .claude/skills/ccs-delegation && rm skill.zip

Installs to .claude/skills/ccs-delegation

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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.
435 chars · catalog descriptionno explicit “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Parse user task requirements
  • Auto-select optimal CCS profile
  • Enhance prompts with context
  • Execute CLI delegation commands
  • Report delegation results

How it works

The skill analyzes task keywords to select a profile from the local config, enhances the prompt with relevant file context, and executes the task via the CCS CLI.

Inputs & outputs

You give it
Natural language task description
You get back
Executed CLI command and performance report

When to use ccs-delegation

  • Fix typos in documentation
  • Add unit tests using a cost-optimized profile
  • Continue a coding task session
  • Refactor code using a specific AI model

About this skill

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)/ineedsReasoning = true
      • /(architecture|entire|all files|codebase|analyze all)/ineedsLongContext = true
      • /(typo|test|refactor|update|fix)/ipreferCostOptimized = 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)
  6. Execute delegation

    • Run: ccs {selectedProfile} -p "$enhancedPrompt" via Bash tool
  7. Report results

    • Log: "Selected {profile} (reason: {reasoning/long-context/cost-optimized})"
    • Report: Cost (USD), Duration (sec), Session ID, Exit code

For /ccs:continue [follow-up]:

  1. Detect profile

    • Read ~/.ccs/delegation-sessions.json using Read tool
    • Find most recent session (latest timestamp)
    • Extract profile name from session data
    • If no sessions → Error: "No previous delegation. Use /ccs first"
  2. Parse override flag

    • Scan follow-up for pattern: --(\w+)
    • If match: profile = match[1], remove flag from follow-up, log profile switch
    • If no match: use detected profile from step 1
  3. Enhance prompt

    • Review previous work (check what was accomplished)
    • Add: previous context, incomplete tasks, validation criteria
    • Preserve slash commands at start
  4. Execute continuation

    • Run: ccs {profile}:continue -p "$enhancedPrompt" via Bash tool
  5. Report results

    • Report: Profile, Session #, Incremental cost, Total cost, Duration, Exit code

Decision Framework

Delegate when:

  • Simple refactoring, tests, typos, documentation
  • Deterministic, well-defined scope
  • No discussion/decisions needed

Keep in main when:

  • Architecture/design decisions
  • Security-critical code
  • Complex debugging requiring investigation
  • Performance optimization
  • Breaking changes/migrations

Profile Selection Logic

Task Analysis Keywords (scan task string with regex):

PatternVariableExample
/(think|analyze|reason|debug|investigate|evaluate)/ineedsReasoning = true"think about caching"
/(architecture|entire|all files|codebase|analyze all)/ineedsLongContext = true"analyze all files"
/(typo|test|refactor|update|fix)/ipreferCostOptimized = true"fix typo in README"

Profile Characteristic Inference (classify by name pattern):

Profile PatternCostContextReasoning
/^glm/ilowstandardfalse
/^kimi/imediumlongtrue
/^claude/ihighstandardfalse
otherslowstandardfalse

Selection Algorithm (apply filters sequentially):

profiles = Object.keys(config.profiles)
classified = profiles.map(p => ({name: p, ...inferCharacteristics(p)}))

if (needsReasoning):
  filtered = classified.filter(p => p.reasoning === true).sort(['kimi'])
else if (needsLongContext):
  filtered = classified.filter(p => p.context === 'long').sort(['kimi'])
else:
  filtered = classified.filter(p => p.cost === 'low').sort(['glm', ...])

selected = filtered[0] || profiles.find(p => p === 'glm') || profiles[0]
if (!selected): throw Error("No profiles configured")

log("Selected {selected} (reason: {reasoning|long-context|cost-optimized})")

Override Logic:

  • Parse task for /--(\w+)/. If match: profile = match[1], remove from task, skip selection

Example Delegation Tasks

Good candidates:

  • "/ccs add unit tests for UserService using Jest" → Auto-selects: glm (simple task)
  • "/ccs analyze entire architecture in src/" → Auto-selects: kimi (long-context)
  • "/ccs think about the best database schema design" → Auto-selects: kimi (reasoning)
  • "/ccs --glm refactor parseConfig to use destructuring" → Forces: glm (override)

Bad candidates (keep in main):

  • "implement OAuth" (too complex, needs design)
  • "improve performance" (requires profiling)
  • "fix the bug" (needs investigation)

Execution

Commands:

  • /ccs "task" - Intelligent delegation (auto-select profile)
  • /ccs --{profile} "task" - Force specific profile
  • /ccs:continue "follow-up" - Continue last session (auto-detect profile)
  • /ccs:continue --{profile} "follow-up" - Continue with profile switch

Agent via Bash:

  • Auto: ccs {auto-selected} -p "task"
  • Continue: ccs {detected}:continue -p "follow-up"

References

Template: CLAUDE.md.template - Copy to user's CLAUDE.md for auto-delegation config Troubleshooting: references/troubleshooting.md

When not to use it

  • Complex architecture design
  • Security-critical code changes
  • Performance optimization tasks

Prerequisites

~/.ccs/config.json configured

Limitations

  • Requires pre-configured profiles in config.json
  • Limited to deterministic, well-defined tasks

How it compares

It automates the selection of cost-optimized models for deterministic tasks, whereas manual delegation requires the user to manually choose profiles and manage context.

Compared to similar skills

ccs-delegation side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
ccs-delegation (this skill)28moNo flagsIntermediate
prompt-optimize139moNo flagsAdvanced
ai-cost-optimizer95moCautionIntermediate
self-improving-agent121moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

prompt-optimize

YYH211

Expert prompt engineering skill that transforms Claude into "Alpha-Prompt" - a master prompt engineer who collaboratively crafts high-quality prompts through flexible dialogue. Activates when user asks to "optimize prompt", "improve system instruction", "enhance AI instruction", or mentions prompt engineering tasks.

13113

ai-cost-optimizer

ScientiaCapital

Save 40-70% on AI costs with intelligent multi-LLM routing. Automatically selects the optimal model based on task complexity across 40+ models from 8 providers.

990

self-improving-agent

alirezarezvani

Curate Claude Code's auto-memory into durable project knowledge. Analyze MEMORY.md for patterns, promote proven learnings to CLAUDE.md and .claude/rules/, extract recurring solutions into reusable skills. Use when: (1) reviewing what Claude has learned about your project, (2) graduating a pattern from notes to enforced rules, (3) turning a debugging solution into a skill, (4) checking memory health and capacity.

128

skill-from-notebook

GBSOSS

Extract methodologies from documents or examples to create executable skills

28

prompt-factory

alirezarezvani

World-class prompt powerhouse that generates production-ready mega-prompts for any role, industry, and task through intelligent 7-question flow, 69 comprehensive presets across 15 professional domains (technical, business, creative, legal, finance, HR, design, customer, executive, manufacturing, R&D, regulatory, specialized-technical, research, creative-media), multiple output formats (XML/Claude/ChatGPT/Gemini), quality validation gates, and contextual best practices from OpenAI/Anthropic/Google. Supports both core and advanced modes with testing scenarios and prompt variations.

45

skillforge

tripleyak

Intelligent skill router and creator. Analyzes ANY input to recommend existing skills, improve them, or create new ones. Uses deep iterative analysis with 11 thinking models, regression questioning, evolution lens, and multi-agent synthesis panel. Phase 0 triage ensures you never duplicate existing functionality.

13

Search skills

Search the agent skills registry