Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .opencode/commands/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ Toggle workflows for the current session:
- `/wf on` - Enable workflows (shorthand)
- `/wf off` - Disable workflows (shorthand)

When workflows are disabled, the plugin will not inject development instructions or enforce file edit restrictions.
The override is per-session only and resets when the session ends.

You can also set the initial state via environment variable:
---

You can also restrict which agents have workflows active by default via `WORKFLOW_ACTIVE_AGENTS`:

```bash
WORKFLOW=off opencode
WORKFLOW_ACTIVE_AGENTS=agent1,agent2,agentN opencode
```

When not set, workflows are active for all agents. `/workflow on` overrides this for the current session.
24 changes: 24 additions & 0 deletions packages/opencode-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,30 @@ Or for local development:

Integrated with `@codemcp/workflows-core` for real state management and phase-based file restrictions.

## Configuration

### Agent filtering

By default the plugin is active for all agents. Set `WORKFLOW_ACTIVE_AGENTS` to a comma-separated list of agent names to restrict it to specific agents only:

```bash
# Only activate for the "coder" and "architect" agents
WORKFLOW_ACTIVE_AGENTS=coder,architect
```

When the env var is set, workflow hooks and edit restrictions are skipped for any agent not in the list. Workflow tools are still registered, and calling them from an inactive agent will result in an error. This prevents subagents (Tasks) from being interrupted by workflow instructions when they are not expected to follow the workflow.

### Session override

Use the `/workflow` command to toggle the plugin on or off for the current session, regardless of the agent filter:

```
/workflow off # disable for this session
/workflow on # enable for this session (overrides WORKFLOW_ACTIVE_AGENTS filter)
```

`/workflow on` acts as a full escape hatch — it forces workflows active even if the current agent is not listed in `WORKFLOW_ACTIVE_AGENTS`.

## Related

- [`@codemcp/workflows-core`](../core) — The workflow engine (shared with MCP server)
Expand Down
Loading
Loading