.local/skills/delegation/SKILL.md
Delegate tasks to specialized subagents. Use subagent for synchronous task execution, startAsyncSubagent for background task execution, messageSubagent for async follow-ups, or messageSubagentAndGetResponse for sync follow-ups.
npx skillsauth add akhil151/dtpapp delegationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Delegate tasks to specialized subagents for autonomous execution.
Use this skill when:
Launch a subagent to handle a task synchronously. Blocks until the subagent completes and returns the result.
Parameters:
task (str, required): Task ID from session plan (e.g., "T003") OR brief task descriptionfromPlan (bool, default False): If True, subagent reads full task context from .local/session_plan.mdrelevantFiles (list[str], optional): File paths the subagent should access. Include skill paths if subagent needs skillsspecialization (str, default "GENERAL"): "GENERAL" or "SMALL_TASK" for quick tasksReturns: Dict with task results
{
"success": true,
"message": "Task summary",
"subagentAlias": "subagent_1",
"result": "Full task output..."
}
Usage Patterns:
1. From Plan (Recommended when you have a session plan):
// Reference tasks by ID - subagent reads full context from .local/session_plan.md
const result = await subagent({ task: "T003", fromPlan: true });
console.log(result); // Always print the result
2. Direct Task (for ad-hoc tasks without a plan):
const result = await subagent({
task: "Fix the auth bug in src/auth.ts",
relevantFiles: ["src/auth.ts"]
});
console.log(result); // Always print the result
Launch a subagent to handle a task asynchronously in the background. Returns immediately without waiting for completion. Use waitForBackgroundTasks to collect results later.
Parameters:
task (str, required): Task ID from session plan (e.g., "T003") OR brief task descriptionfromPlan (bool, default False): If True, subagent reads full task context from .local/session_plan.mdrelevantFiles (list[str], optional): File paths the subagent should access. Include skill paths if subagent needs skillsspecialization (str, default "GENERAL"): "GENERAL" or "SMALL_TASK" for quick tasksReturns: Immediately with acknowledgment. Results come via waitForBackgroundTasks.
Usage Patterns:
1. From Plan (Recommended when you have a session plan):
// Reference tasks by ID - no print needed, result comes via wait_for_background_tasks
await startAsyncSubagent({ task: "T003", fromPlan: true });
2. Direct Task (for ad-hoc tasks without a plan):
await startAsyncSubagent({
task: "Fix the auth bug in src/auth.ts",
relevantFiles: ["src/auth.ts"]
});
Parallel Execution:
// Launch independent tasks simultaneously
console.log(await startAsyncSubagent({ task: "T002", fromPlan: true }));
console.log(await startAsyncSubagent({ task: "T003", fromPlan: true }));
console.log(await startAsyncSubagent({ task: "T004", fromPlan: true }));
Giving Subagents Access to Skills:
// Include skill documentation in relevantFiles if subagent needs it
await startAsyncSubagent({
task: "T005",
fromPlan: true,
relevantFiles: [".local/skills/database/SKILL.md"]
});
Send a follow-up message to an existing subagent asynchronously. Returns immediately after the message is delivered. Use this when the subagent should continue in the background.
Parameters:
subagentId (str, required): Alias returned when the subagent was startedmessage (str, required): Follow-up instruction or clarification for the subagentReturns: Acknowledgment that the message was sent. The subagent keeps running in the background.
Example:
// Async follow-up: continue background work
await messageSubagent({
subagentId: "subagent-happy-tiger",
message: "After the fix, add regression tests for the auth edge case."
});
// Collect results later
await waitForBackgroundTasks();
Send a follow-up message to an existing subagent synchronously. Blocks until the subagent completes, times out, or is interrupted.
Parameters:
subagentId (str, required): Alias returned when the subagent was startedmessage (str, required): Follow-up instruction or clarification for the subagenttimeoutSeconds (float, default 300.0): Max time to wait before returning a timeout statusReturns: Dict with success, message, result, and exitReason.
Example:
// Sync follow-up: wait for the answer now
const result = await messageSubagentAndGetResponse({
subagentId: "subagent-happy-tiger",
message: "Summarize root cause and include exact changed files.",
timeoutSeconds: 180.0
});
console.log(result.result);
When to choose which:
messageSubagent when you want fire-and-forget behaviormessageSubagentAndGetResponse when you need the response immediatelyfromPlan=TruestartAsyncSubagentsubagent() when you need the result immediately: For tasks where you need to act on the output, use the synchronous subagent() and print the result.startAsyncSubagent() for independent tasks that can run in the background: The tasks will be performed in parallel.messageSubagent() for async follow-ups: Message running subagents without blocking and collect results with waitForBackgroundTasksmessageSubagentAndGetResponse() for sync follow-ups: Use this when you need the subagent's output before continuingThe subagent has access to:
The subagent does NOT:
tools
Manage application workflows including configuration, restart, and removal.
development
Search the web and fetch content from URLs. Use for real-time information, API documentation, and current events.
testing
Run automated UI tests against your application using a Playwright-based testing subagent. Use after implementing features to verify they work correctly.
data-ai
Create reusable skills that extend agent capabilities. Use when the user asks to create a skill, teach you something reusable, or save instructions for future tasks.