Hmbown/CodeWhale · error

skill was imported locally

Error message

skill was imported locally (spec '{spec}') and cannot be updated from a registry; re-import or remove it first

What it means

Before updating a skill from a registry, the library reads the INSTALLED_FROM marker written at import time and checks that its spec is registry-updatable. If the skill was imported from a local path (or the spec is empty/non-registry), there is no registry source to update from, so the update is refused with guidance to re-import or remove first.

Solutions

  1. Remove the locally imported skill and install it from the registry if a registry version exists
  2. Re-import the updated local copy from its source path instead of using update
  3. Check the INSTALLED_FROM marker's spec field; if it is empty or malformed, re-import to rewrite it correctly
  4. If the skill is published to a registry now, re-install from the registry once so the marker records an updatable spec
Defensive patterns

Strategy: type-guard

Validate before calling

fn is_registry_updatable(install_dir: &Path) -> std::io::Result<bool> {
    let marker = install_dir.join(install::INSTALLED_FROM_MARKER);
    let value: serde_json::Value = serde_json::from_str(&std::fs::read_to_string(marker)?)?;
    let spec = value.get("spec").and_then(|v| v.as_str()).unwrap_or_default();
    Ok(install::is_registry_updatable_spec(spec))
}

Type guard

fn updatable_spec(marker: &MarkerFile) -> Option<&str> {
    let spec = marker.spec.as_str()?;
    install::is_registry_updatable_spec(spec).then_some(spec)
}

Try / catch

match mutation::execute(update_request, &ctx).await {
    Err(e) if e.to_string().contains("imported locally") => {
        eprintln!("local import: re-import from source or remove, then install from registry");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling update_skill (or a name-based Update) on a skill whose .codewhale install marker has a spec that is_registry_updatable_spec rejects — e.g. spec "file:///path/to/skill", a bare local path, or a missing/empty spec field.

Common situations: User imported a skill from a local folder during development and later runs the update command expecting a registry refresh; a marker file written by an older version lacks the spec field; the marker was hand-edited into a non-registry value.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/5499b46925776202. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/skills/mutation.rs:580

            "skill content changed since audit (expected {expected}, found {current}); \
             re-review before mutating"
        );
    }
    Ok(Some(current))
}

fn ensure_remote_updatable(skill_dir: &Path) -> Result<()> {
    let marker_path = skill_dir.join(install::INSTALLED_FROM_MARKER);
    let body = fs::read_to_string(&marker_path)
        .with_context(|| format!("failed to read {}", marker_path.display()))?;
    let value: serde_json::Value = serde_json::from_str(&body)
        .with_context(|| format!("malformed {}", install::INSTALLED_FROM_MARKER))?;
    let spec = value
        .get("spec")
        .and_then(|v| v.as_str())
        .unwrap_or_default();
    if !install::is_registry_updatable_spec(spec) {
        bail!(
            "skill was imported locally (spec '{spec}') and cannot be updated from a registry; \
             re-import or remove it first"
        );
    }
    Ok(())
}

async fn install_remote(
    source: InstallSource,
    target: SkillTargetScope,
    ctx: &MutationContext<'_>,
) -> Result<SkillMutationReceipt> {
    let skills_dir = prepare_owned_target(ctx.workspace, ctx.home, target)?;
    let anchor = owned_anchor(ctx.workspace, ctx.home, target)?;

    let outcome = install::install_with_registry(
        source,
        &skills_dir,

View on GitHub (pinned to 73e0f67d83)