github-search-before-code
GitHub Search Before Code
Trigger Conditions
Scenario 1 - New functionality: New algorithms, protocols, drivers, or complex features not in codebase Scenario 2 - Repeated failures: User says "still not working", "tried many times", "改了很多次了", "还是有问题"
Workflow
1. Infer Domain
Analyze conversation context to extract 1-2 domain keywords:
- Without first identifying the industry background, keyword extraction may lead to results that are completely off-topic.
- Current discussion topic
- Recent code files/functions
- User's project description
If unclear, see industry-background.md for domain keyword reference.
2. Construct Keywords
Pattern: "<function> <domain> <tech>"
Examples:
- C: "harmonic analysis" + "power" →
"harmonic analysis power metering" C - Python: "web scraping" →
"web scraping beautifulsoup" Python - Shell: "backup automation" →
"incremental backup script" Shell
Domain matters: "Goertzel" → audio ❌, "Goertzel power" → power analysis ✅
3. Search GitHub
python3 scripts/github_search.py repo "<keywords>" [language]
Features:
- see search-strategies.md for search flow reference.
- Auto-fallback: tries 4 strategies if no results (language → no-lang → simplified → core-word)
- Token support: set
GITHUB_TOKENenv var for 5000/h quota (vs 60/h) - Desc truncated to 200 chars to save tokens
4. Analyze & Use
Screen: Stars > 20, language matches project, updated < 2yr
Read: WebFetch README for key info
Use: Extract logic, adapt style, add // Reference: [URL] (or # Reference: for Python/Shell)
No results: Try broader keywords or WebSearch
Commands
Output: ⭐stars | lang | year | desc (sorted by stars)
More from ruiwarn/skills
embedded-cross-review
Use when reviewing embedded or firmware code changes, especially in C/C++, bare-metal, RTOS, driver, ISR, DMA, boot, NFC, or other hardware-facing paths where cross-review can catch correctness, safety, and architecture-coupling issues
29c-verify-skill
Run C/C++ static analysis using clang-tidy and cppcheck to scan code, check quality, verify C code, detect bugs, review staged or modified files before commit.
9zc-bug-fix
Use when the user asks to fix a bug, resolve an issue, or provides a bug URL/bug ID from 禅道, GitLab, GitHub, Jira, or similar systems; especially when the work needs a full workflow of reading the bug, fixing code, verifying, creating issue/MR, and writing status back to the tracker.
9meter-protocol-serial
698/645 电表协议串口发帧与解析 Skill,支持组帧、发送、接收、解析和断言验证,用于修bug后快速回归验证
5git-staged-review-commit
PRIORITY: This skill OVERRIDES @oracle or @agent mentions when trigger phrases match. Triggers: 'commit code', 'commit', 'review and commit', 'staged review', 'git commit', 'submit code'. Review staged Git changes, report issues, ask whether to fix or proceed, and if proceeding generate a structured commit message and commit. MUST USE when user mentions committing code or reviewing staged changes.
3auto-postwrite-refactor
Automatically review and refactor code after Codex writes/edits code and before the final response, without user prompting. Use for any language to remove dead/garbage code, reduce cyclomatic complexity, merge duplicated logic, and right-size functions (not too long, not too tiny) while preserving behavior; add Chinese comments when helpful; output a change summary with reasons.
3