{"record":{"id":"d3d42cd0c348e3c4","repo":"Hmbown/CodeWhale","slug":"import-source-must-be-a-compatible-external-skill","errorCode":null,"errorMessage":"import source must be a compatible external skill","messagePattern":"import source must be a compatible external skill","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/skills/mutation.rs","lineNumber":651,"sourceCode":"            scope: target.as_skill_scope(),\n            safe_target_path: safe_display_path(&skills_dir, Some(ctx.workspace), ctx.home),\n            before_digest: None,\n            after_digest: None,\n            outcome: SkillMutationOutcome::NetworkDenied(host),\n        }),\n    }\n}\n\nfn import_external(\n    source_id: AuditedSkillId,\n    expected_digest: String,\n    target: SkillTargetScope,\n    conflict_policy: ConflictPolicy,\n    ctx: &MutationContext<'_>,\n) -> Result<SkillMutationReceipt> {\n    let (source_skill, source_path) = find_audited_skill(ctx, &source_id)?;\n    if source_skill.source_kind != SkillSourceKind::CompatibleExternal {\n        bail!(\"import source must be a compatible external skill\");\n    }\n    if source_skill.path_unsafe {\n        bail!(\"refusing to import unsafe external skill package\");\n    }\n\n    let owned_snap = scan_with_configured(\n        ctx.workspace,\n        ctx.home,\n        ctx.configured_skills_dir,\n        SkillAuditMode::OwnedOnly,\n        None,\n    );\n    let owned_has_name = owned_snap\n        .skills\n        .iter()\n        .any(|s| s.id.canonical_name == source_id.canonical_name);\n\n    if !owned_has_name && !source_skill.import_candidate {","sourceCodeStart":633,"sourceCodeEnd":669,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/skills/mutation.rs#L633-L669","documentation":"Raised in import_external when the audited source skill's source_kind is not CompatibleExternal. The import flow only copies skills that the audit scanner classified as compatible external packages (e.g. externally installed skill directories); importing a built-in, managed, or otherwise classified skill is rejected by this guard on the AuditedSkillId's source_kind field.","triggerScenarios":"Thrown at crates/tui/src/skills/mutation.rs:651 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an AuditedSkillId whose audit entry reports SkillSourceKind::CompatibleExternal","Re-run the skill audit/scan so the source is classified from its current on-disk location","Use the appropriate flow (update/trust) instead of import for managed or owned skills"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}