Wiki Q&A
Answer repository questions grounded entirely in source code evidence.
When to Activate
- User asks a question about the codebase
- User wants to understand a specific file, function, or component
- User asks "how does X work" or "where is Y defined"
Source Repository Resolution (MUST DO FIRST)
Before answering any question, you MUST determine the source repository context:
- Check for git remote: Run
git remote get-url origin to detect if a remote exists
- Ask the user: "Is this a local-only repository, or do you have a source repository URL (e.g., GitHub, Azure DevOps)?"
- Remote URL provided → store as
REPO_URL, use linked citations: [file:line](REPO_URL/blob/BRANCH/file#Lline)
- Local-only → use local citations:
(file_path:line_number)
- Determine default branch: Run
git rev-parse --abbrev-ref HEAD
- Do NOT proceed until source repo context is resolved
Procedure
- Resolve source repo context (see above)
- Detect the language of the question; respond in the same language
- Search the codebase for relevant files
- Read those files to gather evidence
- Synthesize an answer with inline linked citations
Response Format
- Use
## headings, code blocks with language tags, tables, bullet lists
- Cite sources inline using resolved format:
- Remote:
[src/path/file.ts:42](REPO_URL/blob/BRANCH/src/path/file.ts#L42)
- Local:
(src/path/file.ts:42)
- Include a "Key Files" table mapping files to their roles (with linked citations in the "File" column)
- Include at least 1 Mermaid diagram when the answer involves architecture, data flow, or relationships — a diagram makes the answer 10x more useful
- Use tables for any structured data in the answer (component lists, API endpoints, config options, comparisons)
- If information is insufficient, say so and suggest files to examine
Rules
- ONLY use information from actual source files
- NEVER invent, guess, or use external knowledge
- Think step by step before answering
When to Use
Answers questions about a code repository using source file analysis. Use when the user asks a question about how something works, wants to understand a component, or needs help navigating the codebase.
Covers: When to Activate, Source Repository Resolution (MUST DO FIRST), Procedure, Response Format.
1---2name: wiki-qa3description: Answers questions about a code repository using source file analysis. Use when the user asks a question about how something works, wants to understand a component, or needs help navigating the codebase.4license: MIT5---6# Wiki Q&A78Answer repository questions grounded entirely in source code evidence.910## When to Activate1112- User asks a question about the codebase13- User wants to understand a specific file, function, or component14- User asks "how does X work" or "where is Y defined"1516## Source Repository Resolution (MUST DO FIRST)1718Before answering any question, you MUST determine the source repository context:19201. **Check for git remote**: Run `git remote get-url origin` to detect if a remote exists212. **Ask the user**: _"Is this a local-only repository, or do you have a source repository URL (e.g., GitHub, Azure DevOps)?"_22 - Remote URL provided → store as `REPO_URL`, use **linked citations**: `[file:line](REPO_URL/blob/BRANCH/file#Lline)`23 - Local-only → use **local citations**: `(file_path:line_number)`243. **Determine default branch**: Run `git rev-parse --abbrev-ref HEAD`254. **Do NOT proceed** until source repo context is resolved2627## Procedure28291. Resolve source repo context (see above)302. Detect the language of the question; respond in the same language313. Search the codebase for relevant files324. Read those files to gather evidence335. Synthesize an answer with inline linked citations3435## Response Format3637- Use `##` headings, code blocks with language tags, tables, bullet lists38- Cite sources inline using resolved format:39 - **Remote**: `[src/path/file.ts:42](REPO_URL/blob/BRANCH/src/path/file.ts#L42)`40 - **Local**: `(src/path/file.ts:42)`41- Include a "Key Files" table mapping files to their roles (with linked citations in the "File" column)42- **Include at least 1 Mermaid diagram** when the answer involves architecture, data flow, or relationships — a diagram makes the answer 10x more useful43- **Use tables** for any structured data in the answer (component lists, API endpoints, config options, comparisons)44- If information is insufficient, say so and suggest files to examine4546## Rules4748- ONLY use information from actual source files49- NEVER invent, guess, or use external knowledge50- Think step by step before answering5152## When to Use5354Answers questions about a code repository using source file analysis. Use when the user asks a question about how something works, wants to understand a component, or needs help navigating the codebase.5556Covers: When to Activate, Source Repository Resolution (MUST DO FIRST), Procedure, Response Format.