Skip to content

Custom OpenCode agent support #334

@veschin

Description

@veschin

Problem Statement

When OpenSpec is initialized in a directory, it automatically creates markdown files configured with the build agent. However, if default agents are disabled in the configuration, OpenSpec fails to start because the build agent is unavailable. The only workaround is to manually edit each markdown file to specify a custom agent, which is inefficient and error-prone.

Reproduction Steps

  1. Initialize OpenSpec in a directory using the standard initialization command.
  2. Observe that markdown files are created with the default build agent configuration:
   ---
   agent: build
   description: Implement an approved OpenSpec change and keep tasks in sync.
   ---
  1. Disable default agents in the OpenSpec configuration.
  2. Attempt to /openspec-proposal
  3. Manually edit the agent configuration in $PWD/.opencode/*.md files to a custom agent:
   ---
   description: Implement an approved OpenSpec change and keep tasks in sync.
   ---
  1. Re-do /openspec-proposal

Feature Request

Add a command-line argument to specify a custom default agent during initialization.
For example:
openspec init --agent custom_agent

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions