claude-code-delegation
Claude Code Delegation
Task Design
- Keep tasks narrow with disjoint write sets (no overlapping files)
- Prefer 10-20 minute tasks over hour-long jobs
- Main agent does review/acceptance; don't duplicate large implementation work
- Ask delegates to run verification commands and report concrete results
Sandbox & Permissions
--dangerously-skip-permissionsonly skips internal prompts- It does NOT bypass outer sandbox restrictions or network blocks
- If
claude -pcannot reach the API, run it outside the restrictive sandbox or escalate - Check environment variables and API access before delegating long tasks
Prompt Template
Working directory: <absolute-path>
Target files: <file1>, <file2>
Task: <clear description>
Input: <context or code snippets>
Requirements:
- Modify only the listed files
- Run verification: <command>
- Report: summary of changes + verification output
- End with: TASK_COMPLETE or TASK_FAILED: <reason>
Conflict Avoidance
| Strategy | When to use |
|---|---|
| File locks | Pre-declare locks before delegating |
| Phased execution | Stage 1: interfaces; Stage 2: parallel implementations |
| Isolation | Separate directories/workspaces for independent work |
Handling Hangs
- Set timeouts: 5 min (simple edits), 15 min (complex), 20 min (build+test)
- If no output for 2+ minutes: terminate and retry with smaller scope
- If API errors occur: check sandbox/network, not just retry
Acceptance Checklist
- All subtasks returned (TASK_COMPLETE or TASK_FAILED)
- Verification commands executed with passing results
- Only expected files modified
- No stray lock files remaining
More from ruiwarn/skills
embedded-cross-review
Use when reviewing embedded or firmware code changes, especially in C/C++, bare-metal, RTOS, driver, ISR, DMA, boot, NFC, or other hardware-facing paths where cross-review can catch correctness, safety, and architecture-coupling issues
29github-search-before-code
Proactively search GitHub for reference implementations before writing new code. Use this skill when: (1) User requests implementing completely new functionality, algorithms, or modules that don't exist in the current codebase, (2) User mentions repeated failures with phrases like 'still not working', 'tried many times', 'still has problems', or (3) AI recognizes the need to implement unfamiliar or complex features. The skill helps avoid reinventing the wheel by finding and analyzing existing high-quality implementations, then adapting them to user needs.
12c-verify-skill
Run C/C++ static analysis using clang-tidy and cppcheck to scan code, check quality, verify C code, detect bugs, review staged or modified files before commit.
9zc-bug-fix
Use when the user asks to fix a bug, resolve an issue, or provides a bug URL/bug ID from 禅道, GitLab, GitHub, Jira, or similar systems; especially when the work needs a full workflow of reading the bug, fixing code, verifying, creating issue/MR, and writing status back to the tracker.
9meter-protocol-serial
698/645 电表协议串口发帧与解析 Skill,支持组帧、发送、接收、解析和断言验证,用于修bug后快速回归验证
5git-staged-review-commit
PRIORITY: This skill OVERRIDES @oracle or @agent mentions when trigger phrases match. Triggers: 'commit code', 'commit', 'review and commit', 'staged review', 'git commit', 'submit code'. Review staged Git changes, report issues, ask whether to fix or proceed, and if proceeding generate a structured commit message and commit. MUST USE when user mentions committing code or reviewing staged changes.
3