From f0b24f22bcc626adedcec8151618028abb1511ac Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 5 Jan 2026 13:51:36 +0900 Subject: [PATCH] feat(commands): add start-work command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add /start-work command for executing Prometheus plans: - start-work.ts: Command template for orchestrator-sisyphus - commands.ts: Register command with agent binding - types.ts: Add command name to type union 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) --- src/features/builtin-commands/commands.ts | 18 +++++ .../builtin-commands/templates/start-work.ts | 72 +++++++++++++++++++ src/features/builtin-commands/types.ts | 2 +- 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 src/features/builtin-commands/templates/start-work.ts diff --git a/src/features/builtin-commands/commands.ts b/src/features/builtin-commands/commands.ts index 30b03fce..f7649e07 100644 --- a/src/features/builtin-commands/commands.ts +++ b/src/features/builtin-commands/commands.ts @@ -3,6 +3,7 @@ import type { BuiltinCommandName, BuiltinCommands } from "./types" import { INIT_DEEP_TEMPLATE } from "./templates/init-deep" import { RALPH_LOOP_TEMPLATE, CANCEL_RALPH_TEMPLATE } from "./templates/ralph-loop" import { REFACTOR_TEMPLATE } from "./templates/refactor" +import { START_WORK_TEMPLATE } from "./templates/start-work" const BUILTIN_COMMAND_DEFINITIONS: Record> = { "init-deep": { @@ -41,6 +42,23 @@ ${REFACTOR_TEMPLATE} `, argumentHint: " [--scope=] [--strategy=]", }, + "start-work": { + description: "(builtin) Start Sisyphus work session from Prometheus plan", + agent: "orchestrator-sisyphus", + template: ` +${START_WORK_TEMPLATE} + + + +Session ID: $SESSION_ID +Timestamp: $TIMESTAMP + + + +$ARGUMENTS +`, + argumentHint: "[plan-name]", + }, } export function loadBuiltinCommands( diff --git a/src/features/builtin-commands/templates/start-work.ts b/src/features/builtin-commands/templates/start-work.ts new file mode 100644 index 00000000..f3a785bb --- /dev/null +++ b/src/features/builtin-commands/templates/start-work.ts @@ -0,0 +1,72 @@ +export const START_WORK_TEMPLATE = `You are starting a Sisyphus work session. + +## WHAT TO DO + +1. **Find available plans**: Search for Prometheus-generated plan files at \`.sisyphus/plans/\` + +2. **Check for active boulder state**: Read \`.sisyphus/boulder.json\` if it exists + +3. **Decision logic**: + - If \`.sisyphus/boulder.json\` exists AND plan is NOT complete (has unchecked boxes): + - **APPEND** current session to session_ids + - Continue work on existing plan + - If no active plan OR plan is complete: + - List available plan files + - If ONE plan: auto-select it + - If MULTIPLE plans: show list with timestamps, ask user to select + +4. **Create/Update boulder.json**: + \`\`\`json + { + "active_plan": "/absolute/path/to/plan.md", + "started_at": "ISO_TIMESTAMP", + "session_ids": ["session_id_1", "session_id_2"], + "plan_name": "plan-name" + } + \`\`\` + +5. **Read the plan file** and start executing tasks according to Orchestrator Sisyphus workflow + +## OUTPUT FORMAT + +When listing plans for selection: +\`\`\` +📋 Available Work Plans + +Current Time: {ISO timestamp} +Session ID: {current session id} + +1. [plan-name-1.md] - Modified: {date} - Progress: 3/10 tasks +2. [plan-name-2.md] - Modified: {date} - Progress: 0/5 tasks + +Which plan would you like to work on? (Enter number or plan name) +\`\`\` + +When resuming existing work: +\`\`\` +🔄 Resuming Work Session + +Active Plan: {plan-name} +Progress: {completed}/{total} tasks +Sessions: {count} (appending current session) + +Reading plan and continuing from last incomplete task... +\`\`\` + +When auto-selecting single plan: +\`\`\` +🚀 Starting Work Session + +Plan: {plan-name} +Session ID: {session_id} +Started: {timestamp} + +Reading plan and beginning execution... +\`\`\` + +## CRITICAL + +- The session_id is injected by the hook - use it directly +- Always update boulder.json BEFORE starting work +- Read the FULL plan file before delegating any tasks +- Follow Orchestrator Sisyphus delegation protocols (7-section format)` diff --git a/src/features/builtin-commands/types.ts b/src/features/builtin-commands/types.ts index 3df5b77f..4df23f53 100644 --- a/src/features/builtin-commands/types.ts +++ b/src/features/builtin-commands/types.ts @@ -1,6 +1,6 @@ import type { CommandDefinition } from "../claude-code-command-loader" -export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph" | "refactor" +export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph" | "refactor" | "start-work" export interface BuiltinCommandConfig { disabled_commands?: BuiltinCommandName[]