Search Before Ask
Golden rule: Don't ask the user what you can search for.
When faced with an unfamiliar topic, tool, technique, or concept, follow this workflow before giving up or asking the user:
Workflow
- Identify gaps — What specific information are you missing? Extract key search terms.
- Choose sources — Pick the most relevant search sources based on the question type:
- Chinese content / general knowledge → Baidu (via
web_searchwithsearch_lang: "zh") - Open-source projects / code → GitHub search script
- Security articles / 安全技术 → WeChat article search
- English / international → General
web_search
- Chinese content / general knowledge → Baidu (via
- Search in parallel — Run multiple searches at once when appropriate
- Synthesize — Combine results into a clear answer
- Only if nothing found — Then and only then, tell the user what you tried and ask for guidance
Search Tools
1. General Web Search (Baidu-prioritized)
# Baidu search for Chinese results
web_search query="<keywords>" search_lang="zh" count=10
# General web search (Google/Bing fallback)
web_search query="<keywords>" count=10
2. GitHub Search
python3 skills/search-before-ask/scripts/github-search.py "<keywords>" [--type repos|code|issues] [--limit 10]
--type repos: search repositories (default)--type code: search code--type issues: search issues--limit: max results, default 10
Requires GITHUB_TOKEN env var for higher rate limits (optional, works without but at lower rate limit).
3. WeChat Article Search
python3 skills/wechat-search/scripts/search.py "<keywords>" [days] [limit]
For security/Chinese tech topics. See wechat-search skill for details.
Decision Matrix
| Question type | Search first |
|---|---|
| Security technique / CVE / 渗透 | WeChat + Baidu + GitHub |
| Programming / framework / library | GitHub + Baidu + general web |
| Chinese policy / news / 百科 | Baidu + WeChat |
| Open-source tool usage | GitHub (code search) + web |
| General knowledge / how-to | Baidu + web |
| English docs / international | General web_search |
Rules
- Always search before saying "I don't know" — unless the answer is genuinely unknowable
- Batch searches — run GitHub + Baidu + WeChat in parallel when topic spans multiple domains
- Be transparent — tell the user "我查了一下..." so they know you searched
- Respect rate limits — don't spam the same API with repeated identical queries
- Fallback gracefully — if one source fails, try another; don't block on a single failure
Notes
- GitHub search API allows 10 req/min unauthenticated, 30 req/min with token
- WeChat search via doonsec.com; no auth needed
- Baidu search uses
web_searchbuilt-in tool withsearch_lang: "zh" - This skill is always on — the assistant should internalize the "search before ask" mindset
