Answers questions by querying a local knowledge base with 3-layer search, semantic synthesis, and source citations.
Install
mkdir -p .claude/skills/query-ltdrew && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11768" && unzip -o skill.zip -d .claude/skills/query-ltdrew && rm skill.zipInstalls to .claude/skills/query-ltdrew
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Answer questions using the brain's knowledge with 3-layer search, synthesis, and citation propagation. Use when the user asks a question, wants a lookup, or needs information from the brain.Key capabilities
- →Answer questions grounded in brain content
- →Provide citations for every claim
- →Flag information gaps explicitly
- →Respect source precedence (user statements > compiled truth)
- →Note conflicting sources with both citations
- →Traverse the link graph for relationship questions
How it works
This skill answers questions by decomposing them into search strategies, executing searches against the brain's knowledge, reading top results, and synthesizing an answer with citations. It prioritizes user statements and flags gaps.
Inputs & outputs
When to use query
- →Finding project information
- →Answering questions from documentation
- →Connecting conceptual ideas from notes
About this skill
Query Skill
Answer questions using the brain's knowledge with 3-layer search and synthesis.
Contract
This skill guarantees:
- Every answer is grounded in brain content (no hallucination)
- Every claim has a citation tracing back to a specific page slug
- Gaps are flagged explicitly ("the brain doesn't have information on X")
- Source precedence is respected (user statements > compiled truth > timeline > external)
- Conflicting sources are noted with both citations
Phases
- Decompose the question into search strategies:
- Keyword search for specific names, dates, terms
- Semantic query for conceptual questions
- Structured queries (list by type, backlinks) for relational questions
- Execute searches:
- Keyword search gbrain for FTS matches (search)
- Hybrid search gbrain for semantic+keyword with expansion (query)
- List pages in gbrain by type or check backlinks for structural queries
- Read top results. Read the top 3-5 pages from gbrain to get full context.
- Synthesize answer with citations. Every claim traces back to a specific page slug.
- Flag gaps. If the brain doesn't have info, say "the brain doesn't have information on X" rather than hallucinating.
Anti-Patterns
- Answering from general knowledge when the brain has relevant content
- Hallucinating facts not in the brain
- Silently picking one source when sources conflict
- Loading full pages when search chunks are sufficient
- Ignoring source precedence (user statements are highest authority)
Output Format
Answers should include:
- Direct response to the question
- Citations: "According to [Source: people/jane-doe, compiled truth]..."
- Gap flags: "The brain doesn't have information on X"
- Conflict notes when sources disagree
Quality Rules
- Never hallucinate. Only answer from brain content.
- Cite sources: "According to concepts/do-things-that-dont-scale..."
- Flag stale results: if a search result shows [STALE], note that the info may be outdated
- For "who" questions, use backlinks and typed links to find connections
- For "what happened" questions, use timeline entries
- For "what do we know" questions, read compiled_truth directly
Token-Budget Awareness
Search returns chunks, not full pages. Read the excerpts first before deciding whether to load a full page.
gbrain search/gbrain queryreturn ranked chunks with context snippets. These are often enough to answer the question directly.- Only use
gbrain get <slug>to load the full page when a chunk confirms the page is relevant and you need more context (e.g., compiled truth, timeline). - "Tell me about X" -- get the full page (the user wants the complete picture).
- "Did anyone mention Y?" -- search results are enough (the user wants a yes/no with evidence).
Source precedence
When multiple sources provide conflicting information, follow this precedence:
- User's direct statements (highest authority -- what the user told you directly)
- Compiled truth (the brain's synthesized, cited understanding)
- Timeline entries (raw evidence, reverse-chronological)
- External sources (web search, API enrichment -- lowest authority)
When sources conflict, note the contradiction with both citations. Don't silently pick one.
Citation in Answers
When referencing brain pages in your answer, propagate inline citations:
- Cite the page: "According to [Source: people/jane-doe, compiled truth]..."
- When brain pages have inline
[Source: ...]citations, propagate them so the user can trace facts to their origin - When you synthesize across multiple pages, cite all sources
Graph Traversal (v0.10.1+)
For relationship questions ("who knows who at X?", "connections between A and B", "who works at Acme?", "who attended the standup?"), use the graph layer instead of full-text search:
gbrain graph-query <slug> --type <link_type> --depth N --direction in|out|both- Available link types:
attended,works_at,invested_in,founded,advises,mentions,source --direction inanswers "who points to X?" (e.g., who works at company X)--direction outanswers "what does X point to?" (default)--depth Ncontrols multi-hop traversal (default 5)
Examples:
- "Who works at Acme?" →
gbrain graph-query companies/acme --type works_at --direction in - "Who attended Demo Day W26?" →
gbrain graph-query meetings/demo-day-w26 --type attended --direction out - "What companies has Emily advised?" →
gbrain graph-query people/emily --type advises --direction out - "Who has Alice met (via meetings)?" →
gbrain graph-query people/alice --type attended --depth 2
Combine with gbrain query for queries that need BOTH semantic similarity AND
graph structure. Search results are ranked with a small backlink boost so well-
connected entities surface higher.
Search Quality Awareness
If search results seem off (wrong results, missing known pages, irrelevant hits):
- Run
gbrain doctor --jsonto check index health - Check embedding coverage -- partial embeddings degrade hybrid search
- Compare keyword search (
gbrain search) vs hybrid search (gbrain query) for the same query to isolate whether the issue is embedding-related - Report search quality issues in the maintain workflow (see maintain skill)
Tools Used
- Keyword search gbrain (search)
- Hybrid search gbrain (query)
- Read a page from gbrain (get_page)
- List pages in gbrain with filters (list_pages)
- Check backlinks in gbrain (get_backlinks)
- Traverse the link graph in gbrain (traverse_graph)
- View timeline entries in gbrain (get_timeline)
When not to use it
- →The user wants answers from general knowledge not in the brain
- →The user expects hallucinated facts
- →The user wants to ignore source precedence
Limitations
- →Only answers from brain content (no hallucination)
- →Every claim requires a citation
- →Gaps are flagged explicitly
How it compares
This skill provides strictly grounded and cited answers from a knowledge base, explicitly flagging gaps and conflicts, which differs from general knowledge retrieval that might not cite sources or acknowledge limitations.
Compared to similar skills
query side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| query (this skill) | 0 | — | No flags | Intermediate |
| nlm-skill | 8 | 27d | Review | Intermediate |
| extract-transcript | 0 | 5mo | Review | Beginner |
| claim-extraction | 0 | 2mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
nlm-skill
jacob-bd
Expert guide for the NotebookLM CLI (`nlm`) and MCP server - interfaces for Google NotebookLM. Use this skill when users want to interact with NotebookLM programmatically, including: creating/managing notebooks, adding sources (URLs, YouTube, text, Google Drive), generating content (podcasts, reports, quizzes, flashcards, mind maps, slides, infographics, videos, data tables), conducting research, chatting with sources, or automating NotebookLM workflows. Triggers on mentions of "nlm", "notebooklm", "notebook lm", "podcast generation", "audio overview", or any NotebookLM-related automation task.
extract-transcript
pamelafox
>-
claim-extraction
grammy-jiang
Extract atomic, typed, source-anchored claims from ingested sources into analysis/claims.jsonl (claims-v1). Two-stage: LLM check-worthiness detection, then JSON decomposition + classification. Tier 1+.
literature-review
K-Dense-AI
Conduct comprehensive, systematic literature reviews using multiple academic databases (PubMed, arXiv, bioRxiv, Semantic Scholar, etc.). This skill should be used when conducting systematic literature reviews, meta-analyses, research synthesis, or comprehensive literature searches across biomedical, scientific, and technical domains. Creates professionally formatted markdown documents and PDFs with verified citations in multiple citation styles (APA, Nature, Vancouver, etc.).
youtube-wisdom
sammcj
Extract wisdom, insights, and actionable takeaways from YouTube videos. Use when asked to analyse, summarise, or extract key learnings from YouTube content. Downloads transcripts only (no video files), performs comprehensive analysis including key insights, notable quotes, structured summaries, and actionable takeaways, then saves the analysis to a markdown file.
summarize
openclaw
Summarize or extract text/transcripts from URLs, podcasts, and local files (great fallback for “transcribe this YouTube/video”).