Code-local skills middleware adapter for plugin namespaces.
Qualify a skill name under its plugin namespace.
Nested skill directories contribute intermediate :-joined segments
between the plugin namespace and the skill name, matching the plugin skill
naming convention (e.g. plugin:sub:review).
Merge one skill into merged by name, last-one-wins.
Emits one DEBUG log whenever a skill replaces an already-merged skill with
the same name, recording the skill name plus the previous and replacement
source paths and labels so the winning definition is unambiguous. Nothing is
logged when there is no collision.
Callers must iterate sources in ascending precedence order so the replacing skill is always the higher-precedence one.
Return (skill_dir, subfolders) pairs found under source_path.
Walks the source tree, treating any directory that directly contains a
SKILL.md as a skill directory (a recursion leaf, like a plugin walker).
subfolders holds the directory names between the source
root and the skill directory, excluding the skill directory's own name.
Async counterpart of discover_skill_dirs.
Load and namespace every skill found under a plugin source.
Reads each discovered skill directory's SKILL.md directly, since the SDK
loader only scans one level below a source and would not read a leaf
directory's own SKILL.md. Nested directories become :-joined namespace
segments (e.g. plugin:foo:bar:review).
Async counterpart of load_namespaced_skills.
Load namespaced plugin skills without extending the SDK source API.
Wraps the SDK SkillsMiddleware. Sources without a namespace load exactly
as the SDK loads them. Sources carrying a plugin namespace are walked
recursively so nested skill directories (skills/foo/bar/review/SKILL.md)
are discovered, and each skill's name is qualified as
plugin_id:foo:bar:review before the last-one-wins merge — matching
the plugin skill naming convention.