Workflow question
Hi,
what is the suggested workflow with 2 basic agents?
For more complicated tasks - first I plan, then I accept the plan -- so I switch to build agent?
Sorry, but this is not obvious to me and I am not sure if this have been described in the docs. I'm a bit new to this whole AI thing.
This issue might be a duplicate of existing issues. Please check:
- #882: Documents the need for better plan mode documentation in README
- #1070: Discusses the exact same workflow question about plan mode → build mode workflow
- #1912: Addresses workflow awkwardness when switching between plan and build modes
Feel free to ignore if none of these address your specific case.
We do have a very basic workflow outline here in docs: https://opencode.ai/docs/#usage but ill give you my workflow
what is the suggested workflow with 2 basic agents?
^ by this do you mean the out of the box agents? or are you saying 2 opencode instances? or what?
The high level workflow that many do:
- tab to plan agent
- outline what you want to do
- iterate with it until it has a plan you like
- tab to build agent
- tell it to do go do it
Depending on complexity of task there may be no need to talk to plan agent at all, it is generally just helpful to prevent needless work and just confirm with agent before it does anything
Sorry, but this is not obvious to me ... I'm a bit new to this whole AI thing.
Me too, the following is fresh, so excuse the unstructured dump (also a note to future self)...
... and I am not sure if this have been described in the docs. ...
I don't believe it has. But the ideas are generic and (see further down) you can probably implement what you need even if the tool (dev clients like OC, CC, etc.) don't have those batteries included, see:
- https://docs.ag2.ai/latest/docs/user-guide/advanced-concepts/pattern-cookbook/overview/
- https://www.anthropic.com/engineering/building-effective-agents
For more complicated tasks - first I plan, then I accept the plan -- so I switch to build agent?
From the overviews and details above you'll see there are probably a couple of relevant workflow patterns, and which is best depends on the nature of what the agent does.
So what do you do? Eventually, some common workflows will be packaged as defaults, with enough logic built in that you can just use them by setting some configuration values.
However, we are probably a couple of years away from that.... so what to do until then?
There are two options as I see it:
- Try to coax existing agent/command functionality to act out one of those patterns. This just requires a text editor and a probably a larger token budget. For a non-trivial example see Darren Dinde's videos and this example abusing OC to cajol the LLM to act out Workflow implementing "Context-Aware Routing". See also Richard Hightower's pipeline example.
- Try to coax MCP functionality to act out one of those patterns. This requires writing code, and probably a smaller token budget, but it also gets you any of those patterns with more precision and flexibility. For non-trivial examples see the Lastmile-AI project MCP-Agent repo, specifically the example workflows. An alternative that requires writing less code, but wrangling a MCD document is the Agent-MCP project.
If you do head down the path of MCP-ified agents as workflows you'll want to keep an eye on the Agent2Agent protocol - that sets out issues you're likely to bang your head on - forewarned is forearmed.
@rekram1-node let me know if you'll accept a doc PR with a more formal statement of the above.
i think docs like this would need to go through @jayair
This is tremendous feedback and great community. Thank you guys, as a noob I'd love to check the docs when they're eventually updated. THANKS.
ofc always happy to help, and like I said if u havent read usage section of docs yet they may answer some of your questions: https://opencode.ai/docs/#usage
I'd love to check the docs when they're eventually updated.
Just to be clear, workflows are not currently even a code primitive in OC, docs are downstream of that.
That isn't a problem, as my comment details, the OC support for MCP could be considered the MVP for workflows.
Implementing a workflow can quite happily, even properly, be outside the scope of OC. Further, the agentic experiment suggests that Agents/Commands/Rules could also be outside the scope of OC.... time will tell (see #3113). It might even be best that OC focus on performance, and robustness until the A2A best practices are settled?
My workflow is similar to what @rekram1-node outlined but with one caveat. For complex changes I sometimes do a lot of back and forth with the plan agent. At this point I've sometimes used over 50% of the context. So after the plan is finalized, I paste it into a fresh Build agent chat and ask it to start building. It would be nice if there was an easy way to do this last bit.
We do have a very basic workflow outline here in docs: https://opencode.ai/docs/#usage but ill give you my workflow
what is the suggested workflow with 2 basic agents?
^ by this do you mean the out of the box agents? or are you saying 2 opencode instances? or what?
The high level workflow that many do:
- tab to plan agent
- outline what you want to do
- iterate with it until it has a plan you like
- tab to build agent
- tell it to do go do it
Depending on complexity of task there may be no need to talk to plan agent at all, it is generally just helpful to prevent needless work and just confirm with agent before it does anything