npx claudepluginhub manifoldlogic/claude-code-plugins --plugin sdd# Assign Custom Agents to Ticket
## Context
User input: "$ARGUMENTS"
Plugin root: "${CLAUDE_PLUGIN_ROOT}"
## Workflow
**IMPORTANT: You are an orchestrator. You do NOT do the work yourself. You delegate to the agent-assigner agent.**
### Step 1: Parse Arguments
Extract from `$ARGUMENTS`:
- **TICKET_ID**: Ticket identifier (e.g., "APIV2")
- **Additional Instructions**: Optional agent assignment preferences or criteria (everything after TICKET_ID)
Examples:
- `APIV2` → ticket_id: "APIV2", instructions: none
- `APIV2 Prefer specialized agents over general ones` → ticket_id: "APIV2", inst...User input: "$ARGUMENTS" Plugin root: "${CLAUDE_PLUGIN_ROOT}"
IMPORTANT: You are an orchestrator. You do NOT do the work yourself. You delegate to the agent-assigner agent.
Extract from $ARGUMENTS:
Examples:
APIV2 → ticket_id: "APIV2", instructions: noneAPIV2 Prefer specialized agents over general ones → ticket_id: "APIV2", instructions: "Prefer specialized agents over general ones"CACHE Assign agents with concurrency expertise → ticket_id: "CACHE", instructions: "Assign agents with concurrency expertise"Check ticket exists:
if [ ! -d "${SDD_ROOT_DIR:-/app/.sdd}/tickets/${TICKET_ID}_"* ]; then
echo "Error: Ticket ${TICKET_ID} not found"
exit 1
fi
Find exact ticket path:
TICKET_PATH=$(ls -d ${SDD_ROOT_DIR:-/app/.sdd}/tickets/${TICKET_ID}_* 2>/dev/null | head -1)
Verify agent recommendations exist:
if [ ! -f "${TICKET_PATH}/planning/agent-recommendations.md" ]; then
echo "Error: No agent recommendations found for ${TICKET_ID}"
echo "Run /sdd:recommend-agents ${TICKET_ID} first"
exit 1
fi
Delegate to agent-assigner agent (Sonnet):
Assignment: Integrate newly created agents into ticket {TICKET_ID}
Context:
- Ticket path: {TICKET_PATH}
- Agent recommendations: {TICKET_PATH}/planning/agent-recommendations.md
- Additional instructions: {ARGUMENTS after TICKET_ID, or "None provided"}
Instructions:
1. Read agent-recommendations.md to understand recommended agents
2. Search for which recommended agents were actually created
3. Update plan.md to assign agents to appropriate phases
4. Update existing tasks with agent assignments (if tasks exist)
5. Update architecture.md if it mentions agent responsibilities
6. Create agent-assignments.md summarizing all assignments
7. Document which recommended agents were NOT created
Quality Requirements:
- Assignments must match recommended scope
- All similar work should use the same agent (consistency)
- Clear boundaries between agent responsibilities
- Document agents that were recommended but not created
Output: Updated planning docs + tasks + agent-assignments.md + summary report
After agent completes, display summary:
AGENT ASSIGNMENTS COMPLETE
Ticket: {TICKET_ID}_{name}
{Agent's summary of assignments}
Files Updated:
- {list of modified files}
New Document:
- {TICKET_PATH}/planning/agent-assignments.md
After displaying the report above, use the AskUserQuestion tool to present next steps to the user:
Question: "What would you like to do next?" Header: "Next step" multiSelect: false
Options:
Where {TICKET_ID} is the actual ticket ID from the command execution context, NOT the literal placeholder text.
# Basic agent assignment
/sdd:assign-agents APIV2
# Prefer specialized agents
/sdd:assign-agents APIV2 Prefer specialized agents over general ones
# Require specific expertise
/sdd:assign-agents CACHE Assign agents with concurrency and caching expertise
# Assignment strategy guidance
/sdd:assign-agents DOCKER Assign same agent for related container tasks
# After creating some (but not all) recommended agents
/sdd:assign-agents DOCKER
# Update assignments after creating additional agents later
/sdd:assign-agents CACHE Use general agents for flexibility
Recommended: Run BEFORE /sdd:create-tasks
# 1. Create ticket and review
/sdd:plan-ticket "API Version 2"
/sdd:review APIV2
# 2. Get agent recommendations
/sdd:recommend-agents APIV2
# 3. Create agents using Claude Code's /agents UI
# (Paste descriptions from agent-recommendations.md)
# 4. Assign agents to phases ← BEFORE decompose
/sdd:assign-agents APIV2
# 5. Create tasks (inherits agent assignments from plan.md)
/sdd:create-tasks APIV2
# 6. Execute work
/sdd:do-all-tasks APIV2
Alternative: Run AFTER /sdd:create-tasks
If you create tasks first, then decide to add custom agents:
# Tasks already exist
/sdd:create-tasks APIV2
# Later: Get agent recommendations
/sdd:recommend-agents APIV2
# Create agents, then retroactively assign
/sdd:assign-agents APIV2 # Updates both plan.md AND existing tasks
Pros of Before-Decompose:
Pros of After-Decompose:
Re-running Assign-Agents:
If ticket doesn't exist:
Error: Ticket {TICKET_ID} not found
Available tickets:
{list projects in ${SDD_ROOT_DIR}/tickets/}
If no recommendations found:
Error: No agent recommendations found for {TICKET_ID}
Please run /sdd:recommend-agents {TICKET_ID} first to analyze
the ticket and get recommendations for custom agents.
If planning incomplete:
Error: Ticket planning incomplete
Missing required documents for agent assignment:
{list missing planning docs like plan.md, architecture.md}
Cannot assign agents without execution plan.
The agent-assigner will update:
In plan.md:
## Phase 2: Caching Implementation
**Agent Assignments:**
- cache-engineer: Design and implement cache layers
- database-engineer: Optimize database queries for caching
In tasks:
## Agent Assignment
**Primary:** cache-engineer
- Responsible for cache invalidation strategy
- Ensures performance requirements met