What is discover_skills()?
discover_skills() walks configured skill directories — typically a repository-level skills/ folder, optional user-global directories, and any registered registries — and returns lightweight metadata for each SKILL.md it finds. The scan parses front matter and titles so you can populate pickers, CLI menus, or startup banners without loading full markdown bodies into memory. Actual skill text and bundled assets load later through activate_skill(), which keeps cold-start latency predictable when dozens of skills exist.
Treat discovery as an IO-heavy operation tied to the filesystem layout: CI containers must include the same paths as developer laptops, and Kubernetes pods should mount ConfigMaps or init containers that materialize skills before agents boot. Caching the manifest in process memory is normal; re-run discovery when you hot-reload configuration or detect file watchers firing in dev.
Security-wise, manifests still reveal names and descriptions that might include proprietary codenames. Do not expose raw discovery output directly to untrusted tenants without filtering paths to their own skill roots.
Use Cases
- • Boot-time inventory
- • Building skill pickers
Key Features
- ✓ Filesystem + registry scan
- ✓ Returns lightweight manifests
When NOT to Use
Hot paths — discovery hits the filesystem.
Notes
Path drift across environments
Relative skill roots resolve against the process cwd. Pin absolute paths in production settings or chdir explicitly before discovery.
Partial SKILL.md errors
Malformed markdown in one skill should not crash the whole manifest — but log validation warnings so broken files do not silently disappear from menus.
Version skew
Skills authored for newer CrewAI features may declare metadata your runtime ignores. Encode a minimum_crewai_version in description text until the framework enforces it.
Relationship to activate_skill
Discovery tells you what exists; activation pays the token and tool wiring cost. Keep the two phases separate in UX so operators understand billing impact.
Code Examples
List
for s in discover_skills():
print(s.name)
Startup cache
from functools import lru_cache
@lru_cache(maxsize=1)
def skill_index():
return {s.name: s for s in discover_skills()}
manifest = skill_index()
When to Use
On startup to enumerate available skills.
Common Mistakes
❌ Calling per-task and re-scanning the filesystem
✅ Cache the result at startup.
Related: @tool decorator reference, Agent class reference, and the first Crew tutorial.
discover_skills() FAQ
What is discover_skills() in CrewAI?
Scans for available SKILL.md files and returns a manifest of skills. discover_skills() walks configured skill directories — typically a repository-level skills/ folder, optional user-global directories, and any registered registries — and returns lightweight metadata for each SKILL.md it finds. The scan parses front matter and titles so you can populate pickers, CLI menus, or startup banners without loading full markdown bodies into memory. Actual skill text and bundled assets load later through activate_skill(), which keeps cold-start latency…
Which CrewAI types expose the method discover_skills()?
DevShelfHub documents discover_skills() on Skills. The reference maps it to Python module crewai.skills — pin your installed crewai version and match imports to the snippet on this page.
When should I use discover_skills()?
On startup to enumerate available skills.
When should I avoid discover_skills()?
Hot paths — discovery hits the filesystem.
How do I call discover_skills() from Python?
skills = discover_skills()
Where can I explore more CrewAI API reference pages?
Open the CrewAI API reference index on DevShelfHub to search classes, methods, and decorators, each with runnable examples, parameters, common mistakes, and cross-links.