/goal is a durable-objective mode for long-running work in
oh-my-opencode-slim.
It is meant for tasks where the orchestrator should keep working through a clear objective, maintain progress, validate the result, and stop when the goal is done without needing the user to steer every step.
The first implementation focuses on one active goal per session, persisted goal state, prompt context, and guarded idle continuation.
Use /goal for work with a clear finish line:
Avoid it for vague or high-risk work:
The command set is:
/goal start <objective>
/goal
/goal status
/goal pause
/goal resume
/goal complete [note]
/goal block <reason>
/goal clear
/goal checkpoint <note>
Planned follow-up commands may include:
/goal validate <command>
/goal stop-condition <text>
/goal list
/goal export
Examples:
/goal start Fix the tmux ghost pane issue. Stop when tests pass and no orphaned opencode attach processes remain.
/goal start Implement the preset-switching docs update. Stop when README.md and docs/configuration.md agree with the current command behavior.
The feature should make long work feel supervised, not uncontrolled. Progress should be visible through status/checkpoints, and the user should always be able to pause or clear the goal.
/auto-continue is todo-based: it resumes the orchestrator when incomplete
todos remain.
/goal should be objective-based: it owns the durable user objective, lifecycle,
checkpoints, stop condition, and validation expectations.
The two features do not run competing continuation loops. When an active goal owns a session, todo continuation skips that session, including paused and blocked goals.
The implementation keeps one active goal per session and persists a compact record outside the repository by default.
Suggested shape:
type GoalStatus =
| 'running'
| 'paused'
| 'blocked'
| 'completed'
| 'archived';
interface GoalRecord {
version: 1;
id: string;
directory: string;
sessionID?: string;
objective: string;
stopCondition?: string;
validationCommands: string[];
artifacts: string[];
status: GoalStatus;
createdAt: string;
updatedAt: string;
maxCycles: number;
completedCycles: number;
checkpoints: GoalCheckpoint[];
lastError?: string;
}
State should live in an XDG-style user data location rather than creating noisy files in every workspace. A later export command can write a Markdown summary when users want a shareable artifact.
Slim should not secretly execute validation commands.
Instead:
This preserves the normal permission model and keeps command execution visible.
The feature lives in:
src/goal/
index.ts
manager.ts
store.ts
types.ts
prompts.ts
command.ts
It is wired through src/index.ts:
/goal,Current scope:
/goal start/status/pause/resume/checkpoint/clear,/goal complete and /goal block <reason>,Defer:
Goal continuation should use strict guards similar to todo continuation:
running,/auto-continue loop owns the session.If the orchestrator is uncertain, blocked, or needs approval, it should mark the goal blocked or ask the user instead of continuing indefinitely.
A fuller version can add a structured tool such as goal_update so the
orchestrator can update status, checkpoints, validation results, and artifacts
without relying on prose parsing.
Possible later additions:
/goal list for cross-session resume,