Skip to content

Agent Documentation RAG

Scraped agent documentation for local RAG indexing. The scraper fetches pages from the official documentation sites of opencode, Claude Code, and Cline, converts them to Markdown, and stores them in rag/agents/.

Usage

Scrape Documentation

bash
npm run scrape:agent-docs

This fetches ~10 pages per agent and writes them to rag/agents/<agent>/<page>.md with YAML frontmatter (title, source, scraped_at).

Configure local-rag MCP Server

Point mcp-local-rag at the rag/agents directory to make the documentation queryable by AI agents:

jsonc
{
  "mcpServers": {
    "local-rag": {
      "type": "local",
      "command": ["npx", "-y", "mcp-local-rag"],
      "enabled": true,
      "timeout": 120000,
      "environment": {
        "BASE_DIR": "./rag"
      }
    }
  }
}

Querying Agent Docs

Once configured, agents can query the RAG index to understand native formats. For example:

"Search the RAG for opencode rules format" "Search the RAG for claude-code memory configuration" "Search the RAG for cline plugin setup"

Pages by Agent

AgentPages
opencodeintro, overview, rules, skills, agents, commands, config, mcp-servers, permissions, tools
claude-codeoverview, memory, skills, hooks, sub-agents, settings, mcp, permissions, best-practices, common-workflows
clineoverview, rules, skills, plugins, config, using-commands, subagents, mcp-overview, memory-bank, cli-reference
codexoverview, quickstart, prompting, customization, memories, sandboxing, subagents, workflows, app, ide, cli, config, permissions, rules, hooks, agents-md, mcp, plugins, skills, best-practices, enterprise, and more (43 pages)
copilotcustom-instructions, repository-instructions, agent-instructions

Output Structure

text
rag/
└── agents/
    ├── opencode/
    │   ├── intro.md
    │   ├── overview.md
    │   ├── rules.md
    │   └── ...
    ├── claude-code/
    │   ├── overview.md
    │   ├── memory.md
    │   └── ...
    ├── cline/
    │   ├── overview.md
    │   ├── rules.md
    │   └── ...
    ├── codex/
    │   ├── overview.md
    │   ├── quickstart.md
    │   ├── rules.md
    │   ├── config-basics.md
    │   └── ... (43 pages)
    └── copilot/
        ├── custom-instructions.md
        ├── repository-instructions.md
        └── agent-instructions.md

Each file includes frontmatter with the original source URL and scrape timestamp, making it easy to refresh individual pages when docs change.

Regeneration

The rag/ directory is gitignored. Regenerate at any time:

bash
npm run scrape:agent-docs

Released under the MIT License.