oh-my-claude-sisyphus 3.2.3 → 3.3.0

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.
Files changed (81) hide show
  1. package/README.md +37 -2
  2. package/agents/scientist-high.md +1003 -0
  3. package/agents/scientist-low.md +232 -0
  4. package/agents/scientist.md +1180 -0
  5. package/bridge/__pycache__/gyoshu_bridge.cpython-310.pyc +0 -0
  6. package/bridge/gyoshu_bridge.py +846 -0
  7. package/commands/autopilot.md +51 -3
  8. package/commands/ralph.md +17 -2
  9. package/commands/ultrawork.md +18 -1
  10. package/dist/__tests__/installer.test.js +1 -1
  11. package/dist/agents/definitions.d.ts +9 -0
  12. package/dist/agents/definitions.d.ts.map +1 -1
  13. package/dist/agents/definitions.js +25 -0
  14. package/dist/agents/definitions.js.map +1 -1
  15. package/dist/agents/index.d.ts +2 -1
  16. package/dist/agents/index.d.ts.map +1 -1
  17. package/dist/agents/index.js +2 -1
  18. package/dist/agents/index.js.map +1 -1
  19. package/dist/agents/scientist.d.ts +16 -0
  20. package/dist/agents/scientist.d.ts.map +1 -0
  21. package/dist/agents/scientist.js +370 -0
  22. package/dist/agents/scientist.js.map +1 -0
  23. package/dist/hooks/omc-orchestrator/audit.d.ts +30 -0
  24. package/dist/hooks/omc-orchestrator/audit.d.ts.map +1 -0
  25. package/dist/hooks/omc-orchestrator/audit.js +66 -0
  26. package/dist/hooks/omc-orchestrator/audit.js.map +1 -0
  27. package/dist/hooks/omc-orchestrator/constants.d.ts +6 -2
  28. package/dist/hooks/omc-orchestrator/constants.d.ts.map +1 -1
  29. package/dist/hooks/omc-orchestrator/constants.js +37 -1
  30. package/dist/hooks/omc-orchestrator/constants.js.map +1 -1
  31. package/dist/hooks/omc-orchestrator/index.d.ts +4 -0
  32. package/dist/hooks/omc-orchestrator/index.d.ts.map +1 -1
  33. package/dist/hooks/omc-orchestrator/index.js +34 -3
  34. package/dist/hooks/omc-orchestrator/index.js.map +1 -1
  35. package/dist/installer/hooks.d.ts +18 -0
  36. package/dist/installer/hooks.d.ts.map +1 -1
  37. package/dist/installer/hooks.js +24 -0
  38. package/dist/installer/hooks.js.map +1 -1
  39. package/dist/installer/index.d.ts +1 -1
  40. package/dist/installer/index.js +1 -1
  41. package/dist/lib/atomic-write.d.ts +29 -0
  42. package/dist/lib/atomic-write.d.ts.map +1 -0
  43. package/dist/lib/atomic-write.js +111 -0
  44. package/dist/lib/atomic-write.js.map +1 -0
  45. package/dist/tools/index.d.ts +1 -0
  46. package/dist/tools/index.d.ts.map +1 -1
  47. package/dist/tools/index.js +4 -1
  48. package/dist/tools/index.js.map +1 -1
  49. package/dist/tools/python-repl/bridge-manager.d.ts +65 -0
  50. package/dist/tools/python-repl/bridge-manager.d.ts.map +1 -0
  51. package/dist/tools/python-repl/bridge-manager.js +478 -0
  52. package/dist/tools/python-repl/bridge-manager.js.map +1 -0
  53. package/dist/tools/python-repl/index.d.ts +40 -0
  54. package/dist/tools/python-repl/index.d.ts.map +1 -0
  55. package/dist/tools/python-repl/index.js +36 -0
  56. package/dist/tools/python-repl/index.js.map +1 -0
  57. package/dist/tools/python-repl/paths.d.ts +84 -0
  58. package/dist/tools/python-repl/paths.d.ts.map +1 -0
  59. package/dist/tools/python-repl/paths.js +213 -0
  60. package/dist/tools/python-repl/paths.js.map +1 -0
  61. package/dist/tools/python-repl/session-lock.d.ts +111 -0
  62. package/dist/tools/python-repl/session-lock.d.ts.map +1 -0
  63. package/dist/tools/python-repl/session-lock.js +510 -0
  64. package/dist/tools/python-repl/session-lock.js.map +1 -0
  65. package/dist/tools/python-repl/socket-client.d.ts +42 -0
  66. package/dist/tools/python-repl/socket-client.d.ts.map +1 -0
  67. package/dist/tools/python-repl/socket-client.js +157 -0
  68. package/dist/tools/python-repl/socket-client.js.map +1 -0
  69. package/dist/tools/python-repl/tool.d.ts +100 -0
  70. package/dist/tools/python-repl/tool.d.ts.map +1 -0
  71. package/dist/tools/python-repl/tool.js +575 -0
  72. package/dist/tools/python-repl/tool.js.map +1 -0
  73. package/dist/tools/python-repl/types.d.ts +95 -0
  74. package/dist/tools/python-repl/types.d.ts.map +1 -0
  75. package/dist/tools/python-repl/types.js +2 -0
  76. package/dist/tools/python-repl/types.js.map +1 -0
  77. package/docs/CLAUDE.md +31 -0
  78. package/package.json +2 -1
  79. package/skills/deepinit/SKILL.md +1 -1
  80. package/skills/hud/SKILL.md +2 -0
  81. package/skills/research/SKILL.md +511 -0
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Bridge metadata stored in bridge_meta.json
3
+ */
4
+ export interface BridgeMeta {
5
+ pid: number;
6
+ socketPath: string;
7
+ startedAt: string;
8
+ sessionId: string;
9
+ pythonEnv: PythonEnvInfo;
10
+ processStartTime?: number;
11
+ }
12
+ export interface PythonEnvInfo {
13
+ pythonPath: string;
14
+ type: 'venv';
15
+ }
16
+ export interface LockInfo {
17
+ lockId: string;
18
+ pid: number;
19
+ processStartTime?: number;
20
+ hostname: string;
21
+ acquiredAt: string;
22
+ }
23
+ export interface ExecuteResult {
24
+ success: boolean;
25
+ stdout: string;
26
+ stderr: string;
27
+ markers: MarkerInfo[];
28
+ artifacts: unknown[];
29
+ timing: {
30
+ started_at: string;
31
+ duration_ms: number;
32
+ };
33
+ memory: {
34
+ rss_mb: number;
35
+ vms_mb: number;
36
+ };
37
+ error?: {
38
+ type: string;
39
+ message: string;
40
+ traceback: string;
41
+ };
42
+ }
43
+ export interface MarkerInfo {
44
+ type: string;
45
+ subtype: string | null;
46
+ content: string;
47
+ line_number: number;
48
+ category: string;
49
+ }
50
+ export interface StateResult {
51
+ memory: {
52
+ rss_mb: number;
53
+ vms_mb: number;
54
+ };
55
+ variables: string[];
56
+ variable_count: number;
57
+ }
58
+ export interface ResetResult {
59
+ status: string;
60
+ memory: {
61
+ rss_mb: number;
62
+ vms_mb: number;
63
+ };
64
+ }
65
+ export interface InterruptResult {
66
+ status: string;
67
+ terminatedBy?: 'SIGINT' | 'SIGTERM' | 'SIGKILL' | 'graceful';
68
+ terminationTimeMs?: number;
69
+ }
70
+ export interface PythonReplInput {
71
+ action: 'execute' | 'interrupt' | 'reset' | 'get_state';
72
+ researchSessionID: string;
73
+ code?: string;
74
+ executionLabel?: string;
75
+ executionTimeout?: number;
76
+ queueTimeout?: number;
77
+ projectDir?: string;
78
+ }
79
+ export interface JsonRpcRequest {
80
+ jsonrpc: '2.0';
81
+ id: string;
82
+ method: string;
83
+ params?: Record<string, unknown>;
84
+ }
85
+ export interface JsonRpcResponse {
86
+ jsonrpc: '2.0';
87
+ id: string;
88
+ result?: unknown;
89
+ error?: {
90
+ code: number;
91
+ message: string;
92
+ data?: unknown;
93
+ };
94
+ }
95
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tools/python-repl/types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/tools/python-repl/types.ts"],"names":[],"mappings":""}
package/docs/CLAUDE.md CHANGED
@@ -64,6 +64,37 @@ When you detect these patterns, you MUST invoke the corresponding skill:
64
64
  | Standard work | `sonnet` | "Add error handling", "Implement feature" |
65
65
  | Complex reasoning | `opus` | "Debug race condition", "Refactor architecture" |
66
66
 
67
+ ### Path-Based Write Rules
68
+
69
+ Direct file writes are enforced via path patterns:
70
+
71
+ **Allowed Paths (Direct Write OK):**
72
+ | Path | Allowed For |
73
+ |------|-------------|
74
+ | `~/.claude/**` | System configuration |
75
+ | `.omc/**` | OMC state and config |
76
+ | `.claude/**` | Local Claude config |
77
+ | `CLAUDE.md` | User instructions |
78
+ | `AGENTS.md` | AI documentation |
79
+
80
+ **Warned Paths (Should Delegate):**
81
+ | Extension | Type |
82
+ |-----------|------|
83
+ | `.ts`, `.tsx`, `.js`, `.jsx` | JavaScript/TypeScript |
84
+ | `.py` | Python |
85
+ | `.go`, `.rs`, `.java` | Compiled languages |
86
+ | `.c`, `.cpp`, `.h` | C/C++ |
87
+ | `.svelte`, `.vue` | Frontend frameworks |
88
+
89
+ **How to Delegate Source File Changes:**
90
+ ```
91
+ Task(subagent_type="oh-my-claudecode:executor",
92
+ model="sonnet",
93
+ prompt="Edit src/file.ts to add validation...")
94
+ ```
95
+
96
+ This is **soft enforcement** (warnings only). Audit log at `.omc/logs/delegation-audit.jsonl`.
97
+
67
98
  ---
68
99
 
69
100
  ## PART 2: USER EXPERIENCE
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-claude-sisyphus",
3
- "version": "3.2.3",
3
+ "version": "3.3.0",
4
4
  "description": "Multi-agent orchestration system for Claude Code - Inspired by oh-my-opencode",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -17,6 +17,7 @@
17
17
  "files": [
18
18
  "dist",
19
19
  "agents",
20
+ "bridge",
20
21
  "commands",
21
22
  "hooks",
22
23
  "scripts",
@@ -154,7 +154,7 @@ grep -r "<!-- Parent:" --include="AGENTS.md" .
154
154
  | Directory mapping | `explore` |
155
155
  | File analysis | `architect-low` |
156
156
  | Content generation | `writer` |
157
- | Multi-file writes | `executor` |
157
+ | AGENTS.md writes | `writer` |
158
158
 
159
159
  ## Empty Directory Handling
160
160
 
@@ -2,6 +2,8 @@
2
2
  name: hud
3
3
  description: Configure HUD display options (layout, presets, display elements)
4
4
  user-invocable: true
5
+ role: config-writer # DOCUMENTATION ONLY - This skill writes to ~/.claude/ paths
6
+ scope: ~/.claude/** # DOCUMENTATION ONLY - Allowed write scope
5
7
  ---
6
8
 
7
9
  # HUD Skill
@@ -0,0 +1,511 @@
1
+ ---
2
+ name: research
3
+ description: Orchestrate parallel scientist agents for comprehensive research with AUTO mode
4
+ user-invocable: true
5
+ argument-hint: <research goal>
6
+ ---
7
+
8
+ # Research Skill
9
+
10
+ Orchestrate parallel scientist agents for comprehensive research workflows with optional AUTO mode for fully autonomous execution.
11
+
12
+ ## Overview
13
+
14
+ Research is a multi-stage workflow that decomposes complex research goals into parallel investigations:
15
+
16
+ 1. **Decomposition** - Break research goal into independent stages/hypotheses
17
+ 2. **Execution** - Run parallel scientist agents on each stage
18
+ 3. **Verification** - Cross-validate findings, check consistency
19
+ 4. **Synthesis** - Aggregate results into comprehensive report
20
+
21
+ ## Usage Examples
22
+
23
+ ```
24
+ /research <goal> # Standard research with user checkpoints
25
+ /research AUTO: <goal> # Fully autonomous until complete
26
+ /research status # Check current research session status
27
+ /research resume # Resume interrupted research session
28
+ /research list # List all research sessions
29
+ /research report <session-id> # Generate report for session
30
+ ```
31
+
32
+ ### Quick Examples
33
+
34
+ ```
35
+ /research What are the performance characteristics of different sorting algorithms?
36
+ /research AUTO: Analyze authentication patterns in this codebase
37
+ /research How does the error handling work across the API layer?
38
+ ```
39
+
40
+ ## Research Protocol
41
+
42
+ ### Stage Decomposition Pattern
43
+
44
+ When given a research goal, decompose into 3-7 independent stages:
45
+
46
+ ```markdown
47
+ ## Research Decomposition
48
+
49
+ **Goal:** <original research goal>
50
+
51
+ ### Stage 1: <stage-name>
52
+ - **Focus:** What this stage investigates
53
+ - **Hypothesis:** Expected finding (if applicable)
54
+ - **Scope:** Files/areas to examine
55
+ - **Tier:** LOW | MEDIUM | HIGH
56
+
57
+ ### Stage 2: <stage-name>
58
+ ...
59
+ ```
60
+
61
+ ### Parallel Scientist Invocation
62
+
63
+ Fire independent stages in parallel via Task tool:
64
+
65
+ ```
66
+ // Stage 1 - Simple data gathering
67
+ Task(subagent_type="oh-my-claudecode:scientist-low", model="haiku", prompt="[RESEARCH_STAGE:1] Investigate...")
68
+
69
+ // Stage 2 - Standard analysis
70
+ Task(subagent_type="oh-my-claudecode:scientist", model="sonnet", prompt="[RESEARCH_STAGE:2] Analyze...")
71
+
72
+ // Stage 3 - Complex reasoning
73
+ Task(subagent_type="oh-my-claudecode:scientist-high", model="opus", prompt="[RESEARCH_STAGE:3] Deep analysis of...")
74
+ ```
75
+
76
+ ### Smart Model Routing
77
+
78
+ **CRITICAL: Always pass `model` parameter explicitly!**
79
+
80
+ | Task Complexity | Agent | Model | Use For |
81
+ |-----------------|-------|-------|---------|
82
+ | Data gathering | `scientist-low` | haiku | File enumeration, pattern counting, simple lookups |
83
+ | Standard analysis | `scientist` | sonnet | Code analysis, pattern detection, documentation review |
84
+ | Complex reasoning | `scientist-high` | opus | Architecture analysis, cross-cutting concerns, hypothesis validation |
85
+
86
+ ### Routing Decision Guide
87
+
88
+ | Research Task | Tier | Example Prompt |
89
+ |---------------|------|----------------|
90
+ | "Count occurrences of X" | LOW | "Count all usages of useState hook" |
91
+ | "Find all files matching Y" | LOW | "List all test files in the project" |
92
+ | "Analyze pattern Z" | MEDIUM | "Analyze error handling patterns in API routes" |
93
+ | "Document how W works" | MEDIUM | "Document the authentication flow" |
94
+ | "Explain why X happens" | HIGH | "Explain why race conditions occur in the cache layer" |
95
+ | "Compare approaches A vs B" | HIGH | "Compare Redux vs Context for state management here" |
96
+
97
+ ### Verification Loop
98
+
99
+ After parallel execution completes, verify findings:
100
+
101
+ ```
102
+ // Cross-validation stage
103
+ Task(subagent_type="oh-my-claudecode:scientist", model="sonnet", prompt="
104
+ [RESEARCH_VERIFICATION]
105
+ Cross-validate these findings for consistency:
106
+
107
+ Stage 1 findings: <summary>
108
+ Stage 2 findings: <summary>
109
+ Stage 3 findings: <summary>
110
+
111
+ Check for:
112
+ 1. Contradictions between stages
113
+ 2. Missing connections
114
+ 3. Gaps in coverage
115
+ 4. Evidence quality
116
+
117
+ Output: [VERIFIED] or [CONFLICTS:<list>]
118
+ ")
119
+ ```
120
+
121
+ ## AUTO Mode
122
+
123
+ AUTO mode runs the complete research workflow autonomously with loop control.
124
+
125
+ ### Loop Control Protocol
126
+
127
+ ```
128
+ [RESEARCH + AUTO - ITERATION {{ITERATION}}/{{MAX}}]
129
+
130
+ Your previous attempt did not output the completion promise. Continue working.
131
+
132
+ Current state: {{STATE}}
133
+ Completed stages: {{COMPLETED_STAGES}}
134
+ Pending stages: {{PENDING_STAGES}}
135
+ ```
136
+
137
+ ### Promise Tags
138
+
139
+ | Tag | Meaning | When to Use |
140
+ |-----|---------|-------------|
141
+ | `[PROMISE:RESEARCH_COMPLETE]` | Research finished successfully | All stages done, verified, report generated |
142
+ | `[PROMISE:RESEARCH_BLOCKED]` | Cannot proceed | Missing data, access issues, circular dependency |
143
+
144
+ ### AUTO Mode Rules
145
+
146
+ 1. **Max Iterations:** 10 (configurable)
147
+ 2. **Continue until:** Promise tag emitted OR max iterations
148
+ 3. **State tracking:** Persist after each stage completion
149
+ 4. **Cancellation:** `/cancel-research` or "stop", "cancel"
150
+
151
+ ### AUTO Mode Example
152
+
153
+ ```
154
+ /research AUTO: Comprehensive security analysis of the authentication system
155
+
156
+ [Decomposition]
157
+ - Stage 1 (LOW): Enumerate auth-related files
158
+ - Stage 2 (MEDIUM): Analyze token handling
159
+ - Stage 3 (MEDIUM): Review session management
160
+ - Stage 4 (HIGH): Identify vulnerability patterns
161
+ - Stage 5 (MEDIUM): Document security controls
162
+
163
+ [Execution - Parallel]
164
+ Firing stages 1-3 in parallel...
165
+ Firing stages 4-5 after dependencies complete...
166
+
167
+ [Verification]
168
+ Cross-validating findings...
169
+
170
+ [Synthesis]
171
+ Generating report...
172
+
173
+ [PROMISE:RESEARCH_COMPLETE]
174
+ ```
175
+
176
+ ## Parallel Execution Patterns
177
+
178
+ ### Independent Dataset Analysis (Parallel)
179
+
180
+ When stages analyze different data sources:
181
+
182
+ ```
183
+ // All fire simultaneously
184
+ Task(subagent_type="oh-my-claudecode:scientist-low", model="haiku", prompt="[STAGE:1] Analyze src/api/...")
185
+ Task(subagent_type="oh-my-claudecode:scientist-low", model="haiku", prompt="[STAGE:2] Analyze src/utils/...")
186
+ Task(subagent_type="oh-my-claudecode:scientist-low", model="haiku", prompt="[STAGE:3] Analyze src/components/...")
187
+ ```
188
+
189
+ ### Hypothesis Battery (Parallel)
190
+
191
+ When testing multiple hypotheses:
192
+
193
+ ```
194
+ // Test hypotheses simultaneously
195
+ Task(subagent_type="oh-my-claudecode:scientist", model="sonnet", prompt="[HYPOTHESIS:A] Test if caching improves...")
196
+ Task(subagent_type="oh-my-claudecode:scientist", model="sonnet", prompt="[HYPOTHESIS:B] Test if batching reduces...")
197
+ Task(subagent_type="oh-my-claudecode:scientist", model="sonnet", prompt="[HYPOTHESIS:C] Test if lazy loading helps...")
198
+ ```
199
+
200
+ ### Cross-Validation (Sequential)
201
+
202
+ When verification depends on all findings:
203
+
204
+ ```
205
+ // Wait for all parallel stages
206
+ [stages complete]
207
+
208
+ // Then sequential verification
209
+ Task(subagent_type="oh-my-claudecode:scientist-high", model="opus", prompt="
210
+ [CROSS_VALIDATION]
211
+ Validate consistency across all findings:
212
+ - Finding 1: ...
213
+ - Finding 2: ...
214
+ - Finding 3: ...
215
+ ")
216
+ ```
217
+
218
+ ### Concurrency Limit
219
+
220
+ **Maximum 5 concurrent scientist agents** to prevent resource exhaustion.
221
+
222
+ If more than 5 stages, batch them:
223
+ ```
224
+ Batch 1: Stages 1-5 (parallel)
225
+ [wait for completion]
226
+ Batch 2: Stages 6-7 (parallel)
227
+ ```
228
+
229
+ ## Session Management
230
+
231
+ ### Directory Structure
232
+
233
+ ```
234
+ .omc/research/{session-id}/
235
+ state.json # Session state and progress
236
+ stages/
237
+ stage-1.md # Stage 1 findings
238
+ stage-2.md # Stage 2 findings
239
+ ...
240
+ findings/
241
+ raw/ # Raw findings from scientists
242
+ verified/ # Post-verification findings
243
+ figures/
244
+ figure-1.png # Generated visualizations
245
+ ...
246
+ report.md # Final synthesized report
247
+ ```
248
+
249
+ ### State File Format
250
+
251
+ ```json
252
+ {
253
+ "id": "research-20240115-abc123",
254
+ "goal": "Original research goal",
255
+ "status": "in_progress | complete | blocked | cancelled",
256
+ "mode": "standard | auto",
257
+ "iteration": 3,
258
+ "maxIterations": 10,
259
+ "stages": [
260
+ {
261
+ "id": 1,
262
+ "name": "Stage name",
263
+ "tier": "LOW | MEDIUM | HIGH",
264
+ "status": "pending | running | complete | failed",
265
+ "startedAt": "ISO timestamp",
266
+ "completedAt": "ISO timestamp",
267
+ "findingsFile": "stages/stage-1.md"
268
+ }
269
+ ],
270
+ "verification": {
271
+ "status": "pending | passed | failed",
272
+ "conflicts": [],
273
+ "completedAt": "ISO timestamp"
274
+ },
275
+ "createdAt": "ISO timestamp",
276
+ "updatedAt": "ISO timestamp"
277
+ }
278
+ ```
279
+
280
+ ### Session Commands
281
+
282
+ | Command | Action |
283
+ |---------|--------|
284
+ | `/research status` | Show current session progress |
285
+ | `/research resume` | Resume most recent interrupted session |
286
+ | `/research resume <session-id>` | Resume specific session |
287
+ | `/research list` | List all sessions with status |
288
+ | `/research report <session-id>` | Generate/regenerate report |
289
+ | `/research cancel` | Cancel current session (preserves state) |
290
+
291
+ ## Tag Extraction
292
+
293
+ Scientists use structured tags for findings. Extract them with these patterns:
294
+
295
+ ### Finding Tags
296
+
297
+ ```
298
+ [FINDING:<id>] <title>
299
+ <evidence and analysis>
300
+ [/FINDING]
301
+
302
+ [EVIDENCE:<finding-id>]
303
+ - File: <path>
304
+ - Lines: <range>
305
+ - Content: <relevant code/text>
306
+ [/EVIDENCE]
307
+
308
+ [CONFIDENCE:<level>] # HIGH | MEDIUM | LOW
309
+ <reasoning for confidence level>
310
+ ```
311
+
312
+ ### Extraction Regex Patterns
313
+
314
+ ```javascript
315
+ // Finding extraction
316
+ const findingPattern = /\[FINDING:(\w+)\]\s*(.*?)\n([\s\S]*?)\[\/FINDING\]/g;
317
+
318
+ // Evidence extraction
319
+ const evidencePattern = /\[EVIDENCE:(\w+)\]([\s\S]*?)\[\/EVIDENCE\]/g;
320
+
321
+ // Confidence extraction
322
+ const confidencePattern = /\[CONFIDENCE:(HIGH|MEDIUM|LOW)\]\s*(.*)/g;
323
+
324
+ // Stage completion
325
+ const stageCompletePattern = /\[STAGE_COMPLETE:(\d+)\]/;
326
+
327
+ // Verification result
328
+ const verificationPattern = /\[(VERIFIED|CONFLICTS):?(.*?)\]/;
329
+ ```
330
+
331
+ ### Evidence Window
332
+
333
+ When extracting evidence, include context window:
334
+
335
+ ```
336
+ [EVIDENCE:F1]
337
+ - File: /src/auth/login.ts
338
+ - Lines: 45-52 (context: 40-57)
339
+ - Content:
340
+ ```typescript
341
+ // Lines 45-52 with 5 lines context above/below
342
+ ```
343
+ [/EVIDENCE]
344
+ ```
345
+
346
+ ### Quality Validation
347
+
348
+ Findings must meet quality threshold:
349
+
350
+ | Quality Check | Requirement |
351
+ |---------------|-------------|
352
+ | Evidence present | At least 1 [EVIDENCE] per [FINDING] |
353
+ | Confidence stated | Each finding has [CONFIDENCE] |
354
+ | Source cited | File paths are absolute and valid |
355
+ | Reproducible | Another agent could verify |
356
+
357
+ ## Report Generation
358
+
359
+ ### Report Template
360
+
361
+ ```markdown
362
+ # Research Report: {{GOAL}}
363
+
364
+ **Session ID:** {{SESSION_ID}}
365
+ **Date:** {{DATE}}
366
+ **Status:** {{STATUS}}
367
+
368
+ ## Executive Summary
369
+
370
+ {{2-3 paragraph summary of key findings}}
371
+
372
+ ## Methodology
373
+
374
+ ### Research Stages
375
+
376
+ | Stage | Focus | Tier | Status |
377
+ |-------|-------|------|--------|
378
+ {{STAGES_TABLE}}
379
+
380
+ ### Approach
381
+
382
+ {{Description of decomposition rationale and execution strategy}}
383
+
384
+ ## Key Findings
385
+
386
+ ### Finding 1: {{TITLE}}
387
+
388
+ **Confidence:** {{HIGH|MEDIUM|LOW}}
389
+
390
+ {{Detailed finding with evidence}}
391
+
392
+ #### Evidence
393
+
394
+ {{Embedded evidence blocks}}
395
+
396
+ ### Finding 2: {{TITLE}}
397
+ ...
398
+
399
+ ## Visualizations
400
+
401
+ {{FIGURES}}
402
+
403
+ ## Cross-Validation Results
404
+
405
+ {{Verification summary, any conflicts resolved}}
406
+
407
+ ## Limitations
408
+
409
+ - {{Limitation 1}}
410
+ - {{Limitation 2}}
411
+ - {{Areas not covered and why}}
412
+
413
+ ## Recommendations
414
+
415
+ 1. {{Actionable recommendation}}
416
+ 2. {{Actionable recommendation}}
417
+
418
+ ## Appendix
419
+
420
+ ### Raw Data
421
+
422
+ {{Links to raw findings files}}
423
+
424
+ ### Session State
425
+
426
+ {{Link to state.json}}
427
+ ```
428
+
429
+ ### Figure Embedding Protocol
430
+
431
+ Scientists generate visualizations using this marker:
432
+
433
+ ```
434
+ [FIGURE:path/to/figure.png]
435
+ Caption: Description of what the figure shows
436
+ Alt: Accessibility description
437
+ [/FIGURE]
438
+ ```
439
+
440
+ Report generator embeds figures:
441
+
442
+ ```markdown
443
+ ## Visualizations
444
+
445
+ ![Figure 1: Description](figures/figure-1.png)
446
+ *Caption: Description of what the figure shows*
447
+
448
+ ![Figure 2: Description](figures/figure-2.png)
449
+ *Caption: Description of what the figure shows*
450
+ ```
451
+
452
+ ### Figure Types
453
+
454
+ | Type | Use For | Generated By |
455
+ |------|---------|--------------|
456
+ | Architecture diagram | System structure | scientist-high |
457
+ | Flow chart | Process flows | scientist |
458
+ | Dependency graph | Module relationships | scientist |
459
+ | Timeline | Sequence of events | scientist |
460
+ | Comparison table | A vs B analysis | scientist |
461
+
462
+ ## Configuration
463
+
464
+ Optional settings in `.claude/settings.json`:
465
+
466
+ ```json
467
+ {
468
+ "omc": {
469
+ "research": {
470
+ "maxIterations": 10,
471
+ "maxConcurrentScientists": 5,
472
+ "defaultTier": "MEDIUM",
473
+ "autoVerify": true,
474
+ "generateFigures": true,
475
+ "evidenceContextLines": 5
476
+ }
477
+ }
478
+ }
479
+ ```
480
+
481
+ ## Cancellation
482
+
483
+ ```
484
+ /cancel-research
485
+ ```
486
+
487
+ Or say: "stop research", "cancel research", "abort"
488
+
489
+ Progress is preserved in `.omc/research/{session-id}/` for resume.
490
+
491
+ ## Troubleshooting
492
+
493
+ **Stuck in verification loop?**
494
+ - Check for conflicting findings between stages
495
+ - Review state.json for specific conflicts
496
+ - May need to re-run specific stages with different approach
497
+
498
+ **Scientists returning low-quality findings?**
499
+ - Check tier assignment - complex analysis needs HIGH tier
500
+ - Ensure prompts include clear scope and expected output format
501
+ - Review if research goal is too broad
502
+
503
+ **AUTO mode exhausted iterations?**
504
+ - Review state to see where it's stuck
505
+ - Check if goal is achievable with available data
506
+ - Consider breaking into smaller research sessions
507
+
508
+ **Missing figures in report?**
509
+ - Verify figures/ directory exists
510
+ - Check [FIGURE:] tags in findings
511
+ - Ensure paths are relative to session directory