# create-workflow-command

Create commands that orchestrate multi-step workflows by dispatching sub-agents with task-specific instructions stored in separate files. Solves the **context bloat problem** by keeping orchestrator commands lean.

* Purpose - Build workflow commands that dispatch sub-agents with file-based task prompts
* Output - Complete workflow structure: orchestrator command, task files, and optional custom agents

```bash
/customaize-agent:create-workflow-command [workflow-name] [description]
```

## Arguments

Optional workflow name (kebab-case) and description of what the workflow accomplishes.

## Usage Examples

```bash
# Create a feature implementation workflow
> /customaize-agent:create-workflow-command feature-implementation "Research, plan, and implement features"

# Create a code review workflow
> /customaize-agent:create-workflow-command code-review "Multi-phase code analysis and feedback"

# Start interactive workflow creation
> /customaize-agent:create-workflow-command
```

## How It Works

1. **Gather Requirements**: Collects workflow details
   * Workflow name and description
   * List of discrete steps with goals and tools
   * Execution mode (sequential or parallel)
   * Agent type preferences
2. **Create Directory Structure**: Sets up the workflow layout

```
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 workflows
```

1. **Create Task Files**: Generates self-contained task instructions
   * Context and goal for each step
   * Input/output specifications
   * Constraints and success criteria
2. **Create Orchestrator Command**: Builds lean dispatch logic
   * Uses `${CLAUDE_PLUGIN_ROOT}/tasks/` paths for portability
   * Passes minimal context between steps (summaries, not full data)
   * Supports sequential, parallel, and stateful (resume) patterns

## Execution Patterns

| Pattern               | Use Case             | Description                           |
| --------------------- | -------------------- | ------------------------------------- |
| **Sequential**        | Dependent steps      | Each step uses previous step's output |
| **Parallel**          | Independent analysis | Multiple agents run simultaneously    |
| **Stateful (Resume)** | Shared context       | Continue same agent across steps      |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cek.neolab.finance/plugins/customaize-agent/create-workflow-command.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
