pub async fn run(
server: String,
servers_dir: Option<PathBuf>,
output_path: Option<PathBuf>,
skill_name: Option<String>,
hints: Vec<String>,
overwrite: bool,
output_format: OutputFormat,
) -> Result<ExitCode>Expand description
Runs the skill command.
Scans generated progressive loading TypeScript files and prepares context for generating a Claude Code instruction skill (SKILL.md).
§Process
- Validates server ID format
- Determines servers directory (default: ~/.claude/servers)
- Validates path security (no symlink escape)
- Scans TypeScript files in
{servers_dir}/{server}/ - Builds skill generation context
- Returns structured output with generation prompt
§Arguments
server- Server identifier (e.g., “github”)servers_dir- Base directory for generated servers (default: ~/.claude/servers)output_path- Custom output path for SKILL.md (default: ~/.claude/skills/{server}/SKILL.md)skill_name- Custom skill name (default: {server}-progressive)hints- Use case hints for skill generationoverwrite- Whether to overwrite existing SKILL.md fileoutput_format- Output format (json, text, pretty)
§Errors
Returns an error if:
- Server ID format is invalid
- Servers directory does not exist
- Server subdirectory does not exist
- Path traversal detected
- TypeScript files cannot be scanned
§Examples
use mcp_execution_cli::commands::skill;
use mcp_execution_core::cli::OutputFormat;
// Generate skill for GitHub server
let exit_code = skill::run(
"github".to_string(),
None,
None,
None,
vec![],
false,
OutputFormat::Json
).await?;