Expand description
Skills module for AGPM
This module provides functionality for managing Claude Skills, which are directory-based resources containing a SKILL.md file with frontmatter and optional supporting files.
§What are Skills?
Skills are directories that:
- Contain a SKILL.md file with required YAML frontmatter
- May include additional files (REFERENCE.md, scripts, examples)
- Install to
.claude/skills/<name>/as directories - Can declare dependencies on other resources
- Support patching for customization
§SKILL.md Format
---
name: Skill Name
description: What this skill does
version: 1.0.0 # optional
allowed-tools: Read, Grep # optional
dependencies: # optional
agents:
- path: agents/helper.md
---
# Skill content in markdown§Async vs Sync Functions
This module uses a hybrid async/sync approach for performance and compatibility:
-
validate_skill_size: Async wrapper around syncwalkdir. Integrates with the async installer pipeline while usingspawn_blockingfor the actual I/O. This prevents blocking the Tokio runtime during directory traversal. -
extract_skill_metadata: Async for the same reason - wraps sync directory iteration inspawn_blockingto avoid blocking async contexts. -
collect_skill_directory_info: Sync helper that performs the actual directory walk. Called viaspawn_blockingfrom async functions. Useswalkdirwhich is inherently synchronous. -
validate_skill_frontmatter: Pure sync function that only parses in-memory YAML. No I/O, so no need for async.
The walkdir crate is synchronous, so we wrap it in spawn_blocking rather than
using a fake async interface. This is the recommended Tokio pattern for CPU-bound
or blocking I/O operations.
Modules§
- patches
- Skill-specific patch support for modifying SKILL.md frontmatter.
Structs§
- Skill
Directory Info - Information collected from iterating over a skill directory.
- Skill
Frontmatter - Frontmatter structure for SKILL.md files
Functions§
- extract_
skill_ metadata - Extract metadata from a skill directory.
- extract_
skill_ metadata_ from_ info - Extract metadata from pre-collected skill directory info.
- validate_
skill_ frontmatter - Validate and extract frontmatter from SKILL.md content
- validate_
skill_ size - Validate skill directory size and file count before installation.