# AetherDesk workflow factory

The workflow factory is the workflow-making workflow.

It turns a rough operator idea into a reviewable packet before anyone edits the server, UI, smoke tests, or docs.

## Command

```powershell
npm run aetherdesk:workflow:factory
```

Create a named workflow packet:

```powershell
npm run aetherdesk:workflow:factory -- --id=youtube_clip_factory --title="YouTube clip factory" --goal="Turn a long video into Shorts candidates, captions, metadata, and receipts."
```

## Artifacts

- `artifacts/aetherdesk_workflow_factory/latest.json`
- `artifacts/aetherdesk_workflow_factory/latest.md`
- `artifacts/aetherdesk_workflow_factory/latest.packet.json`
- `artifacts/aetherdesk_workflow_factory/latest.packet.md`
- `artifacts/aetherdesk_workflow_factory/latest.receipts.json`
- `artifacts/aetherdesk_workflow_factory/latest.state.json`

## Packet contents

- objective
- domain
- surface
- proposed command
- proposed route
- inputs
- outputs
- blockers
- invariants
- stages
- proposed action cards
- next patch plan
- packet hash

## Boundary

- Proposal-first.
- No arbitrary shell.
- No host-write or external account write by default.
- No secrets, tokens, stream keys, payment keys, or private user data in artifacts.
- Promote a packet to a real AetherDesk workflow only after route, receipts, UI placement, and proof plan are explicit.


## Visual entry

Open **This PC -> Workflow Factory**. The same cards are available from the desktop icon, launcher nav, side rail, hero quick buttons, mission card, command finder, and shared action-card panel.

The visual surface fetches `/api/agent/workflow-factory`, stages safe packet commands into the terminal, and keeps workflow creation proposal-first until the packet is reviewed.


## Materialize a real local workflow

Use `--materialize` when the packet is ready to become a runnable local artifact-writing workflow scaffold:

```powershell
npm run aetherdesk:workflow:factory -- --id=my_new_lane --title="My new lane" --goal="Do the useful thing safely." --materialize
```

This writes:

- `scripts/aetherdesk-workflow-<id>.js`
- `docs/generated-workflows/<id>.md`
- a package script named `aetherdesk:workflow:<id>`
- a materialization receipt under `artifacts/aetherdesk_workflow_factory/materialized/`

The scaffold is real and runnable, but bounded: it writes local artifacts only. Promote it to a server route, desktop button, and smoke validator after its schema and receipt policy are stable.
