About this project

OpenCode Goal Plugin is an npm package that extends OpenCode with a goal-driven workflow for AI coding agents. It adds a `/goal` slash command, persistent per-session goal state with history and checkpoints, completion evidence requirements, automatic idle continuation, and a terminal UI goal indicator. The plugin supports both OpenCode 1 stable and OpenCode 2 beta, with separate installation instructions for each. It provides agent tools like `get_goal`, `create_goal`, `set_goal`, `update_goal_objective`, `update_goal_status`, `update_goal`, and `clear_goal`. Goals can be closed with `complete` status requiring verified evidence or `unmet` status with a concrete blocker. Safety states include `budgetLimited`, `usageLimited`, and `paused`. The plugin includes Plan-mode safety to prevent goal mode from escaping planning sessions. Configuration options include auto_continue, max_auto_turns, locale support (including zh-CN), token budgets, and restricted agents. Goal state is stored atomically at `$XDG_DATA_HOME/opencode-goal-plugin/goals.json` with crash consistency. The plugin is developed with Bun, tested with unit tests and smoke tests, and published via npm Trusted Publishing from GitHub Actions.