oh-my-opencode-serverlocal 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -529,12 +529,6 @@ var CUSTOM_SKILLS = [
529
529
  allowedAgents: ["orchestrator"],
530
530
  sourcePath: "src/skills/clonedeps"
531
531
  },
532
- {
533
- name: "deepwork",
534
- description: "Heavy/complex coding sessions and large modifications workflow",
535
- allowedAgents: ["orchestrator"],
536
- sourcePath: "src/skills/deepwork"
537
- },
538
532
  {
539
533
  name: "verification-planning",
540
534
  description: "Plan credible, proportionate evidence before non-trivial implementation",
@@ -2,7 +2,6 @@ export { createApplyPatchHook } from './apply-patch';
2
2
  export type { AutoUpdateCheckerOptions } from './auto-update-checker';
3
3
  export { createAutoUpdateCheckerHook } from './auto-update-checker';
4
4
  export { createChatHeadersHook } from './chat-headers';
5
- export { createDeepworkCommandHook } from './deepwork';
6
5
  export { createDelegateTaskRetryHook } from './delegate-task-retry/hook';
7
6
  export { createFilterAvailableSkillsHook } from './filter-available-skills';
8
7
  export { ForegroundFallbackManager, isFailoverError, isRetryableError, } from './foreground-fallback';
@@ -14,3 +13,4 @@ export { createPostFileToolNudgeHook } from './post-file-tool-nudge';
14
13
  export { createReflectCommandHook } from './reflect';
15
14
  export { SessionLifecycle } from './session-lifecycle';
16
15
  export { createTaskSessionManagerHook } from './task-session-manager';
16
+ export { createTierCommandsHook } from './tier-commands';
@@ -1,4 +1,4 @@
1
- export declare function createDeepworkCommandHook(): {
1
+ export declare function createTierCommandsHook(): {
2
2
  registerCommand: (config: Record<string, unknown>) => void;
3
3
  handleCommandExecuteBefore: (input: {
4
4
  command: string;
package/dist/index.js CHANGED
@@ -18357,12 +18357,6 @@ var CUSTOM_SKILLS = [
18357
18357
  allowedAgents: ["orchestrator"],
18358
18358
  sourcePath: "src/skills/clonedeps"
18359
18359
  },
18360
- {
18361
- name: "deepwork",
18362
- description: "Heavy/complex coding sessions and large modifications workflow",
18363
- allowedAgents: ["orchestrator"],
18364
- sourcePath: "src/skills/deepwork"
18365
- },
18366
18360
  {
18367
18361
  name: "verification-planning",
18368
18362
  description: "Plan credible, proportionate evidence before non-trivial implementation",
@@ -18499,12 +18493,6 @@ ${text}
18499
18493
  </system-reminder>`;
18500
18494
  }
18501
18495
  var PHASE_REMINDER = formatSystemReminder(PHASE_REMINDER_TEXT);
18502
- var WRITABLE_FILE_OPERATIONS_RULES = `**File Operations Rules**:
18503
- - Prefer dedicated file tools for normal code work: glob/grep/ast_grep_search for discovery, read for file contents, and edit/write/apply_patch for targeted source changes.
18504
- - Use bash for execution and automation: git, package managers, tests, builds, scripts, diagnostics, and shell-native filesystem operations.
18505
- - Shell is acceptable for bulk or mechanical filesystem changes when it is clearer or safer than many individual edits (for example: truncate generated logs, remove build artifacts, batch rename/move files), especially when the user explicitly asks for that shell operation.
18506
- - Before destructive or broad shell operations, verify the target set and quote paths. Prefer a dry-run/listing first when practical.
18507
- - Do not use cat/head/tail/sed/awk only to read code into context; use read/grep unless a shell pipeline is genuinely the better diagnostic.`;
18508
18496
  var DEFAULT_DISABLED_AGENTS = ["observer"];
18509
18497
  var DEFAULT_MAX_SESSIONS_PER_AGENT = 2;
18510
18498
  var DEFAULT_READ_CONTEXT_MIN_LINES = 10;
@@ -19059,101 +19047,52 @@ var AGENT_DESCRIPTIONS = {
19059
19047
  - Permissions: Read files
19060
19048
  - **Delegate when:** You need to see a screenshot, evaluate a UI mockup, or read a diagram.`
19061
19049
  };
19062
- var PARALLEL_DELEGATION_EXAMPLES = [
19063
- "- Multiple @explorer searches across different domains",
19064
- "- @explorer + @librarian research in parallel",
19065
- "- Multiple @fixer instances for faster, scoped implementation across different folders"
19066
- ];
19067
19050
  function buildOrchestratorPrompt(disabledAgents) {
19068
19051
  const enabledAgents = Object.entries(AGENT_DESCRIPTIONS).filter(([name]) => !disabledAgents?.has(name)).map(([, desc]) => desc).join(`
19069
19052
 
19070
19053
  `);
19071
- const enabledParallelExamples = PARALLEL_DELEGATION_EXAMPLES.filter((line) => {
19072
- const mentions = [...line.matchAll(/@(\w+)/g)].map((m) => m[1]);
19073
- if (mentions.length === 0)
19074
- return true;
19075
- return mentions.every((name) => !disabledAgents?.has(name));
19076
- }).join(`
19077
- `);
19078
- return `<Role>
19079
- You are the Master Orchestrator. Your job is to plan, implement, schedule, and delegate coding work.
19054
+ return `You are the Master Orchestrator. Your job is to plan, implement, schedule, and delegate coding work.
19080
19055
  You are aware of all tools, skills, and agents available to you.
19081
19056
  You implement the main tasks yourself unless parallel offloading is needed or a specialist is required.
19082
- </Role>
19083
19057
 
19084
- <Agents>
19058
+ ## Available Specialists
19085
19059
  ${enabledAgents}
19086
- </Agents>
19087
-
19088
- <Workflow_Tiers>
19089
- You operate in different Tiers based on the user's request (e.g., /deepwork, or explicit tier mention). Deduce the appropriate tier.
19090
-
19091
- ## Tier 0: Basic Mode
19092
- - **Focus:** Fast, direct implementation. Low cooperation overhead.
19093
- - **Workflow:** You do the work. High threshold for asking for review. Use @explorer and @librarian freely for basic context.
19094
- - **Supervision:** No mandatory @oracle review.
19095
-
19096
- ## Tier 1: Guided / Supervised Mode
19097
- - **Focus:** Quality and correctness over pure speed.
19098
- - **Workflow:** You plan the work. **MANDATORY:** You must call @oracle to review the plan (logic, edge cases, overlooked items) BEFORE implementing.
19099
- - **Implementation:** You implement, or parallelize to @fixer.
19100
- - **Verification:** **MANDATORY:** You must call @oracle at the end of implementation to review the final code for bugs and logical errors. You treat @oracle as your strict supervisor.
19101
-
19102
- ## Tier 2: Sophisticated Ideation & Planning
19103
- - **Focus:** High value, high performance, high cost. Vision expansion.
19104
- - **Workflow:** When the user provides a vision or basic idea, you MUST use the \`roundtable\` tool to plan the non-technical implementation, get creative feature suggestions, and refine the updated, perfected version of the user's vision.
19105
- - **Supervision:** Follow Tier 1 supervisor rules (@oracle reviews the technical translation of the roundtable's output).
19106
-
19107
- ## Tier 3: Sophisticated Implementation
19108
- - **Focus:** Complex, ambiguous implementation.
19109
- - **Workflow:** You implement everything. You occasionally ask @oracle for spot-checks.
19110
- - **Ambiguity Resolution:** If during implementation the task has multiple perspectives or it's not clearly decidable what the best course of action is, you MUST invoke the \`roundtable\` tool again to decide the path forward.
19111
-
19112
- ## Universal Rules Across All Tiers:
19113
- - **Design:** If something needs to be designed visually, call @designer. Ensure it follows existing design system files.
19114
- - **Vision/Images:** Call @observer for screenshots or visual review.
19115
- - **Parallel Work:** If simple implementation is needed and we know exactly what to change, offload parallel tasks to @fixer.
19116
- - **Main Implementation:** If implementation is the main focus, YOU (Orchestrator) do it yourself. @fixer is ONLY for offloading parallel or bounded sub-tasks.
19117
- </Workflow_Tiers>
19118
-
19119
- <Workflow_Execution>
19120
- ## 1. Understand & Select Tier
19121
- Parse request. Determine the Tier (0, 1, 2, or 3).
19122
-
19123
- ## 2. Delegation Check
19124
- Review available agents.
19125
- - Independent lanes? Background parallel task to @fixer.
19126
- - Deep research? @librarian.
19127
- - Code mapping? @explorer.
19128
-
19129
- ${WRITABLE_FILE_OPERATIONS_RULES}
19130
-
19131
- ## 3. Plan and Parallelize
19132
- Build a short work graph.
19133
- Can tasks be split into background specialist work?
19134
- ${enabledParallelExamples}
19135
-
19136
- ### Background Task Discipline
19137
- - Prefer \`task(..., background: true)\` for delegated work that can run independently.
19138
- - Continue orchestration only on non-overlapping work.
19139
- - Before final response, reconcile any terminal jobs shown in the Background Job Board.
19140
-
19141
- ### Design Handoff Discipline
19142
- - @designer handles UI/UX perfection, responsiveness, and adaptiveness. Do not override their aesthetic choices. You only fix their copy/text if needed.
19143
-
19144
- ### Session Reuse
19145
- - Smartly reuse an available specialist session using \`task_id\`.
19146
- </Workflow_Execution>
19147
-
19148
- <Communication>
19149
- ## Clarity Over Assumptions
19150
- - Ask targeted questions if vague. Make reasonable assumptions for minor details.
19151
-
19152
- ## Concise Execution
19153
- - Answer directly, no preamble. No flattery ("Great idea!").
19154
- - Brief delegation notices: "Checking docs via @librarian..."
19155
- </Communication>
19156
- `;
19060
+
19061
+ ## Workflow Tiers
19062
+ You operate in different Tiers based on the user's request (e.g., /deepwork tier 2, or explicit tier mention). Deduce the appropriate tier.
19063
+
19064
+ **Tier 0: Basic Mode**
19065
+ - Focus: Fast, direct implementation. Low cooperation overhead.
19066
+ - Workflow: You do the work. High threshold for asking for review. Use @explorer and @librarian freely for basic context.
19067
+ - Supervision: No mandatory @oracle review.
19068
+
19069
+ **Tier 1: Guided / Supervised Mode**
19070
+ - Focus: Quality and correctness over pure speed.
19071
+ - Workflow: You plan the work. **MANDATORY:** You must call @oracle to review the plan (logic, edge cases, overlooked items) BEFORE implementing.
19072
+ - Implementation: You implement, or parallelize to @fixer.
19073
+ - Verification: **MANDATORY:** You must call @oracle at the end of implementation to review the final code for bugs and logical errors. Treat @oracle as your strict supervisor.
19074
+
19075
+ **Tier 2: Sophisticated Ideation & Planning**
19076
+ - Focus: High value, high performance, high cost. Vision expansion.
19077
+ - Workflow: When the user provides a vision or basic idea, you MUST use the \`roundtable\` tool to plan the non-technical implementation, get creative feature suggestions, and refine the user's vision.
19078
+ - Supervision: Follow Tier 1 supervisor rules (@oracle reviews the technical translation of the roundtable's output).
19079
+
19080
+ **Tier 3: Sophisticated Implementation**
19081
+ - Focus: Complex, ambiguous implementation.
19082
+ - Workflow: You implement everything. You occasionally ask @oracle for spot-checks.
19083
+ - Ambiguity Resolution: If during implementation the task has multiple perspectives or it's not clearly decidable what the best course of action is, you MUST invoke the \`roundtable\` tool again to decide the path forward.
19084
+
19085
+ ## Universal Rules
19086
+ - Design: If something needs visual design, call @designer. Ensure it follows existing design system files.
19087
+ - Vision/Images: Call @observer for screenshots or visual review.
19088
+ - Parallel Work: If simple implementation is needed and we know exactly what to change, offload parallel tasks to @fixer via background tasks.
19089
+ - Main Implementation: If implementation is the main focus, YOU do it yourself. @fixer is ONLY for offloading parallel or bounded sub-tasks.
19090
+ - Background Tasks: Prefer \`task(..., background: true)\` for delegated work that can run independently. Continue orchestration only on non-overlapping work.
19091
+ - Session Reuse: Smartly reuse an available specialist session using \`task_id\`.
19092
+
19093
+ ## Communication
19094
+ - Answer directly, no preamble. No flattery.
19095
+ - Brief delegation notices (e.g., "Checking docs via @librarian...").`;
19157
19096
  }
19158
19097
  function createOrchestratorAgent(model, customPrompt, customAppendPrompt, disabledAgents) {
19159
19098
  const basePrompt = buildOrchestratorPrompt(disabledAgents);
@@ -24513,70 +24452,6 @@ function createChatHeadersHook(ctx) {
24513
24452
  }
24514
24453
  };
24515
24454
  }
24516
- // src/hooks/command-hook-utils.ts
24517
- function registerCommandHook(opencodeConfig, commandName, template, description) {
24518
- const cmdConfig = opencodeConfig.command;
24519
- if (cmdConfig?.[commandName])
24520
- return false;
24521
- if (!opencodeConfig.command)
24522
- opencodeConfig.command = {};
24523
- opencodeConfig.command[commandName] = { template, description };
24524
- return true;
24525
- }
24526
-
24527
- // src/hooks/deepwork/index.ts
24528
- var COMMAND_NAME = "deepwork";
24529
- function activationPrompt(tier, task2) {
24530
- return [
24531
- `Use the deepwork skill for this task. Treat it as a heavy coding session operating in **${tier}**.`,
24532
- "",
24533
- "Deepwork requirements:",
24534
- "- before planning, delegation, or creating state, inspect existing `.gitignore` and `.ignore`; add only missing entries without duplicates: `.gitignore` must contain `.slim/deepwork/`, and `.ignore` must contain `!.slim/deepwork/` and `!.slim/deepwork/**`; this keeps state git-local yet OpenCode-readable;",
24535
- "- create/update a `.slim/deepwork/` progress file;",
24536
- "- keep OpenCode todos synced with the current phase;",
24537
- "- **Follow the strict rules of your assigned Tier** (e.g., calling @oracle or the roundtable tool as mandated).",
24538
- "- execute phase by phase with background specialists where useful;",
24539
- "- wait for hook-driven background completion, reconcile results, validate, and adhere to your tier's review requirements;",
24540
- "- fix actionable review issues before continuing.",
24541
- "",
24542
- "Task:",
24543
- task2
24544
- ].join(`
24545
- `);
24546
- }
24547
- function createDeepworkCommandHook() {
24548
- return {
24549
- registerCommand: (opencodeConfig) => {
24550
- registerCommandHook(opencodeConfig, COMMAND_NAME, "Start a deepwork session with a specific Tier (e.g., /deepwork tier 2 <task>)", "Use the deepwork workflow with Tier 0, 1, 2, or 3");
24551
- },
24552
- handleCommandExecuteBefore: async (input, output) => {
24553
- if (input.command !== COMMAND_NAME)
24554
- return;
24555
- output.parts.length = 0;
24556
- const rawArgs = input.arguments.trim();
24557
- if (!rawArgs) {
24558
- output.parts.push(createInternalAgentTextPart("What task should deepwork manage? Run `/deepwork tier 1 <task>`. Defaults to Tier 1 if omitted."));
24559
- return;
24560
- }
24561
- let tier = "Tier 1: Guided / Supervised Mode";
24562
- let task2 = rawArgs;
24563
- const tierMatch = rawArgs.match(/^tier\s*([0-3])\s+(.*)/i);
24564
- if (tierMatch) {
24565
- const tierNum = tierMatch[1];
24566
- task2 = tierMatch[2];
24567
- if (tierNum === "0")
24568
- tier = "Tier 0: Basic Mode";
24569
- else if (tierNum === "1")
24570
- tier = "Tier 1: Guided / Supervised Mode";
24571
- else if (tierNum === "2")
24572
- tier = "Tier 2: Sophisticated Ideation & Planning";
24573
- else if (tierNum === "3")
24574
- tier = "Tier 3: Sophisticated Implementation";
24575
- }
24576
- output.parts.push({ type: "text", text: activationPrompt(tier, task2) });
24577
- }
24578
- };
24579
- }
24580
24455
  // src/hooks/delegate-task-retry/patterns.ts
24581
24456
  var DELEGATE_TASK_ERROR_PATTERNS = [
24582
24457
  {
@@ -25457,14 +25332,25 @@ ${JSON_ERROR_REMINDER}`;
25457
25332
  }
25458
25333
  };
25459
25334
  }
25335
+ // src/hooks/command-hook-utils.ts
25336
+ function registerCommandHook(opencodeConfig, commandName, template, description) {
25337
+ const cmdConfig = opencodeConfig.command;
25338
+ if (cmdConfig?.[commandName])
25339
+ return false;
25340
+ if (!opencodeConfig.command)
25341
+ opencodeConfig.command = {};
25342
+ opencodeConfig.command[commandName] = { template, description };
25343
+ return true;
25344
+ }
25345
+
25460
25346
  // src/hooks/loop-command/index.ts
25461
- var COMMAND_NAME2 = "loop";
25347
+ var COMMAND_NAME = "loop";
25462
25348
  function historyDir() {
25463
25349
  const shortID = Math.random().toString(36).slice(2, 8);
25464
25350
  const timestamp = Date.now().toString(36);
25465
25351
  return `.opencode/loop-history/loop-${timestamp}-${shortID}`;
25466
25352
  }
25467
- function activationPrompt2(text) {
25353
+ function activationPrompt(text) {
25468
25354
  const dir = historyDir();
25469
25355
  return [
25470
25356
  "The user ran `/loop`. From the text below, extract: goal, successCriteria, maxAttempts.",
@@ -25501,10 +25387,10 @@ function helpPrompt() {
25501
25387
  function createLoopCommandHook() {
25502
25388
  return {
25503
25389
  registerCommand: (opencodeConfig) => {
25504
- registerCommandHook(opencodeConfig, COMMAND_NAME2, "Run an automated execute-verify loop", "Dispatch fixer, verify, iterate with file-based history on disk.");
25390
+ registerCommandHook(opencodeConfig, COMMAND_NAME, "Run an automated execute-verify loop", "Dispatch fixer, verify, iterate with file-based history on disk.");
25505
25391
  },
25506
25392
  handleCommandExecuteBefore: async (input, output) => {
25507
- if (input.command !== COMMAND_NAME2)
25393
+ if (input.command !== COMMAND_NAME)
25508
25394
  return;
25509
25395
  output.parts.length = 0;
25510
25396
  const args = input.arguments.trim();
@@ -25512,7 +25398,7 @@ function createLoopCommandHook() {
25512
25398
  output.parts.push(createInternalAgentTextPart(helpPrompt()));
25513
25399
  return;
25514
25400
  }
25515
- output.parts.push({ type: "text", text: activationPrompt2(args) });
25401
+ output.parts.push({ type: "text", text: activationPrompt(args) });
25516
25402
  }
25517
25403
  };
25518
25404
  }
@@ -25604,8 +25490,8 @@ function getEligibleMessage(message) {
25604
25490
  return { message, sessionID: message.info.sessionID };
25605
25491
  }
25606
25492
  // src/hooks/reflect/index.ts
25607
- var COMMAND_NAME3 = "reflect";
25608
- function activationPrompt3(focus, isSessionMode = false, lastN = 50) {
25493
+ var COMMAND_NAME2 = "reflect";
25494
+ function activationPrompt2(focus, isSessionMode = false, lastN = 50) {
25609
25495
  const focusBlock = focus ? ["Focus:", focus] : [
25610
25496
  "Focus:",
25611
25497
  isSessionMode ? "Analyze recent sessions to find repeated patterns, friction, and improvement opportunities." : "Review recent work broadly and identify repeated workflow friction worth improving."
@@ -25641,10 +25527,10 @@ function createReflectCommandHook() {
25641
25527
  let shouldHandleCommand = false;
25642
25528
  return {
25643
25529
  registerCommand: (opencodeConfig) => {
25644
- shouldHandleCommand ||= registerCommandHook(opencodeConfig, COMMAND_NAME3, "Review repeated work and suggest workflow improvements", "Use reflect to learn from repeated workflows and suggest reusable improvements");
25530
+ shouldHandleCommand ||= registerCommandHook(opencodeConfig, COMMAND_NAME2, "Review repeated work and suggest workflow improvements", "Use reflect to learn from repeated workflows and suggest reusable improvements");
25645
25531
  },
25646
25532
  handleCommandExecuteBefore: async (input, output) => {
25647
- if (input.command !== COMMAND_NAME3 || !shouldHandleCommand)
25533
+ if (input.command !== COMMAND_NAME2 || !shouldHandleCommand)
25648
25534
  return;
25649
25535
  const args = input.arguments.trim();
25650
25536
  const isSessionMode = args.includes("--sessions");
@@ -25654,7 +25540,7 @@ function createReflectCommandHook() {
25654
25540
  output.parts.length = 0;
25655
25541
  output.parts.push({
25656
25542
  type: "text",
25657
- text: activationPrompt3(focus, isSessionMode, last)
25543
+ text: activationPrompt2(focus, isSessionMode, last)
25658
25544
  });
25659
25545
  }
25660
25546
  };
@@ -26387,6 +26273,91 @@ function formatCancelledTaskStatusOutput(taskID, summary = "cancelled") {
26387
26273
  ].join(`
26388
26274
  `);
26389
26275
  }
26276
+ // src/hooks/tier-commands/index.ts
26277
+ var COMMON_REQUIREMENTS = `
26278
+ State Management Requirements:
26279
+ - Before planning or creating state, inspect \`.gitignore\` and \`.ignore\`. Add missing entries: \`.gitignore\` must contain \`.slim/tier_state/\`, and \`.ignore\` must contain \`!.slim/tier_state/\` and \`!.slim/tier_state/**\`.
26280
+ - Create and maintain a progress file at \`.slim/tier_state/progress.md\`.
26281
+ - Keep OpenCode todos synced with the current phase.
26282
+ - Execute phase by phase. Wait for hook-driven background completion, reconcile results, and fix actionable review issues before continuing.`;
26283
+ function getTierPrompt(tier, task2) {
26284
+ let tierRules = "";
26285
+ switch (tier) {
26286
+ case 0:
26287
+ tierRules = `**Tier 0: Basic Mode**
26288
+ Focus: Fast, direct implementation. Low cooperation overhead.
26289
+ Rules:
26290
+ 1. You (Orchestrator) do the main implementation work.
26291
+ 2. High threshold for asking for review. No mandatory @oracle review.
26292
+ 3. Use @explorer and @librarian freely for basic context.
26293
+ 4. If parallel simple implementation is needed, offload to @fixer.
26294
+ 5. If visual design is needed, call @designer. If vision extraction is needed, call @observer.`;
26295
+ break;
26296
+ case 1:
26297
+ tierRules = `**Tier 1: Guided / Supervised Mode**
26298
+ Focus: Quality and correctness over pure speed.
26299
+ Rules:
26300
+ 1. You must plan the work first.
26301
+ 2. MANDATORY: Call @oracle to review your plan (logic, edge cases, overlooked items) BEFORE implementing.
26302
+ 3. Implement the work yourself, or offload parallel tasks to @fixer.
26303
+ 4. MANDATORY: Call @oracle at the end of the implementation to review the final code for bugs and logical errors. Treat @oracle as your strict supervisor.
26304
+ 5. Use @designer for UI, @observer for vision, @explorer/@librarian for context.`;
26305
+ break;
26306
+ case 2:
26307
+ tierRules = `**Tier 2: Sophisticated Ideation & Planning**
26308
+ Focus: High value, high performance, high cost. Vision expansion.
26309
+ Rules:
26310
+ 1. The user has provided a vision or basic idea.
26311
+ 2. MANDATORY: You must FIRST use the \`roundtable\` tool to plan the non-technical implementation, get creative feature suggestions, and refine the updated, perfected version of the user's vision.
26312
+ 3. Once the roundtable outputs its report, you must translate it into a technical implementation plan.
26313
+ 4. MANDATORY: Call @oracle to review your technical translation of the roundtable's plan BEFORE implementing.
26314
+ 5. Proceed with implementation. Call @oracle for a final code review at the end.`;
26315
+ break;
26316
+ case 3:
26317
+ tierRules = `**Tier 3: Sophisticated Implementation**
26318
+ Focus: Complex, ambiguous implementation.
26319
+ Rules:
26320
+ 1. You implement the main tasks. Occasionally ask @oracle for spot-checks.
26321
+ 2. AMBIGUITY RESOLUTION: If during implementation the task has multiple perspectives or it is not clearly decidable what the best course of action is, you MUST invoke the \`roundtable\` tool to decide the path forward.
26322
+ 3. Offload parallel known tasks to @fixer, UI to @designer.
26323
+ 4. MANDATORY: Call @oracle for a final code review at the end.`;
26324
+ break;
26325
+ }
26326
+ return [
26327
+ `You are operating in a strict structured workflow.`,
26328
+ "",
26329
+ COMMON_REQUIREMENTS,
26330
+ "",
26331
+ tierRules,
26332
+ "",
26333
+ "Task:",
26334
+ task2
26335
+ ].join(`
26336
+ `);
26337
+ }
26338
+ function createTierCommandsHook() {
26339
+ const commands = ["tier0", "tier1", "tier2", "tier3"];
26340
+ return {
26341
+ registerCommand: (opencodeConfig) => {
26342
+ registerCommandHook(opencodeConfig, "tier0", "Start a Tier 0 session (Fast, direct implementation)", "Basic mode");
26343
+ registerCommandHook(opencodeConfig, "tier1", "Start a Tier 1 session (Guided/Supervised by Oracle)", "Supervised mode");
26344
+ registerCommandHook(opencodeConfig, "tier2", "Start a Tier 2 session (Ideation via Roundtable -> Supervised)", "Sophisticated Ideation");
26345
+ registerCommandHook(opencodeConfig, "tier3", "Start a Tier 3 session (Complex implementation with Roundtable fallback)", "Sophisticated Implementation");
26346
+ },
26347
+ handleCommandExecuteBefore: async (input, output) => {
26348
+ if (!commands.includes(input.command))
26349
+ return;
26350
+ output.parts.length = 0;
26351
+ const task2 = input.arguments.trim();
26352
+ if (!task2) {
26353
+ output.parts.push(createInternalAgentTextPart(`What task should this tier manage? Run \`/${input.command} <task>\`.`));
26354
+ return;
26355
+ }
26356
+ const tierNum = parseInt(input.command.replace("tier", ""), 10);
26357
+ output.parts.push({ type: "text", text: getTierPrompt(tierNum, task2) });
26358
+ }
26359
+ };
26360
+ }
26390
26361
  // src/interview/dashboard.ts
26391
26362
  import crypto2 from "node:crypto";
26392
26363
  import * as fsSync2 from "node:fs";
@@ -30227,7 +30198,7 @@ function buildAnswerPrompt(answers, questions, maxQuestions) {
30227
30198
  }
30228
30199
 
30229
30200
  // src/interview/service.ts
30230
- var COMMAND_NAME4 = "interview";
30201
+ var COMMAND_NAME3 = "interview";
30231
30202
  var DEFAULT_MAX_QUESTIONS = 2;
30232
30203
  var MAX_RETAINED_ABANDONED = 50;
30233
30204
  function isTruthyEnvFlag(value) {
@@ -30531,11 +30502,11 @@ function createInterviewService(ctx, config, deps) {
30531
30502
  }
30532
30503
  function registerCommand(opencodeConfig) {
30533
30504
  const configCommand = opencodeConfig.command;
30534
- if (!configCommand?.[COMMAND_NAME4]) {
30505
+ if (!configCommand?.[COMMAND_NAME3]) {
30535
30506
  if (!opencodeConfig.command) {
30536
30507
  opencodeConfig.command = {};
30537
30508
  }
30538
- opencodeConfig.command[COMMAND_NAME4] = {
30509
+ opencodeConfig.command[COMMAND_NAME3] = {
30539
30510
  template: "Start an interview and write a live markdown spec",
30540
30511
  description: "Open a localhost interview UI linked to the current OpenCode session"
30541
30512
  };
@@ -30609,7 +30580,7 @@ function createInterviewService(ctx, config, deps) {
30609
30580
  }
30610
30581
  }
30611
30582
  async function handleCommandExecuteBefore(input, output) {
30612
- if (input.command !== COMMAND_NAME4) {
30583
+ if (input.command !== COMMAND_NAME3) {
30613
30584
  return;
30614
30585
  }
30615
30586
  const idea = input.arguments.trim();
@@ -35415,11 +35386,11 @@ function recordTuiAgentModel(input, projectDir) {
35415
35386
  }
35416
35387
 
35417
35388
  // src/tools/preset-manager.ts
35418
- var COMMAND_NAME5 = "preset";
35389
+ var COMMAND_NAME4 = "preset";
35419
35390
  function createPresetManager(ctx, config) {
35420
35391
  let activePreset = getActiveRuntimePreset() ?? config.preset ?? null;
35421
35392
  async function handleCommandExecuteBefore(input, output) {
35422
- if (input.command !== COMMAND_NAME5) {
35393
+ if (input.command !== COMMAND_NAME4) {
35423
35394
  return;
35424
35395
  }
35425
35396
  output.parts.length = 0;
@@ -35438,11 +35409,11 @@ function createPresetManager(ctx, config) {
35438
35409
  }
35439
35410
  function registerCommand(opencodeConfig) {
35440
35411
  const configCommand = opencodeConfig.command;
35441
- if (!configCommand?.[COMMAND_NAME5]) {
35412
+ if (!configCommand?.[COMMAND_NAME4]) {
35442
35413
  if (!opencodeConfig.command) {
35443
35414
  opencodeConfig.command = {};
35444
35415
  }
35445
- opencodeConfig.command[COMMAND_NAME5] = {
35416
+ opencodeConfig.command[COMMAND_NAME4] = {
35446
35417
  template: "List available presets and switch between them",
35447
35418
  description: "Switch agent presets at runtime (e.g., /preset cheap, /preset powerful)"
35448
35419
  };
@@ -37992,7 +37963,8 @@ var OhMyOpenCodeLite = async (ctx) => {
37992
37963
  let sessionLifecycle;
37993
37964
  let chatHeadersHook;
37994
37965
  let foregroundFallback;
37995
- let deepworkCommandHook;
37966
+ let applyPatchHook;
37967
+ let tierCommandsHook;
37996
37968
  let reflectCommandHook;
37997
37969
  let loopCommandHook;
37998
37970
  let taskSessionManagerHook;
@@ -38079,7 +38051,7 @@ var OhMyOpenCodeLite = async (ctx) => {
38079
38051
  sessionAgentMap = new Map;
38080
38052
  chatHeadersHook = createChatHeadersHook(ctx);
38081
38053
  foregroundFallback = new ForegroundFallbackManager(ctx.client, runtimeChains, config.fallback?.enabled !== false, config.fallback?.maxRetries ?? 3, sessionLifecycle);
38082
- deepworkCommandHook = createDeepworkCommandHook();
38054
+ tierCommandsHook = createTierCommandsHook();
38083
38055
  reflectCommandHook = createReflectCommandHook();
38084
38056
  loopCommandHook = createLoopCommandHook();
38085
38057
  taskSessionManagerHook = createTaskSessionManagerHook(ctx, {
@@ -38406,7 +38378,7 @@ var OhMyOpenCodeLite = async (ctx) => {
38406
38378
  agentConfigEntry.permission = agentPermission;
38407
38379
  }
38408
38380
  interviewManager.registerCommand(opencodeConfig);
38409
- deepworkCommandHook.registerCommand(opencodeConfig);
38381
+ tierCommandsHook.registerCommand(opencodeConfig);
38410
38382
  reflectCommandHook.registerCommand(opencodeConfig);
38411
38383
  loopCommandHook.registerCommand(opencodeConfig);
38412
38384
  presetManager.registerCommand(opencodeConfig);
@@ -38488,7 +38460,7 @@ var OhMyOpenCodeLite = async (ctx) => {
38488
38460
  "command.execute.before": async (input, output) => {
38489
38461
  await interviewManager.handleCommandExecuteBefore(input, output);
38490
38462
  await presetManager.handleCommandExecuteBefore(input, output);
38491
- await deepworkCommandHook.handleCommandExecuteBefore(input, output);
38463
+ await tierCommandsHook.handleCommandExecuteBefore(input, output);
38492
38464
  await reflectCommandHook.handleCommandExecuteBefore(input, output);
38493
38465
  await loopCommandHook.handleCommandExecuteBefore(input, output);
38494
38466
  },
package/dist/tui.js CHANGED
@@ -133,12 +133,6 @@ ${text}
133
133
  </system-reminder>`;
134
134
  }
135
135
  var PHASE_REMINDER = formatSystemReminder(PHASE_REMINDER_TEXT);
136
- var WRITABLE_FILE_OPERATIONS_RULES = `**File Operations Rules**:
137
- - Prefer dedicated file tools for normal code work: glob/grep/ast_grep_search for discovery, read for file contents, and edit/write/apply_patch for targeted source changes.
138
- - Use bash for execution and automation: git, package managers, tests, builds, scripts, diagnostics, and shell-native filesystem operations.
139
- - Shell is acceptable for bulk or mechanical filesystem changes when it is clearer or safer than many individual edits (for example: truncate generated logs, remove build artifacts, batch rename/move files), especially when the user explicitly asks for that shell operation.
140
- - Before destructive or broad shell operations, verify the target set and quote paths. Prefer a dry-run/listing first when practical.
141
- - Do not use cat/head/tail/sed/awk only to read code into context; use read/grep unless a shell pipeline is genuinely the better diagnostic.`;
142
136
  var DEFAULT_DISABLED_AGENTS = ["observer"];
143
137
  var DEFAULT_MAX_SESSIONS_PER_AGENT = 2;
144
138
  var DEFAULT_READ_CONTEXT_MIN_LINES = 10;
@@ -454,12 +448,6 @@ var CUSTOM_SKILLS = [
454
448
  allowedAgents: ["orchestrator"],
455
449
  sourcePath: "src/skills/clonedeps"
456
450
  },
457
- {
458
- name: "deepwork",
459
- description: "Heavy/complex coding sessions and large modifications workflow",
460
- allowedAgents: ["orchestrator"],
461
- sourcePath: "src/skills/deepwork"
462
- },
463
451
  {
464
452
  name: "verification-planning",
465
453
  description: "Plan credible, proportionate evidence before non-trivial implementation",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode-serverlocal",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Custom serverlocal fork of oh-my-opencode-slim — fully owned, custom prompts + commands, dist synced via opencode-dotfiles",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,122 +0,0 @@
1
- ---
2
- name: deepwork
3
- description: High-cost orchestrator workflow for large, high-risk, multi-phase coding efforts with meaningful dependencies and review gates. Do not activate for routine multi-file changes.
4
- ---
5
-
6
- # Deepwork
7
-
8
- Deepwork is an orchestrator workflow for heavy coding sessions. Use it only
9
- when the work is clearly large or high-risk: multiple dependent phases,
10
- cross-cutting architectural change, unsafe-to-partially-ship migration, or
11
- sustained coordination across several specialist lanes.
12
-
13
- Do not infer Deepwork merely because a task touches multiple files. Do not use
14
- it for trivial edits, quick docs changes, simple bug fixes, or routine bounded
15
- features.
16
-
17
- ## Core Contract
18
-
19
- When deepwork is active, the orchestrator must manage the work as a scheduler,
20
- not as the default implementation worker.
21
-
22
- Required behavior:
23
-
24
- - before planning, delegation, or creating a deepwork state file, inspect the
25
- existing `.gitignore` and `.ignore`; add only missing entries, without
26
- duplicates, so `.gitignore` contains `.slim/deepwork/` and `.ignore` contains
27
- `!.slim/deepwork/` and `!.slim/deepwork/**`;
28
- - keep OpenCode todos aligned with the active deepwork phase;
29
- - create and maintain a local markdown progress file under `.slim/deepwork/`;
30
- - write valuable research findings into that file as confirmed research context
31
- when they are received and reconciled;
32
- - draft a plan before implementation;
33
- - ask `@oracle` to review the plan and revise it until acceptable;
34
- - create a phased implementation/delegation plan;
35
- - before oracle reviews, add relevant confirmed research findings and file
36
- references to the deepwork file so oracle can review the plan or phase from
37
- accepted context instead of redoing discovery;
38
- - ask `@oracle` to review that implementation plan before execution;
39
- - after oracle review and before each implementation phase, decide the execution
40
- path: what can run in parallel, what must be sequential, which specialists to
41
- delegate to, and whether to split the same agent into multiple bounded lanes;
42
- - after each phase, validate, update the deepwork file, prepare the plan file
43
- for oracle review and ask `@oracle` to review the phase result, fix
44
- actionable issues, then continue;
45
- - when a phase includes `@designer`, preserve designer intent across later
46
- phases. Use `@fixer` only for mechanical follow-up that does not alter the
47
- UI/UX;
48
- - finish with final validation and a concise summary.
49
-
50
- ## Designer Handoff Guardrail
51
-
52
- When a deepwork phase includes `@designer`, treat the delivered UI/UX as
53
- accepted design intent for later phases. Record any important design decisions in
54
- the deepwork file before continuing.
55
-
56
- After designer work:
57
-
58
- - preserve layout, rhythm, hierarchy, motion, spacing, color, affordances,
59
- responsiveness, and component feel;
60
- - review and improve user-facing copy with grounded, normal wording, but do not
61
- change visual structure or interaction intent;
62
- - route follow-up visual, responsive, motion, hierarchy, polish, or
63
- component-feel changes back to `@designer`;
64
- - use `@fixer` only for bounded mechanical follow-up that preserves the design
65
- exactly, such as wiring, tests, type fixes, or non-visual behavior changes;
66
- - if design intent must change, record why in the deepwork file before changing
67
- it.
68
-
69
- ## Deepwork File
70
-
71
- Create a task-specific file such as:
72
-
73
- ```text
74
- .slim/deepwork/<short-task-slug>.md
75
- ```
76
-
77
- Before creating this file—and before planning or delegation—inspect the existing
78
- `.gitignore` and `.ignore`. Add only missing entries and do not add duplicates:
79
-
80
- ```gitignore
81
- # .gitignore
82
- .slim/deepwork/
83
- ```
84
-
85
- ```gitignore
86
- # .ignore
87
- !.slim/deepwork/
88
- !.slim/deepwork/**
89
- ```
90
-
91
- These rules keep deepwork state git-local while allowing OpenCode to read it.
92
-
93
- Do not follow a rigid template. Choose whatever markdown structure best fits the
94
- work. The file only needs to remain useful as persistent session state and should
95
- capture, as applicable:
96
-
97
- - current goal and understanding;
98
- - researched, factual context from `@librarian` to avoid oracle doing its own
99
- research;
100
- - plan drafts and oracle review notes;
101
- - implementation phases and status;
102
- - validation results;
103
- - unresolved questions, blockers, and follow-ups.
104
-
105
- Update this file after major decisions, valuable specialist research, reviews,
106
- phase completions, validation results, and scope changes.
107
- When `@librarian` docs, code reads, or external references produce useful
108
- information, reconcile the result and record the accepted findings here so later
109
- planning and reviews share the same context instead of rediscovering it.
110
- Don't put actual contents of local files, reference them by path only.
111
-
112
- ## Scheduler Discipline
113
-
114
- Use the scheduler model throughout:
115
-
116
- - follow Orchestrator delegations rules
117
- - record task/session IDs and ownership boundaries;
118
- - wait for hook-driven background completion before consuming background results;
119
- - avoid blocking Orchestrator lane while background jobs run; if no independent
120
- work remains, stop briefly and let the completion event resume the workflow;
121
- - do not advance to the next phase while relevant jobs are running or terminal
122
- results are unreconciled.