We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Plan Agent

OpenCode ships with two built-in primary agents:

  • Build (default): The agent can take action on the codebase: edit files, run commands, use tools.
  • Plan: The agent can inspect the project, run shell commands, ask questions, and plan changes. OpenCode blocks its edit, write, and patch tool calls from modifying project files – except for dedicated plan files.

I've almost stopped using Plan agents entirely. It's a personal preference, but I just talk to the agent in Build mode, iterate on actual code changes, and eventually arrive at a final solution. The model is smart enough to know we're planning and not actually make changes yet.

If I do want an intermediary step where I create a checklist, I just stay in Build mode and have it write a Markdown file for me.

Okay, so whether you actually switch to "plan" or just plan-in-build mode is up to you, but there are still some best practices to consider:

  • If you're confident about what you want, force the agent to write a plan, then review it and clarify any points before it implements.
  • If you're not confident about what you want, force the agent to ask you clarifying questions before it proposes a plan.

Making your agent ask you questions is one of the best "productivity hacks", particularly when you're feeling blocked on a task. In my experience, agents are much better at helping you brainstorm and clarify your ideas, than they are at producing creative ideas on their own.

Assignment

Plan and add support for the loadbearing keyword, SlopLang's immutable variable declaration (like const in other languages). For example:

loadbearing LIMIT = 100✨
slop score = 10✨

— allowed
score = score + 1✨

— not allowed
LIMIT = 200✨

slop can be reassigned, LIMIT can't, so that last line should be a runtime error: cannot assign to loadbearing 'LIMIT'.

    • Needs an initializer
    • Should follow the same scoping rules as slop
    • Should reject reassignment with the message cannot assign to loadbearing '<name>'
    • Cannot be redeclared in the same scope
    • Should be documented in docs/spec.md

Tell OpenCode to run and submit the CLI tests from the project root.