# Workflow: Create Workflow

Create workflow documents for Claude Code plugins that define repeatable processes for subagents.

## Who should do this work

- **Main thread**: Requirements gathering, design, verification
- **Haiku subagent**: File creation

## When to use

- Creating new workflow document for plugin
- Workflow file doesn't exist yet
- Defining repeatable process for subagents

## Before you start

If concept unclear, brainstorm: `references/brainstorming/workflow.md`

## Inputs required

- **workflow_name** - kebab-case
- **workflow_purpose** - Repeatable process this defines
- **target_plugin_path** - Where to create (plugin's skill directory)
- **subagent_requirements** - What subagent needs (tools, model)

## Task document

Create: `.claude/plugin-data/workflow-architect/tasks/new-workflow-<workflow-name>-<date>.md`

---

## Pattern consideration

See `references/tool-patterns/catalog.md`.

| Question | If Yes |
|----------|--------|
| Workflow involves design decisions? | Brainstorm first |
| Subagents modify files? | Include verification guidance |
| Subagents create files in user projects? | Follow [plugin-data-convention](../references/conventions/plugin-data-convention.md) |
| Reused across projects? | Consider golden examples |

---

## Subtasks

### 1. Understand requirements

Subagent: Main with user.
Read: `${CLAUDE_PLUGIN_ROOT}/references/layout/workflow-structure.md`

**Do:**
- Confirm workflow name (kebab-case)
- Understand specific purpose
- Identify subagent needs (tools, model)
- Identify input/output requirements
- Write to task doc: `## Requirements`

---

### 2. Design the workflow

Subagent: Main.
Read: `${CLAUDE_PLUGIN_ROOT}/references/layout/workflow-structure.md`

**Do:**
- Draft purpose and trigger conditions
- Define subtasks/steps
- Specify who performs each (main vs subagent)
- Identify what must be read per step
- Define constraints and validation
- If modifies files: include verification
- Write to task doc: `## Design`

---

### 3. Create the workflow file

Subagent: haiku.
Read: Task doc (requirements, design), `${CLAUDE_PLUGIN_ROOT}/references/layout/workflow-structure.md` (minimal skeleton section)

**Do:**
- Create `<target_plugin_path>/skills/<skill-name>/workflows/` if needed
- Write `<target_plugin_path>/skills/<skill-name>/workflows/<workflow-name>.md`
- Include: "When to use", "Inputs required", "Output", "Subtasks"
- Per subtask: who (main/subagent), what to read, what to do
- Include verification if modifies files
- Write to task doc: `## Created Files`

---

### 4. Verify and report

Subagent: Main.

**Do:**
- Verify structure complete
- Verify correct location
- Check all subtasks have clear ownership
- Summarize created
- Suggest use via SKILL.md entry point

---

## Reflection

- Workflow focused on single purpose?
- Subtasks clearly defined with explicit ownership?
- Would another developer understand what this accomplishes?
