{"record":{"id":"8a77adff8e6eda56","repo":"zed-industries/zed","slug":"not-a-skill-share-link","errorCode":null,"errorMessage":"not a skill share link","messagePattern":"not a skill share link","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/agent_skills/agent_skills.rs","lineNumber":835,"sourceCode":"/// The contents are base64url-encoded (no padding) so the link is\n/// self-contained and URL-safe: the recipient doesn't need the skill to be\n/// hosted anywhere. Recover the contents with [`decode_skill_share_link`].\npub fn encode_skill_share_link(skill_file_content: &str) -> String {\n    use base64::Engine as _;\n    let data =\n        base64::engine::general_purpose::URL_SAFE_NO_PAD.encode(skill_file_content.as_bytes());\n    let mut url = Url::parse(SKILL_SHARE_LINK_PREFIX).expect(\"skill share link prefix is valid\");\n    url.query_pairs_mut()\n        .append_pair(SKILL_SHARE_LINK_DATA_PARAM, &data);\n    url.into()\n}\n\n/// Recover the `SKILL.md` contents embedded in a `zed://skill?data=…` link\n/// produced by [`encode_skill_share_link`].\npub fn decode_skill_share_link(link: &str) -> Result<String> {\n    use base64::Engine as _;\n    let url = Url::parse(link).context(\"skill share link is not a valid URL\")?;\n    anyhow::ensure!(\n        url.scheme() == SKILL_SHARE_LINK_SCHEME && url.host_str() == Some(SKILL_SHARE_LINK_HOST),\n        \"not a skill share link\"\n    );\n    let data = url\n        .query_pairs()\n        .find_map(|(key, value)| (key == SKILL_SHARE_LINK_DATA_PARAM).then_some(value))\n        .context(\"skill share link is missing the `data` parameter\")?;\n    let bytes = base64::engine::general_purpose::URL_SAFE_NO_PAD\n        .decode(data.as_bytes())\n        .context(\"skill share link `data` is not valid base64\")?;\n    anyhow::ensure!(\n        bytes.len() <= MAX_SKILL_FILE_SIZE,\n        \"shared skill exceeds the maximum size of {MAX_SKILL_FILE_SIZE} bytes\"\n    );\n    let content = String::from_utf8(bytes).context(\"skill share link `data` is not valid UTF-8\")?;\n    Ok(content)\n}\n","sourceCodeStart":817,"sourceCodeEnd":853,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/agent_skills/agent_skills.rs#L817-L853","documentation":"Error \"not a skill share link\" thrown in zed-industries/zed.","triggerScenarios":"Thrown at crates/agent_skills/agent_skills.rs:835 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}