{"record":{"id":"960485760c17f445","repo":"Hmbown/CodeWhale","slug":"github-source-must-be-github-owner-repo-got-sp","errorCode":null,"errorMessage":"github source must be 'github:owner/repo' (got {spec})","messagePattern":"github source must be 'github:owner/repo' \\(got (.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/skills/install.rs","lineNumber":130,"sourceCode":"    ///   [`InstallSource::GitHubRepo`]\n    /// * any other `http://` or `https://` prefix → [`InstallSource::DirectUrl`]\n    /// * anything else → [`InstallSource::Registry`]\n    pub fn parse(spec: &str) -> Result<Self> {\n        let trimmed = spec.trim();\n        if trimmed.is_empty() {\n            bail!(\"install source must not be empty\");\n        }\n        if let Some(rest) = trimmed.strip_prefix(\"github:\") {\n            let rest = rest.trim();\n            // Reject obviously bogus values up front. We intentionally accept\n            // case-insensitive owner/repo so `github:Hmbown/Foo` works.\n            let (owner, repo) = rest.split_once('/').with_context(|| {\n                format!(\"github source must be 'github:owner/repo' (got {spec})\")\n            })?;\n            let owner = owner.trim();\n            let repo = repo.trim().trim_end_matches('/');\n            if owner.is_empty() || repo.is_empty() {\n                bail!(\"github source must be 'github:owner/repo' (got {spec})\");\n            }\n            if owner.contains('/') || repo.contains('/') {\n                bail!(\"github source must be 'github:owner/repo' (got {spec})\");\n            }\n            return Ok(Self::GitHubRepo(format!(\"{owner}/{repo}\")));\n        }\n        if trimmed.starts_with(\"https://\") || trimmed.starts_with(\"http://\") {\n            if let Some(repo) = parse_github_browser_url(trimmed) {\n                return Ok(Self::GitHubRepo(repo));\n            }\n            return Ok(Self::DirectUrl(trimmed.to_string()));\n        }\n        Ok(Self::Registry(trimmed.to_string()))\n    }\n}\n\n/// Detect bare `https://github.com/<owner>/<repo>` URLs (with or without a\n/// trailing `.git`) and return `owner/repo`. Returns `None` for any URL that","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/skills/install.rs#L112-L148","documentation":"For a spec beginning with 'github:', parse splits owner/repo on '/'. If there is no '/' at all, split_once fails and this error is raised via with_context. It means the github: source did not have the required owner/repo shape.","triggerScenarios":"`InstallSource::parse(\"github:somerepo\")` or `parse(\"github:  \")` — a github: prefix with no slash separating owner and repo.","commonSituations":"Pasting just a repo name assuming a default owner; truncating a URL when copying; writing 'github:owner-repo' instead of 'github:owner/repo'.","solutions":["Include the owner and repo separated by a slash: github:owner/repo","If you have a full GitHub URL, paste the https:// URL instead and it will be parsed","Trim stray whitespace inside the spec"],"exampleFix":"// before\nskill install github:tokio-rs\n// after\nskill install github:tokio-rs/tokio","handlingStrategy":"validation","validationCode":"fn valid_github_spec(spec: &str) -> bool {\n    match spec.trim().strip_prefix(\"github:\") {\n        Some(rest) => rest.split_once('/').map_or(false, |(o, r)| !o.trim().is_empty() && !r.trim().is_empty()),\n        None => true, // not a github: spec\n    }\n}","typeGuard":null,"tryCatchPattern":"match InstallSource::parse(spec) {\n    Ok(src) => /* proceed */,\n    Err(e) if e.to_string().contains(\"github source must be\") => {\n        eprintln!(\"expected github:owner/repo, got: {spec}\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Always include owner and repo: github:owner/repo","Prefer pasting full https:// GitHub URLs — the parser accepts them","Trim whitespace inside the spec before passing"],"tags":["validation","install","github","format"],"backgroundTag":"invalid-argument-format","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}