Claude-skill-registry gh-grep
Search real-world code examples across millions of GitHub repositories using grep.app. This skill should be used when looking for implementation patterns, API usage examples, library integration patterns, or production code references. Supports literal code search, regex patterns, and filtering by language/repo/path.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/gh-grep" ~/.claude/skills/majiayu000-claude-skill-registry-gh-grep && rm -rf "$T"
manifest:
skills/data/gh-grep/SKILL.mdsource content
GitHub Grep
Base directory for this skill: /home/hazeruno/.config/opencode/skills/gh-grep
Search for real-world code examples across over a million public GitHub repositories via grep.app.
When to Use
- Finding implementation patterns for unfamiliar APIs or libraries
- Looking for correct syntax, parameters, or configuration examples
- Discovering production-ready code examples and best practices
- Understanding how different libraries/frameworks work together
Quick Start
Run the CLI script with bun (use absolute path):
bun /home/hazeruno/.config/opencode/skills/gh-grep/scripts/grep.ts searchGitHub --query "<code-pattern>" [options]
Core Options
| Option | Description |
|---|---|
| Literal code pattern (required) |
| Case-sensitive search |
| Match whole words only |
| Interpret query as regex |
| Filter by repository (e.g., ) |
| Filter by file path (e.g., ) |
| Filter by language (comma-separated, e.g., ) |
Global Options
: Call timeout (default: 30000)-t, --timeout <ms>
: Output format:-o, --output <format>
|text
|markdown
|jsonraw
Search Patterns
Important: This tool searches for literal code patterns, not keywords.
Good searches:
- Find React useState usageuseState(
- Find React import statementsimport React from
- Find async function declarationsasync function
Bad searches:
- Keywords, not codereact tutorial
- Concepts, not patternsbest practices
- Questions, not codehow to use
For detailed pattern examples and regex usage, see
references/api_reference.md.
Common Examples
# Find Authentication Patterns bun /home/hazeruno/.config/opencode/skills/gh-grep/scripts/grep.ts searchGitHub \ --query "getServerSession" --language "TypeScript,TSX" # Find Error Boundary Implementations bun /home/hazeruno/.config/opencode/skills/gh-grep/scripts/grep.ts searchGitHub \ --query "ErrorBoundary" --language "TSX" # Find useEffect Cleanup with Regex bun /home/hazeruno/.config/opencode/skills/gh-grep/scripts/grep.ts searchGitHub \ --query "(?s)useEffect\(\(\) => {.*removeEventListener" --use-regexp true # Find CORS Handling in Flask bun /home/hazeruno/.config/opencode/skills/gh-grep/scripts/grep.ts searchGitHub \ --query "CORS(" --match-case true --language "Python" # Search Within Specific Repository bun /home/hazeruno/.config/opencode/skills/gh-grep/scripts/grep.ts searchGitHub \ --query "createContext" --repo "facebook/react"
Requirements
- Bun runtime
package (embedded in script)mcporter
Resources
- Main CLI tool wrapping grep.app MCP serverscripts/grep.ts
- Detailed parameter documentation and regex patternsreferences/api_reference.md