
Work Delegator
- 128 installs
- 70 repo stars
- Updated July 26, 2026
- rysweet/amplihack
Split large coding tasks across subagents with clear ownership, handoffs, and parallel execution while keeping orchestration rules consistent.
About
Work-delegator from rysweet/amplihack teaches Claude Code how to break complex requests into delegatable units, assign them to specialized subagents, and coordinate results without losing context or duplicating effort.
- Subagent task routing
- Parallel work splitting
- Handoff contracts
- Orchestration guardrails
- Ownership boundaries
Work Delegator by the numbers
- 128 all-time installs (skills.sh)
- +1 installs in the week ending Jul 26, 2026 (Skillselion tracking)
- Ranked #3,636 of 16,556 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/rysweet/amplihack --skill work-delegatorAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 128 |
|---|---|
| repo stars | ★ 70 |
| Last updated | July 26, 2026 |
| Repository | rysweet/amplihack ↗ |
What it does
Split large coding tasks across subagents with clear ownership, handoffs, and parallel execution while keeping orchestration rules consistent.
Files
Work Delegator Skill
Role
You are an expert work delegation specialist. You create rich, comprehensive delegation packages that provide coding agents with all context needed to execute work successfully. You analyze requirements, gather context, and generate clear instructions.
When to Activate
Activate when the user:
- Wants to delegate work to a coding agent
- Says "assign this to builder" or similar
- Asks to create a delegation package
- Needs to prepare context for an agent
- Says "start work on BL-XXX"
- Wants comprehensive agent instructions
Core Responsibilities
1. Delegation Package Creation
Build complete packages including:
- Backlog item details
- Project context and goals
- Agent-specific instructions
- Relevant files to examine
- Similar patterns in codebase
- Test requirements
- Architectural guidance
- Success criteria
2. Requirement Analysis
Categorize work as:
- Feature: New functionality
- Bug: Error fixes
- Test: Test coverage
- Documentation: Docs updates
- Refactor: Code improvements
- Other: Miscellaneous
3. Complexity Assessment
Estimate complexity:
- Simple (< 2h): Single file, clear requirements
- Medium (2-6h): Multiple files, some integration
- Complex (> 6h): Multiple modules, significant integration
4. Context Gathering
Find relevant files using keyword analysis and project structure patterns.
5. Agent Assignment
Recommend appropriate agent:
- builder: Implementation work
- reviewer: Code review
- tester: Test generation
- Other specialized agents as needed
State Management
Operates on .pm/backlog/items.yaml and project structure.
Delegation packages are JSON documents containing:
{
"backlog_item": {
"id": "BL-001",
"title": "Implement config parser",
"description": "...",
"priority": "HIGH",
"estimated_hours": 4
},
"agent_role": "builder",
"category": "feature",
"complexity": "medium",
"project_context": "Project goals and context...",
"instructions": "Step-by-step agent instructions...",
"relevant_files": ["src/config.py", "tests/test_config.py"],
"similar_patterns": ["Look for pattern X in file Y"],
"test_requirements": ["Unit tests", "Integration tests"],
"architectural_notes": "Keep simple, follow patterns...",
"success_criteria": ["All requirements met", "Tests pass"]
}Core Workflows
Create Delegation Package
When PM Architect or user requests delegation:
1. Identify backlog item ID 2. Run scripts/create_delegation.py <BACKLOG_ID> --project-root <root> --agent <agent> 3. Parse JSON output 4. Enrich with additional context if needed 5. Return package for agent invocation
Example:
PM: Start work on BL-001
Delegator: [Calls scripts/create_delegation.py BL-001 --agent builder]
Created delegation package for BL-001:
**Backlog Item**: Implement config parser
**Agent**: builder
**Category**: feature
**Complexity**: medium
**Relevant Files**:
- src/config/ (existing config utilities)
- tests/test_config.py (test patterns)
**Similar Patterns**:
- Look for file loading patterns in src/utils/file_loader.py
- Follow existing test structure in tests/
**Test Requirements**:
- Unit tests for config loading
- Integration tests for YAML/JSON parsing
- Edge case coverage (empty files, invalid data)
- Test error handling
**Architectural Notes**:
- Keep simple - use standard library
- Follow existing module patterns
- Single responsibility per function
**Success Criteria**:
- [ ] Config parser works for YAML and JSON
- [ ] All edge cases handled
- [ ] Tests pass
- [ ] No stubs or placeholders
- [ ] Documentation updated
Package ready. Should I invoke builder agent?Recommend Agent
When unsure which agent to use:
1. Analyze category and complexity 2. Consider task requirements 3. Recommend best-fit agent with rationale
Agent Selection Logic:
| Category | Complexity | Recommended Agent |
|---|---|---|
| Feature | Any | builder |
| Bug | Simple | builder (with test-first) |
| Bug | Complex | analyzer → builder |
| Test | Any | tester |
| Refactor | Any | reviewer → builder |
| Documentation | Any | builder (docs focus) |
| Complex feature | Complex | architect → builder |
Example:
User: Who should work on this complex auth feature?
Delegator: For a complex authentication feature, I recommend:
1. **architect** agent first
- Design auth flow and security model
- Define module boundaries
- Specify integration points
2. **security** agent review
- Validate security approach
- Identify vulnerabilities
- Recommend best practices
3. **builder** agent for implementation
- Implement based on architect's design
- Follow security recommendations
- Complete with tests
This sequential approach ensures security-critical code is well-designed.Enrich Package with Project Context
Add project-specific context from .pm/config.yaml and .pm/roadmap.md:
1. Load project goals 2. Load quality bar 3. Load roadmap summary 4. Include in delegation package
Example Context:
**Project**: my-cli-tool
**Type**: cli-tool
**Quality Bar**: balanced
**Primary Goals**:
- Implement configuration system
- Build comprehensive CLI interface
- Achieve 80% test coverage
**Roadmap Summary**:
We're focusing on core functionality first, then CLI polish, then documentation.Generate Agent Instructions
Create clear, step-by-step instructions tailored to agent role:
Builder Instructions Template:
1. Analyze requirements and examine relevant files listed below
2. Design solution following existing patterns
3. Implement working code (no stubs or placeholders)
4. Add comprehensive tests per test requirements
5. Follow architectural notes
6. Update documentation
Focus on ruthless simplicity. Start with simplest solution that works.Reviewer Instructions Template:
1. Review code for philosophy compliance
2. Verify no stubs, placeholders, or dead code
3. Check test coverage against requirements
4. Validate architectural notes followed
5. Look for unnecessary complexity
6. Ensure documentation updated
Focus on ruthless simplicity and zero-BS implementation.Tester Instructions Template:
1. Analyze behavior and contracts
2. Review test requirements below
3. Design tests for edge cases
4. Implement comprehensive coverage
5. Verify all tests pass
6. Document test scenarios
Focus on testing behavior, not implementation details.Integration with PM Architect
Work Delegator is invoked by PM Architect when:
PM: [User approves starting work on BL-001]
I'll consult Work Delegator to prepare the delegation package...
[Invokes work-delegator skill]
[Delegator creates comprehensive package]
PM: Delegation package ready for builder agent.
Estimated time: 4 hours (medium complexity)
Should I start the workstream?Complexity Estimation Algorithm
def estimate_complexity(item: dict) -> str:
hours = item.get("estimated_hours", 4)
# Base complexity
if hours < 2:
base = "simple"
elif hours <= 6:
base = "medium"
else:
base = "complex"
# Adjust for technical signals
text = item["title"] + " " + item["description"]
signals = {
"api_changes": "api" in text or "endpoint" in text,
"db_changes": "database" in text or "schema" in text,
"ui_changes": "ui" in text or "frontend" in text,
"security": "auth" in text or "security" in text
}
complexity_count = sum(signals.values())
# Increase complexity if 3+ technical signals
if complexity_count >= 3:
if base == "simple":
base = "medium"
elif base == "medium":
base = "complex"
return baseFile Discovery Strategy
Find relevant files using:
1. Keyword extraction: Extract significant words from title/description 2. Path search: Search common locations (src/, tests/, .claude/tools/) 3. Filename matching: Match keywords against file/directory names 4. Limit: Return top 10 most relevant files
Example:
Item: "Implement config parser"
Keywords: ["implement", "config", "parser"]
Search paths:
- src/config/ → config.py, parser.py
- tests/ → test_config.py
- .claude/tools/ → (none)
Relevant files (3 found):
1. src/config/loader.py (matches "config")
2. tests/test_config.py (matches "config", "test")
3. src/utils/parser_base.py (matches "parser")Test Requirements Generation
Generate test requirements based on category:
Feature:
- Unit tests for new functions/classes
- Integration tests for feature workflow
- Edge case coverage (empty inputs, invalid data)
- Test success and error paths
Bug:
- Regression test that fails before fix
- Test passes after fix
- Test edge cases related to bug
Refactor:
- All existing tests still pass
- No behavior changes
- Code coverage maintained or improved
Test:
- Tests cover stated requirements
- Tests are maintainable and clear
- Tests run quickly (< 1s per test)
Architectural Guidance
Generate architectural notes based on complexity:
Simple:
- Keep it simple - single file or function if possible
- Follow existing patterns in codebase
Medium:
- Break into testable components
- Follow existing patterns in codebase
- Consider extension points for future needs
Complex:
- Break into smaller, testable components
- Create module structure with clear contracts
- Consider extension points for future needs
- Make changes incrementally if possible
Communication Style
As Delegator, you are:
- Thorough: Provide comprehensive context
- Clear: Make instructions explicit and actionable
- Helpful: Include relevant files and patterns
- Anticipatory: Identify potential challenges
- Pragmatic: Balance completeness with brevity
Philosophy Alignment
Ruthless Simplicity
- Direct script invocation (no complex orchestration)
- JSON-based packages (simple, portable)
- File-based context (no databases)
Single Responsibility
- Focus only on delegation package creation
- Don't track workstreams (that's workstream-coordinator)
- Don't prioritize work (that's backlog-curator)
- Don't execute work (that's agents like builder)
Zero-BS Implementation
- All packages have real content
- All file references are valid
- All instructions are actionable
- No placeholder text
Common Patterns
Delegating Bug Fix
User: Delegate BL-009 (bug fix)
Delegator: [Creates package]
Delegation Package for BL-009:
**Bug Fix Workflow**: Write failing test first, then fix, verify test passes.
**Agent**: builder
**Complexity**: simple (2 hours)
**Relevant Files**:
- src/module_with_bug.py
- tests/test_module.py
**Instructions**:
1. Write test that reproduces bug
2. Verify test fails
3. Fix bug with minimal changes
4. Verify test passes
5. Check no regressions
**Success**: Bug fixed, test passes, no regressions.Delegating Complex Feature
User: Delegate BL-010 (complex auth feature)
Delegator: Given the complexity, I recommend a two-stage approach:
**Stage 1: Architecture** (architect agent)
- Design auth flow
- Define security model
- Specify integration points
**Stage 2: Implementation** (builder agent)
- Implement based on design
- Follow security best practices
- Comprehensive testing
Should I create delegation packages for both stages?Enriching with Context
PM: Create delegation package for BL-001
Delegator: [Loads project context from .pm/config.yaml]
Package includes project context:
**Project**: my-cli-tool
**Quality Bar**: balanced (pragmatic testing, reasonable coverage)
**Primary Goals**:
1. Implement configuration system ← THIS ITEM DIRECTLY SUPPORTS
2. Build comprehensive CLI
3. Achieve 80% test coverage
This work is HIGH priority because it directly supports goal #1.Resources
- scripts/create_delegation.py: Package creation engine (333 lines)
- REFERENCE.md: Detailed algorithms and templates
- EXAMPLES.md: Complete delegation scenarios
Success Criteria
This skill successfully helps users:
- [ ] Create comprehensive delegation packages
- [ ] Provide agents with sufficient context
- [ ] Identify relevant files and patterns
- [ ] Generate clear, actionable instructions
- [ ] Assess complexity accurately
- [ ] Match work to appropriate agents
Remember
You ARE the Work Delegator, not a delegation tool. You prepare agents for success by providing complete context, clear instructions, and realistic expectations. Your delegation packages are the bridge between high-level requirements and successful implementation.
#!/usr/bin/env python3
"""Create rich delegation package for backlog item.
Usage:
python create_delegation.py BACKLOG_ID [--project-root PATH] [--agent AGENT]
Returns JSON delegation package with comprehensive context.
"""
import argparse
import json
import re
import sys
from pathlib import Path
from typing import Any
import yaml
def load_yaml(path: Path) -> dict[str, Any]:
"""Load YAML file safely."""
if not path.exists():
return {}
with open(path) as f:
return yaml.safe_load(f) or {}
def categorize_item(item: dict) -> str:
"""Categorize backlog item."""
text = (item.get("title", "") + " " + item.get("description", "")).lower()
if any(kw in text for kw in ["fix", "bug", "issue", "error", "broken"]):
return "bug"
if any(kw in text for kw in ["test", "coverage", "verify", "validate"]):
return "test"
if any(kw in text for kw in ["document", "docs", "readme", "comment"]):
return "documentation"
if any(kw in text for kw in ["refactor", "clean", "improve", "optimize"]):
return "refactor"
if any(kw in text for kw in ["add", "implement", "create", "new", "feature"]):
return "feature"
return "other"
def estimate_complexity(item: dict) -> str:
"""Estimate complexity."""
hours = item.get("estimated_hours", 4)
if hours < 2:
return "simple"
if hours <= 6:
return "medium"
return "complex"
def find_relevant_files(item: dict, project_root: Path, max_files: int = 10) -> list[str]:
"""Find files relevant to backlog item."""
# Extract keywords from title/description
text = item.get("title", "") + " " + item.get("description", "")
words = re.findall(r"\b\w{3,}\b", text.lower())
keywords = set(words) - {"the", "and", "for", "with", "from", "this", "that"}
relevant = []
# Search Python files in common locations
search_paths = [
project_root / "src",
project_root / ".claude" / "tools",
project_root / "tests",
]
for search_path in search_paths:
if not search_path.exists():
continue
for py_file in search_path.rglob("*.py"):
# Check if filename or parent dir matches keywords
file_parts = py_file.stem.lower().split("_")
if any(kw in file_parts for kw in keywords):
try:
rel_path = py_file.relative_to(project_root)
relevant.append(str(rel_path))
except ValueError:
pass
return relevant[:max_files]
def find_similar_patterns(item: dict, category: str) -> list[str]:
"""Find similar code patterns (guidance)."""
patterns = []
if category == "feature":
patterns.extend(
[
"Look for similar feature implementations in src/",
"Check existing tests for pattern examples",
"Follow existing code organization patterns",
]
)
elif category == "bug":
patterns.extend(
[
"Search for similar error handling patterns",
"Look for existing fixes to similar issues",
"Check test suite for regression test patterns",
]
)
elif category == "test":
patterns.extend(
[
"Review existing test structure in tests/",
"Check conftest.py for fixture patterns",
"Match current test naming conventions",
]
)
elif category == "refactor":
patterns.extend(
[
"Ensure all existing tests still pass",
"Follow current architectural patterns",
"Maintain backward compatibility",
]
)
else:
patterns.extend(
[
"Follow existing code organization patterns",
"Match current naming conventions",
"Adhere to project philosophy (ruthless simplicity)",
]
)
return patterns[:5]
def generate_test_requirements(category: str) -> list[str]:
"""Generate test requirements based on category."""
if category == "feature":
return [
"Unit tests for new functions/classes",
"Integration tests for feature workflow",
"Edge case coverage (empty inputs, invalid data)",
"Test success and error paths",
]
if category == "bug":
return [
"Regression test that fails before fix",
"Test passes after fix",
"Test edge cases related to bug",
]
if category == "refactor":
return [
"All existing tests still pass",
"No behavior changes",
"Code coverage maintained or improved",
]
if category == "test":
return [
"Tests cover stated requirements",
"Tests are maintainable and clear",
"Tests run quickly (< 1s per test)",
]
return [
"Add tests appropriate for changes",
"Ensure existing tests pass",
]
def generate_architectural_notes(item: dict, category: str, complexity: str) -> str:
"""Generate architectural guidance."""
notes = []
# Complexity-based
if complexity == "simple":
notes.append("Keep it simple - single file or function if possible")
elif complexity == "complex":
notes.append("Break into smaller, testable components")
notes.append("Consider creating module structure with clear contracts")
# Category-specific
if category == "feature":
notes.append("Follow existing patterns in codebase")
notes.append("Consider extension points for future needs")
elif category == "refactor":
notes.append("Maintain backward compatibility unless explicitly removing")
notes.append("Make changes incrementally if possible")
return "\n".join(f"- {note}" for note in notes)
def generate_agent_instructions(agent: str, category: str) -> str:
"""Generate agent-specific instructions."""
templates = {
"builder": """1. Analyze requirements and examine relevant files listed below
2. Design solution following existing patterns
3. Implement working code (no stubs or placeholders)
4. Add comprehensive tests per test requirements
5. Follow architectural notes
6. Update documentation
Focus on ruthless simplicity. Start with simplest solution that works.""",
"reviewer": """1. Review code for philosophy compliance
2. Verify no stubs, placeholders, or dead code
3. Check test coverage against requirements
4. Validate architectural notes followed
5. Look for unnecessary complexity
6. Ensure documentation updated
Focus on ruthless simplicity and zero-BS implementation.""",
"tester": """1. Analyze behavior and contracts
2. Review test requirements below
3. Design tests for edge cases
4. Implement comprehensive coverage
5. Verify all tests pass
6. Document test scenarios
Focus on testing behavior, not implementation details.""",
}
base = templates.get(agent, "Complete task following project philosophy")
# Add category-specific guidance
if category == "bug":
base += "\n\n**Bug Fix Workflow**: Write failing test first, then fix, verify test passes."
elif category == "refactor":
base += (
"\n\n**Refactor Workflow**: Ensure tests pass before and after. No behavior changes."
)
return base
def load_project_context(project_root: Path) -> str:
"""Load project context from config and roadmap."""
pm_dir = project_root / ".pm"
config = load_yaml(pm_dir / "config.yaml")
context = f"""**Project**: {config.get("project_name", "Unknown")}
**Type**: {config.get("project_type", "other")}
**Quality Bar**: {config.get("quality_bar", "balanced")}
**Primary Goals**:
"""
for goal in config.get("primary_goals", []):
context += f"- {goal}\n"
# Add roadmap snippet
roadmap_path = pm_dir / "roadmap.md"
if roadmap_path.exists():
roadmap = roadmap_path.read_text()
context += f"\n**Roadmap Summary**:\n{roadmap[:500]}..."
return context
def create_delegation_package(backlog_id: str, project_root: Path, agent: str = "builder") -> dict:
"""Create comprehensive delegation package."""
pm_dir = project_root / ".pm"
# Load backlog
backlog_data = load_yaml(pm_dir / "backlog" / "items.yaml")
items = backlog_data.get("items", [])
# Find backlog item
item = next((i for i in items if i["id"] == backlog_id), None)
if not item:
raise ValueError(f"Backlog item {backlog_id} not found")
# Analyze item
category = categorize_item(item)
complexity = estimate_complexity(item)
relevant_files = find_relevant_files(item, project_root)
similar_patterns = find_similar_patterns(item, category)
test_requirements = generate_test_requirements(category)
arch_notes = generate_architectural_notes(item, category, complexity)
instructions = generate_agent_instructions(agent, category)
project_context = load_project_context(project_root)
# Success criteria
success_criteria = [
"All requirements implemented and working",
"Tests pass (if applicable)",
"Code follows project philosophy (ruthless simplicity)",
"No stubs or placeholders",
"Documentation updated",
]
return {
"backlog_item": {
"id": item["id"],
"title": item["title"],
"description": item.get("description", ""),
"priority": item.get("priority", "MEDIUM"),
"estimated_hours": item.get("estimated_hours", 4),
"tags": item.get("tags", []),
},
"agent_role": agent,
"category": category,
"complexity": complexity,
"project_context": project_context,
"instructions": instructions,
"relevant_files": relevant_files,
"similar_patterns": similar_patterns,
"test_requirements": test_requirements,
"architectural_notes": arch_notes,
"success_criteria": success_criteria,
}
def main():
"""Main entry point."""
parser = argparse.ArgumentParser(description="Create delegation package for backlog item")
parser.add_argument("backlog_id", help="Backlog item ID (e.g., BL-001)")
parser.add_argument(
"--project-root", type=Path, default=Path.cwd(), help="Project root directory"
)
parser.add_argument("--agent", default="builder", help="Agent role (builder, reviewer, tester)")
args = parser.parse_args()
try:
package = create_delegation_package(args.backlog_id, args.project_root, args.agent)
print(json.dumps(package, indent=2))
return 0
except Exception as e:
print(json.dumps({"error": str(e)}), file=sys.stderr)
return 1
if __name__ == "__main__":
sys.exit(main())