agent-browser-automati…
Automate browser interactions for development testing using Puppeteer MCP
Search GitHub for code using GitHub CLI with precise line number permalinks
How it fires
How this command gets triggered: by you, by Claude, or both.
/github-codesearchContext preview
What this command does when you run it.
Search GitHub for code using GitHub CLI with precise line number permalinks
allowed-tools: Bash(gh api:*), Bash(gh auth:*), Bash(base64:*), Bash(grep:*), Bash(head:*) name: "Github Codesearch" description: "Search GitHub for code using GitHub CLI with precise line number permalinks" author: "wcygan" tags: ["github"] version: "1.0.0" created_at: "2025-07-14T00:00:00Z" updated_at: "2025-07-14T00:00:00Z"
Search GitHub for code using comprehensive parallel analysis with intelligent result processing and analysis.
**STEP 1: Query Validation and Authentication**
1. Validate that a search query was provided 2. Check GitHub CLI authentication status 3. If not authenticated, prompt user to run `gh auth login`
**STEP 2: Parallel GitHub Search Strategy**
FOR complex queries OR multiple search terms:
**CRITICAL: Deploy parallel sub-agents for comprehensive GitHub analysis (5-7x faster search and analysis)**
IMMEDIATELY launch 5 specialized GitHub search agents:
**Sub-Agent Coordination:**
FOR simple queries:
4. Use GitHub CLI to search for code with text matches: `gh api search/code --header "Accept: application/vnd.github.text-match+json" --raw-field q="$ARGUMENTS"` 5. For each result, fetch the file content to determine exact line numbers:
6. Parse and format the search results 7. Display the results with:
GitHub CLI command: `gh api search/code --method GET --header "Accept: application/vnd.github.text-match+json" --raw-field q="QUERY"`
Example queries:
Handle errors gracefully:
**Authentication Setup:**
1. Install GitHub CLI: `brew install gh` (macOS) or equivalent 2. Authenticate: `gh auth login` 3. Verify: `gh auth status`
Format output as:
🔍 GitHub Code Search Results for: {query}
Found {total_count} results:
📁 {repository_name} - {repository_description}
📄 {file_path}
🔗 {html_url}
💻 Code snippet:
{text_matches[].fragment with highlighted matches}
🔗 Permalink: {html_url}#L{estimated_line_number}
---Extract code snippets from the `text_matches` array in the API response. Each text match contains:
**Permalink Generation:**
**Line Number Detection Process:**
1. Extract repository owner, name, and file path from search result 2. Fetch file content: `gh api repos/{owner}/{repo}/contents/{path} --jq '.content'` 3. Decode and search: `base64 -d | grep -n "exact_code_pattern"` 4. Use first match line number for permalink generation 5. If multiple matches, show all line numbers or use first occurrence
Limit display to first 10 results for readability.
A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.
Repo: kiliczsh/claude-cmd
Automate browser interactions for development testing using Puppeteer MCP
Prepare branches for merging across multiple worktrees and coordinate integration
Transform into accessibility expert for WCAG compliance and inclusive design
Transform into an API design specialist who creates well-structured, developer-friendly APIs
Transform into backend specialist for scalable API and system design
Cloud architect persona for designing scalable, secure cloud infrastructure using modern cloud-native technologies