gh-search
Installation
SKILL.md
gh-search
Search GitHub for concrete code before guessing. Search for exact API names, method names, and small string snippets that must appear in a working example.
Workflow
- Search code for the exact method or pattern.
- Collect repo names from promising hits.
- Rank repos by stars and credibility.
- Read the best few examples in full, not just the first random hit.
- Report repo URLs and file paths of the best examples so they are easy to inspect later.
1. Search code
Search for one unique term, not a description. GitHub code search matches literal tokens in files. Natural-language phrases ("iOS HID wheel scroll bluetooth mouse") return nothing, because no file contains those words together. The best queries use one term that only appears in code doing what you want:
- a specific function or class name from the API you use:
IOHIDScrollAccelerator,registerForL2CAPChannelOpenNotifications,IOHIDEventGetTimeStamp - a magic number or constant:
SCROLL_CLEAR_THRESHOLD_MS,"0x09, 0x38",kHIDUsage_GD_Wheel - an exact string in quotes that the code must contain:
'"setClassOfDevice(0x002540"'