//! Arguments for `mcptest skill`.

use std::path::PathBuf;

use clap::{Args, ValueEnum};

/// Which coding agent `mcptest skill` targets.
///
/// Claude Code gets the `.claude` skill pack; the others get an `AGENTS.md`
/// authoring guide plus a registration of the mcptest MCP server in that
/// client's own config so it can call the authoring verbs.
#[derive(Debug, Clone, Copy, Default, ValueEnum)]
pub enum SkillAgentArg {
    /// Claude Code skill pack (default).
    #[default]
    Claude,
    /// Codex: AGENTS.md guide + `~/.codex/mcp.json` registration.
    Codex,
    /// Cursor: AGENTS.md guide + `~/.cursor/mcp.json` registration.
    Cursor,
    /// Windsurf: AGENTS.md guide + Windsurf mcp-config registration.
    Windsurf,
}

/// Args for `mcptest skill`.
///
/// Prints the packaged "test-mcp-server" agent skill to stdout by
/// default (like `mcptest prompt`). With `--install` it writes the skill
/// pack (Claude Code) or an `AGENTS.md` guide plus an MCP-server
/// registration (Codex, Cursor, Windsurf), selected with `--agent`.
#[derive(Debug, Args, Default)]
pub struct SkillArgs {
    /// Install the skill and subagent instead of printing the skill.
    /// Writes `.claude/skills/test-mcp-server/SKILL.md` and
    /// `.claude/agents/mcp-server-tester.md` under the current directory.
    #[arg(long = "install")]
    pub install: bool,

    /// Install under `~/.claude` instead of the project-level `.claude`.
    #[arg(long = "global", requires = "install", conflicts_with = "dir")]
    pub global: bool,

    /// Install under this base directory instead of a `.claude`
    /// directory (the `skills/` and `agents/` trees are created
    /// beneath it).
    #[arg(long = "dir", value_name = "DIR", requires = "install")]
    pub dir: Option<PathBuf>,

    /// Overwrite files that already exist at the install paths.
    #[arg(long = "force", requires = "install")]
    pub force: bool,

    /// Which coding agent to target: claude (default), codex, cursor, or
    /// windsurf. Non-claude agents write an AGENTS.md guide and register the
    /// mcptest MCP server in that client's config.
    #[arg(long = "agent", value_enum, default_value_t = SkillAgentArg::Claude)]
    pub agent: SkillAgentArg,
}
