Skill v1.0.0
currentAutomated scan100/100name: mufreze-delegate description: Delegate coding tasks to workers (kimi, codex, claude-sonnet, claude-opus) using the MUFREZE CLI. Use when asked to create files, implement features, build components, or write code. metadata: version: "1.0.0"
MUFREZE Task Delegation
Use this skill when you need to delegate coding tasks to specialized workers via the MUFREZE CLI.
When to Use This Skill
Triggers: Use delegation when user asks to:
- "Create file" / "Create component" / "Create module"
- "Implement" / "Implement feature" / "Implement endpoint"
- "Build" / "Build app" / "Build service"
- "Write code" / "Write function" / "Write API"
When NOT to Use (Do Directly)
Do NOT delegate - handle directly instead:
- Small edits (< 20 lines)
- Configuration changes (json, yaml, toml updates)
- Renaming variables or simple refactoring
- Adding comments or documentation
- Deleting unused code
- Import/dependency adjustments
Atomic Task Rule
1 task = 1 file ONLY
- NEVER create cross-file tasks in a single delegation
- If multiple files needed → split into sequential delegations
- Each task spec should target exactly ONE file path
Step-by-Step Delegation Protocol
1. Read Project Briefing
Always read the project briefing first:
# Check for MUFREZE briefingcat docs/MUFREZE-BRIEFING.md 2>/dev/null || cat docs/KIMI-BRIEFING.md 2>/dev/null
This ensures the worker understands:
- Tech stack and conventions
- Coding standards (e.g.,
set -euo pipefailfor bash) - Project-specific rules
2. Write Atomic Task Spec
Create a focused task specification:
Create /src/utils/validators.py with a single function:def validate_email(email: str) -> bool:'''Validate email format using regex.'''Requirements:- Use Python 3.9+ type hints- Import re module- Return True if valid, False otherwise- Handle None/empty input gracefully
Task Spec Guidelines:
- Specify ONE file path explicitly
- Include complete function/class signature
- List all imports needed
- Provide example usage if helpful
- Keep under 100 lines
3. Call Delegate Command
mufreze delegate <worker> '<task_spec>' /project/path
Workers Available:
kimi- Fast, cost-effective (default for most tasks)codex- Good for complex logicclaude-sonnet- Review and refinementclaude-opus- Escalation only
Examples:
# Basic delegation to kimimufreze delegate kimi 'Create users.py with FastAPI User model' ./myproject# Delegation with specific workermufreze delegate codex 'Implement JWT authentication middleware' ./api# Delegation with full task spec (quote properly)mufreze delegate kimi 'Create /src/api/routes.py with:- GET /health endpoint returning {"status": "ok"}- Use FastAPI Router- Include proper imports' ./myproject
4. Wait for Output
- Delegation runs asynchronously
- Worker will create/modify the target file
- Output shows success/failure with file paths
5. Verify the Result
ALWAYS verify after delegation:
mufreze verify /project/path
This checks:
- Syntax errors (Python:
py_compile, JS:node --check, TS:tsc) - Type errors (TypeScript)
- Import resolution
6. Handle Failures
If verification fails:
Option A - Retry with Error Context:
mufreze delegate kimi 'Fix syntax error in validators.py: unexpected indent at line 23' ./project
Option B - Escalate to Stronger Worker:
mufreze delegate claude-opus 'Implement complex recursive parser with proper error handling' ./project
Option C - Fix Directly (if small):
- Make minimal edits yourself
- Then re-verify
Complete Example
# 1. Read briefingcat docs/KIMI-BRIEFING.md# 2. Delegate taskmufreze delegate kimi 'Create /src/auth/jwt.py with:- import jwt from PyJWT- create_token(user_id: str) -> str (HS256, 24h expiry)- verify_token(token: str) -> dict | None- Handle exceptions gracefully' ./myproject# 3. Verify resultmufreze verify ./myproject# 4. If failed, retry with contextmufreze delegate kimi 'Fix jwt.py: PyJWT import should be "import jwt" not "from jwt import jwt"' ./myproject
Worker Escalation Chain
If a worker fails, MUFREZE auto-escalates:
kimi → codex → claude-sonnet → claude-opus
Manual escalation: Use stronger worker for complex tasks.