Skip to main content

Module archive

Module archive 

Source
Expand description

Shared skill-archive extraction.

Stateless helpers for extracting skill .zip archives into a target directory. Both the ClawHub marketplace installer and the user-driven .skill file import use these so that the Zip-Slip defense ([crate::skill::is_safe_relative_path]) and the SKILL.md marker detection live in exactly one place.

Functionsยง

extract_skill_zip
Extract a skill zip into target, stripping the detected skill-root prefix so contents land flat in target. Defends against Zip Slip via [crate::skill::is_safe_relative_path].
find_skill_md
Locate the first SKILL.md (case-insensitive) within dir recursively. Returns its path, or None if no marker is present.
find_skill_root
Find the directory prefix inside the archive that contains a SKILL.md marker. Returns "" when the marker sits at the archive root.