feat(commands): add start-work command

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)
This commit is contained in:
YeonGyu-Kim 2026-01-05 13:51:36 +09:00
parent 7d2983fafb
commit f0b24f22bc
3 changed files with 91 additions and 1 deletions

View File

@ -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<BuiltinCommandName, Omit<CommandDefinition, "name">> = {
"init-deep": {
@ -41,6 +42,23 @@ ${REFACTOR_TEMPLATE}
</command-instruction>`,
argumentHint: "<refactoring-target> [--scope=<file|module|project>] [--strategy=<safe|aggressive>]",
},
"start-work": {
description: "(builtin) Start Sisyphus work session from Prometheus plan",
agent: "orchestrator-sisyphus",
template: `<command-instruction>
${START_WORK_TEMPLATE}
</command-instruction>
<session-context>
Session ID: $SESSION_ID
Timestamp: $TIMESTAMP
</session-context>
<user-request>
$ARGUMENTS
</user-request>`,
argumentHint: "[plan-name]",
},
}
export function loadBuiltinCommands(

View File

@ -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)`

View File

@ -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[]