Skip to main content

mcp_execution_skill/
lib.rs

1//! Skill generation for MCP progressive loading.
2//!
3//! This crate provides functionality to generate Claude Code skill files (SKILL.md)
4//! from generated progressive loading TypeScript files.
5//!
6//! # Architecture
7//!
8//! The skill generation flow:
9//! 1. `parser` - Reads the `_meta.json` sidecar emitted by codegen
10//! 2. `context` - Builds structured context from parsed tools
11//! 3. `template` - Renders Handlebars template with context
12//!
13//! # Examples
14//!
15//! ```no_run
16//! use mcp_execution_skill::{scan_tools_directory, build_skill_context, ScanError};
17//! use std::path::Path;
18//!
19//! # async fn example() -> Result<(), ScanError> {
20//! let result = scan_tools_directory(Path::new("~/.claude/servers/github")).await?;
21//! let context = build_skill_context("github", &result.tools, None);
22//! # Ok(())
23//! # }
24//! ```
25#![warn(missing_docs, missing_debug_implementations)]
26
27mod context;
28mod output_path;
29mod parser;
30mod template;
31pub mod types;
32
33pub use context::build_skill_context;
34pub use output_path::{OutputPathError, resolve_skill_output_path};
35pub use parser::{
36    MAX_FILE_SIZE, MAX_FRONTMATTER_SIZE, MAX_TOOL_FILES, ParsedParameter, ParsedToolFile,
37    ScanError, ScanResult, SkillMetadataError, extract_skill_metadata, scan_tools_directory,
38};
39pub use template::{TemplateError, render_generation_prompt, render_skill_md};
40pub use types::{
41    GenerateSkillParams, GenerateSkillResult, MAX_SERVER_ID_LENGTH, SaveSkillParams,
42    SaveSkillResult, SkillCategory, SkillMetadata, SkillServerIdError, SkillTool, ToolExample,
43    validate_server_id,
44};