$npx -y skills add witt3rd/oh-my-hermes --skill omh-deep-researchparallel web research; subagents→synthesis→cite-verify
| 1 | # OMH Deep Research — Multi-Phase Web Research with Citation Verification |
| 2 | |
| 3 | ## When to Use |
| 4 | |
| 5 | - The user asks for "deep research on", "a research report about", |
| 6 | "comprehensive research", "investigate X", "what's known about Y" |
| 7 | - omh-deep-interview encounters an unfamiliar domain and needs background |
| 8 | - omh-ralplan needs external context before it can plan responsibly |
| 9 | - The user's question requires synthesizing 3+ web sources into one |
| 10 | coherent answer, not a single search |
| 11 | |
| 12 | ## When NOT to Use |
| 13 | |
| 14 | - A confirmed report already exists at `.omh/research/{slug}-report.md` |
| 15 | with `status: confirmed` for this topic — view it instead |
| 16 | - The question is answerable by a single web_search call |
| 17 | - The user wants real-time / current-events data only (this skill |
| 18 | emphasizes durable synthesis, not freshness) |
| 19 | - No `web` toolset is available in this Hermes install (see Prerequisites) |
| 20 | |
| 21 | ## Prerequisites |
| 22 | |
| 23 | This skill fail-fasts if any of the following are missing: |
| 24 | |
| 25 | - **`web` toolset** — provides `web_search` AND `web_extract`. If either |
| 26 | is unavailable, print: |
| 27 | ``` |
| 28 | omh-deep-research requires the `web` toolset (web_search + web_extract); aborting. |
| 29 | ``` |
| 30 | and exit before doing any work. |
| 31 | - **`omh_state` tool** — preferred path. If absent, fall back to manual |
| 32 | JSON read/write at `.omh/state/research--{slug}.json` (per-instance — |
| 33 | `{slug}` is the kebab+date+random4 minted in Phase 1; multiple research |
| 34 | topics can run concurrently). If neither is writable, fail-fast with a |
| 35 | clear error. |
| 36 | - **Write access** to `.omh/` for state, plan, findings, report, log. |
| 37 | |
| 38 | Hermes discovery: `hermes skills list | grep omh-deep-research` should |
| 39 | return this skill once installed. |
| 40 | |
| 41 | ### Installation (symlink for Hermes discovery) |
| 42 | |
| 43 | ``` |
| 44 | mkdir -p ~/.hermes/skills/omh && ln -snf <repo>/plugins/omh/skills/omh-deep-research ~/.hermes/skills/omh/omh-deep-research |
| 45 | ``` |
| 46 | |
| 47 | Parent dir creation MUST precede the symlink. |
| 48 | |
| 49 | ## Architecture |
| 50 | |
| 51 | Five invocation phases, exit-safe between any two: |
| 52 | |
| 53 | | # | Phase | Reads | Writes | Subagents | |
| 54 | |---|-----------|----------------------------------------|--------------------------------------------------------------|-----------| |
| 55 | | 1 | decompose | user query | `{slug}-plan.md`, state.phase=search | none | |
| 56 | | 2 | search | plan, state, findings/ | new findings file(s), state.completed_subtopics, phase | 1-3 `[omh-role:researcher]` parallel | |
| 57 | | 3 | gap_check | all findings | optional `_followup.md` OR direct phase flip | 0 or 1 `[omh-role:researcher]` | |
| 58 | | 4 | synthesize| all findings (parent inlines) | `{slug}-report.md` `status: draft`, phase=verify | 1 `[omh-role:research-synthesist]` | |
| 59 | | 5 | verify | report + findings (parent inlines) | confirmed frontmatter / state mutate / blocked | 1 `[omh-role:research-verifier]` | |
| 60 | |
| 61 | **Per-instance state.** Each research session lives at |
| 62 | `.omh/state/research--{slug}.json` (the engine slugifies `instance_id` |
| 63 | into the filename). Multiple topics can be in flight concurrently — the |
| 64 | slug minted in Phase 1 IS the instance_id, and every subsequent |
| 65 | `omh_state(...)` call passes `instance_id="{slug}"`. Per-session |
| 66 | artifacts (plan, findings, report) are slug-keyed under |
| 67 | `.omh/research/`. The earlier `research-{id}.json` and |
| 68 | `research-state.json` (singleton) wordings from older specs are |
| 69 | superseded. |
| 70 | |
| 71 | **Parent owns the filesystem.** All web tool use happens inside delegated |
| 72 | subagents. The parent reads findings files and inlines their contents |
| 73 | into synthesist's and verifier's `context` field. Subagents return |
| 74 | text only. |
| 75 | |
| 76 | **Roles are referenced, never inlined.** Use `[omh-role:NAME]` markers. |
| 77 | The full role bodies live in `plugins/omh/references/role-*.md`. |
| 78 | |
| 79 | ## Procedure |
| 80 | |
| 81 | ### Phase 0: Check for Existing State and Sentinel |
| 82 | |
| 83 | Before starting any new research session: |
| 84 | |
| 85 | 1. **Mint a candidate slug** for the new request (see Phase 1 rule). |
| 86 | Call this `new_slug`. We need it to disambiguate enumeration below. |
| 87 | 2. **List existing research instances** — |
| 88 | `omh_state(action="list_instances", mode="research")`. If the tool is |
| 89 | unavailable, glob `.omh/state/research--*.json` manually. Each entry |
| 90 | carries an `instance_id` (== slug) and `active` flag. |
| 91 | 3. **For each active entry**, run a cancel check first: |
| 92 | `omh_state(action="cancel_check", mode="research", instance_id="{slug}")`. |
| 93 | If cancelled, log `CANCELLED slug={slug}` and clear that instance via |
| 94 | `omh_state(action="clear", mode="research", instance_id="{slug}")`. |
| 95 | 4. **Sentinel self-heal (recovery from crash between confirm and |
| 96 | clear).** For each remaining active en |