Browse Source

Merge pull request #817 from alvinunreal/omos/deepwork-review-budget

Alvin 3 weeks ago
parent
commit
779832c1d9
3 changed files with 46 additions and 30 deletions
  1. 13 7
      docs/skills.md
  2. 4 5
      src/hooks/deepwork/index.ts
  3. 29 18
      src/skills/deepwork/SKILL.md

+ 13 - 7
docs/skills.md

@@ -96,7 +96,7 @@ See **[Clonedeps](clonedeps.md)** for the full workflow and file layout.
 
 **Heavy/complex coding sessions and large modifications workflow.**
 
-`deepwork` is an orchestrator-only workflow skill for managing deep architectural work, multi-phase implementations, and complex refactoring. It provides a structured approach with mandatory review gates while maintaining flexibility in planning.
+`deepwork` is an orchestrator-only workflow skill for managing deep architectural work, multi-phase implementations, and complex refactoring. It provides a structured approach with risk-based review gates while maintaining flexibility in planning.
 
 Start it directly with:
 
@@ -111,15 +111,21 @@ Start it directly with:
    `!.slim/deepwork/**` in `.ignore`. This keeps state git-local while making it
    readable to OpenCode.
 2. Orchestrator creates a session artifact at `.slim/deepwork/<task>.md`
-3. Draft plan → Oracle review → Revise until acceptable
-4. Create phased implementation plan → Oracle review
-5. Execute phase by phase with validation
-6. After each phase: validate → Oracle review → fix issues → continue
+3. Draft a phased implementation plan with a small number of coherent phases
+   based on dependencies and natural delivery boundaries. Do not split work
+   merely to make an Oracle review smaller.
+4. Before execution, show a compact overview of phase order, specialist
+   ownership/scope, the Oracle review total, the review after each phase, and a
+   short reason for each gate.
+5. Execute phase by phase: validate, update session state, then get an Oracle
+   review before advancing.
+6. Batch material findings into one bounded remediation pass with focused
+   validation. Re-review only when needed to assess a changed decision/risk or
+   an otherwise unverifiable concern.
 
 **Key features:**
 - Persistent session state in markdown files
-- Mandatory oracle reviews at plan and phase boundaries
-- Oracle phase reviews include simplify/readability feedback alongside regular correctness and risk review
+- Predictable Oracle reviews after each planned phase, declared before execution
 - V2 scheduler integration (dispatch specialists, wait for hook-driven completion, reconcile)
 - OpenCode todo lists for progress tracking
 - Flexible structure - orchestrator adapts format to task needs

+ 4 - 5
src/hooks/deepwork/index.ts

@@ -12,12 +12,11 @@ function activationPrompt(task: string): string {
     '- create/update a `.slim/deepwork/` progress file;',
     '- save code/doc deliverables to project paths (e.g. `src/`, `docs/`); reserve `.slim/deepwork/` strictly for progress files;',
     '- keep OpenCode todos synced with the current phase;',
-    '- draft a plan and get `@oracle` review before implementation;',
-    '- create and review a phased implementation/delegation plan;',
+    '- draft a phased implementation/delegation plan with a small number of coherent phases based on dependencies and natural delivery boundaries; do not split work merely to reduce review scope;',
+    '- before execution, show the user a compact overview with phase titles/order, delegated specialists and ownership/scope, plus the Oracle review total, gate after each phase, and a short reason for each;',
     '- execute phase by phase with background specialists where useful;',
-    '- wait for hook-driven background completion, reconcile results, validate, and ask `@oracle` to review each phase;',
-    '- ask `@oracle` to include simplify/readability feedback in phase reviews;',
-    '- fix actionable review issues before continuing.',
+    '- wait for hook-driven background completion, reconcile results, validate and update state, then ask `@oracle` to review every planned phase before continuing;',
+    '- batch material actionable Oracle findings into one bounded remediation pass and validate it with focused evidence; only re-review when the remediation changes the reviewed decision/risk or the original concern cannot otherwise be verified.',
     '',
     'Task:',
     task,

+ 29 - 18
src/skills/deepwork/SKILL.md

@@ -32,32 +32,43 @@ Required behavior:
 - write valuable research findings into that file as confirmed research context
   when they are received and reconciled;
 - draft a plan before implementation;
-- ask `@oracle` to review the plan and revise it until acceptable;
 - create a phased implementation/delegation plan;
-- before oracle reviews, add relevant confirmed research findings and file
-  references to the deepwork file so oracle can review the plan or phase from
+- before dispatch, choose a small number of coherent implementation phases from
+  the work's dependencies and natural delivery boundaries; do not split work
+  merely to reduce an Oracle review's scope;
+- before execution, show the user a compact overview containing only phase
+  titles and order, each delegated specialist with its ownership/scope, and the
+  total Oracle reviews with the gate after each phase and a short reason for it;
+- before each implementation phase, decide the execution path: what can run in
+  parallel, what must be sequential, which specialists to delegate to, and
+  whether to split the same agent into multiple bounded lanes;
+- after each planned phase, validate and update the deepwork file, then ask
+  `@oracle` to review the phase result before continuing;
+- before an Oracle review, add relevant confirmed research findings and file
+  references to the deepwork file so Oracle can assess the decision or risk from
   accepted context instead of redoing discovery;
-- ask `@oracle` to review that implementation plan before execution;
-- after oracle review and before each implementation phase, decide the execution
-  path: what can run in parallel, what must be sequential, which specialists to
-  delegate to, and whether to split the same agent into multiple bounded lanes;
-- after each phase, validate, update the deepwork file, prepare the plan file
-  for oracle review and ask `@oracle` to review the phase result, fix
-  actionable issues, then continue;
+- triage and batch material actionable Oracle findings into one bounded
+  remediation pass, then validate it with focused evidence; request a follow-up
+  Oracle review only if that remediation changes the reviewed decision/risk or
+  the original concern cannot otherwise be verified;
 - when a phase includes `@designer`, preserve designer intent across later
   phases. Use `@fixer` only for mechanical follow-up that does not alter the
   UI/UX;
 - finish with final validation and a concise summary.
 
-## Phase Sizing
+## Planned Phase Reviews
 
-Oracle review adds time and cost, so choose phase size deliberately during
-implementation planning. Phases that are too large can hide bugs, missed
-adjustments, and architecture decisions until they are expensive to change.
-Phases that are too small add review overhead with little useful feedback.
+Oracle reviews are automatic gates between the planned implementation phases.
+Before dispatch, decide the phases from the task itself: its dependencies,
+integration boundaries, and meaningful delivery points. Record the phase order,
+the total review count, the review after each phase, and a short reason for each
+gate in the deepwork file and compact user overview.
 
-Balance phase size so each Oracle review happens when its findings could
-meaningfully improve the work that follows.
+Avoid micro-phases created only to make reviews smaller or cheaper. Larger,
+complex tasks can have broader phases, broader patches, and correspondingly
+broader phase reviews. The goal is a sensible number of predictable review
+gates, not the smallest possible review scope. Never add an extra Oracle review
+merely to re-confirm a mechanical fixer change.
 
 ## Designer Handoff Guardrail
 
@@ -109,7 +120,7 @@ capture, as applicable:
 - current goal and understanding;
 - researched, factual context from `@librarian` to avoid oracle doing its own
   research;
-- plan drafts and oracle review notes;
+- plan drafts, Oracle review budget/gates, and review notes;
 - implementation phases and status;
 - validation results;
 - unresolved questions, blockers, and follow-ups.