Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@phall1/opencode-workflows

Workflow graphs for OpenCode V2. A run is an Effect. The plugin is an Effect plugin. Checkpoints are deferred values. Cancel interrupts the fiber.

Install

opencode plugin add @phall1/opencode-workflows

Or load the package from this repo:

{
  "plugins": ["./packages/workflows"]
}

The CLI loads ./tui from the same package. Do not add it to cli.json.

Commands

/workflow                         list
/workflow ping hi                 start (finishes immediately)
/workflow echo hi                 talks in this session
/workflow autoplan <task>         start
/workflow status
/workflow cancel
/workflow answer { ... }
/workflow-graph                   session panel

The model uses the workflow tool (list, start, status, cancel, submit, answer).

Bundled workflows

Name What it does
ping Compute-only. Finishes in this chat so you can see a done run.
echo One agent step in this session
wire Add this plugin to ~/dotfiles OpenCode config, apply, prove it loads
autoplan Intent → candidates → choose → plan → summary
autodoc Record an existing plan in docs
autoimplement Implement, verify, fix loop
sanity-check Read-only keep/simplify/refactor/drop/needs_evidence
monitor Observe → wait or act → loop
ship autoplan → autodoc → autoimplement

Project files in .opencode/workflows/*.workflow.ts override bundled names.

Author

import { agent, defineWorkflow, includeWorkflow } from "@phall1/opencode-workflows/dsl"

export default defineWorkflow({
  name: "echo",
  startAt: "reply",
  nodes: {
    reply: agent({
      prompt: ({ input }) => `Answer concisely: ${(input as { task?: string }).task}`,
    }),
  },
  edges: [],
})

/workflow kicks off a run and returns. Agent steps default to a child session, so this chat stays yours. Use session: "origin" only when a step must read this conversation (autoplan capture). The graph panel is the progress UI, not a hijacked turn. The side panel is the step list. f opens the Merman graph when the run is too long to draw beside it. ↑↓ select, enter opens a child session, a answers a checkpoint, x stops. The footer chip opens it. decision is a Jev Choice when TYPESAFE_API_KEY is set, otherwise generate.text. Below minConfidence the graph gets uncertain. wait sleeps on the OpenCode service. includeWorkflow runs a child graph and routes on named exits.

See docs/ARCHITECTURE.md.