[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M788S598GCN2QP310XT5H36G":3,"skill-same:01M788S598GCN2QP310XT5H36G":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M788S598GCN2QP310XT5H36G","search-strategy",null,"How to search effectively across any corpus — code, docs, and chat\u002Fknowledge bases. Pick the right source for the question, craft precise queries, iterate (broaden\u002Fnarrow), apply structural filters (path\u002Flang\u002Fdate\u002Fauthor), and know when to switch from keyword to semantic search. Use when a search returns too many or zero results, when you're unsure which tool to search with, or when you need to find code, docs, or discussions efficiently.","jingchaodev\u002Fskills-lab","jingchaodev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F8307474?v=4","01M788N3PES0P1DGEKSE9ZYDSD","chao","01M788N3QH1AYYGWKFG9XTX3WF",1,"MIT","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Fskills\u002Fsearch-strategy\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: search-strategy\ndescription: How to search effectively across any corpus — code, docs, and chat\u002Fknowledge bases. Pick the right source for the question, craft precise queries, iterate (broaden\u002Fnarrow), apply structural filters (path\u002Flang\u002Fdate\u002Fauthor), and know when to switch from keyword to semantic search. Use when a search returns too many or zero results, when you're unsure which tool to search with, or when you need to find code, docs, or discussions efficiently.\n---\n\n# Search Strategy\n\nA tool-agnostic method for finding things fast in any corpus. The moves are the same\nwhether you're using `ripgrep`, `git grep`, GitHub code search, a docs site, or a\nteam chat search — only the syntax changes. The core loop:\n\n**pick the source → craft a precise query → iterate (broaden\u002Fnarrow) → filter structurally → switch modes if stuck.**\n\n## Step 1: Pick the Right Source\n\nThe single biggest time-saver is searching the *right corpus* first.\n\n| You want… | Search… | With |\n|-----------|---------|------|\n| How *this* project does X | The local codebase | `rg`, `git grep` |\n| How *anyone* does X, examples in the wild | Public code | GitHub code search |\n| What a tool\u002FAPI\u002Fservice does | Official docs | docs site search, `web-search` skill |\n| A design decision or \"why did we do this\" | Project docs \u002F notes \u002F commit history | `rg` over `docs\u002F`, `git log --grep` |\n| A recent decision, announcement, or gotcha | Team chat \u002F knowledge base | your team's chat\u002Fwiki search |\n| Whether something even exists | Package registry \u002F repo search | registry search, GitHub repo search |\n\nIf unsure, start with the broadest source, see where the good hits come from, then\nre-search that source specifically.\n\n## Step 2: Craft a Precise Query\n\nGood queries are **specific and short**. Search engines rank on relevance; you supply\ndistinctiveness.\n\n- **Use the most distinctive token** — an exact identifier, error string, or symbol name\n  beats a generic word (`\"connectWithRetry\"` beats `retry`).\n- **Quote multi-word \u002F exact phrases** — otherwise most engines OR the words:\n  `\"connection reset by peer\"`, `\"class RetryPolicy\"`.\n- **Keywords, not sentences** — `raft leader election timeout` not `how does leader\n  election work in raft`. (Full-sentence questions are for semantic search — see Step 5.)\n- **Add a version or year for fast-moving topics** — `tokio select 2024` filters stale hits.\n- **Match how it appears in the corpus** — search `def process_order` for a Python\n  definition, `import process_order` for its call sites, `class Foo` for a type.\n\n## Step 3: Iterate — Broaden or Narrow\n\nAlmost never nail it on the first query. Read the result count and adjust:\n\n| Symptom | Move | How |\n|---------|------|-----|\n| **Zero results** | Broaden | Drop a term, remove quotes, try a synonym or the canonical name, search a wider scope |\n| **Thousands of results** | Narrow | Add a distinctive term, quote a phrase, add a path\u002Flang filter, scope to one dir\u002Frepo |\n| **Wrong kind of hit** | Redirect | Exclude noise (`-test`, `-vendor`), switch definition↔usage phrasing |\n| **Right area, missing the exact line** | Zoom | Search within the found file\u002Fdir; widen to see surrounding context (`-C`) |\n\nRule of thumb: **start narrow, broaden only on zero results.** A broad-then-narrow sweep\nwastes time wading through noise.\n\n## Step 4: Use Structural Filters\n\nFilters cut the corpus before matching — the highest-leverage way to kill noise.\n\n**ripgrep (local):**\n```bash\nrg \"RetryPolicy\" --type py                 # language\u002Ftype filter\nrg \"RetryPolicy\" -g '!**\u002Ftest\u002F**'          # exclude a path glob\nrg \"RetryPolicy\" -g '*.go' src\u002F            # glob + directory scope\nrg -n -C3 \"backoff\"                        # line numbers + 3 lines of context\nrg -i \"timeout\" --stats                    # case-insensitive + match stats\n```\n\n**git grep (tracked files \u002F history):**\n```bash\ngit grep -n \"RetryPolicy\" -- 'src\u002F**\u002F*.ts'         # path-scoped, tracked files only\ngit grep -n \"backoff\" $(git rev-list --all)        # search all of history\ngit log -S \"RetryPolicy\" --oneline                 # commits that added\u002Fremoved the string\ngit log --grep=\"retry\" --oneline                   # commits whose message mentions it\n```\n\n**GitHub code search (public code):**\n```\nRetryPolicy language:go                    # language filter\n\"maxAttempts\" repo:org\u002Fname                # scope to one repo\nbackoff path:src\u002F NOT path:test            # path include \u002F exclude\nretryPolicy org:some-org stars:>500        # org + popularity filter\n```\n\n**Docs \u002F chat \u002F knowledge bases** — the concepts port even when syntax differs:\n- **Scope**: restrict to a section\u002Fchannel\u002Fspace (`in:#channel`, a docs path prefix, a site: filter).\n- **Author**: `from:@person` \u002F `author:` narrows to a known expert.\n- **Date**: `after:2024-01-01` \u002F sort-by-recency surfaces current answers over stale ones.\n- **Exact phrase**: quote multi-word identifiers so they aren't tokenized apart.\n\n## Step 5: Keyword vs Semantic — Know When to Switch\n\n| Use **keyword \u002F regex** search when | Use **semantic \u002F natural-language** search when |\n|-------------------------------------|--------------------------------------------------|\n| You know an exact token: symbol, error string, filename, config key | You don't know the vocabulary the corpus uses |\n| You need every literal occurrence (refactor, audit) | You want *conceptually* related material, not literal matches |\n| Precision matters more than recall | The idea can be phrased many ways (\"auth\" vs \"login\" vs \"session\") |\n| Corpus is code or structured text | Corpus is prose, tickets, docs, chat |\n\nIf keyword search keeps returning zero because you're guessing the wrong word, **stop\nguessing and go semantic** (or vice-versa: if semantic search returns fuzzy junk and you\nactually know the exact string, switch to grep). A common winning combo: semantic search\nto discover the real identifier, then keyword search on that identifier for every hit.\n\n## Worked Examples\n\n**\"Find who implements `OrderValidator`\" (local):**\n```bash\nrg -n \"class OrderValidator\" --type py          # the definition\nrg -n \"OrderValidator\\(\" -g '!**\u002Ftest\u002F**'       # instantiation \u002F call sites\n```\n\n**\"Does anyone in the org call the deprecated `oldAuth()`?\" (public code):**\n```\n\"oldAuth(\" org:my-org language:typescript NOT path:test\n```\n\n**\"When and why was this retry cap changed?\" (history):**\n```bash\ngit log -S \"maxAttempts\" --oneline -- src\u002Fretry.ts   # commits touching that literal\ngit show \u003Csha>                                       # read the change + message\n```\n\n## Tips\n\n- **Right source first.** Searching the wrong corpus perfectly still fails — pick the corpus before the query.\n- **Distinctive token wins.** One exact identifier beats five generic words.\n- **Quote multi-word identifiers** so the engine doesn't OR them apart.\n- **Start narrow; broaden only on zero results.** Don't wade through 10k hits by choice.\n- **Filters before terms.** Path\u002Flang\u002Fdate filters cut noise faster than more keywords.\n- **Switch modes when stuck.** Keyword for known strings, semantic for unknown vocabulary — flip if one keeps failing.\n- **Definition vs usage are different queries.** `class Foo` finds the type; `Foo(` \u002F `import Foo` finds callers.\n","# Search Strategy\n\nA tool-agnostic method for finding things fast in any corpus. The moves are the same\nwhether you're using `ripgrep`, `git grep`, GitHub code search, a docs site, or a\nteam chat search — only the syntax changes. The core loop:\n\n**pick the source → craft a precise query → iterate (broaden\u002Fnarrow) → filter structurally → switch modes if stuck.**\n\n## Step 1: Pick the Right Source\n\nThe single biggest time-saver is searching the *right corpus* first.\n\n| You want… | Search… | With |\n|-----------|---------|------|\n| How *this* project does X | The local codebase | `rg`, `git grep` |\n| How *anyone* does X, examples in the wild | Public code | GitHub code search |\n| What a tool\u002FAPI\u002Fservice does | Official docs | docs site search, `web-search` skill |\n| A design decision or \"why did we do this\" | Project docs \u002F notes \u002F commit history | `rg` over `docs\u002F`, `git log --grep` |\n| A recent decision, announcement, or gotcha | Team chat \u002F knowledge base | your team's chat\u002Fwiki search |\n| Whether something even exists | Package registry \u002F repo search | registry search, GitHub repo search |\n\nIf unsure, start with the broadest source, see where the good hits come from, then\nre-search that source specifically.\n\n## Step 2: Craft a Precise Query\n\nGood queries are **specific and short**. Search engines rank on relevance; you supply\ndistinctiveness.\n\n- **Use the most distinctive token** — an exact identifier, error string, or symbol name\n  beats a generic word (`\"connectWithRetry\"` beats `retry`).\n- **Quote multi-word \u002F exact phrases** — otherwise most engines OR the words:\n  `\"connection reset by peer\"`, `\"class RetryPolicy\"`.\n- **Keywords, not sentences** — `raft leader election timeout` not `how does leader\n  election work in raft`. (Full-sentence questions are for semantic search — see Step 5.)\n- **Add a version or year for fast-moving topics** — `tokio select 2024` filters stale hits.\n- **Match how it appears in the corpus** — search `def process_order` for a Python\n  definition, `import process_order` for its call sites, `class Foo` for a type.\n\n## Step 3: Iterate — Broaden or Narrow\n\nAlmost never nail it on the first query. Read the result count and adjust:\n\n| Symptom | Move | How |\n|---------|------|-----|\n| **Zero results** | Broaden | Drop a term, remove quotes, try a synonym or the canonical name, search a wider scope |\n| **Thousands of results** | Narrow | Add a distinctive term, quote a phrase, add a path\u002Flang filter, scope to one dir\u002Frepo |\n| **Wrong kind of hit** | Redirect | Exclude noise (`-test`, `-vendor`), switch definition↔usage phrasing |\n| **Right area, missing the exact line** | Zoom | Search within the found file\u002Fdir; widen to see surrounding context (`-C`) |\n\nRule of thumb: **start narrow, broaden only on zero results.** A broad-then-narrow sweep\nwastes time wading through noise.\n\n## Step 4: Use Structural Filters\n\nFilters cut the corpus before matching — the highest-leverage way to kill noise.\n\n**ripgrep (local):**\n```bash\nrg \"RetryPolicy\" --type py                 # language\u002Ftype filter\nrg \"RetryPolicy\" -g '!**\u002Ftest\u002F**'          # exclude a path glob\nrg \"RetryPolicy\" -g '*.go' src\u002F            # glob + directory scope\nrg -n -C3 \"backoff\"                        # line numbers + 3 lines of context\nrg -i \"timeout\" --stats                    # case-insensitive + match stats\n```\n\n**git grep (tracked files \u002F history):**\n```bash\ngit grep -n \"RetryPolicy\" -- 'src\u002F**\u002F*.ts'         # path-scoped, tracked files only\ngit grep -n \"backoff\" $(git rev-list --all)        # search all of history\ngit log -S \"RetryPolicy\" --oneline                 # commits that added\u002Fremoved the string\ngit log --grep=\"retry\" --oneline                   # commits whose message mentions it\n```\n\n**GitHub code search (public code):**\n```\nRetryPolicy language:go                    # language filter\n\"maxAttempts\" repo:org\u002Fname                # scope to one repo\nbackoff path:src\u002F NOT path:test            # path include \u002F exclude\nretryPolicy org:some-org stars:>500        # org + popularity filter\n```\n\n**Docs \u002F chat \u002F knowledge bases** — the concepts port even when syntax differs:\n- **Scope**: restrict to a section\u002Fchannel\u002Fspace (`in:#channel`, a docs path prefix, a site: filter).\n- **Author**: `from:@person` \u002F `author:` narrows to a known expert.\n- **Date**: `after:2024-01-01` \u002F sort-by-recency surfaces current answers over stale ones.\n- **Exact phrase**: quote multi-word identifiers so they aren't tokenized apart.\n\n## Step 5: Keyword vs Semantic — Know When to Switch\n\n| Use **keyword \u002F regex** search when | Use **semantic \u002F natural-language** search when |\n|-------------------------------------|--------------------------------------------------|\n| You know an exact token: symbol, error string, filename, config key | You don't know the vocabulary the corpus uses |\n| You need every literal occurrence (refactor, audit) | You want *conceptually* related material, not literal matches |\n| Precision matters more than recall | The idea can be phrased many ways (\"auth\" vs \"login\" vs \"session\") |\n| Corpus is code or structured text | Corpus is prose, tickets, docs, chat |\n\nIf keyword search keeps returning zero because you're guessing the wrong word, **stop\nguessing and go semantic** (or vice-versa: if semantic search returns fuzzy junk and you\nactually know the exact string, switch to grep). A common winning combo: semantic search\nto discover the real identifier, then keyword search on that identifier for every hit.\n\n## Worked Examples\n\n**\"Find who implements `OrderValidator`\" (local):**\n```bash\nrg -n \"class OrderValidator\" --type py          # the definition\nrg -n \"OrderValidator\\(\" -g '!**\u002Ftest\u002F**'       # instantiation \u002F call sites\n```\n\n**\"Does anyone in the org call the deprecated `oldAuth()`?\" (public code):**\n```\n\"oldAuth(\" org:my-org language:typescript NOT path:test\n```\n\n**\"When and why was this retry cap changed?\" (history):**\n```bash\ngit log -S \"maxAttempts\" --oneline -- src\u002Fretry.ts   # commits touching that literal\ngit show \u003Csha>                                       # read the change + message\n```\n\n## Tips\n\n- **Right source first.** Searching the wrong corpus perfectly still fails — pick the corpus before the query.\n- **Distinctive token wins.** One exact identifier beats five generic words.\n- **Quote multi-word identifiers** so the engine doesn't OR them apart.\n- **Start narrow; broaden only on zero results.** Don't wade through 10k hits by choice.\n- **Filters before terms.** Path\u002Flang\u002Fdate filters cut noise faster than more keywords.\n- **Switch modes when stuck.** Keyword for known strings, semantic for unknown vocabulary — flip if one keeps failing.\n- **Definition vs usage are different queries.** `class Foo` finds the type; `Foo(` \u002F `import Foo` finds callers.\n",{"name":5,"description":7},"main","44b1acb2c22ab1e94663691dda7d7739f1b83cf6","skills\u002Fsearch-strategy",0,"https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab","https:\u002F\u002Fgithub.com\u002Fjingchaodev","https:\u002F\u002Fx.com\u002Fcifra1902","Developer","2026-07-13 09:03:55",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add jingchaodev\u002Fskills-lab --skill search-strategy",{"tool":39,"command":40},"bunx","bunx skills add jingchaodev\u002Fskills-lab --skill search-strategy",{"tool":42,"command":43},"pnpm","pnpm dlx skills add jingchaodev\u002Fskills-lab --skill search-strategy","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Fskills\u002Fsearch-strategy\u002FSKILL.md",true,[],[48,55,62,69,75,82],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M788VYAVHEH5QAV7T1Z8QFV9","default-skill","Valid default cwd skill.","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fdefault_cwd\u002Fskills\u002Fdefault-skill\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M788VVHF3TC2RY65NVPR26DN","clean-two","Another valid skill with a quoted trigger phrase \"specific action\".","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fclean_skills\u002Fclean-two\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M788VRPGJXZ09X9AM1ZPNAHA","clean-one","Use when the user needs a clean example.","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fclean_skills\u002Fclean-one\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M788VPP8BFKCBXDFRHMP67WH","wrong-frontmatter","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbad_skills\u002Fwrong-frontmatter\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M788VKP781ZRGKXVMHZFR062","trigger-two","Use for the exact phrase \"panic button\".","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbad_skills\u002Ftrigger-two\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M788VJBR5Q14W6MJB2DWRSVE","trigger-one","Use when someone says \"panic button\".","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbad_skills\u002Ftrigger-one\u002FSKILL.md",[],[]]