use std::path::{Path, PathBuf};
const SKILL_BODY: &str = include_str!("skill/SKILL.md");
#[must_use]
pub fn render(command_reference: &str) -> String {
format!(
"{}\n\n## Command reference\n\nAuto-generated from `conclave --help` — the authoritative, always-current flag list for every verb.\n\n{}\n",
SKILL_BODY.trim_end(),
command_reference.trim_end(),
)
}
#[must_use]
pub fn install_path(skills_dir: &Path) -> PathBuf {
skills_dir.join("conclave").join("SKILL.md")
}
#[cfg(test)]
mod tests {
#![allow(clippy::unwrap_used)]
use super::*;
use pretty_assertions::assert_eq;
#[test]
fn skill_render_has_frontmatter_and_appends_the_reference() {
let rendered = render("### conclave register\n```\n--username ...\n```");
assert!(rendered.starts_with("---\n"), "skill must start with YAML frontmatter: {}", &rendered[..40]);
assert!(rendered.contains("name: conclave"));
assert!(rendered.contains("join_channel"), "skill must document joining via the bridge tool");
assert!(rendered.contains("## Command reference"));
assert!(rendered.contains("conclave register"));
}
#[test]
fn skill_install_path_targets_the_conclave_skill_dir() {
assert_eq!(install_path(Path::new("/home/x/.claude/skills")), Path::new("/home/x/.claude/skills/conclave/SKILL.md"));
}
}