Search Router
Scheduling
Goal
Route an information request to the appropriate channel and return relevant sources with trust labels.
Intent signature
- Search, find, look up, reference docs, inspect official APIs, or search remote code.
- Another skill requests docs, web, code, or local search with a query and constraints.
When to use
- Library documentation, web research, GitHub/GitLab implementation patterns, or unclear search channels.
When NOT to use
- Pure local code exploration -> use configured code intelligence under the shared contract.
- Git history/blame ->
oma-scm; architecture analysis -> oma-architecture.
Expected inputs
Query, optional route hint (docs, web, code, local), source/recency constraints, and flags. Explicit --docs, --code, or --web selects the route; --strict filters trust, --wide retains labeled results, and --gitlab selects the remote code host.
Expected outputs
Ranked sources with URL or file reference, route, relevance, trust level/score, and material fallback limits. Do not invent sources when no reliable result is found.
Dependencies
Context7 for docs, runtime web search, oma search/gh/glab for remote code, and configured code intelligence or native local search.
Structural Flow
Routes
| Route |
Primary |
Fallback |
Use for |
docs |
Context7 resolve-library-id → query-docs |
Web search |
Official API/framework documentation |
web |
Runtime web search |
oma search fetch <url> for known result URLs |
Web sources |
code |
oma search code |
Report unavailable host/auth |
Remote repository patterns |
local |
Configured code-intelligence provider |
Native search and scoped reads |
Current project files and symbols |
Failure and recovery
- Missing/empty documentation lookup: use web search and state the fallback.
- A known URL cannot be fetched: use the fetch strategies in the route reference; retain authentication/blocking errors if all strategies fail.
- Configured local tools unavailable or timed out: follow
../_shared/core/code-intelligence.md.
- Unknown trust: retain the result as
unknown with score —; do not imply verification.
- No result satisfies
--strict: report that outcome and offer a wider or narrower query.
Exit
Return evidence-backed results and disclose failed routes or source limitations. A domain score alone does not verify an individual claim.
Logical Operations
Canonical workflow path
- Parse the query and explicit flags. Use
resources/intent-rules.md only when classification is needed; select one route unless ambiguity requires more.
- Dispatch using Routes. Load
resources/execution-protocol.md for the selected channel's command flags, fetch strategies, or normalization details.
- Collect source references and deduplicate by URL. For non-local results, resolve domain trust using
resources/trust-registry.md; reuse the current session cache. Apply --strict after scoring.
- Rank by relevance, using trust as a tiebreaker. Return the requested answer or source list with supporting references and fallback limitations.
CLI entry points
oma search code "<query>" [--host gitlab] [--language <lang>] [--repo <owner/repo>]
oma search trust <domain>
oma search fetch <url>
The CLI also exposes api, api:search, meta, rss, rss:google, media, archive, and doctor; use a primitive only when the selected route needs it.
Guardrails
- Explicit route/source constraints take precedence over automatic classification.
- Score at domain level, not URL-path or page level. Use the CLI registry and the documented Context7/official-site exceptions; do not invent scores.
- Do not duplicate successful routes or search locally via the web.
- Use available runtime web tools and the configured local provider; do not install or track a repository automatically.
Resource scope and effects
Search may contact external services or inspect local code and spawn gh/glab processes. Query constraints, selected sources, and trust metadata are session context; persistent caches belong in generated state, not skill definitions.
References
- Intent classifier:
resources/intent-rules.md (no explicit route or ambiguous query)
- Route execution detail:
resources/execution-protocol.md (selected channel only)
- Trust resolution and cache rules:
resources/trust-registry.md (non-local sources)
- Recovery detail:
resources/error-playbook.md (route failures)
- Result checklist:
resources/checklist.md (applicable route checks)
- Examples:
resources/examples.md (unfamiliar input/output contracts)
- Local code-intelligence contract:
../_shared/core/code-intelligence.md
1---2name: oma-search-23description: Intent-based search router with trust scoring. Routes queries to optimal channels (Context7 docs, native web search, gh/glab code search, configured local code intelligence) and attaches domain trust labels. Use for search, find, lookup, reference, docs, code search, and web research.4---56# Search Router78## Scheduling910### Goal11Route an information request to the appropriate channel and return relevant sources with trust labels.1213### Intent signature14- Search, find, look up, reference docs, inspect official APIs, or search remote code.15- Another skill requests docs, web, code, or local search with a query and constraints.1617### When to use18- Library documentation, web research, GitHub/GitLab implementation patterns, or unclear search channels.1920### When NOT to use21- Pure local code exploration -> use configured code intelligence under the shared contract.22- Git history/blame -> `oma-scm`; architecture analysis -> `oma-architecture`.2324### Expected inputs25Query, optional route hint (`docs`, `web`, `code`, `local`), source/recency constraints, and flags. Explicit `--docs`, `--code`, or `--web` selects the route; `--strict` filters trust, `--wide` retains labeled results, and `--gitlab` selects the remote code host.2627### Expected outputs28Ranked sources with URL or file reference, route, relevance, trust level/score, and material fallback limits. Do not invent sources when no reliable result is found.2930### Dependencies31Context7 for docs, runtime web search, `oma search`/`gh`/`glab` for remote code, and configured code intelligence or native local search.3233## Structural Flow3435### Routes36| Route | Primary | Fallback | Use for |37|---|---|---|---|38| `docs` | Context7 `resolve-library-id` → `query-docs` | Web search | Official API/framework documentation |39| `web` | Runtime web search | `oma search fetch <url>` for known result URLs | Web sources |40| `code` | `oma search code` | Report unavailable host/auth | Remote repository patterns |41| `local` | Configured code-intelligence provider | Native search and scoped reads | Current project files and symbols |4243### Failure and recovery44- Missing/empty documentation lookup: use web search and state the fallback.45- A known URL cannot be fetched: use the fetch strategies in the route reference; retain authentication/blocking errors if all strategies fail.46- Configured local tools unavailable or timed out: follow `../_shared/core/code-intelligence.md`.47- Unknown trust: retain the result as `unknown` with score `—`; do not imply verification.48- No result satisfies `--strict`: report that outcome and offer a wider or narrower query.4950### Exit51Return evidence-backed results and disclose failed routes or source limitations. A domain score alone does not verify an individual claim.5253## Logical Operations5455### Canonical workflow path561. Parse the query and explicit flags. Use `resources/intent-rules.md` only when classification is needed; select one route unless ambiguity requires more.572. Dispatch using Routes. Load `resources/execution-protocol.md` for the selected channel's command flags, fetch strategies, or normalization details.583. Collect source references and deduplicate by URL. For non-local results, resolve domain trust using `resources/trust-registry.md`; reuse the current session cache. Apply `--strict` after scoring.594. Rank by relevance, using trust as a tiebreaker. Return the requested answer or source list with supporting references and fallback limitations.6061### CLI entry points62```bash63oma search code "<query>" [--host gitlab] [--language <lang>] [--repo <owner/repo>]64oma search trust <domain>65oma search fetch <url>66```67The CLI also exposes `api`, `api:search`, `meta`, `rss`, `rss:google`, `media`, `archive`, and `doctor`; use a primitive only when the selected route needs it.6869### Guardrails70- Explicit route/source constraints take precedence over automatic classification.71- Score at domain level, not URL-path or page level. Use the CLI registry and the documented Context7/official-site exceptions; do not invent scores.72- Do not duplicate successful routes or search locally via the web.73- Use available runtime web tools and the configured local provider; do not install or track a repository automatically.7475### Resource scope and effects76Search may contact external services or inspect local code and spawn `gh`/`glab` processes. Query constraints, selected sources, and trust metadata are session context; persistent caches belong in generated state, not skill definitions.7778## References79- Intent classifier: `resources/intent-rules.md` (no explicit route or ambiguous query)80- Route execution detail: `resources/execution-protocol.md` (selected channel only)81- Trust resolution and cache rules: `resources/trust-registry.md` (non-local sources)82- Recovery detail: `resources/error-playbook.md` (route failures)83- Result checklist: `resources/checklist.md` (applicable route checks)84- Examples: `resources/examples.md` (unfamiliar input/output contracts)85- Local code-intelligence contract: `../_shared/core/code-intelligence.md`