Agent skill

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.

Stars 5
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/huynguyen03dev/opencode-setup/tree/main/skills/gh-grep

SKILL.md

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):

bash
bun /home/hazeruno/.config/opencode/skills/gh-grep/scripts/grep.ts searchGitHub --query "<code-pattern>" [options]

Core Options

Option Description
--query Literal code pattern (required)
--match-case Case-sensitive search
--match-whole-words Match whole words only
--use-regexp Interpret query as regex
--repo Filter by repository (e.g., facebook/react)
--path Filter by file path (e.g., src/components/)
--language Filter by language (comma-separated, e.g., TypeScript,TSX)

Global Options

  • -t, --timeout <ms>: Call timeout (default: 30000)
  • -o, --output <format>: Output format: text | markdown | json | raw

Search Patterns

Important: This tool searches for literal code patterns, not keywords.

Good searches:

  • useState( - Find React useState usage
  • import React from - Find React import statements
  • async function - Find async function declarations

Bad searches:

  • react tutorial - Keywords, not code
  • best practices - Concepts, not patterns
  • how to use - Questions, not code

For detailed pattern examples and regex usage, see references/api_reference.md.

Common Examples

bash
# 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
  • mcporter package (embedded in script)

Resources

  • scripts/grep.ts - Main CLI tool wrapping grep.app MCP server
  • references/api_reference.md - Detailed parameter documentation and regex patterns

Expand your agent's capabilities with these related and highly-rated skills.

huynguyen03dev/opencode-setup

context7

Fetch up-to-date documentation and code examples for any library or framework. Use when needing API references, code examples, library documentation, or framework guides. Supports React, Next.js, MongoDB, Supabase, and thousands of other libraries.

5 0
Explore
huynguyen03dev/opencode-setup

github

Interact with GitHub repositories, issues, pull requests, and code via the GitHub MCP server. This skill should be used when managing repositories, creating/updating files, working with issues and PRs, searching code/repos/users, creating branches, and performing code reviews. Supports all major GitHub API operations.

5 0
Explore
huynguyen03dev/opencode-setup

code-review

Use when receiving code review feedback (especially if unclear or technically questionable), when completing tasks or major features requiring review before proceeding, or before making any completion/success claims. Covers three practices - receiving feedback with technical rigor over performative agreement, requesting reviews via code-reviewer subagent, and verification gates requiring evidence before any status claims. Essential for subagent-driven development, pull requests, and preventing false completion claims.

5 0
Explore
huynguyen03dev/opencode-setup

deep-wiki

Access AI-generated documentation and insights for GitHub repositories via DeepWiki. This skill should be used when exploring unfamiliar codebases, understanding repository architecture, finding implementation patterns, or asking questions about how a GitHub project works. Supports any public GitHub repository.

5 0
Explore
huynguyen03dev/opencode-setup

gkg

Global Knowledge Graph for codebase analysis. This skill should be used when searching for code definitions (functions, classes, methods), finding references to symbols, understanding code structure, analyzing import usage, generating repository maps, or performing impact analysis before refactoring. Supports TypeScript, JavaScript, Python, Java, and more.

5 0
Explore
huynguyen03dev/opencode-setup

chrome-devtools

Browser automation, debugging, and performance analysis using Puppeteer CLI scripts. Use for automating browsers, taking screenshots, analyzing performance, monitoring network traffic, web scraping, form automation, and JavaScript debugging.

5 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results