//! Handler for `mcptest skill`.

use anyhow::Result;

use crate::cli::args::{SkillAgentArg, SkillArgs};
use crate::commands;

/// Dispatch `mcptest skill` to the bundled skill print/install command.
pub(crate) fn skill_command(args: SkillArgs) -> Result<i32> {
    let agent = match args.agent {
        SkillAgentArg::Claude => commands::SkillAgent::Claude,
        SkillAgentArg::Codex => commands::SkillAgent::Codex,
        SkillAgentArg::Cursor => commands::SkillAgent::Cursor,
        SkillAgentArg::Windsurf => commands::SkillAgent::Windsurf,
    };
    commands::run_skill(commands::SkillRunArgs {
        install: args.install,
        global: args.global,
        dir: args.dir,
        force: args.force,
        agent,
    })
}
