Ask Knowledge Base Wiki
This skill formalizes the "Question -> Answer -> Save" loop. It instructs the AI to treat the wiki/ directory (as defined by AGENTS.md) as its sole truth and automatically save generated insights so they compound over time.
Instructions
When the user asks a question, requests a briefing, or asks you to find gaps in the knowledge base using this skill:
Resolve Paths (always do this first): First, check if a
wiki-config.mdexists in the current workspace root (this indicates a project-local wiki). If not found, readwiki-config.mdfrom the same directory as this skill (e.g.,~/.cursor/skills/wiki-config.md) for the global wiki. The file contains four absolute paths labelled Wiki root, Wiki folder, Raw folder, and Output folder. Use these paths everywhere below instead of the relativewiki/,raw/, andoutput/defaults. If neither file exists, fall back to relative paths from the workspace root.Explore the Knowledge Base (Graph Traversal):
- Start Token-Efficiently: First, scan
wiki/index.mdto identify the entry-point nodes (topics) directly relevant to the user's query. - Traverse the Knowledge Graph: Read the entry-point
.mdfiles inwiki/(which may live in thematic subfolders likewiki/Building Energy/) and follow their internal[[wiki-links]]to navigate to related concepts. Obsidian resolves links regardless of subfolder, so search for the target filename across all subfolders. Follow links instead of blindly searching the entirewiki/directory, staying within the cluster relevant to the query (e.g., a query about "Token Optimization" should not touch "HVAC Control" pages). Apply these traversal rules:- Summary-first reading: For pages over ~100 lines, read only the extended summary (opening paragraphs before the first
##section) and decide whether the full page is relevant before reading the rest. For shorter pages (≤100 lines), read the full page — the token savings from a partial read are negligible and the extra tool call to fetch the remainder is wasteful. - Prioritize by relevance: When a page has multiple outgoing
[[wiki-links]], follow the link whose topic name is most semantically related to the query first. Skip links that clearly diverge from the query's scope. - Track visited pages: Keep a mental set of pages already read. Never re-read a page you have already visited, even if you encounter a link back to it.
- Dead-end handling: If the current page's outgoing links all point to already-visited pages or clearly irrelevant topics, do not force further traversal from this path. Return to the index and try the next most relevant entry-point topic that has not yet been visited. This prevents wasting reads on tangential content.
- Depth limit: Stop traversing after visiting ~8–10 pages (or sooner if new pages add diminishing context). The wiki is the summary layer — exhaustive reading defeats its purpose.
- Summary-first reading: For pages over ~100 lines, read only the extended summary (opening paragraphs before the first
- Optional Deep-Dive into Raw Sources: After the wiki traversal is complete, assess whether the wiki content alone is sufficient to answer the query. If — and only if — the wiki pages lack detail, contain "[citation needed]"-style gaps, or the user explicitly asks for primary-source grounding, review the Sources sections of visited pages and select up to 5
raw/files most relevant to the query. To locate raw files, glob-search theraw/folder by keywords from the source title (raw filenames match paper/article titles with special characters replaced). This two-phase approach (cheap wiki scan first, targeted raw reads only when needed) keeps token usage efficient while still allowing primary-source grounding when it matters.
- Start Token-Efficiently: First, scan
Generate the Insight / Answer: Synthesize an answer using the facts contained within the
wiki/folder and, if necessary, their original sources inraw/. Do not hallucinate external knowledge. If the answer cannot be found in your sources, clearly state that the knowledge base lacks information on the topic.Include References: At the end of every generated answer or briefing, you MUST include a "References" section. This section should list and link to all the original source documents (from the
raw/folder or cited in the wiki) that were used to compile the answer.Save to Outputs: Save the full generated response (including the References section) as a new
.mdfile inside theoutput/directory (e.g.,output/Briefing - Agentic AI Workflows.md).Re-integrate (Compound) the Knowledge: If the generated answer uncovers a new connection, a synthesized insight, or a newly discovered gap, update the relevant pages back in the
wiki/directory.- For example, if the user asks you to compare Source A and Source B on a specific topic, and you find a novel insight, add a "Synthesized Insights" section to that topic's
.mdpage inwiki/. - This ensures that every question asked makes the knowledge base permanently smarter for future queries.
- For example, if the user asks you to compare Source A and Source B on a specific topic, and you find a novel insight, add a "Synthesized Insights" section to that topic's
Log the Query: Append a row to
wiki/log.mdrecording the timestamp, the query asked, and which wiki pages were updated during re-integration (if any). This keeps the log as the single audit trail for all wiki modifications.
Example Queries
- "What are the three biggest gaps in my understanding of Agentic AI?"
- "Compare what the wiki says about RAG vs LLM Wikis. Where do they disagree?"
- "Write me a 500-word briefing on HVAC control using only what's in this knowledge base."