Skip to main content

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.

The problem with AI fact-checking

It’s tempting to ask your AI to review your content for accuracy:
Hey Claude, review my React tutorial for accuracy.
And Claude sounds confident:
Looks good! The forwardRef pattern is correct — wrapping your component
lets the parent access the child's DOM node. The useRef(null)
initialization is right, and the overall approach follows React best
practices. ✓
This answer is wrong — and Claude doesn’t know it. AI fact-checks content against its training data, which can be outdated, sourced from unreliable places, or simply wrong about enterprise vs. OSS behavior. The more confidently wrong, the harder it is to catch.
The fix is simple: give your AI the source. Instead of letting it pull information from memory, point it at the specific versioned docs your readers are actually using. This tutorial shows how to do that using Grounded Docs. You’ll index two versions of the React docs, enhance the fact-checking skill to produce citation-backed output, and watch the same tutorial pass one version and fail another.

Prerequisites

Set up your environment

You need a CLAUDE.md or AGENTS.md file in your repo before starting.

Set up Grounded Docs

Grounded Docs must be installed and the Claude skills must be in place.

The example file

This tutorial fact-checks a sample React tutorial at public/examples/react-18-forwardref-tutorial.md. It covers forwarding refs to child components using the React 18 pattern:
import { forwardRef } from 'react';

const FancyInput = forwardRef(function FancyInput(props, ref) {
  return <input ref={ref} className="fancy-input" {...props} />;
});
This code is valid in React 18 — but deprecated in React 19. That’s exactly what you’ll catch.

Steps

1

Index both React versions

Index both React 18.3.1 and React 19.2 so you can fact-check against either version. In Claude Code, run:
/docs-manage Index the following two versions of the React documentation:
- https://react.dev/reference/react --version 18.3.1
- https://react.dev/reference/react --version 19.2
Claude will crawl both sites and store the content locally. Allow each permission prompt as it runs. Indexing takes a few minutes per version and covers roughly 49 pages each.
2

Verify both versions are indexed

Confirm both versions are ready:
Give me a list of the react docs
You should see both versions in the table:
LibraryVersionPages
react19.249
react18.3.149
If only one version appears, re-run the index command for the missing one before continuing.
3

Enhance the docs-search skill

By default, the docs-search skill returns generic AI output. You need to enhance it so Claude produces structured, citation-backed findings instead of vague summaries.Run this prompt:
Enhance ~/.claude/skills/docs-search/SKILL.md for fact-checking.
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. Label as "(local)" to make
                  clear content came from the local index, not
                  a live fetch.>
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

Rules:
- Quote must be verbatim from content — never paraphrase
- Never use [DOCS SAY] without a quote to back it
- Always use the (local) label

Include a concrete example citation block.
This enhancement is permanent — the skill file is updated on disk. You only need to do this once across all tutorials that use docs-search for fact-checking.
4

Fact-check against React v18.3.1

Now run the fact-check against the React 18 docs:
Use the /docs-search skill to fact-check
public/examples/react-18-forwardref-tutorial.md
against the react v18.3.1 documentation.
The forwardRef pattern is valid in React 18, so you should see it pass:
Doc path (local): /reference/react/forwardRef (local)
Public URL:       https://react.dev/reference/react/forwardRef
Quote:            "forwardRef lets your component expose a DOM node
                  to the parent component with a ref."
Finding:          [DOCS SAY] forwardRef correctly exposes a child's
                  DOM node to a parent. ✅ Accurate
This is the baseline. The tutorial is correct for readers on React 18.
5

Fact-check against React v19.2

Now run the same check against the React 19 docs:
Use the /docs-search skill to fact-check
public/examples/react-18-forwardref-tutorial.md
against the react v19.2 documentation.
This time, the same code gets flagged:
Doc path (local): /reference/react/forwardRef (local)
Public URL:       https://react.dev/reference/react/forwardRef
Quote:            "In React 19, forwardRef is no longer necessary.
                  Pass ref as a prop instead. forwardRef will be
                  deprecated in a future release."
Finding:          [DOCS SAY] ⚠ OUTDATED — forwardRef is deprecated
                  in React 19. The tutorial teaches it as the required
                  pattern, but the 19.2 docs explicitly say it is no
                  longer necessary. ❌ Flagged — breaking change.
Same tutorial, same code — different result depending on which version your readers are on. This is what version-aware fact-checking catches that generic AI review misses.
6

Fix the deprecated code

Ask Claude to update the file using the React 19 docs as the authoritative source:
Update the tutorial to fix the deprecated forwardRef usage,
using the react v19.2 docs.
Claude will rewrite the component to the React 19 pattern:
function FancyInput({ ref, ...props }) {
  return <input ref={ref} className="fancy-input" {...props} />;
}
It will also remove the forwardRef import, update the surrounding explanation, and add an upgrade callout for readers coming from React 18.
Review the diff before accepting. Claude should only be touching the deprecated patterns — not rewriting the whole file.
7

Verify the fix

Re-run the fact-check against React 19.2 to confirm the deprecation warning is gone:
Use the /docs-search skill to fact-check
public/examples/react-18-forwardref-tutorial.md
against the react v19.2 documentation.
All findings should now return [DOCS SAY] with no deprecation flags. The tutorial accurately reflects React 19.2 and is ready to publish.