Skip to main content

Module skill_import

Module skill_import 

Source
Expand description

Bring a skill in from outside the catalog: a local folder, a git repository over HTTPS, or a single SKILL.md at an HTTPS URL. This module only reads and parses; it never writes the catalog. The caller shows the whole text (and a diff against what the catalog holds), and writes only what the person approved.

Limits are deliberate: HTTPS only (a git ext:: or file:// source would run or read something local), no symlinks followed, a size cap per file and a count cap per source.

Structs§

Candidate
One SKILL.md found in a source.
Scan
What a scan found, with the reasons anything was left out.

Functions§

fetch_git
Shallow-clone an HTTPS git repository into a scratch folder, scan it, delete the folder. The clone runs with every protocol but https switched off, never asks for a password, and is stopped when it runs past the time or size limit.
fetch_url
One SKILL.md fetched from an HTTPS URL.
parse_skill_md
Split a SKILL.md into name, description and body. Tolerant of what skills in the wild carry: quoted or bare values, a folded or literal block for the description, extra frontmatter fields (ignored) and CRLF line ends. Without frontmatter the whole text is the body.
scan_dir
Every SKILL.md under root (a skill folder, a pack of them, or one markdown file). A folder with its own SKILL.md is one skill and is not searched further. Symlinks are not followed.