home / skills / openclaw / skills / opencode-controller

opencode-controller skill

/skills/karatla/opencode-controller

This skill helps you manage Opencode sessions, models, and agents via slash commands, coordinating planning and build tasks for efficient coding.

npx playbooks add skill openclaw/skills --skill opencode-controller

Review the files below or copy the command above to add this skill to your agents.

Files (10)
SKILL.md
1.9 KB
---
name: opencode-controller
description: Control and operate Opencode via slash commands. Use this skill to manage sessions, select models, switch agents (plan/build), and coordinate coding through Opencode.
---

# Opencode Controller

## Core rule

Clawdbot does not write code.
All planning and coding happens inside Opencode.

## Pre-flight

- Ask the user which AI provider to use.
- Ask how the provider should be authenticated.
- Do not proceed without confirmation.

## Session management

- Start Opencode.
- Open session selector using:
  /sessions
- If the current project already exists:
  - Select the existing session.
- Never create a new session without user approval.

## Agent (mode) control

- Open agent selector using:
  /agents
- Available agents:
  - Plan
  - Build
- Always select Plan first.
- Switch agents whenever required using `/agents`.

## Model selection

- Open model selector using:
  /models
- Select the user-requested provider.
- If authentication is required:
  - Copy the login link provided by Opencode.
  - Send it to the user.
  - Wait for confirmation before continuing.

## Plan agent behavior

- Ask Opencode to analyze the task.
- Request a clear step-by-step plan.
- Allow Opencode to ask clarification questions.
- Review the plan carefully.
- If the plan is incorrect or incomplete:
  - Ask Opencode to revise it.
- Do not allow code generation in Plan.

## Build agent behavior

- Switch to Build using `/agents`.
- Ask Opencode to implement the approved plan.
- If Opencode asks any question:
  - Immediately switch back to Plan.
  - Answer and confirm the plan.
  - Switch back to Build.

## Completion

- Repeat the Plan → Build loop until all user requirements are satisfied.
- Never skip Plan.
- Never answer questions in Build.

## Output format

- Show all slash commands explicitly.
- State which option is selected.
- Provide login links verbatim.

Overview

This skill controls and operates Opencode through explicit slash commands to manage sessions, select models, and switch agents (Plan/Build). It enforces a strict Plan → Build workflow so all planning happens in Opencode and coding is produced only after plan approval. Use it to coordinate multi-step coding tasks while preserving clear authentication and session rules.

How this skill works

The skill opens Opencode selectors with explicit slash commands (/sessions, /agents, /models) and reports which option is selected. It prompts for provider choice and authentication, sends any login links verbatim to the user, and waits for confirmation before proceeding. The skill always runs the Plan agent first to produce a step-by-step plan, then switches to Build to implement the approved plan, looping until requirements are met.

When to use it

  • Starting or joining an existing Opencode session tied to a project
  • Coordinating multi-step development where explicit planning is required
  • Managing model/provider selection and authentication before coding
  • Ensuring a Plan-first workflow to avoid premature code generation
  • Switching agents between planning and implementation during a task

Best practices

  • Ask the user which AI provider to use and how it should be authenticated before any action
  • Never create a new session without explicit user approval; prefer selecting existing sessions with /sessions
  • Always run the Plan agent first and require a clear step-by-step plan before Build
  • If a login link is required, copy it exactly and send it to the user, then wait for confirmation
  • If Build asks questions, immediately switch back to Plan, resolve them, then return to Build

Example use cases

  • Onboarding a user into a shared Opencode project: open /sessions, select the existing session, confirm provider and auth
  • Running a medium-sized feature: use Plan to generate a step plan, iterate until approved, then switch to Build to implement
  • Switching models: open /models, select the requested provider, send any authentication link to the user
  • Handling clarification during implementation: Build asks a question, switch to /agents -> Plan, resolve, then resume Build

FAQ

What happens if Opencode requests authentication?

I copy the login link provided by Opencode and send it verbatim to you, then wait for your confirmation before continuing.

Can I skip the Plan step and go straight to Build?

No. The workflow requires Plan first; never skip Plan and never allow code generation during Plan.