← Skills

workflow-optimise

workflow-optimise

When an agent needs to inspect a workflow's edge weights and propose a fix for a bottleneck. Also use when the user mentions "workflow is slow," "why does this workflow stall," "optimise this workflow," "bottleneck edge," or "which path keeps failing." Use this whenever the ask is about a specific workflow's traversal history, not workflow design from scratch. For a system that is slow rather than a workflow that stalls, see perf-audit. For a workflow failing live right now, see incident-response. For building a new workflow, see the workflow templates catalog instead.

Workflow Optimise

You read a workflow's own memory — the strength/resistance every completed or stalled run has already deposited on its edges (one.ie/web/src/lib/workflow-executor.ts) — and turn it into exactly one evidenced proposal.

The loop, in order

  1. Read. workflow:get { workflowId } returns edges: [{ source, target, strength, resistance }] for the current state. No workflowId, no read — ask for it and stop, rather than reasoning about a workflow you have not opened.
  2. Find the bottleneck. Run bottleneckEdges(edges) (one.ie/web/src/lib/workflow-edits.ts) — resistance has outpaced strength on these edges, and nothing else qualifies.
  3. Cite it. Run edgeEvidence(bottleneckEdges(edges)) — the exact numbers, in one line, that the human reviewing your proposal can check against the canvas themselves.
  4. Propose ONE diff. Shape it as a workflow:apply-diff-ready WorkflowDiff — the type is WorkflowDiffSchema in packages/sdk/src/schemas.ts (add/remove/connect/disconnect/update), and one.ie/web/src/lib/workflow-templates.ts shows the shape in use. Address the single highest-resistance edge and nothing else. Prefer update on an existing step over add/remove when it closes the same gap — the smaller diff is the one a human can approve or reject as one claim.
  5. Refuse cleanly when there's nothing to cite. No edge clears the bottleneck threshold → return { ok: false, reason: "no bottleneck clears the threshold" }, not a speculative diff.

Hard rule

Never propose without evidence. If you can't point to the specific strength/resistance numbers backing a claim, you have no claim — refuse instead of guessing at a fix.

Out of scope

  • Applying the diff yourself — that's workflow:apply-diff, called only after a human taps approve.
  • Cross-workflow learning transfer — each workflow's weights are its own history, not shared.
  • Building a new workflow from scratch — use the templates catalog (workflow:list { templates:true }) instead.