Skip to main content

unique_skill_slug

Function unique_skill_slug 

Source
pub(crate) fn unique_skill_slug(
    name: &str,
    used: &mut HashSet<String>,
) -> String
Expand description

Derive a filesystem-safe, COLLISION-FREE, spec-valid slug for an Agent Skill name within one caller-scoped used set. skill_name_slug alone can produce identical output for distinct names that differ only in punctuation/whitespace (e.g. “Deploy Checklist” and “Deploy!!!Checklist” both -> “deploy-checklist”), which would otherwise silently overwrite one skill’s SKILL.md with another’s on disk (reagent P1, PR #2322). Appends -2, -3, … until the slug is unique within used, truncating the base first so the suffixed result never exceeds the spec’s 64-character max (Codex P2, PR #2322 — a 64-char base plus -2 was previously 66 chars).