//! Deploy the embedded SKILL.md to ~/.claude/skills/adom-video-post/SKILL.md
//! so Claude Code finds it via trigger words.

use std::fs;
use std::path::PathBuf;

const SKILL_MD: &str = include_str!("../SKILL.md");

pub fn install() -> Result<PathBuf, String> {
    let home = std::env::var("HOME").map_err(|_| "HOME env var not set".to_string())?;
    let dir = PathBuf::from(home).join(".claude").join("skills").join("adom-video-post");
    fs::create_dir_all(&dir).map_err(|e| format!("create {}: {}", dir.display(), e))?;
    let path = dir.join("SKILL.md");
    fs::write(&path, SKILL_MD).map_err(|e| format!("write {}: {}", path.display(), e))?;
    Ok(path)
}