Migrate skills from legacy Ion formats to the current manifest and lockfile layout.

SkillsLockFile

Fields

NameTypeDescription
versionu32
skillsBTreeMap<String, SkillsLockEntry>

Trait Implementations

  • Debug
  • Deserialize<'de>

SkillsLockEntry

Fields

NameTypeDescription
sourceString
source_typeString
computed_hashString

Trait Implementations

  • Debug
  • Deserialize<'de>

DiscoveredSkill

Fields

NameTypeDescription
nameString
sourceOption<SkillSource>
versionOption<String>
installed_pathPathBuf
originDiscoveryOrigin

Trait Implementations

  • Debug
  • Clone

ResolvedSkill

Per-skill resolution provided by the CLI layer after prompting the user.

Fields

NameTypeDescription
nameString
sourceSkillSource
revOption<String>

MigrateOptions

Fields

NameTypeDescription
dry_runbool
manifest_optionsManifestOptions

DiscoveryOrigin

Variants

  • LockFile
  • AgentsDir
  • ClaudeDir

Trait Implementations

  • Debug
  • Clone
  • PartialEq
  • Eq

discover_from_lockfile

pub fn discover_from_lockfile(lockfile_path: &Path) -> Result<Vec<DiscoveredSkill>>

Parse a skills-lock.json file and return discovered skills.


discover_from_directories

pub fn discover_from_directories(project_dir: &Path) -> Result<Vec<DiscoveredSkill>>

Scan .agents/skills/ and .claude/skills/ for installed skills.


migrate

pub fn migrate(project_dir: &Path, resolved: &[ResolvedSkill], options: &MigrateOptions) -> Result<Vec<LockedSkill>>

Execute migration for a list of resolved skills. Returns (migrated count, list of locked skills).


discover_leftover_skills

pub fn discover_leftover_skills(project_dir: &Path, migrated_names: &HashSet<String>, target_paths: &[String]) -> Result<Vec<DiscoveredSkill>>

Scan agent skill directories for non-symlink skill directories that weren’t migrated. These are “leftover” skills that need to be either matched to a known remote skill or treated as project-specific custom skills.


move_skill_to_local

pub fn move_skill_to_local(project_dir: &Path, skill: &DiscoveredSkill, options: &ManifestOptions) -> Result<()>

Move a leftover skill directory to .agents/skills/<name>/ and create symlinks from target directories back to it. This is used for custom project-specific skills that don’t match any known remote skill.