Skip to content

jasonz-ncc42/local-context7

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

local-context7

English | 中文

Build local documentation reference material for AI coding agents.

This repo is designed to be used with Claude Code. Open this repo in Claude Code and use slash commands (/build-my-context7, /generate-agent-skills, /install-agent-skills) to download docs, generate skills, and install them. The skills and scripts are meant to be invoked by Claude Code, not run manually.

What It Does

local-context7 downloads official documentation from various sources, filters it with AI assistance to keep only developer-relevant content, and generates skills that make the docs available as context during development.

Supported AI Agents:

  • Claude Code (~/.claude/skills/)
  • OpenAI Codex CLI (~/.codex/skills/)
  • OpenCode (~/.config/opencode/skills/)

Included Documentation:

Skill Source Files Description
claude-code-docs Anthropic 30 Claude Code CLI features, hooks, MCP, skills
codex-docs OpenAI 12 Codex CLI configuration, skills, agents
langchain-docs LangChain 1688 LangChain, LangGraph, agents, RAG, tools
nextjs-canary-docs Vercel 376 Next.js App Router, Server Components, APIs
opencode-docs OpenCode 70 OpenCode tools, agents, MCP, plugins
prisma-docs Prisma 415 Prisma ORM, Client, Schema, migrations
tsf-docs TanStack 192 TanStack Form validation, React/Vue/Solid/Angular
zod-docs Zod 13 Zod schema validation, TypeScript type inference

Quick Start

Prerequisites

  • Claude Code installed
  • jq, git, curl available in your shell

Usage

  1. Open this repo in Claude Code
  2. Run the slash commands:
/build-my-context7           # Download and filter all manifests
/generate-agent-skills       # Generate skills for all agents
/install-agent-skills        # Install skills to system locations

To process a single library:

/build-my-context7 zod-docs        # Download only zod-docs
/generate-agent-skills zod-docs    # Generate only zod-docs skill
/install-agent-skills zod-docs     # Install only zod-docs skill

After installation, the skills are available in your other projects. For example, when working on a Next.js app, Claude Code will automatically have access to nextjs-canary-docs.

Adding New Documentation

Just give Claude Code the GitHub URL of the docs folder:

"Add docs from https://github.com/prisma/docs/tree/main/content"

Claude Code will automatically create the manifest and run the build commands. This is the fastest way to add new documentation.

Or create a manifest manually:

  1. Create a JSON file in .claude/skills/download-docs/scripts/manifests/
  2. Run /build-my-context7 <name>/generate-agent-skills <name>/install-agent-skills <name>

Manifest Formats

Manifests use JSON Schema for validation. Add "$schema": "./manifest.schema.json" for IDE autocomplete and validation.

GitHub Source (for repos with docs):

{
  "$schema": "./manifest.schema.json",
  "_source": {
    "type": "github",
    "repo": "owner/repo-name",
    "branch": "main",
    "path": "docs",
    "extensions": [".md", ".mdx"],
    "exclude": ["**/internal/**"]
  }
}

URL Source (for individual files):

{
  "$schema": "./manifest.schema.json",
  "_source": { "type": "url" },
  "files": {
    "getting-started": {
      "installation": "https://example.com/docs/install.md"
    }
  }
}

URL Source with HTML Conversion (requires pandoc):

{
  "$schema": "./manifest.schema.json",
  "_source": { "type": "url", "convert": "html" },
  "files": {
    "docs": { "overview": "https://example.com/docs/overview.html" }
  }
}

Limitation: HTML conversion only works for static HTML pages. Single Page Applications (SPAs) that render content via JavaScript (e.g., React/Angular apps) will produce empty output. See TODO below for planned Playwright support.

Directory Structure

.claude/                    # Working config for this repo
├── skills/                 # Skills for building docs
│   ├── build-my-context7/  # Main orchestration skill
│   ├── download-docs/      # Downloads from manifests
│   ├── filter-docs/        # AI-assisted filtering
│   ├── generate-agent-skills/
│   └── install-agent-skills/
└── agents/                 # Sub-agents

dotfiles/                   # Generated skills (source of truth)
├── shared/                 # Documentation stored once
├── claude/skills/          # SKILL.md → ~/.claude/skills/
├── codex/skills/           # SKILL.md → ~/.codex/skills/
└── opencode/skills/        # SKILL.md → ~/.config/opencode/skills/

output/                     # Intermediate files (gitignored)

How It Works

  1. Download - Fetches documentation from GitHub repos or URLs based on manifest configurations
  2. Filter - AI reviews each file and removes non-useful content (changelogs, contribution guides, marketing pages, etc.)
  3. Generate - Creates skills for each AI agent following their specific format requirements
  4. Install - Symlinks generated skills to system locations where agents can find them

Why Local?

  • Offline access - Documentation available without internet
  • Version control - Pin to specific documentation versions
  • Customization - Add your own documentation sources
  • Privacy - No data sent to external services during development
  • Speed - Instant context loading without API calls

TODO

  • Playwright handler for SPA sites - Add a "type": "playwright" source handler to support JavaScript-rendered documentation sites (e.g., antigravity.google). Would use headless Chromium to render pages before extracting content.

License

This project is open source and available under the MIT License.

About

downloads official documentation, filters it with AI assistance, and generates skills that make the docs available as local context for AI coding agents—a local alternative to Context7's cloud-based documentation lookup

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors