Always sync the atomic-skills cache to latest. Unlike the plugin cache (which reuses until --force), the skills cache is **always** re-cloned on every install. This ensures new skills added to atomic-skills are picked up immediately without --force. If the re-clone fails (network), the error is returned — the caller can retry or use --from to install from a local checkout.
(_force: bool)
| 412 | /// re-clone fails (network), the error is returned — the caller can retry |
| 413 | /// or use --from to install from a local checkout. |
| 414 | fn sync_skills_cache(_force: bool) -> CliResult<std::path::PathBuf> { |
| 415 | const SKILLS_AGENT: &str = "atomic-skills"; |
| 416 | |
| 417 | let spec = atomic_agent::integrations::resolve(SKILLS_AGENT).ok_or_else(|| { |
| 418 | crate::error::CliError::Internal(anyhow::anyhow!( |
| 419 | "atomic-skills not found in the integration registry — this is a bug" |
| 420 | )) |
| 421 | })?; |
| 422 | |
| 423 | let cache = atomic_agent::integrations::cache_repo_dir(SKILLS_AGENT) |
| 424 | .map_err(|e| crate::error::CliError::Internal(anyhow::anyhow!(e.to_string())))?; |
| 425 | |
| 426 | // Always delete + re-clone to get latest. The atomic-skills package is |
| 427 | // small (markdown files only), so this is fast. |
| 428 | if cache.exists() { |
| 429 | std::fs::remove_dir_all(&cache).map_err(crate::error::CliError::Io)?; |
| 430 | } |
| 431 | |
| 432 | crate::commands::clone::Clone::new(spec.url.clone()) |
| 433 | .with_path(cache.display().to_string()) |
| 434 | .with_view(spec.view.clone()) |
| 435 | .run()?; |
| 436 | |
| 437 | Ok(cache) |
| 438 | } |
| 439 | |
| 440 | /// Sync an agent's integration package into the CLI-managed cache |
| 441 | /// (`~/.atomic/integrations/<agent>/repo`) using Atomic's own remote |
no test coverage detected