Hmbown/CodeWhale · error

skill ' ' was imported locally (spec ' ') and cannot be…

Error message

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

What it means

`update_with_registry` refuses to update a skill whose `.installed-from` marker records a locally imported source (e.g. a local directory) rather than a registry-updatable spec. Registry updates only make sense for specs the registry can re-fetch; local imports have no upstream artifact. The user must re-import the skill locally or remove it and install it from a registry.

Solutions

  1. Remove the locally imported skill (`uninstall`) and install it from the registry so it has an updatable spec
  2. Re-import the skill locally from the newer local source instead of updating
  3. Edit the `.installed-from` marker to a registry-updatable spec only if you truly know the upstream provenance

Example fix

// before
update("my-skill", &skills_dir, MAX, &network).await?; // fails: imported locally
// after
uninstall("my-skill", &skills_dir)?;
install("registry:my-skill", &skills_dir, MAX, &network, false).await?;
update("my-skill", &skills_dir, MAX, &network).await?;
Defensive patterns

Strategy: validation

Validate before calling

fn is_locally_imported(marker_body: &str) -> bool {
    let spec = serde_json::from_str::<InstalledFromMarker>(marker_body).map(|m| m.spec).unwrap_or_default();
    !is_registry_updatable_spec(&spec)
}

Try / catch

match update(name, &skills_dir, MAX, &network).await {
    Err(e) if e.to_string().contains("imported locally") => reimport_or_remove(name)?,
    other => other?,
}

Prevention

When it happens

Trigger: Calling `update_with_registry(name, ...)` (or `update(name, ...)`) on a skill whose `.installed-from` marker spec fails `is_registry_updatable_spec` — i.e. the skill was placed via local import, not registry/GitHub/tarball install.

Common situations: User imported a skill from a local folder with `skills import`, then later runs the update command for it; skills synced between machines whose marker records a machine-local path; a registry was later added and the user assumes all skills update from it.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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

Appendix: source

Thrown at crates/tui/src/skills/install.rs:453

    max_size: u64,
    network: &NetworkPolicy,
    registry_url: &str,
) -> Result<UpdateResult> {
    let target = skill_target_path(name, skills_dir)?;
    if tokio::fs::try_exists(&target).await.unwrap_or(false) {
        ensure_target_within_skills_dir(&target, skills_dir)?;
    }
    let marker_path = target.join(INSTALLED_FROM_MARKER);
    if !tokio::fs::try_exists(&marker_path).await.unwrap_or(false) {
        return Err(InstallError::NotInstalledHere(name.to_string()).into());
    }
    let marker_body = tokio::fs::read_to_string(&marker_path)
        .await
        .with_context(|| format!("failed to read {}", marker_path.display()))?;
    let marker: InstalledFromMarker = serde_json::from_str(&marker_body)
        .with_context(|| format!("malformed {INSTALLED_FROM_MARKER} for {name}"))?;
    if !is_registry_updatable_spec(&marker.spec) {
        bail!(
            "skill '{name}' was imported locally (spec '{}') and cannot be updated from a registry; \
             re-import or remove it first",
            marker.spec
        );
    }

    // Re-resolve the URL, taking the existing checksum as a short-circuit hint:
    // we still hit the network so the user gets a useful "no upstream change"
    // signal, but we skip the unpack step if the bytes match.
    let source = InstallSource::parse(&marker.spec)?;
    let urls = match candidate_urls(&source, network, registry_url).await? {
        UrlResolution::Resolved(urls) => urls,
        UrlResolution::NeedsApproval(host) => return Ok(UpdateResult::NeedsApproval(host)),
        UrlResolution::Denied(host) => return Ok(UpdateResult::NetworkDenied(host)),
    };
    let (bytes, _url) = match download_first_success(&urls, network, max_size).await? {
        DownloadOutcome::Bytes { bytes, url } => (bytes, url),
        DownloadOutcome::NeedsApproval(host) => return Ok(UpdateResult::NeedsApproval(host)),

View on GitHub (pinned to 73e0f67d83)