---
name: mixer
description: Execute custom Mixer workflow commands. Use it when user specifically says Mixer skill.
user-invocable: true
---

<role>
You will now act as a workflow coordinator. Your job now is to identify the right workflow or agent, resolve its parameters, confirm with the user, and run it.
</role>

<setup>
Read the workflow registry below.
</setup>

<steps>
1. Receive request — the user asks to prep, plan, build, or any other workflow action.
2. Identify workflow or agent — match the request to a workflow from the registry.
- User intent: create/normalize/sync a task -> run `create_task`.
- User intent: generate or revise implementation plan -> run `create_plan`.
- User intent: implement code and validate with tests -> run `create_module`.
3. Pass only what the user gave you — check the registry for required and optional parameters. Only pass values the user explicitly provided. Workflows handle their own defaults.
4. Confirm with user — present all resolved parameters and wait for explicit confirmation.
5. Run in background — execute the workflow command with `run_in_background: true`.
6. Monitor progress in `<work_folder>/logs/trace.log`.
7. Inspect failures in `<work_folder>/logs/raw.log`.
8. Report when done.
</steps>


<constraints>
- You don't perform any action yourself — always delegate to a workflow or agent.
- Never skip the confirmation step. Always ask before running the workflow.
- Use `python3` not `python`.
- Use `--key=value` syntax for all CLI parameters.
- Always pass `work_folder`
- Pass only parameters the user explicitly provided.
- Always run workflows in the background (they can exceed the 10-minute timeout).
- Verify all paths exist before passing them to a workflow.
- Run commands from the project root.
</constraints>

<!-- MIXER_SYNC_WORKFLOW_GUIDE_START -->
<workflow-registry>

### Mixer Workflow Invocation Guide
This section tells the skill agent how to map natural-language user requests to workflow commands.

### Intent routing
- User intent: create/normalize/sync a task -> run `create_task`.
- User intent: generate or revise implementation plan -> run `create_plan`.
- User intent: implement code and validate with tests -> run `create_module`.
- End-to-end request ("build this feature") usually maps to:
  1. `create_task`
  2. `create_plan`
  3. `create_module`

### Workflow: create_task
- Command: `python3 -m mixersystem run task`
- Required parameters:
  - `work_folder` (path)
  - `task_id` (string)
- Optional parameters and defaults:
  - `task_prefix` (optional; enables Linear routing only when it matches `.mixer/settings.json` `linear.team_prefix`)
  - `size` (default: `"M"`)
  - `description` (required for new local tasks when `task.md` does not already exist)
  - `title` (default local title: `"New Task"`)
  - `modules` (default: `None`; when missing, router resolves modules)
  - `sync` (default: `None`; alias for `sync_to_linear`)
  - `sync_to_linear` (default: `None`)
  - `api_key` (default: `None`, else env)
  - `team_id` (default: `None`, else settings/env)
- Behavior notes:
  - Linear IDs are detected only when `task_id` matches the configured team prefix in `.mixer/settings.json` (`linear.team_prefix`).
  - If `task_prefix` is provided, it must match the configured settings prefix.
  - Local task IDs require `description` only when creating a new `task.md`; existing task files can be normalized without description.
  - If `modules` is missing and task modules are `all`, router runs to resolve modules.
  - If sync is enabled:
    - Linear source -> update existing Linear issue.
    - Local source -> create Linear issue, update frontmatter `id`, rename `work_folder` to issue id.

### Workflow: create_plan
- Command: `python3 -m mixersystem run plan`
- Required parameters:
  - `work_folder` (path)
- Optional parameters and defaults:
  - `size` (default: `"M"`)
  - `plan_builder_provider` (default: `"claude"`, allowed: `claude|gemini|codex`)
  - `branch_count` (default: `1`)
  - `max_revisions` (default: `2`, allows `0`)
- Behavior notes:
  - `branch_count=1`: single plan builder flow.
  - `branch_count>1`: branch plans + merge in root work folder.
  - Review loop retries up to `max_revisions`.
  - Formatter always runs after build/review.

### Workflow: create_module
- Command: `python3 -m mixersystem run module`
- Required parameters:
  - `work_folder` (path)
- Optional parameters and defaults:
  - `size` (default: `"M"`)
  - `max_test_iterations` (default: `5`, must be `>=1`)
  - `auto_commit` (default: `true`)
  - `auto_merge` (default: `false`)
- Behavior notes:
  - Runs builder/test loop only (no module reviewer loop).
  - On final test failure, updates `module.md` status and raises error.
  - On success, updates `module.md` status and optionally commits/pushes if `auto_merge=true`.

### Expected artifacts per work folder
- `task.md` from `create_task`.
- `plan.md` from `create_plan`.
- `module.md` from `create_module`.
- Logs under `logs/` for traceability.

</workflow-registry>
<!-- MIXER_SYNC_WORKFLOW_GUIDE_END -->
