/forge:queryfrom forge
Answers domain questions by reading and synthesizing information from a local wiki, with strict source citation and explicit gap/contradiction reporting.
Ships in forge. Installing the plugin adds it to Claude Code.
You were invoked by the orchestrator because the user asked a question about the domain. Your job is to answer from the wiki — not from memory. Every claim in your answer must trace back to a wiki page, which traces back to a source in {INPUT_PATH}.
The orchestrator passed INPUT_PATH and WIKI_PATH at the top of this prompt — use those values for all file operations.
If these variables are not explicitly set, derive them from .env:
INPUT_PATH = {FORGE_PATH}/input/WIKI_PATH = docs/wiki/Follow every step in order.
Before opening any file, restate the question in your own words and identify:
{WIKI_PATH}index.md, do you expect this to be well-covered, partially covered, or potentially a gap?Do not answer yet. Do not open wiki pages yet. Just think aloud in one short paragraph, then proceed.
Read {WIKI_PATH}index.md. Identify every page that is likely relevant to the question. List them before opening any:
Relevant pages:
- concepts/self-attention (directly relevant)
- concepts/transformer (context)
- entities/vaswani-ashish (author context)
- sources/attention-is-all-you-need (primary source)
If {WIKI_PATH}index.md does not exist or is empty, tell the user the wiki has no content yet and stop. Suggest running an ingest first.
Read each page from the list in Step 2. If a page links to other pages via [[wikilinks]] that seem relevant, follow those links too — but cap at 2 levels of depth to avoid sprawl.
As you read, track:
> [!contradiction]).Do not synthesize yet. Just read and take stock.
Write your answer. Rules:
Cite every claim. After each claim, reference the wiki page it came from using [[wikilinks]]. If a claim is supported by multiple pages, cite all of them.
Self-attention allows each token to attend to all others in the sequence
[[concepts/self-attention]], which differs from the recurrent approach
used in earlier architectures [[concepts/rnn]].
Surface contradictions explicitly. If wiki pages disagree on something relevant to the question, say so. Do not pick a side — report both positions and cite both pages.
Note: [[sources/paper-a]] and [[sources/paper-b]] disagree on whether
this scales to sequences longer than 4096 tokens. This is an open
tension in the wiki.
Flag gaps honestly. If the wiki does not cover something relevant to the question, say so explicitly rather than filling in from memory.
The wiki does not yet have coverage on mixture-of-experts variants.
Consider ingesting a source on this if it is relevant to your work.
Do not hallucinate sources. If you are tempted to cite something not in the wiki, do not. Write "not in wiki" instead.
Length: match the depth of the question. A factual lookup gets a paragraph. A synthesis question gets structured sections. A comparison question gets a side-by-side if useful.
After answering, ask:
Want me to save this as a wiki page?
If the user says yes, ask for a title if not obvious, then create {WIKI_PATH}concepts/<slug>.md using the concept page structure defined in commands/ingest.prompt.md (see "Creating a new concept page" section). The page should contain the synthesized answer, with all citations intact, plus a ## Source question section at the top:
## Source question
> "Original question the user asked"
> Filed: YYYY-MM-DD
Then update {WIKI_PATH}index.md and {WIKI_PATH}log.md:
## [YYYY-MM-DD] query | Original question
Answer filed as: concepts/slug
Pages read: concepts/x, concepts/y, sources/z (N total)
Gaps identified: 1 (mixture-of-experts not covered)
If the user says no, log anyway without the "filed as" line.
After answering (and filing if applicable), offer one of the following if relevant — not all of them:
One suggestion max. Do not pad.
{LANGUAGE}. If LANGUAGE is pt-BR, write in Brazilian Portuguese. If LANGUAGE is en, write in English. Apply this to all responses and any filed wiki pages. If LANGUAGE is not set, default to English.{INPUT_PATH}. Query operates only on {WIKI_PATH}. If the user wants raw source content, suggest ingest.{WIKI_PATH}index.md, correct yourself.What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
Generated from the plugin's indexed repository (cooperacode/forge) — no native marketplace selected
npx claudepluginhub p/cooperacode-forge6 commands in this plugin
/draftGenerate a software engineering artifact for the active work item. Routes to the correct artifact type based on the hierarchy level set in .env./focusCreate or select the active work item. Creates a new work item or switches focus to an existing one, writing the .env context file used by all other commands./ingestAdd new sources to the wiki, creating and updating pages as needed. Always update the index and log. Default is non-interactive. Pass -buddy for step-by-step confirmation./langSet the language for artifact generation and user interactions. Supported: en (English), pt-BR (Brazilian Portuguese)./lintScan the wiki for structural, factual, and navigational problems — and fix what you can, flag what you cannot.