{"record":{"id":"0e6b35453af66e52","repo":"upstash/context7","slug":"no-skills-found-matching-query","errorCode":null,"errorMessage":"No skills found matching \"${query}\"","messagePattern":"No skills found matching \"(.+?)\"","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/cli/src/commands/skill.ts","lineNumber":499,"sourceCode":"  trackEvent(\"command\", { name: \"search\" });\n  log.blank();\n  const spinner = ora(`Searching for \"${query}\"...`).start();\n\n  let data;\n  try {\n    data = await searchSkills(query);\n  } catch (err) {\n    spinner.fail(pc.red(`Error: ${err instanceof Error ? err.message : String(err)}`));\n    return;\n  }\n\n  if (data.error) {\n    spinner.fail(pc.red(`Error: ${data.message || data.error}`));\n    return;\n  }\n\n  if (!data.results || data.results.length === 0) {\n    spinner.warn(pc.yellow(`No skills found matching \"${query}\"`));\n    return;\n  }\n\n  spinner.succeed(`Found ${data.results.length} skill(s)`);\n  trackEvent(\"search_query\", { query, resultCount: data.results.length });\n  log.blank();\n\n  const indexWidth = data.results.length.toString().length;\n  const nameWithRepo = (s: SkillSearchResult) => `${s.name} ${pc.dim(`(${s.project})`)}`;\n  const nameWithRepoLen = (s: SkillSearchResult) => `${s.name} (${s.project})`.length;\n  const maxNameLen = Math.max(...data.results.map(nameWithRepoLen));\n  const popularityColWidth = 13;\n  const choices = data.results.map((s, index) => {\n    const indexStr = pc.dim(`${(index + 1).toString().padStart(indexWidth)}.`);\n    const rawLen = nameWithRepoLen(s);\n    const displayName = nameWithRepo(s) + \" \".repeat(maxNameLen - rawLen);\n    const popularity = formatPopularity(s.installCount) + \" \".repeat(popularityColWidth - 4);\n    const trust = formatTrust(s.trustScore);","sourceCodeStart":481,"sourceCodeEnd":517,"githubUrl":"https://github.com/upstash/context7/blob/5284672feb575908efead6fcf1b5e542f8d607bb/packages/cli/src/commands/skill.ts#L481-L517","documentation":"After `context7 skill search <query>` completes searchSkills() without an error payload, the results array is empty or missing. The CLI marks the spinner 'warn' with 'No skills found matching \"<query>\"' and returns — no selection prompt is shown.","triggerScenarios":"Search API returned 200 with zero results: overly specific or misspelled query, query for a library with no published skills, or punctuation/format the search index does not match on.","commonSituations":"Searching a brand-new skill repo not yet indexed; using the repo's full URL instead of a keyword; hyphenation/casing differences between the query and indexed names.","solutions":["Broaden or simplify the query — search by primary framework/tool name rather than full skill titles.","Check spelling and try common variants (e.g. 'react' instead of 'reactjs').","If you know the repository, skip search: `context7 skill add owner/repo [skill]`.","Wait/retry if the skill was published very recently and may not be indexed yet."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Cheap client-side guard: reject obviously-unmatchable queries\nif (!query.trim() || query.trim().length < 2) {\n  console.error(\"Search query too short - use a library/tool name.\");\n  process.exit(1);\n}","typeGuard":"type SearchResponse = { results?: unknown[] };\n\nfunction hasSearchResults(data: SearchResponse): boolean {\n  return Array.isArray(data.results) && data.results.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Search by concise keywords (framework/tool name), not full titles or URLs.","Fall back to `skill add owner/repo` when search returns empty but you know the repo.","Handle empty results as a no-op path, not an exception."],"tags":["cli","skills","search","empty-results"],"backgroundTag":"empty-result-set","analyzedSha":"5284672feb575908efead6fcf1b5e542f8d607bb","analyzedAt":"2026-08-18T18:00:18.510Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}