{"record":{"id":"b74c539e90d84a36","repo":"mastra-ai/mastra","slug":"could-not-find-skill-skillname-in-owner","errorCode":null,"errorMessage":"Could not find skill \"${skillName}\" in ${owner}/${repo}.","messagePattern":"Could not find skill \"(.+?)\" in (.+?)/(.+?)\\.","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"packages/server/src/server/handlers/builder-registry.ts","lineNumber":346,"sourceCode":"  requiresAuth: true,\n  requiresPermission: 'stored-skills:write',\n  handler: async ({ mastra, requestContext, registryId, owner, repo, skillName, visibility: bodyVisibility }) => {\n    try {\n      await requireEnabledRegistry(mastra, registryId);\n\n      const storage = mastra.getStorage();\n      if (!storage) {\n        throw new HTTPException(500, { message: 'Storage is not configured' });\n      }\n      const skillStore = await storage.getStore('skills');\n      if (!skillStore) {\n        throw new HTTPException(500, { message: 'Skills storage domain is not available' });\n      }\n\n      // Pull files from the registry\n      const result = await fetchSkillFiles(owner, repo, skillName);\n      if (!result || result.files.length === 0) {\n        throw new HTTPException(404, {\n          message: `Could not find skill \"${skillName}\" in ${owner}/${repo}.`,\n        });\n      }\n\n      const safeSkillId = assertSafeSkillName(result.skillId);\n      const files = buildFileTree(result.files);\n\n      // Parse SKILL.md frontmatter into structured fields. Splitting\n      // frontmatter (name/description) from the markdown body keeps the\n      // body as the agent-facing `instructions` instead of polluting it\n      // with raw YAML metadata. SKILL.md missing or unparseable simply\n      // yields a null snapshot — registry-provided values then fill in.\n      const snapshot = parseSkillSnapshot(result.files);\n\n      const resolvedName = snapshot?.name ?? safeSkillId;\n      const description = snapshot?.description ?? `Imported from ${owner}/${repo}`;\n      const id = toSlug(resolvedName) || safeSkillId;\n","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/builder-registry.ts#L328-L364","documentation":"The install-skill handler fetches the skill's files from the upstream registry via fetchSkillFiles(owner, repo, skillName) and throws a 404 HTTPException when the fetch returns nothing or an empty file list. This means no skill matching skillName exists in the given owner/repo on the registry (or the registry returned no content).","triggerScenarios":"POSTing the install route with a skillName that does not exist in owner/repo; a repo path that exists but contains no skill files; a registry outage or partial response causing an empty result; wrong owner/repo casing or path.","commonSituations":"Typo in the skill name; skill renamed or removed upstream; browsing a repo root that has skills in a subdirectory; registry indexing lag for newly published skills.","solutions":["Verify the skill exists in owner/repo on the registry (browse the repo or registry search endpoint) and match the exact skillName.","Check owner/repo spelling and casing exactly as the registry indexes them.","Retry if the registry may have transient issues; empty results from an outage look like not-found.","If the skill was recently published, wait for registry indexing before installing."],"exampleFix":"// before\nawait install({ registryId, owner: 'acme', repo: 'skills', skillName: 'code-review ' }); // trailing space\n\n// after\nconst search = await searchRegistry(registryId, 'code-review');\nawait install({ registryId, owner: search.owner, repo: search.repo, skillName: search.name });","handlingStrategy":"validation","validationCode":"const results = await registrySearch(registryId, skillName);\nconst match = results.find(r => r.name === skillName && r.owner === owner && r.repo === repo);\nif (!match) throw new Error(`Skill \"${skillName}\" not found in ${owner}/${repo}; search first`);","typeGuard":null,"tryCatchPattern":"try {\n  await installSkill({ registryId, owner, repo, skillName });\n} catch (e) {\n  if (e.status === 404 && e.message.startsWith('Could not find skill')) {\n    // offer registry search UI to pick the correct skill\n  } else throw e;\n}","preventionTips":["Always install via IDs returned from registry search, never hand-typed names.","Trim and case-match skill names exactly as the registry indexes them.","Handle empty search results distinctly from network failures.","Re-check the skill exists after upstream renames or deletions."],"tags":["http-404","builder-registry","skills"],"backgroundTag":"resource-not-found-404","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}