[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F2B9CQCEJMRTNDEBAAARM6":3,"skill-same:01M7F2B9CQCEJMRTNDEBAAARM6":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":6,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M7F2B9CQCEJMRTNDEBAAARM6","omh-deep-research",null,"parallel web research; subagents→synthesis→cite-verify","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fomh-deep-research\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: omh-deep-research\ndescription: parallel web research; subagents→synthesis→cite-verify\nversion: 1.0.0\nmetadata:\n  hermes:\n    tags: [research, web, synthesis, parallel, omh]\n    category: omh\n    requires_toolsets: [terminal, omh, web]\n---\n\n# OMH Deep Research — Multi-Phase Web Research with Citation Verification\n\n## When to Use\n\n- The user asks for \"deep research on\", \"a research report about\",\n  \"comprehensive research\", \"investigate X\", \"what's known about Y\"\n- omh-deep-interview encounters an unfamiliar domain and needs background\n- omh-ralplan needs external context before it can plan responsibly\n- The user's question requires synthesizing 3+ web sources into one\n  coherent answer, not a single search\n\n## When NOT to Use\n\n- A confirmed report already exists at `.omh\u002Fresearch\u002F{slug}-report.md`\n  with `status: confirmed` for this topic — view it instead\n- The question is answerable by a single web_search call\n- The user wants real-time \u002F current-events data only (this skill\n  emphasizes durable synthesis, not freshness)\n- No `web` toolset is available in this Hermes install (see Prerequisites)\n\n## Prerequisites\n\nThis skill fail-fasts if any of the following are missing:\n\n- **`web` toolset** — provides `web_search` AND `web_extract`. If either\n  is unavailable, print:\n  ```\n  omh-deep-research requires the `web` toolset (web_search + web_extract); aborting.\n  ```\n  and exit before doing any work.\n- **`omh_state` tool** — preferred path. If absent, fall back to manual\n  JSON read\u002Fwrite at `.omh\u002Fstate\u002Fresearch--{slug}.json` (per-instance —\n  `{slug}` is the kebab+date+random4 minted in Phase 1; multiple research\n  topics can run concurrently). If neither is writable, fail-fast with a\n  clear error.\n- **Write access** to `.omh\u002F` for state, plan, findings, report, log.\n\nHermes discovery: `hermes skills list | grep omh-deep-research` should\nreturn this skill once installed.\n\n### Installation (symlink for Hermes discovery)\n\n```\nmkdir -p ~\u002F.hermes\u002Fskills\u002Fomh && ln -snf \u003Crepo>\u002Fplugins\u002Fomh\u002Fskills\u002Fomh-deep-research ~\u002F.hermes\u002Fskills\u002Fomh\u002Fomh-deep-research\n```\n\nParent dir creation MUST precede the symlink.\n\n## Architecture\n\nFive invocation phases, exit-safe between any two:\n\n| # | Phase     | Reads                                  | Writes                                                       | Subagents |\n|---|-----------|----------------------------------------|--------------------------------------------------------------|-----------|\n| 1 | decompose | user query                             | `{slug}-plan.md`, state.phase=search                         | none      |\n| 2 | search    | plan, state, findings\u002F                 | new findings file(s), state.completed_subtopics, phase       | 1-3 `[omh-role:researcher]` parallel |\n| 3 | gap_check | all findings                           | optional `_followup.md` OR direct phase flip                 | 0 or 1 `[omh-role:researcher]` |\n| 4 | synthesize| all findings (parent inlines)          | `{slug}-report.md` `status: draft`, phase=verify             | 1 `[omh-role:research-synthesist]` |\n| 5 | verify    | report + findings (parent inlines)     | confirmed frontmatter \u002F state mutate \u002F blocked               | 1 `[omh-role:research-verifier]` |\n\n**Per-instance state.** Each research session lives at\n`.omh\u002Fstate\u002Fresearch--{slug}.json` (the engine slugifies `instance_id`\ninto the filename). Multiple topics can be in flight concurrently — the\nslug minted in Phase 1 IS the instance_id, and every subsequent\n`omh_state(...)` call passes `instance_id=\"{slug}\"`. Per-session\nartifacts (plan, findings, report) are slug-keyed under\n`.omh\u002Fresearch\u002F`. The earlier `research-{id}.json` and\n`research-state.json` (singleton) wordings from older specs are\nsuperseded.\n\n**Parent owns the filesystem.** All web tool use happens inside delegated\nsubagents. The parent reads findings files and inlines their contents\ninto synthesist's and verifier's `context` field. Subagents return\ntext only.\n\n**Roles are referenced, never inlined.** Use `[omh-role:NAME]` markers.\nThe full role bodies live in `plugins\u002Fomh\u002Freferences\u002Frole-*.md`.\n\n## Procedure\n\n### Phase 0: Check for Existing State and Sentinel\n\nBefore starting any new research session:\n\n1. **Mint a candidate slug** for the new request (see Phase 1 rule).\n   Call this `new_slug`. We need it to disambiguate enumeration below.\n2. **List existing research instances** —\n   `omh_state(action=\"list_instances\", mode=\"research\")`. If the tool is\n   unavailable, glob `.omh\u002Fstate\u002Fresearch--*.json` manually. Each entry\n   carries an `instance_id` (== slug) and `active` flag.\n3. **For each active entry**, run a cancel check first:\n   `omh_state(action=\"cancel_check\", mode=\"research\", instance_id=\"{slug}\")`.\n   If cancelled, log `CANCELLED slug={slug}` and clear that instance via\n   `omh_state(action=\"clear\", mode=\"research\", instance_id=\"{slug}\")`.\n4. **Sentinel self-heal (recovery from crash between confirm and\n   clear).** For each remaining active entry whose\n   `.omh\u002Fresearch\u002F{slug}-report.md` has frontmatter `status: confirmed`,\n   the previous run crashed after writing the sentinel but before\n   clearing state. Treat as completed: log\n   `REPORT_CONFIRMED_RECOVERED slug={slug}`, clear via\n   `omh_state(action=\"clear\", mode=\"research\", instance_id=\"{slug}\")`.\n5. **Topic-match resume** — if any remaining active entry's `topic`\n   matches the new request, jump directly to Phase 2\u002F3\u002F4\u002F5 for THAT\n   slug (use its existing `instance_id`); do not mint `new_slug`.\n6. **Already-confirmed for this topic** — if a `{slug}-report.md`\n   exists with `status: confirmed` matching the new topic, prompt:\n   refresh (mint a new slug and re-run) \u002F view existing report \u002F cancel.\n7. **No conflict** — proceed to Phase 1 with `new_slug`. Concurrent\n   active research on different topics is permitted; do not block.\n\n### Phase 1: Decompose\n\n1. Cancel check: `omh_state(action=\"cancel_check\", mode=\"research\", instance_id=\"{slug}\")`.\n2. **Mint a slug** — concrete rule:\n   `slug = kebab(topic)[:40] + '-' + YYYYMMDD + '-' + random4`\n   where `random4` is 4 lowercase-hex chars.\n   `kebab()` = lowercase, replace runs of non-alphanumeric with `-`,\n   strip leading\u002Ftrailing `-`, truncate to 40 chars.\n3. Decompose the user's topic into 3-5 subtopics. For each subtopic,\n   draft 2-3 candidate search queries.\n4. **Write the plan** atomically (tmp → fsync → rename) to\n   `.omh\u002Fresearch\u002F{slug}-plan.md` with frontmatter:\n   ```\n   ---\n   status: planning\n   topic: {original user topic}\n   slug: {slug}\n   subtopics:\n     - name: {subtopic 1 name}\n       queries: [{q1}, {q2}, {q3}]\n     - ...\n   ---\n   ```\n5. **Initialize state** via `omh_state(action=\"write\", mode=\"research\", instance_id=\"{slug}\", data={...})`:\n   ```\n   {\n     \"phase\": \"search\",\n     \"slug\": \"{slug}\",\n     \"topic\": \"{topic}\",\n     \"subtopic_count\": N,\n     \"completed_subtopics\": [],\n     \"started_at\": \"{ISO-8601}\",\n     \"session_id\": \"{uuid4}\",\n     \"synthesis_attempts\": 0\n   }\n   ```\n6. Log `STARTED slug={slug}` and `PLAN_WRITTEN slug={slug} subtopics=N`.\n7. Exit. Re-invocation will pick up at Phase 2 via the Phase 0 resume path.\n\n### Phase 2: Search (parallel batched, re-entrant)\n\nThis phase is **re-entrant**: it dispatches one batch of up to 3\nresearcher subagents per invocation, then exits. Re-invoke to dispatch\nthe next batch. Re-entry is driven by `state.completed_subtopics`.\n\n1. Cancel check: `omh_state(action=\"cancel_check\", mode=\"research\", instance_id=\"{slug}\")`.\n2. Read state and the `{slug}-plan.md` frontmatter.\n3. Compute `pending = [s for s in plan.subtopics if s.name not in state.completed_subtopics]`.\n4. Take the next `batch = pending[:3]` (up to 3 in parallel).\n5. **Dispatch ONE batch call** with the `[omh-role:researcher]` marker:\n   ```\n   delegate_task(tasks=[\n     {\n       \"goal\": \"\u003Cself-contained: topic, subtopic name, exact queries to run, output template per [omh-role:researcher]>\",\n       \"context\": \"\u003Cplan excerpt for this subtopic; no other subagent's findings>\",\n     },\n     ...up to 3...\n   ])\n   ```\n   Each task's `goal` is fully self-contained — no inter-subagent\n   dependencies. The role marker `[omh-role:researcher]` MUST appear in\n   each goal so the subagent loads the role.\n6. **(Strict write-order — NEVER reverse this order):**\n   1. Write all findings file(s) for this batch atomically\n      (tmp → fsync → rename). Each file lands at\n      `.omh\u002Fresearch\u002F{slug}-findings\u002F{subtopic-slug}.md` with\n      frontmatter capturing `subtopic`, `source_urls`, and credibility\n      tags pulled from the subagent's returned SOURCES block.\n   2. Update `state.completed_subtopics` (extend the list, persist via\n      `omh_state(action=\"write\", mode=\"research\", instance_id=\"{slug}\", data=...)`).\n   3. Exit.\n7. **Phase transition.** On the next invocation, Phase 0 routes back\n   here. If `pending` becomes empty after the write, set\n   `state.phase = \"gap_check\"` BEFORE exiting (still after the\n   findings write — order: findings → completed_subtopics → phase flip).\n8. Log `BATCH_COMPLETE batch=N subtopics=[name1,name2,...]` per batch.\n\n**Pitfalls specific to Phase 2:**\n\n- **Dedup across subtopics.** Two researchers may surface the same URL.\n  The synthesist (Phase 4) handles cross-subtopic dedup via global\n  Sources renumbering; Phase 2 does NOT need to dedup across files.\n- **Slug for findings filename.** Use `kebab(subtopic.name)[:60]`. If\n  two subtopics kebab to the same slug, append `-2`, `-3`, etc.\n- **Parent never calls `web_search` or `web_extract` directly.** All\n  web tool use is inside the delegated `[omh-role:researcher]`\n  subagents. The parent's job is dispatch and disk.\n\n### Phase 3: Gap Check (TWO branches only)\n\nThe parent skill never calls `web_search` or `web_extract` directly;\nall web tool use happens inside delegated subagents.\n\n1. Cancel check: `omh_state(action=\"cancel_check\", mode=\"research\", instance_id=\"{slug}\")`.\n2. Read all `.omh\u002Fresearch\u002F{slug}-findings\u002F*.md` files. From each, extract\n   the `GAPS:` bullet list. Concatenate, then **dedup lexically**\n   (case-insensitive trim-compare; preserve first occurrence).\n3. **TWO branches only:**\n\n   - **(a) 0 gaps** — Set `state.phase = \"synthesize\"`, log\n     `GAP_CHECK_COMPLETE gaps=0`, exit.\n\n   - **(b) ≥1 gap** — Delegate ONE `[omh-role:researcher]` subagent.\n     Goal: synthetic \"subtopic\" named `_followup`, with the deduped gap\n     list as the queries. Parent writes the returned text to\n     `.omh\u002Fresearch\u002F{slug}-findings\u002F_followup.md` (atomic). Set\n     `state.phase = \"synthesize\"`, log `GAP_CHECK_COMPLETE gaps=N`, exit.\n\n   No threshold tiers. No N-versus-M gap branching. No inline\n   web_search branch. Two branches only — that is the contract.\n\n### Phase 4: Synthesize (parent inlines findings; parent writes report)\n\n1. Cancel check: `omh_state(action=\"cancel_check\", mode=\"research\", instance_id=\"{slug}\")`.\n2. **Parent INLINES findings.** Read ALL files under\n   `.omh\u002Fresearch\u002F{slug}-findings\u002F` (including `_followup.md` if\n   present). Concatenate their full contents into the delegation's\n   `context` field. The synthesist subagent has no filesystem access.\n\n   **Budget escape (verified safe).** If the concatenated payload\n   exceeds the orchestrator's tool-arg budget (≈40KB+ across 5+\n   findings files is a soft threshold), the parent MAY summarize\n   each findings file's SYNTHESIS section while preserving:\n     - The full SOURCES `[N]` block verbatim (titles + URLs + tags + dates)\n     - All GAPS sections verbatim\n     - The `_followup` block verbatim (it is usually the smallest and\n       most claim-dense)\n   Do NOT drop or paraphrase any URL, citation tag, or numeric claim.\n   Dogfooded 2026-04: a 5-subtopic + 1-followup run with summarized\n   SYNTHESIS bodies + verbatim source lists passed verification at\n   high confidence with all 28 globally-renumbered citations intact.\n   When in doubt, prefer full inline; summarize only when forced.\n3. Dispatch ONE `[omh-role:research-synthesist]` task:\n   ```\n   delegate_task(\n     goal=\"\u003Cself-contained: produce report per [omh-role:research-synthesist] template; topic={topic}; reference inlined plan + findings>\",\n     context=\"\u003Cplan frontmatter + every findings file content, fully inlined>\",\n   )\n   ```\n4. **Retry context.** If `state.synthesis_attempts > 0`, append the\n   prior verifier's REQUEST_CHANGES feedback (stored in\n   `state.last_verifier_feedback`) to the goal as:\n   ```\n   Address these prior verifier findings:\n   {feedback}\n   ```\n5. **Parent always overwrites** `.omh\u002Fresearch\u002F{slug}-report.md` with\n   the returned text. Frontmatter starts at `status: draft`. NO `-v2`\n   suffixing. Prior verdicts live only in state, not on disk.\n6. **C3 propagation.** Parent does NOT edit the returned report. Any\n   `(insufficient sources for this subtopic)` strings remain verbatim.\n7. Set `state.phase = \"verify\"`, log `REPORT_DRAFT`, exit.\n\n### Phase 5: Verify (parent inlines; 3-strike gate; ordered confirm)\n\n1. Cancel check: `omh_state(action=\"cancel_check\", mode=\"research\", instance_id=\"{slug}\")`.\n2. **Parent INLINES report + findings.** Read `{slug}-report.md` AND\n   all `{slug}-findings\u002F*.md` files. Concatenate BOTH into the\n   verifier delegation's `context` field. Verifier subagent has no\n   filesystem access.\n3. **Tools allowlist (A5).** When dispatching, pass a tools allowlist\n   EXCLUDING write\u002Fedit\u002Ffilesystem tools where Hermes supports\n   per-call tool scoping. If Hermes lacks per-call scoping, document\n   in Known Gaps and rely on the prose READ-ONLY contract in\n   `role-research-verifier.md`.\n4. Dispatch ONE `[omh-role:research-verifier]` task. Parse the\n   returned VERDICT.\n\n5. **On VERDICT: PASS — STRICT ORDER (NEVER reverse):**\n   1. Write `{slug}-report.md` with frontmatter `status: confirmed` (atomic; idempotent sentinel; THIS is the source-of-truth and must land FIRST).\n   2. Append `REPORT_CONFIRMED slug={slug}` to the event log.\n   3. Clear state via `omh_state(action=\"clear\", mode=\"research\", instance_id=\"{slug}\")`.\n   4. Print summary to user; exit.\n\n   Phase 0 self-heals if a crash occurs between step 1 and step 3 (it\n   detects the confirmed sentinel and clears the orphan state).\n\n6. **On VERDICT: FAIL with `state.synthesis_attempts \u003C 3`:**\n   - Increment `state.synthesis_attempts`.\n   - Store the verifier's REQUEST_CHANGES verdict (full body) in\n     `state.last_verifier_feedback`.\n   - Set `state.phase = \"synthesize\"`.\n   - Log `VERIFY_FAIL slug={slug}` and `SYNTHESIS_RETRY attempt={N}`.\n   - Exit. Re-invocation re-runs Phase 4 with feedback context.\n\n7. **On VERDICT: FAIL with `state.synthesis_attempts == 3`:**\n   - Set `state.phase = \"blocked\"`.\n   - Surface the verifier's gap list to the user.\n   - Log `VERIFY_FAIL slug={slug}` and `BLOCKED_RETRIES_EXHAUSTED slug={slug}`.\n   - Exit. State is RETAINED so the user can inspect or escalate\n     (Phase 0 will not auto-restart a blocked session).\n\n## Logging\n\nAppend-only events to `.omh\u002Flogs\u002Fresearch-{session_id}.log`. Events are\ndecisions and phase transitions only — never findings content (matches\nthe omh-deep-interview convention).\n\nDocumented event vocabulary:\n\n- `STARTED slug={slug}`\n- `PLAN_WRITTEN slug={slug} subtopics=N`\n- `BATCH_COMPLETE batch=N subtopics=[...]`\n- `GAP_CHECK_COMPLETE gaps=N`\n- `REPORT_DRAFT`\n- `VERIFY_PASS`\n- `VERIFY_FAIL`\n- `SYNTHESIS_RETRY attempt=N`\n- `BLOCKED_RETRIES_EXHAUSTED slug={slug}`\n- `REPORT_CONFIRMED slug={slug}`\n- `REPORT_CONFIRMED_RECOVERED slug={slug}`\n- `BLOCKED slug={slug}`\n- `CANCELLED`\n\n## Sentinel\n\nDownstream skills (omh-deep-interview, omh-ralplan, omh-autopilot) detect\na completed research session by:\n\n```\n.omh\u002Fresearch\u002F{slug}-report.md  with frontmatter `status: confirmed`\n```\n\nThis file is the durable contract. State is ephemeral; the sentinel is\nthe source of truth.\n\n## Pitfalls\n\n- **Never call `web_search` or `web_extract` from the parent.** All web\n  tool use happens inside delegated `[omh-role:researcher]` subagents.\n- **Never inline role text.** Use `[omh-role:NAME]` markers; bodies live\n  in `plugins\u002Fomh\u002Freferences\u002Frole-*.md`.\n- **Phase boundaries are commit points.** Each phase MUST exit cleanly\n  after writing its outputs and updating state. Long-running phases\n  that span multiple delegations are not exit-safe.\n- **One active research session per project.** Phase 0 enforces this.\n  Don't create parallel research states.\n- **Slug collisions are user-visible.** The `random4` suffix keeps\n  same-topic same-day re-runs from clobbering each other.\n\n## Known Gaps\n\n- **Persistence to wiki \u002F fact_store \u002F memory** is not yet integrated.\n  The sentinel report is the only durable interface in v1. (Q2)\n- **Per-call subagent tool scoping for `[omh-role:research-verifier]`**\n  may be unavailable depending on Hermes install; READ-ONLY contract is\n  enforced by prose in `role-research-verifier.md` in that case. (A5)\n","# OMH Deep Research — Multi-Phase Web Research with Citation Verification\n\n## When to Use\n\n- The user asks for \"deep research on\", \"a research report about\",\n  \"comprehensive research\", \"investigate X\", \"what's known about Y\"\n- omh-deep-interview encounters an unfamiliar domain and needs background\n- omh-ralplan needs external context before it can plan responsibly\n- The user's question requires synthesizing 3+ web sources into one\n  coherent answer, not a single search\n\n## When NOT to Use\n\n- A confirmed report already exists at `.omh\u002Fresearch\u002F{slug}-report.md`\n  with `status: confirmed` for this topic — view it instead\n- The question is answerable by a single web_search call\n- The user wants real-time \u002F current-events data only (this skill\n  emphasizes durable synthesis, not freshness)\n- No `web` toolset is available in this Hermes install (see Prerequisites)\n\n## Prerequisites\n\nThis skill fail-fasts if any of the following are missing:\n\n- **`web` toolset** — provides `web_search` AND `web_extract`. If either\n  is unavailable, print:\n  ```\n  omh-deep-research requires the `web` toolset (web_search + web_extract); aborting.\n  ```\n  and exit before doing any work.\n- **`omh_state` tool** — preferred path. If absent, fall back to manual\n  JSON read\u002Fwrite at `.omh\u002Fstate\u002Fresearch--{slug}.json` (per-instance —\n  `{slug}` is the kebab+date+random4 minted in Phase 1; multiple research\n  topics can run concurrently). If neither is writable, fail-fast with a\n  clear error.\n- **Write access** to `.omh\u002F` for state, plan, findings, report, log.\n\nHermes discovery: `hermes skills list | grep omh-deep-research` should\nreturn this skill once installed.\n\n### Installation (symlink for Hermes discovery)\n\n```\nmkdir -p ~\u002F.hermes\u002Fskills\u002Fomh && ln -snf \u003Crepo>\u002Fplugins\u002Fomh\u002Fskills\u002Fomh-deep-research ~\u002F.hermes\u002Fskills\u002Fomh\u002Fomh-deep-research\n```\n\nParent dir creation MUST precede the symlink.\n\n## Architecture\n\nFive invocation phases, exit-safe between any two:\n\n| # | Phase     | Reads                                  | Writes                                                       | Subagents |\n|---|-----------|----------------------------------------|--------------------------------------------------------------|-----------|\n| 1 | decompose | user query                             | `{slug}-plan.md`, state.phase=search                         | none      |\n| 2 | search    | plan, state, findings\u002F                 | new findings file(s), state.completed_subtopics, phase       | 1-3 `[omh-role:researcher]` parallel |\n| 3 | gap_check | all findings                           | optional `_followup.md` OR direct phase flip                 | 0 or 1 `[omh-role:researcher]` |\n| 4 | synthesize| all findings (parent inlines)          | `{slug}-report.md` `status: draft`, phase=verify             | 1 `[omh-role:research-synthesist]` |\n| 5 | verify    | report + findings (parent inlines)     | confirmed frontmatter \u002F state mutate \u002F blocked               | 1 `[omh-role:research-verifier]` |\n\n**Per-instance state.** Each research session lives at\n`.omh\u002Fstate\u002Fresearch--{slug}.json` (the engine slugifies `instance_id`\ninto the filename). Multiple topics can be in flight concurrently — the\nslug minted in Phase 1 IS the instance_id, and every subsequent\n`omh_state(...)` call passes `instance_id=\"{slug}\"`. Per-session\nartifacts (plan, findings, report) are slug-keyed under\n`.omh\u002Fresearch\u002F`. The earlier `research-{id}.json` and\n`research-state.json` (singleton) wordings from older specs are\nsuperseded.\n\n**Parent owns the filesystem.** All web tool use happens inside delegated\nsubagents. The parent reads findings files and inlines their contents\ninto synthesist's and verifier's `context` field. Subagents return\ntext only.\n\n**Roles are referenced, never inlined.** Use `[omh-role:NAME]` markers.\nThe full role bodies live in `plugins\u002Fomh\u002Freferences\u002Frole-*.md`.\n\n## Procedure\n\n### Phase 0: Check for Existing State and Sentinel\n\nBefore starting any new research session:\n\n1. **Mint a candidate slug** for the new request (see Phase 1 rule).\n   Call this `new_slug`. We need it to disambiguate enumeration below.\n2. **List existing research instances** —\n   `omh_state(action=\"list_instances\", mode=\"research\")`. If the tool is\n   unavailable, glob `.omh\u002Fstate\u002Fresearch--*.json` manually. Each entry\n   carries an `instance_id` (== slug) and `active` flag.\n3. **For each active entry**, run a cancel check first:\n   `omh_state(action=\"cancel_check\", mode=\"research\", instance_id=\"{slug}\")`.\n   If cancelled, log `CANCELLED slug={slug}` and clear that instance via\n   `omh_state(action=\"clear\", mode=\"research\", instance_id=\"{slug}\")`.\n4. **Sentinel self-heal (recovery from crash between confirm and\n   clear).** For each remaining active entry whose\n   `.omh\u002Fresearch\u002F{slug}-report.md` has frontmatter `status: confirmed`,\n   the previous run crashed after writing the sentinel but before\n   clearing state. Treat as completed: log\n   `REPORT_CONFIRMED_RECOVERED slug={slug}`, clear via\n   `omh_state(action=\"clear\", mode=\"research\", instance_id=\"{slug}\")`.\n5. **Topic-match resume** — if any remaining active entry's `topic`\n   matches the new request, jump directly to Phase 2\u002F3\u002F4\u002F5 for THAT\n   slug (use its existing `instance_id`); do not mint `new_slug`.\n6. **Already-confirmed for this topic** — if a `{slug}-report.md`\n   exists with `status: confirmed` matching the new topic, prompt:\n   refresh (mint a new slug and re-run) \u002F view existing report \u002F cancel.\n7. **No conflict** — proceed to Phase 1 with `new_slug`. Concurrent\n   active research on different topics is permitted; do not block.\n\n### Phase 1: Decompose\n\n1. Cancel check: `omh_state(action=\"cancel_check\", mode=\"research\", instance_id=\"{slug}\")`.\n2. **Mint a slug** — concrete rule:\n   `slug = kebab(topic)[:40] + '-' + YYYYMMDD + '-' + random4`\n   where `random4` is 4 lowercase-hex chars.\n   `kebab()` = lowercase, replace runs of non-alphanumeric with `-`,\n   strip leading\u002Ftrailing `-`, truncate to 40 chars.\n3. Decompose the user's topic into 3-5 subtopics. For each subtopic,\n   draft 2-3 candidate search queries.\n4. **Write the plan** atomically (tmp → fsync → rename) to\n   `.omh\u002Fresearch\u002F{slug}-plan.md` with frontmatter:\n   ```\n   ---\n   status: planning\n   topic: {original user topic}\n   slug: {slug}\n   subtopics:\n     - name: {subtopic 1 name}\n       queries: [{q1}, {q2}, {q3}]\n     - ...\n   ---\n   ```\n5. **Initialize state** via `omh_state(action=\"write\", mode=\"research\", instance_id=\"{slug}\", data={...})`:\n   ```\n   {\n     \"phase\": \"search\",\n     \"slug\": \"{slug}\",\n     \"topic\": \"{topic}\",\n     \"subtopic_count\": N,\n     \"completed_subtopics\": [],\n     \"started_at\": \"{ISO-8601}\",\n     \"session_id\": \"{uuid4}\",\n     \"synthesis_attempts\": 0\n   }\n   ```\n6. Log `STARTED slug={slug}` and `PLAN_WRITTEN slug={slug} subtopics=N`.\n7. Exit. Re-invocation will pick up at Phase 2 via the Phase 0 resume path.\n\n### Phase 2: Search (parallel batched, re-entrant)\n\nThis phase is **re-entrant**: it dispatches one batch of up to 3\nresearcher subagents per invocation, then exits. Re-invoke to dispatch\nthe next batch. Re-entry is driven by `state.completed_subtopics`.\n\n1. Cancel check: `omh_state(action=\"cancel_check\", mode=\"research\", instance_id=\"{slug}\")`.\n2. Read state and the `{slug}-plan.md` frontmatter.\n3. Compute `pending = [s for s in plan.subtopics if s.name not in state.completed_subtopics]`.\n4. Take the next `batch = pending[:3]` (up to 3 in parallel).\n5. **Dispatch ONE batch call** with the `[omh-role:researcher]` marker:\n   ```\n   delegate_task(tasks=[\n     {\n       \"goal\": \"\u003Cself-contained: topic, subtopic name, exact queries to run, output template per [omh-role:researcher]>\",\n       \"context\": \"\u003Cplan excerpt for this subtopic; no other subagent's findings>\",\n     },\n     ...up to 3...\n   ])\n   ```\n   Each task's `goal` is fully self-contained — no inter-subagent\n   dependencies. The role marker `[omh-role:researcher]` MUST appear in\n   each goal so the subagent loads the role.\n6. **(Strict write-order — NEVER reverse this order):**\n   1. Write all findings file(s) for this batch atomically\n      (tmp → fsync → rename). Each file lands at\n      `.omh\u002Fresearch\u002F{slug}-findings\u002F{subtopic-slug}.md` with\n      frontmatter capturing `subtopic`, `source_urls`, and credibility\n      tags pulled from the subagent's returned SOURCES block.\n   2. Update `state.completed_subtopics` (extend the list, persist via\n      `omh_state(action=\"write\", mode=\"research\", instance_id=\"{slug}\", data=...)`).\n   3. Exit.\n7. **Phase transition.** On the next invocation, Phase 0 routes back\n   here. If `pending` becomes empty after the write, set\n   `state.phase = \"gap_check\"` BEFORE exiting (still after the\n   findings write — order: findings → completed_subtopics → phase flip).\n8. Log `BATCH_COMPLETE batch=N subtopics=[name1,name2,...]` per batch.\n\n**Pitfalls specific to Phase 2:**\n\n- **Dedup across subtopics.** Two researchers may surface the same URL.\n  The synthesist (Phase 4) handles cross-subtopic dedup via global\n  Sources renumbering; Phase 2 does NOT need to dedup across files.\n- **Slug for findings filename.** Use `kebab(subtopic.name)[:60]`. If\n  two subtopics kebab to the same slug, append `-2`, `-3`, etc.\n- **Parent never calls `web_search` or `web_extract` directly.** All\n  web tool use is inside the delegated `[omh-role:researcher]`\n  subagents. The parent's job is dispatch and disk.\n\n### Phase 3: Gap Check (TWO branches only)\n\nThe parent skill never calls `web_search` or `web_extract` directly;\nall web tool use happens inside delegated subagents.\n\n1. Cancel check: `omh_state(action=\"cancel_check\", mode=\"research\", instance_id=\"{slug}\")`.\n2. Read all `.omh\u002Fresearch\u002F{slug}-findings\u002F*.md` files. From each, extract\n   the `GAPS:` bullet list. Concatenate, then **dedup lexically**\n   (case-insensitive trim-compare; preserve first occurrence).\n3. **TWO branches only:**\n\n   - **(a) 0 gaps** — Set `state.phase = \"synthesize\"`, log\n     `GAP_CHECK_COMPLETE gaps=0`, exit.\n\n   - **(b) ≥1 gap** — Delegate ONE `[omh-role:researcher]` subagent.\n     Goal: synthetic \"subtopic\" named `_followup`, with the deduped gap\n     list as the queries. Parent writes the returned text to\n     `.omh\u002Fresearch\u002F{slug}-findings\u002F_followup.md` (atomic). Set\n     `state.phase = \"synthesize\"`, log `GAP_CHECK_COMPLETE gaps=N`, exit.\n\n   No threshold tiers. No N-versus-M gap branching. No inline\n   web_search branch. Two branches only — that is the contract.\n\n### Phase 4: Synthesize (parent inlines findings; parent writes report)\n\n1. Cancel check: `omh_state(action=\"cancel_check\", mode=\"research\", instance_id=\"{slug}\")`.\n2. **Parent INLINES findings.** Read ALL files under\n   `.omh\u002Fresearch\u002F{slug}-findings\u002F` (including `_followup.md` if\n   present). Concatenate their full contents into the delegation's\n   `context` field. The synthesist subagent has no filesystem access.\n\n   **Budget escape (verified safe).** If the concatenated payload\n   exceeds the orchestrator's tool-arg budget (≈40KB+ across 5+\n   findings files is a soft threshold), the parent MAY summarize\n   each findings file's SYNTHESIS section while preserving:\n     - The full SOURCES `[N]` block verbatim (titles + URLs + tags + dates)\n     - All GAPS sections verbatim\n     - The `_followup` block verbatim (it is usually the smallest and\n       most claim-dense)\n   Do NOT drop or paraphrase any URL, citation tag, or numeric claim.\n   Dogfooded 2026-04: a 5-subtopic + 1-followup run with summarized\n   SYNTHESIS bodies + verbatim source lists passed verification at\n   high confidence with all 28 globally-renumbered citations intact.\n   When in doubt, prefer full inline; summarize only when forced.\n3. Dispatch ONE `[omh-role:research-synthesist]` task:\n   ```\n   delegate_task(\n     goal=\"\u003Cself-contained: produce report per [omh-role:research-synthesist] template; topic={topic}; reference inlined plan + findings>\",\n     context=\"\u003Cplan frontmatter + every findings file content, fully inlined>\",\n   )\n   ```\n4. **Retry context.** If `state.synthesis_attempts > 0`, append the\n   prior verifier's REQUEST_CHANGES feedback (stored in\n   `state.last_verifier_feedback`) to the goal as:\n   ```\n   Address these prior verifier findings:\n   {feedback}\n   ```\n5. **Parent always overwrites** `.omh\u002Fresearch\u002F{slug}-report.md` with\n   the returned text. Frontmatter starts at `status: draft`. NO `-v2`\n   suffixing. Prior verdicts live only in state, not on disk.\n6. **C3 propagation.** Parent does NOT edit the returned report. Any\n   `(insufficient sources for this subtopic)` strings remain verbatim.\n7. Set `state.phase = \"verify\"`, log `REPORT_DRAFT`, exit.\n\n### Phase 5: Verify (parent inlines; 3-strike gate; ordered confirm)\n\n1. Cancel check: `omh_state(action=\"cancel_check\", mode=\"research\", instance_id=\"{slug}\")`.\n2. **Parent INLINES report + findings.** Read `{slug}-report.md` AND\n   all `{slug}-findings\u002F*.md` files. Concatenate BOTH into the\n   verifier delegation's `context` field. Verifier subagent has no\n   filesystem access.\n3. **Tools allowlist (A5).** When dispatching, pass a tools allowlist\n   EXCLUDING write\u002Fedit\u002Ffilesystem tools where Hermes supports\n   per-call tool scoping. If Hermes lacks per-call scoping, document\n   in Known Gaps and rely on the prose READ-ONLY contract in\n   `role-research-verifier.md`.\n4. Dispatch ONE `[omh-role:research-verifier]` task. Parse the\n   returned VERDICT.\n\n5. **On VERDICT: PASS — STRICT ORDER (NEVER reverse):**\n   1. Write `{slug}-report.md` with frontmatter `status: confirmed` (atomic; idempotent sentinel; THIS is the source-of-truth and must land FIRST).\n   2. Append `REPORT_CONFIRMED slug={slug}` to the event log.\n   3. Clear state via `omh_state(action=\"clear\", mode=\"research\", instance_id=\"{slug}\")`.\n   4. Print summary to user; exit.\n\n   Phase 0 self-heals if a crash occurs between step 1 and step 3 (it\n   detects the confirmed sentinel and clears the orphan state).\n\n6. **On VERDICT: FAIL with `state.synthesis_attempts \u003C 3`:**\n   - Increment `state.synthesis_attempts`.\n   - Store the verifier's REQUEST_CHANGES verdict (full body) in\n     `state.last_verifier_feedback`.\n   - Set `state.phase = \"synthesize\"`.\n   - Log `VERIFY_FAIL slug={slug}` and `SYNTHESIS_RETRY attempt={N}`.\n   - Exit. Re-invocation re-runs Phase 4 with feedback context.\n\n7. **On VERDICT: FAIL with `state.synthesis_attempts == 3`:**\n   - Set `state.phase = \"blocked\"`.\n   - Surface the verifier's gap list to the user.\n   - Log `VERIFY_FAIL slug={slug}` and `BLOCKED_RETRIES_EXHAUSTED slug={slug}`.\n   - Exit. State is RETAINED so the user can inspect or escalate\n     (Phase 0 will not auto-restart a blocked session).\n\n## Logging\n\nAppend-only events to `.omh\u002Flogs\u002Fresearch-{session_id}.log`. Events are\ndecisions and phase transitions only — never findings content (matches\nthe omh-deep-interview convention).\n\nDocumented event vocabulary:\n\n- `STARTED slug={slug}`\n- `PLAN_WRITTEN slug={slug} subtopics=N`\n- `BATCH_COMPLETE batch=N subtopics=[...]`\n- `GAP_CHECK_COMPLETE gaps=N`\n- `REPORT_DRAFT`\n- `VERIFY_PASS`\n- `VERIFY_FAIL`\n- `SYNTHESIS_RETRY attempt=N`\n- `BLOCKED_RETRIES_EXHAUSTED slug={slug}`\n- `REPORT_CONFIRMED slug={slug}`\n- `REPORT_CONFIRMED_RECOVERED slug={slug}`\n- `BLOCKED slug={slug}`\n- `CANCELLED`\n\n## Sentinel\n\nDownstream skills (omh-deep-interview, omh-ralplan, omh-autopilot) detect\na completed research session by:\n\n```\n.omh\u002Fresearch\u002F{slug}-report.md  with frontmatter `status: confirmed`\n```\n\nThis file is the durable contract. State is ephemeral; the sentinel is\nthe source of truth.\n\n## Pitfalls\n\n- **Never call `web_search` or `web_extract` from the parent.** All web\n  tool use happens inside delegated `[omh-role:researcher]` subagents.\n- **Never inline role text.** Use `[omh-role:NAME]` markers; bodies live\n  in `plugins\u002Fomh\u002Freferences\u002Frole-*.md`.\n- **Phase boundaries are commit points.** Each phase MUST exit cleanly\n  after writing its outputs and updating state. Long-running phases\n  that span multiple delegations are not exit-safe.\n- **One active research session per project.** Phase 0 enforces this.\n  Don't create parallel research states.\n- **Slug collisions are user-visible.** The `random4` suffix keeps\n  same-topic same-day re-runs from clobbering each other.\n\n## Known Gaps\n\n- **Persistence to wiki \u002F fact_store \u002F memory** is not yet integrated.\n  The sentinel report is the only durable interface in v1. (Q2)\n- **Per-call subagent tool scoping for `[omh-role:research-verifier]`**\n  may be unavailable depending on Hermes install; READ-ONLY contract is\n  enforced by prose in `role-research-verifier.md` in that case. (A5)\n",{"name":5,"version":24,"metadata":25,"description":7},"1.0.0",{"hermes":26},{"tags":27,"category":32,"requires_toolsets":33},[28,29,30,31,32],"research","web","synthesis","parallel","omh",[34,32,29],"terminal","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","05-技能与代理开发\u002Fomh-deep-research",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill omh-deep-research",{"tool":49,"command":50},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill omh-deep-research",{"tool":52,"command":53},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill omh-deep-research","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Fomh-deep-research\u002FSKILL.md",true,[],[58,65,70,77,84,91],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":66,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]