{"record":{"id":"1d3c71e90143adb8","repo":"mastra-ai/mastra","slug":"could-not-find-skill-skillname-for-owner-1d3c71","errorCode":null,"errorMessage":"Could not find skill \"${skillName}\" for ${owner}/${repo}","messagePattern":"Could not find skill \"(.+?)\" for (.+?)/(.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"packages/server/src/server/handlers/workspace.ts","lineNumber":1382,"sourceCode":"  path: '/workspaces/:workspaceId/skills-sh/preview',\n  responseType: 'json',\n  pathParamSchema: workspaceIdPathParams,\n  queryParamSchema: skillsShPreviewQuerySchema,\n  responseSchema: skillsShPreviewResponseSchema,\n  summary: 'Preview skill content',\n  description: 'Fetches the skill content from the Skills API.',\n  tags: ['Workspace', 'Skills'],\n  handler: async ({ owner, repo, path: skillName }) => {\n    try {\n      const controller = new AbortController();\n      const timeoutId = setTimeout(() => controller.abort(), 10000);\n\n      const url = `${SKILLS_SH_API_URL}/api/skills/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/${encodeURIComponent(skillName)}/content`;\n      const response = await fetch(url, { signal: controller.signal });\n      clearTimeout(timeoutId);\n\n      if (!response.ok) {\n        throw new HTTPException(404, {\n          message: `Could not find skill \"${skillName}\" for ${owner}/${repo}`,\n        });\n      }\n\n      const data = (await response.json()) as { instructions: string; raw: string };\n      const content = data.instructions || data.raw || '';\n\n      if (!content) {\n        throw new HTTPException(404, {\n          message: `No content available for skill \"${skillName}\"`,\n        });\n      }\n\n      return { content };\n    } catch (error) {\n      if (error instanceof HTTPException) {\n        throw error;\n      }","sourceCodeStart":1364,"sourceCodeEnd":1400,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/workspace.ts#L1364-L1400","documentation":"HTTPException 404 thrown by the fetch-skill-instructions handler when the skills.sh content endpoint (${SKILLS_SH_API_URL}/api/skills/{owner}/{repo}/{skillName}/content) responds with a non-ok status, meaning the named skill could not be retrieved for that owner/repo.","triggerScenarios":"GET on the workspace skill-instructions route with an owner/repo/skillName combination for which the upstream content endpoint returns 404 or any other non-ok response.","commonSituations":"Typo in skill name or repo slug; skill renamed or unpublished; repo is private so the content endpoint cannot see it; case mismatch between requested and registered skill name.","solutions":["Verify the exact skill name and owner/repo slugs against the skills.sh registry before calling.","Check that the repository is public (or provide credentials the upstream API accepts).","If the skill was renamed, update the request to the new skill identifier; handle the 404 gracefully in the client UI."],"exampleFix":"// before\nawait fetch(`/api/workspaces/${id}/skills/instructions?skillName=SkilName`);\n// after\nawait fetch(`/api/workspaces/${id}/skills/instructions?skillName=SkillName`); // exact registry name","handlingStrategy":"try-catch","validationCode":"// Validate identifiers before calling\nfunction isValidSlug(s) { return typeof s === 'string' && /^[a-zA-Z0-9._-]+$/.test(s); }\nif (!isValidSlug(skillName) || !isValidSlug(owner) || !isValidSlug(repo)) throw new Error('Invalid owner/repo/skillName');","typeGuard":"function isSkillNotFound(e: unknown): boolean {\n  return e instanceof Error && /Could not find skill/.test(e.message);\n}","tryCatchPattern":"try {\n  const { content } = await fetchSkillInstructions(owner, repo, skillName);\n} catch (e) {\n  if (isSkillNotFound(e)) {\n    console.warn(`Skill ${skillName} not found in ${owner}/${repo}; check the registry slug.`);\n    return null; // graceful degradation\n  }\n  throw e;\n}","preventionTips":["Autocomplete/validate skill names against the registry before requesting content.","Handle 404 in UI with a 'skill not found — check name/repo' message rather than a raw failure.","Watch for upstream renames; pin skill identifiers where possible."],"tags":["http-404","not-found","upstream-api","skills"],"backgroundTag":"skill-not-found","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}