Alvin Unreal пре 3 месеци
родитељ
комит
3b5eb175e1

+ 3 - 0
.gitignore

@@ -90,3 +90,6 @@ captures/
 
 # Local git worktrees for parallel feature work
 .slim/worktrees/
+
+# Deepwork session artifacts
+.slim/deepwork/

+ 27 - 0
docs/skills.md

@@ -15,6 +15,7 @@ Bundled skills are installed by the `oh-my-opencode-slim` installer.
 | [`simplify`](#simplify) | Behavior-preserving code simplification | `oracle` |
 | [`codemap`](#codemap) | Repository codemap generation | `orchestrator` |
 | [`clonedeps`](#clonedeps) | Local dependency source cloning | `orchestrator` |
+| [`deepwork`](#deepwork) | Heavy/complex coding sessions workflow | `orchestrator` |
 
 ---
 
@@ -81,6 +82,32 @@ See **[Clonedeps](clonedeps.md)** for the full workflow and file layout.
 
 ---
 
+## deepwork
+
+**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.
+
+**How it works:**
+1. Orchestrator creates a session artifact at `.slim/deepwork/<task>.md`
+2. Draft plan → Oracle review → Revise until acceptable
+3. Create phased implementation plan → Oracle review
+4. Execute phase by phase with validation
+5. After each phase: validate → Oracle review → fix issues → continue
+
+**Key features:**
+- Persistent session state in markdown files
+- Mandatory oracle reviews at plan and phase boundaries
+- V2 scheduler integration (dispatch specialists, poll task_status, reconcile)
+- OpenCode todo lists for progress tracking
+- Flexible structure - orchestrator adapts format to task needs
+
+**When to use:** Large-scale refactoring, multi-file architectural changes, complex feature development spanning modules.
+
+**When NOT to use:** Simple single-file edits, trivial bug fixes, quick one-off changes.
+
+---
+
 ## Skills Assignment
 
 Control which skills each agent can use in `~/.config/opencode/oh-my-opencode-slim.json` (or `.jsonc`):

+ 1 - 0
scripts/verify-release-artifact.ts

@@ -42,6 +42,7 @@ const packagedRequiredFiles = [
   'src/skills/simplify/SKILL.md',
   'src/skills/codemap/SKILL.md',
   'src/skills/clonedeps/SKILL.md',
+  'src/skills/deepwork/SKILL.md',
 ];
 
 function fail(message: string): never {

+ 7 - 0
src/cli/custom-skills.ts

@@ -46,6 +46,13 @@ export const CUSTOM_SKILLS: CustomSkill[] = [
     allowedAgents: ['orchestrator'],
     sourcePath: 'src/skills/clonedeps',
   },
+  {
+    name: 'deepwork',
+    description:
+      'Heavy/complex coding sessions and large modifications workflow',
+    allowedAgents: ['orchestrator'],
+    sourcePath: 'src/skills/deepwork',
+  },
 ];
 
 /**

+ 1 - 0
src/cli/skills.test.ts

@@ -23,6 +23,7 @@ describe('skills permissions', () => {
 
     const orchestratorPerms = getSkillPermissionsForAgent('orchestrator');
     expect(orchestratorPerms.clonedeps).toBe('allow');
+    expect(orchestratorPerms.deepwork).toBe('allow');
   });
 
   it('should honor explicit skill list overrides', () => {

+ 3 - 2
src/skills/codemap.md

@@ -18,6 +18,7 @@
   - `src/skills/codemap/` (command-style repository mapping skill)
   - `src/skills/clonedeps/` (workflow skill for dependency source mirroring)
   - `src/skills/simplify/` (readability/refactor guidance skill)
+  - `src/skills/deepwork/` (orchestrator-only workflow for heavy coding sessions)
 - Files are considered static runtime payload. No plugin TS module in `src/` imports these files directly; they
   are loaded by OpenCode via filesystem installation.
 
@@ -38,6 +39,6 @@
   bundled skills when agent policy is derived from built-in recommendations.
 - `verify-release-artifact.ts` enforces artifact completeness by asserting key
   bundled skill payloads such as `src/skills/simplify/SKILL.md`,
-  `src/skills/codemap/SKILL.md`, and `src/skills/clonedeps/SKILL.md` are present
-  in the tarball.
+  `src/skills/codemap/SKILL.md`, `src/skills/clonedeps/SKILL.md`, and
+  `src/skills/deepwork/SKILL.md` are present in the tarball.
 - `package.json` scripts (`verify:release`, `build`) rely on these assets to ensure install-time skill availability.

+ 73 - 0
src/skills/deepwork/SKILL.md

@@ -0,0 +1,73 @@
+---
+name: deepwork
+description: Orchestrator-only workflow for heavy coding sessions, multi-phase implementation, and risky refactors. Use for complex work that needs planning, review gates, and persistent progress tracking.
+---
+
+# Deepwork
+
+Deepwork is an orchestrator workflow for heavy coding sessions. Use it when the
+work is broad, risky, multi-file, or likely to span several implementation
+phases. Do not use it for trivial edits, quick docs changes, or simple bug fixes.
+
+## Core Contract
+
+When deepwork is active, the orchestrator must manage the work as a scheduler,
+not as the default implementation worker.
+
+Required behavior:
+
+- keep OpenCode todos aligned with the active deepwork phase;
+- create and maintain a local markdown progress file under `.slim/deepwork/`;
+- draft a plan before implementation;
+- ask `@oracle` to review the plan and revise it until acceptable;
+- create a phased implementation/delegation plan;
+- ask `@oracle` to review that implementation plan before execution;
+- execute phase by phase with specialist delegation where useful;
+- after each phase, validate, update the deepwork file, ask `@oracle` to review
+  the phase result, fix actionable issues, then continue;
+- finish with final validation and a concise summary.
+
+## Deepwork File
+
+Create a task-specific file such as:
+
+```text
+.slim/deepwork/<short-task-slug>.md
+```
+
+Do not follow a rigid template. Choose whatever markdown structure best fits the
+work. The file only needs to remain useful as persistent session state and should
+capture, as applicable:
+
+- current goal and understanding;
+- assumptions, constraints, and decisions;
+- plan drafts and oracle review notes;
+- implementation phases and status;
+- validation results;
+- unresolved questions, blockers, and follow-ups.
+
+Update this file after major decisions, reviews, phase completions, validation
+results, and scope changes.
+
+## Scheduler Discipline
+
+Use the V2 scheduler model throughout:
+
+- dispatch `@explorer`, `@librarian`, `@fixer`, `@designer`, `@oracle`, or
+  `@council` lanes as background tasks when useful;
+- record task/session IDs and ownership boundaries;
+- poll `task_status` before consuming background results;
+- reconcile terminal results before dependent work;
+- keep write scopes separate when parallelizing;
+- do not advance to the next phase while relevant jobs are running or terminal
+  results are unreconciled.
+
+`@oracle` owns review and risk assessment. It should review plans and completed
+phase outputs, not become the default implementer.
+
+## Lightweight Judgment
+
+Deepwork is meant to prevent chaotic long sessions, not create paperwork. Keep
+the markdown concise, batch small related checks when reasonable, and scale the
+number of review gates to the risk of the work. If the task becomes small and
+obvious, finish simply while preserving validation and the final summary.