From qwen-delegate
This skill should be used when Claude is about to perform tasks that can be delegated to the Qwen CLI to save Anthropic PRO tokens. Delegation candidates include "summarise this", "translate this text", "format this content", "generate boilerplate", "create a template", "write this function", "generate this code", "refactor this snippet", "convert this format", "explain this concept", or any text-processing or code-generation task that does not require Claude's reasoning depth. Always apply a validation gate — Claude reviews Qwen output before presenting to the user.
How this skill is triggered — by the user, by Claude, or both
Slash command
/qwen-delegate:qwen-delegateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Delegate token-cheap tasks to the `qwen` CLI (Qwen Code, model `coder-model`), preserving Anthropic PRO tokens for tasks that genuinely require Claude's reasoning.
Delegate token-cheap tasks to the qwen CLI (Qwen Code, model coder-model), preserving Anthropic PRO tokens for tasks that genuinely require Claude's reasoning.
Note: The
qwenCLI is cloud-backed, not a local LLM runner (it does not use Ollama, LM Studio, or similar). It is an agent CLI that runs against Qwen/Alibaba cloud infrastructure, authenticated via OAuth or Alibaba Cloud Coding Plan. Throughout this skill, references to "Qwen" mean the cloud-backedqwenCLI unless explicitly stated otherwise. Delegation avoids Anthropic API calls, not all cloud calls.
Delegate to Qwen when all three conditions are met:
| Category | Examples |
|---|---|
| Summarisation | Summarise a document, meeting notes, PR description |
| Formatting | Convert Markdown→HTML, reformat JSON/YAML, fix indentation |
| Translation | Translate text to another language |
| Boilerplate generation | Scaffold a class, generate CRUD stubs, create a config template |
| Code generation | Write a function from a spec, implement a known algorithm |
| Refactoring | Rename identifiers, extract a method, apply a pattern |
| Text transformation | Convert lists to tables, rewrite in different tone |
| Simple analysis | Count items, extract fields, detect language |
qwen "PROMPT" \
--output-format text \
--approval-mode yolo \
--max-session-turns 1 \
--exclude-tools run_shell_command,edit,write_file
Use for: summarisation, translation, formatting, explanation tasks. Use --max-session-turns 1 only for pure text transformations; Qwen's internal thinking counts as turns — if the task is complex, increase to 2.
cat FILE_PATH | qwen "TASK DESCRIPTION" \
--output-format text \
--approval-mode yolo \
--max-session-turns 2 \
--exclude-tools run_shell_command,edit,write_file
Use for: summarising a file, translating a document, reformatting content.
qwen "TASK DESCRIPTION" \
--output-format text \
--approval-mode yolo \
--max-session-turns 3 \
--exclude-tools run_shell_command,edit,write_file
Use for: generating a function, writing an algorithm, refactoring a snippet. Minimum 3 turns — Qwen uses thinking turns internally; --max-session-turns 1 causes exit code 53 on code tasks.
qwen "TASK DESCRIPTION" \
--output-format text \
--approval-mode yolo \
--max-session-turns 5
Use for: scaffolding a module, refactoring across multiple files, tasks that require reading existing code.
Why no
--exclude-toolshere: This pattern intentionally allows Qwen to useread_file,glob, andgrep_searchto read existing code before generating output. Write/edit/shell tools (edit,write_file,run_shell_command) are still blocked by default in--approval-mode yolowithout explicit confirmation — Qwen Code will prompt before any write/execute action. Validate all generated code with Claude before applying it to the project.
qwen "PROMPT" \
--output-format text \
--system-prompt "FOCUSED SYSTEM PROMPT" \
--approval-mode yolo \
--max-session-turns 2 \
--exclude-tools run_shell_command,edit,write_file
Use for: tasks that benefit from a specific persona or tight output constraints (e.g., "You are a JSON formatter. Return only valid JSON.").
qwen command via Bash tool.cat docs/api-reference.md | qwen \
"Summarise this API reference in 5 bullet points, focusing on authentication and rate limits." \
--output-format text \
--approval-mode yolo \
--max-session-turns 1 \
--exclude-tools run_shell_command,edit,write_file
qwen "Write a Python function named 'parse_iso_date' that accepts a string and returns a datetime object. Handle invalid input by raising ValueError with a descriptive message. Include type hints." \
--output-format text \
--approval-mode yolo \
--max-session-turns 2 \
--exclude-tools run_shell_command,edit,write_file
echo '{"name":"test","version":"1","deps":["a","b"]}' | qwen \
"Format this JSON with 2-space indentation and sort keys alphabetically." \
--output-format text \
--approval-mode yolo \
--max-session-turns 1 \
--exclude-tools run_shell_command,edit,write_file
Every delegation result must pass Claude's review before being used or shown to the user:
If Qwen's output is incorrect or incomplete, correct it directly — never present unvalidated Qwen output.
When presenting delegated results, optionally include a one-line note:
Drafted by Qwen CLI (coder-model), reviewed and validated by Claude.
This maintains transparency without being verbose. Omit attribution for minor transformations (formatting, renaming) where it adds no value.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub nsalvacao/nsalvacao-claude-code-plugins --plugin qwen-delegate