🔧 OpenCode Setup Guide

Installation

Initialize Ralphy-Spec with OpenCode support:

cd your-project
ralphy-spec init --tools opencode

Or select OpenCode during interactive setup:

ralphy-spec init

What Gets Installed

Ralphy-Spec creates an AGENTS.md file at the project root:

your-project/
├── AGENTS.md          # Agent instructions
├── openspec/
│   ├── specs/
│   ├── changes/
│   └── project.md
└── .ralphy/
    ├── config.json
    └── ralph-loop.state.json

OpenCode automatically reads AGENTS.md for workflow instructions.

Using with Ralph Loop

Ralphy-Spec is designed to work with Ralph loop runners like opencode-ralph-wiggum:

# Install ralph-wiggum
npm install -g @th0rgal/ralph-wiggum

# Run a Ralph loop to implement an OpenSpec change
ralph "Follow AGENTS.md to implement the add-auth change. \
  Output <promise>TASK_COMPLETE</promise> when all tasks are done and tests pass." \
  --max-iterations 20

Workflow Commands

When using OpenCode, ask it to follow the AGENTS.md workflow:

Plan Phase

"Follow AGENTS.md to create an OpenSpec proposal for [your feature]"

Implement Phase

"Follow AGENTS.md to implement the [change-name] change"

Validate Phase

"Follow AGENTS.md to validate the implementation"

Archive Phase

"Follow AGENTS.md to archive the [change-name] change"

Completion Promise

The Ralph loop expects a completion signal. Configure it in .ralphy/config.json:

{
  "testCommand": "npm test",
  "completionPromise": "TASK_COMPLETE"
}

When all tasks are complete and tests pass, the agent should output:

<promise>TASK_COMPLETE</promise>