Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Create a workflow command that orchestrates multi-step execution through sub-agents with file-based task prompts
.claude/skills/bilal140202-create-workflow-command/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-11 | ✗→✓ | ▲ Improved | 158% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 165% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 29% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 136% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 97% | 0% |
Create a command that orchestrates multi-step workflows by dispatching sub-agents with task-specific instructions stored in separate files.
textWorkflow Name: $1 Description: $2
Workflow commands solve the context bloat problem: instead of embedding detailed step instructions in the main command (polluting orchestrator context), store them in separate task files that sub-agents read on-demand.
plugins/<plugin-name>/
├── commands/
│ └── <workflow>.md # Lean orchestrator (~50-100 tokens per step)
├── agents/ # Optional: reusable executor agents
│ └── step-executor.md # Custom agent with specific tools/behavior
└── tasks/ # All task instructions directly here
├── step-1-<name>.md # Full instructions (~500+ tokens each)
├── step-2-<name>.md
├── step-3-<name>.md
└── common-context.md # Shared context across workflowsEach sub-agent gets its own isolated context window. The main orchestrator stays lean while sub-agents load detailed instructions from files.
| Component | Context Cost | Purpose | |-----------|--------------|---------| | Orchestrator command | ~50-100 tokens/step | Dispatch and coordinate | | Task file | ~500+ tokens | Detailed step instructions | | Sub-agent base | ~294 tokens | System prompt overhead |
Sub-agents spawned via Task tool:
| Capability | Available | Notes | |------------|-----------|-------| | Read tool | ✅ Yes | Can read any file | | Write tool | ✅ Yes | If not restricted | | Grep/Glob | ✅ Yes | For code search | | Skills loading | ❌ No | Skills don't auto-load in sub-agents | | Spawn sub-agents | ❌ No | Cannot nest Task tool | | Resume context | ✅ Yes | Via resume parameter |
Use ${CLAUDE_PLUGIN_ROOT} for portable paths within plugin:
markdownRead ${CLAUDE_PLUGIN_ROOT}/tasks/step-1-workflow-name.md and execute.
Sub-agent will use Read tool to fetch the file content.
Ask user (if not provided):
feature-implementation)general-purpose or custom agentbash# Create tasks directory (if it doesn't exist) mkdir -p ${CLAUDE_PLUGIN_ROOT}/tasks # Optional: Create agents directory (if using custom agents) mkdir -p ${CLAUDE_PLUGIN_ROOT}/agents
Note: All task files (both workflow-specific steps and shared context) are placed directly in tasks/ without subdirectories.
For each step, create a task file with this structure:
markdown# Step N: <Step Name> ## Context You are executing step N of the <workflow-name> workflow. ## Goal <Clear, specific goal for this step> ## Input <What this step receives from previous steps or user> ## Instructions 1. <Specific action> 2. <Specific action> 3. <Specific action> ## Constraints - <Limitation or boundary> - <What NOT to do> ## Expected Output <What to return to orchestrator> ## Success Criteria - [ ] <Measurable outcome> - [ ] <Measurable outcome>
Create the main command file with this pattern:
markdown--- description: <Workflow description> argument-hint: <Required arguments> allowed-tools: Task, Read model: sonnet --- # <Workflow Name> ## User Input \`\`\`text $ARGUMENTS \`\`\` ## Workflow Execution ### Step 1: <Step Name> Launch general-purpose agent: - **Description**: "<3-5 word summary>" - **Prompt**: \`\`\` Read ${CLAUDE_PLUGIN_ROOT}/tasks/step-1-<workflow>-<name>.md and execute. Context: - TARGET: $1 - MODE: $2 \`\`\` **Capture**: <What to extract from result> ### Step 2: <Step Name> Launch general-purpose agent: - **Description**: "<3-5 word summary>" - **Prompt**: \`\`\` Read ${CLAUDE_PLUGIN_ROOT}/tasks/step-2-<workflow>-<name>.md and execute. Context from Step 1: - <Key data from previous step> \`\`\` ### Step 3: <Step Name> [Continue pattern...] ## Completion Summarize workflow results: 1. <What was accomplished> 2. <Key outputs> 3. <Next steps if any>
| Field | Purpose | Default | |-------|---------|---------| | description | Brief description of workflow purpose | Required | | argument-hint | Expected arguments description | None | | allowed-tools | Tools the command can use | Inherits from conversation | | model | Specific Claude model (sonnet, opus, haiku) | Inherits from conversation |
Model selection:
haiku - Fast, efficient for simple workflowssonnet - Balanced performance (recommended default)opus - Maximum capability for complex orchestrationEach step depends on previous step's output:
markdown### Step 1: Analyze Launch agent → Get analysis result ### Step 2: Plan (uses Step 1 result) Launch agent with Step 1 context → Get plan ### Step 3: Execute (uses Step 2 result) Launch agent with Step 2 context → Complete
Steps can run concurrently:
markdown### Analysis Phase (Parallel) Launch 3 agents simultaneously: 1. Agent 1: Security analysis → Read ${CLAUDE_PLUGIN_ROOT}/tasks/step-1a-security.md 2. Agent 2: Performance analysis → Read ${CLAUDE_PLUGIN_ROOT}/tasks/step-1b-performance.md 3. Agent 3: Code quality analysis → Read ${CLAUDE_PLUGIN_ROOT}/tasks/step-1c-quality.md **Wait for all**, then consolidate results. ### Synthesis Phase Launch agent with all analysis results...
When steps need shared context:
markdown### Step 1: Initialize Launch agent, **capture agent_id** ### Step 2: Continue (same context) Resume agent using agent_id: - **resume**: <agent_id from Step 1> - **prompt**: "Proceed to phase 2: <additional instructions>"
markdown--- description: Execute feature implementation through research, planning, and coding phases argument-hint: [feature-description] allowed-tools: Task, Read, TodoWrite model: sonnet --- # Implement Feature ## User Input \`\`\`text $ARGUMENTS \`\`\` Create TodoWrite with workflow steps. ## Phase 1: Research Launch general-purpose agent: - **Description**: "Research feature requirements" - **Prompt**: \`\`\` Read ${CLAUDE_PLUGIN_ROOT}/tasks/step-1-feature-impl-research.md Feature: $ARGUMENTS \`\`\` **Extract**: Key findings, constraints, existing patterns ## Phase 2: Architecture Launch general-purpose agent: - **Description**: "Design feature architecture" - **Prompt**: \`\`\` Read ${CLAUDE_PLUGIN_ROOT}/tasks/step-2-feature-impl-architecture.md Feature: $ARGUMENTS Research findings: <summary from Phase 1> \`\`\` **Extract**: File structure, components, interfaces ## Phase 3: Implementation Launch developer agent: - **Description**: "Implement feature code" - **Prompt**: \`\`\` Read ${CLAUDE_PLUGIN_ROOT}/tasks/step-3-feature-impl-implement.md Architecture: <summary from Phase 2> \`\`\` ## Completion Mark todos complete. Report: 1. Files created/modified 2. Tests added 3. Remaining work
markdown# Step 1: Feature Research ## Context You are the research phase of a feature implementation workflow. ## Goal Thoroughly understand the feature requirements and existing codebase context before any implementation begins. ## Instructions 1. **Parse Feature Request** - Extract core requirements - Identify acceptance criteria - Note any constraints mentioned 2. **Codebase Analysis** - Search for similar existing features - Identify relevant patterns and conventions - Find reusable components/utilities 3. **Dependency Check** - What existing code will this feature interact with? - Are there breaking change risks? - What tests exist for related functionality? 4. **Gap Analysis** - What's missing from the request? - What clarifications might be needed? - What edge cases should be considered? ## Constraints - Do NOT write any implementation code - Do NOT modify any files - Focus purely on research and analysis ## Expected Output Return a structured research summary: \`\`\`markdown ## Feature Understanding - Core requirement: <summary> - Acceptance criteria: <list> ## Codebase Context - Similar features: <list with file paths> - Patterns to follow: <list> - Reusable code: <list with file paths> ## Dependencies - Files affected: <list> - Tests to consider: <list> ## Open Questions - <Question 1> - <Question 2> ## Recommendation <Brief recommendation for architecture phase> \`\`\` ## Success Criteria - [ ] Feature requirements clearly articulated - [ ] Relevant existing code identified - [ ] No implementation attempted - [ ] Clear handoff to architecture phase
| Limitation | Impact | Workaround | |------------|--------|------------| | No nested sub-agents | Sub-agents can't spawn Task tool | Keep all orchestration in main command | | No skill auto-loading | Sub-agents don't trigger skills | Pass explicit file paths or inline context | | Fresh context per agent | Each dispatch starts empty | Use resume pattern OR pass summaries | | File read latency | Extra tool call per step | Acceptable trade-off for context savings |
Before finalizing workflow command:
${CLAUDE_PLUGIN_ROOT} for portabilityBased on user input, create:
${CLAUDE_PLUGIN_ROOT}/tasks/ - All task files directly here${CLAUDE_PLUGIN_ROOT}/agents/ - (Optional) Custom agent definitionstasks/ directory with naming pattern step-N-<workflow>-<name>.mdstep-1-feature-impl-research.mdstep-2-feature-impl-architecture.mdcommon-context.md directly in tasks/commands/<workflow-name>.mdagents/After creation, suggest testing with /customaize-agent:test-prompt command.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-11 | fail→pass | 8,549 | 5,437 | -36% | 1 | 1 | 0% | 1,496 | 3,853 | +158% | 0 | 0 | — |
case-06 | fail→pass | 7,623 | 3,731 | -51% | 1 | 1 | 0% | 1,389 | 3,674 | +165% | 0 | 0 | — |
case-05 | pass→pass | 10,337 | 9,935 | -4% | 1 | 1 | 0% | 2,029 | 5,065 | +150% | 0 | 0 | — |
case-01 | fail→pass | 21,402 | 12,832 | -40% | 1 | 1 | 0% | 4,435 | 5,731 | +29% | 0 | 0 | — |
case-02 | fail→fail | 15,170 | 13,480 | -11% | 1 | 1 | 0% | 3,408 | 5,817 | +71% | 0 | 0 | — |
case-03 | pass→fail | 12,047 | 8,605 | -29% | 1 | 1 | 0% | 2,038 | 4,690 | +130% | 0 | 0 | — |
case-04 | pass→pass | 12,373 | 8,781 | -29% | 1 | 1 | 0% | 2,487 | 4,799 | +93% | 0 | 0 | — |
case-07 | fail→pass | 11,775 | 10,774 | -9% | 1 | 1 | 0% | 2,319 | 5,472 | +136% | 0 | 0 | — |
case-08 | fail→pass | 11,426 | 5,554 | -51% | 1 | 1 | 0% | 2,042 | 4,013 | +97% | 0 | 0 | — |
case-09 | fail→fail | 7,043 | 6,305 | -10% | 1 | 1 | 0% | 1,518 | 4,072 | +168% | 0 | 0 | — |
case-10 | fail→pass | 11,546 | 3,910 | -66% | 1 | 1 | 0% | 2,000 | 3,602 | +80% | 0 | 0 | — |
case-12 | pass→pass | 9,558 | 3,038 | -68% | 1 | 1 | 0% | 1,695 | 3,352 | +98% | 0 | 0 | — |
case-13 | fail→pass | 8,536 | 3,184 | -63% | 1 | 1 | 0% | 1,597 | 3,484 | +118% | 0 | 0 | — |
case-14 | pass→pass | 13,162 | 6,250 | -53% | 1 | 1 | 0% | 2,491 | 4,185 | +68% | 0 | 0 | — |
case-15 | fail→pass | 11,602 | 7,021 | -39% | 1 | 1 | 0% | 1,966 | 4,228 | +115% | 0 | 0 | — |
case-16 | fail→pass | 9,445 | 2,597 | -73% | 1 | 1 | 0% | 1,637 | 3,397 | +108% | 0 | 0 | — |
case-17 | pass→pass | 5,624 | 1,385 | -75% | 1 | 1 | 0% | 982 | 3,084 | +214% | 0 | 0 | — |
case-18 | pass→pass | 11,962 | 7,548 | -37% | 1 | 1 | 0% | 2,268 | 4,326 | +91% | 0 | 0 | — |
case-19 | fail→pass | 8,587 | 3,162 | -63% | 1 | 1 | 0% | 1,599 | 3,458 | +116% | 0 | 0 | — |
case-20 | pass→pass | 13,711 | 6,727 | -51% | 1 | 1 | 0% | 2,694 | 4,180 | +55% | 0 | 0 | — |
case-21 | pass→pass | 9,505 | 5,061 | -47% | 1 | 1 | 0% | 1,635 | 3,736 | +129% | 0 | 0 | — |
case-22 | fail→pass | 12,392 | 2,582 | -79% | 1 | 1 | 0% | 1,977 | 3,271 | +65% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +45 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.