Operates under
retriever:routing. If the user's intent actually fits a different tier — anotherretriever:*skill, a Tier 2 slash, a Tier 3tools.pysubcommand, or (last resort) direct DB access — stop and re-route against the ladder before continuing.
Retriever Search
Use this skill when the user says things like:
- "find documents mentioning Smith"
- "show only PDFs from 2023"
- "search for Latin emails"
- "filter to NDA contracts"
- "show me conversations in gmail-max"
- "/search clear"
- "/search --within indemnification"
- "/search --fts ABC000123"
Exact /search fast paths
For exact slash forms that begin with /search:
- Do not read ../search-strategy/search-strategy.md.
- Do not read schema docs.
- Run exactly one Bash command from the workspace root that passes the slash command through unchanged. Common examples:
/search:python3 skills/tool-template/tools.py slash . /search/search clear:python3 skills/tool-template/tools.py slash . '/search clear'/search --within indemnification:python3 skills/tool-template/tools.py slash . '/search --within indemnification'/search --fts ABC000123:python3 skills/tool-template/tools.py slash . '/search --fts ABC000123'- If canonical tool auto-discovery fails, retry once with
RETRIEVER_CANONICAL_TOOL_PATHpointed at ../tool-template/tools.py. - Return stdout exactly as the entire response. No preamble. No commentary. No reformatting.
Load order
- Read ../search-strategy/search-strategy.md.
- Read ../schema/schema.md if field names or operators are unclear.
- Use ../tool-template/tools.py as the canonical command source.
View vs compose
- Use
--mode viewwhenever the user primarily wants to see a document listing, not just when they literally say "table". Treat verbs like "show", "show me", "list", "display", "view", "browse", "find", "which documents", "what files", "show 10", and "show only" as view requests unless the user explicitly asks for a summary, explanation, or a different layout. - Use
--mode viewfor the slash browse surface (/search,/bates,/filter,/dataset,/from-run,/scope,/sort,/page,/next,/previous,/page-size,/columns, and the internal browse-mode toggles/documentsand/conversations, plus read-onlylistforms such as/scope list,/dataset list,/sort list, and/columns list). - For document-listing requests inside an active investigation, prefer the slash/session browse surface over a fresh stateless search so the current
/page-size,/columns,/sort, and related browse state apply automatically. - If the user asks to show, list, browse, or display conversations, threads, email threads, chat threads, channels, DMs, or similar grouped discussion units, treat that as a conversation-browse request and switch the slash/session browse surface to
/conversationsbefore rendering results. If the user instead asks for individual documents, emails, messages, files, attachments, or per-item details, switch or stay in/documentsmode before rendering results. /documentsand/conversationsare agent-facing mode toggles. Use them on the user's behalf when intent is clear; do not ask or require the user to type those commands explicitly.- The standard
/searchrendered table is the default output contract for every document-listing request unless the user explicitly asks for a different presentation. - In
viewmode, the tool returns arendered_markdownfield containing the complete pre-formatted result table. - When
rendered_markdownis present for a view request, your entire reply MUST be the exact contents of that field and nothing else: no preamble, no trailing commentary, no code fences, no reformatting, and no extra summary sentence. Treat any text before or after the markdown footer as a bug. - The reply must terminate immediately after the table footer, even if the results seem self-explanatory or worth summarizing.
- Use
--mode composeonly when the user wants a summary, count, explanation, drafting, comparison, or other prose answer that is about the documents rather than a document listing itself.
Execution rules
- Prefer SQL-like
--filter "EXPR"filters over tuple-style field/operator/value fragments. - The filter grammar targets Retriever's logical document fields, including schema-defined virtual fields such as
production_name,is_attachment, andhas_attachments. - Use the canonical stateless
searchCLI flags:--filter,--sort,--order,--page,--per-page,--columns, and--mode. - For requests like "show 10 ...", map the requested count to
--page 1 --per-page 10; do not invent--limit. - For sorted browse requests, use
--sort FIELDand--order asc|desc; do not invent--sort-byor--sort-order. - Use canonical built-in field names such as
date_created, not ad hoc variants likecreated_date. - Validate field names against built-in document columns, registered custom fields, and supported virtual filter fields.
- Use browse mode when the user is mostly filtering, and keyword search when they provide terms.
- For a single Bates/control token or a Bates range expression, prefer the Bates-aware search path over plain keyword FTS.
- For persistent investigation flows, prefer the slash surface:
/search,/bates,/filter,/dataset,/from-run,/scope,/sort,/page,/next,/previous,/page-size,/columns, plus the internal mode toggles/documentsand/conversationswhen the request changes between per-document and per-conversation browsing. - If a dataset, scope, or similar browse selector is unknown or only loosely specified (for example
gmail-maxinstead of the full dataset name), resolve it through Retriever's own browse surface first, such as/dataset listplus the closest matching dataset, rather than bypassing Retriever with raw SQL. - Bare slash commands are read-only state inspection when supported:
/scopeshows the active scope,/datasetthe active dataset selector,/sortthe active sort,/pagethe current page state,/page-sizethe active page size, and/columnsthe active display columns. - Use
listsubcommands for discoverability:/scope listlists saved scopes,/dataset listlists available datasets,/sort listlists sortable fields, and/columns listlists displayable fields. - Start with Retriever's default compact output; add
--verboseonly when you need attachment rows, alternate preview targets, or extended metadata not present in compact mode. - For ordinary browse/list/show requests, do not inspect SQLite tables or write ad hoc SQL if Retriever already has a browse/search command for the task. Raw database inspection is for debugging schema/data issues, not for user-facing result rendering.
- For conversation-listing requests, prefer this sequence when practical: apply dataset/scope/filter commands first, then run
/conversations, and return the rendered conversation table exactly as produced. - For document- or message-listing requests that arrive while conversation mode is active, switch back to
/documentsbefore rendering so the result shape, columns, and title links match the user's request. - Honor the active
/page-sizefor document listings unless the user explicitly asks for a different count, asks for all results, or changes/page-size. - Never manually concatenate multiple result pages or enumerate more rows than the active page size in one reply unless the user explicitly asks for more than the current page.
- In compose mode, default to a concise answer: one short paragraph for straightforward summaries, or two short paragraphs when a timeline/contrast genuinely helps. Do not turn ordinary summaries into long narrative memos unless the user asked for depth.
- In compose mode, ground the main claims in the top matching documents. Prefer naming or citing the most relevant
control_numberitems instead of synthesizing a broad story from distant/low-signal hits. - Do not volunteer collection-noise commentary, unrelated matches, or corpus-quality caveats unless the user asked for noise analysis, asked what matched unexpectedly, or the noise materially changes the answer.
- Always show the active scope/header before the result table so the user can see the selector, sort, and page state.
- Standard listing output format — unless the user specifically asks otherwise, whenever your answer shows documents, whether from
--mode viewor embedded in a compose-mode answer, use the exact standard/searchtable schema driven by the active display columns from search-strategy.md. Prefer the tool-returnedrendered_markdownwhenever it is present instead of hand-building a list:
```
Scope: ...
Sort: ...
Page: ...
```
```
| content_type | title | author | date_created | control_number |
```
Example rows:
```
| Email | Re: Q4 Budget | John Smith | 2024-03-15 09:22 | DOC001.00000042 |
| Chat | #general - Dec 16, 2022 | Sergey, Udit | 2022-12-17 00:03 | DOC003.00000003 |
```
Followed by: Documents 1–10 of 85. Ask for the next page to see more.
- Title is the link — whenever
titleis in the active column set, render that cell as a clickable[text](computer://...)link. NEVER add a separate Link/View/Preview column. - Default columns are
content_type,title,author,date_created, andcontrol_numberwhen no display preference overrides them. - Never add a
#row-number column — it is not part of the standard format. - Honor explicit
/columnsor--columnschoices; do not silently substitute a different field unless the user asks for a friendlier presentation. - Prefer
preview_abs_path; fall back toabs_pathfor native-preview files. - Show attachment children as indented
↳rows beneath the parent result when they are present in the response. - Apply the same clickable-title rule to attachment rows and any document rows shown in tables.
- Always include the scope/sort/page header and mention active filters.