MCPcopy Index your code
hub / github.com/shareAI-lab/learn-claude-code / _scan_skills

Function _scan_skills

s07_skill_loading/code.py:69–82  ·  view source on GitHub ↗

Scan skills/ dir, populate SKILL_REGISTRY with name/description/content.

()

Source from the content-addressed store, hash-verified

67SKILL_REGISTRY: dict[str, dict] = {}
68
69def _scan_skills():
70 """Scan skills/ dir, populate SKILL_REGISTRY with name/description/content."""
71 if not SKILLS_DIR.exists():
72 return
73 for d in sorted(SKILLS_DIR.iterdir()):
74 if not d.is_dir():
75 continue
76 manifest = d / "SKILL.md"
77 if manifest.exists():
78 raw = manifest.read_text()
79 meta, body = _parse_frontmatter(raw)
80 name = meta.get("name", d.name)
81 desc = meta.get("description", raw.split("\n")[0].lstrip("#").strip())
82 SKILL_REGISTRY[name] = {"name": name, "description": desc, "content": raw}
83
84_scan_skills()
85

Callers 1

code.pyFile · 0.70

Calls 3

existsMethod · 0.80
_parse_frontmatterFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected