> ## Documentation Index
> Fetch the complete documentation index at: https://cj-teaches.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up Grounded Docs

> Install and configure the Grounded Docs documentation indexer and Claude skills so you can fact-check content against specific documentation versions.

[Grounded Docs](https://grounded.tools/) is a local documentation indexer that lets you scrape, store, and search versioned documentation on your own machine. Several tutorials on this site use it to fact-check content against specific documentation versions. Complete this setup once and skip it in any tutorial that links here.

## Prerequisites

<CardGroup cols={3}>
  <Card title="Node.js 22+" icon="node-js">
    Required for the Grounded Docs CLI. Includes npm.
  </Card>

  <Card title="git" icon="code-branch">
    Required to clone the skills repository
  </Card>
</CardGroup>

## Install Grounded Docs

<Steps>
  <Step title="Install the Grounded Docs CLI">
    Install the Grounded Docs CLI globally:

    ```shell theme={null}
    npm install -g @arabold/docs-mcp-server
    ```
  </Step>

  <Step title="Install the Claude skills">
    The Grounded Docs repository ships three Claude skills. Install them so Claude knows how to index and search documentation on your behalf.
    The following command uses a sparse checkout to grab just the `skills/` directory, not the full repo.

    ```bash theme={null}
    git clone --depth 1 --filter=blob:none --sparse \
      https://github.com/arabold/docs-mcp-server.git /tmp/docs-mcp-server
    cd /tmp/docs-mcp-server && git sparse-checkout set skills

    mkdir -p ~/.claude/skills/docs-manage \
             ~/.claude/skills/docs-search \
             ~/.claude/skills/fetch-url

    cp /tmp/docs-mcp-server/skills/docs-manage/SKILL.md \
       ~/.claude/skills/docs-manage/SKILL.md
    cp /tmp/docs-mcp-server/skills/docs-search/SKILL.md \
       ~/.claude/skills/docs-search/SKILL.md
    cp /tmp/docs-mcp-server/skills/fetch-url/SKILL.md \
       ~/.claude/skills/fetch-url/SKILL.md

    # clean up the temp clone
    rm -rf /tmp/docs-mcp-server
    ```

    Each skill teaches Claude a different capability:

    | Skill         | What Claude can do                                                          |
    | ------------- | --------------------------------------------------------------------------- |
    | `docs-manage` | Scrape, refresh, and remove documentation from the local index              |
    | `docs-search` | List indexed libraries, search content, and fact-check against indexed docs |
    | `fetch-url`   | Fetch a single URL and convert it to Markdown without indexing it           |
  </Step>

  <Step title="Verify the install">
    Ask Claude to list any currently indexed libraries:

    ```text theme={null}
    /docs-search List everything in the docs index
    ```

    If Grounded Docs is installed correctly, Claude will run the `list` command and return a table of indexed libraries (or confirm the index is empty if nothing has been scraped yet).
  </Step>
</Steps>

## Enhance the docs-search skill

<Steps>
  <Step title="Add the citation block format">
    By default, the `docs-search` skill has no fact-checking protocol. The CLI returns
    structured JSON, but Claude's response doesn't cite sources or classify findings.

    Enhance the `docs-search` skill so Claude produces the following for each finding:

    1. **Doc path (local):** the path portion of the URL from the indexed content, labeled as (local) to indicate it came from the local index.
    2. **Public URL:** The full URL from the indexed content.
    3. **Quote:** A verbatim excerpt from the content that supports or refutes the claim.
    4. **Finding:** A classification of the claim based on the content, ending with a severity emoji (✅ accurate, ⚠️ outdated or imprecise, ❌ incorrect, ❓ not found).

    With this format in place, you can see exactly where Claude is pulling its information from,
    read the relevant passage directly, and evaluate each finding against the evidence.

    Ask Claude to update the skill:

    ```text theme={null}
    Enhance ~/.claude/skills/docs-search/SKILL.md for fact-checking.
    If a fact-checking workflow or citation block format already
    exists in this file, replace those sections rather than
    appending duplicates.

    Add a fact-checking workflow and citation block format: when
    fact-checking, search the index, locate the relevant passage in
    the content field, classify the finding, then emit one citation
    block per claim:

    Doc path (local): <path portion of the url field — everything
                      after the domain. The "(local)" is part of the
                      field label only — do not append it to the path
                      value itself.>
    Public URL:       <full url field value>
    Quote:            "<verbatim excerpt from content>"
    Finding:          [DOCS SAY] / [INFERRED from <doc path>] /
                      [NOT FOUND]

    Classification:
    - [DOCS SAY] — a direct quote from content supports the claim
    - [INFERRED from <doc path>] — deduced from context; name source
    - [NOT FOUND] — no indexed source addresses the claim

    Severity emoji (end every Finding line with exactly one):
    ✅  accurate — docs confirm the claim as stated
    ⚠️  warning — claim is outdated, deprecated, or imprecise
    ❌  incorrect — docs directly contradict the claim
    ❓  unknown — no indexed source found ([NOT FOUND] only)

    Rules:
    - Quote must be verbatim from content — never paraphrase
    - Never use [DOCS SAY] without a quote to back it
    - The field label is "Doc path (local):" — never repeat "(local)"
      in the path value

    Include a concrete example citation block.
    ```
  </Step>

  <Step title="Verify the enhancement">
    Ask Claude to confirm the new workflow is in place:

    ```text theme={null}
    /docs-search What citation block format do you use when fact-checking?
    ```

    Claude will describe the four-field format (Doc path, Public URL, Quote, Finding).
  </Step>
</Steps>

<Check>
  You're ready. Return to the tutorial that sent you here, or start with [Fact-check tutorials with versioned docs](/tutorials/increase-content-accuracy).
</Check>

***

Found an issue with this page? [Open a GitHub issue](https://github.com/cjobermaier/ai-docs-and-tutorials/issues).
