pub fn extract_skill_metadata(content: &str) -> Result<SkillMetadata, String>Expand description
Extract skill metadata from SKILL.md content.
Parses YAML frontmatter to extract name and description, and counts sections (H2 headers) and words.
§Arguments
content- SKILL.md content with YAML frontmatter
§Returns
SkillMetadata with extracted information.
§Errors
Returns error if YAML frontmatter is missing or required fields not found.
§Examples
use mcp_execution_skill::extract_skill_metadata;
let content = r"---
name: github-progressive
description: GitHub MCP server operations
---
# Quick Start
Content here.
";
let metadata = extract_skill_metadata(content).unwrap();
assert_eq!(metadata.name, "github-progressive");
assert_eq!(metadata.description, "GitHub MCP server operations");