Clone Skill
Clone a skill into skills/, run a mandatory static security audit before it touches the repo, validate, and register it in the README.
Arguments
<source> [new-name]
source— one of: an existing skill name inskills/, a local path to a directory containingSKILL.md, or a git URL (append#<subdir>when the skill lives in a subdirectory of the repo).new-name— kebab-case target directory name. Required when duplicating an in-repo skill; defaults to the source directory name otherwise.
Audit-only mode: if the user asked only to audit (no cloning implied), run steps 3–4 against the skill in place and report the verdict. Skip staging and integration.
Steps
- Resolve the source.
skills/<source>/SKILL.mdexists → in-repo duplicate. Requirenew-name, and it must differ fromsource.- Local path with
SKILL.md→ external local skill. - Git URL →
git clone --depth 1 <url> "$(mktemp -d)", then locate the directory containingSKILL.md(use the#<subdir>fragment if given; if multiple candidates, list them and ask which). - No
SKILL.mdfound → stop and report what was found instead.
- Stage. Copy the skill directory to a temp staging dir (
mktemp -d). Never copy intoskills/before the audit passes. Ifskills/<new-name>already exists, stop and ask. - Security audit — mandatory, static only. Read
references/security-audit.mdand follow it exactly. Read every file in the staged copy completely. Never execute anything from the skill during the audit. - Act on the verdict.
FAIL→ delete the staging copy, do not integrate, present all findings with evidence.PASS WITH WARNINGS→ present findings, ask the user whether to proceed.PASS→ continue.
- Integrate. Move the staged copy to
skills/<new-name>. Then:- Set frontmatter
nameto<new-name>. - For in-repo duplicates: rewrite
description— two skills with identical trigger phrases collide at retrieval time, so the clone must state its own distinct triggers (ask the user for the clone's purpose if unclear). chmod +xany files underscripts/; verify scripts use paths relative to the skill directory.- Reject or flag symlinks that point outside the skill directory.
- Set frontmatter
- Validate. Run
python3 scripts/validate.pyfrom the repo root — must exit 0. - Register. Add a row for the skill to the README "Skills" table, keeping it alphabetical.
- Report. Source, destination, audit verdict with findings summary, validation result. Note that changes are uncommitted.
Edge cases
- Source frontmatter has keys outside this repo's known set → keep them, but include the validator warning in the report.
- Binary or minified files in the source → the audit covers this (unauditable content fails).
- Git clone requires auth or fails → report the exact error; do not retry with credentials.
- Temp dirs (clone + staging) → remove them once done, including on failure.