use trusty_mpm::core::bundle::{
DOCUMENTATION_STYLE, DOCUMENTATION_STYLE_BLOCK_INLINE, DOCUMENTATION_STYLE_CLASS,
DOCUMENTATION_STYLE_FILE_LEVEL, DOCUMENTATION_STYLE_METHOD_FUNCTION,
DOCUMENTATION_STYLE_README, DOCUMENTATION_STYLE_SPEC,
};
use crate::commands::install::install_to;
#[test]
fn documentation_style_lands_in_deployed_dot_claude_skills() {
let dir = tempfile::tempdir().unwrap();
let paths = trusty_mpm::core::paths::FrameworkPaths::under(dir.path());
install_to(&paths, false).unwrap();
let result = trusty_mpm::core::skill_tiers::deploy_all_skill_tiers(
&paths.skill_source_dir(),
&paths.user_skill_source_dir(),
&paths.claude_skills_dir(),
|_| true,
)
.unwrap()
.stats;
assert!(
result.deployed.contains(&"documentation-style".to_string()),
"documentation-style must be deployed; got {:?}",
result.deployed
);
assert!(
result
.deployed
.contains(&"documentation-style/references/method-function.md".to_string()),
"documentation-style's reference files must deploy alongside it; got {:?}",
result.deployed
);
let skill_dir = paths.claude_skills_dir().join("documentation-style");
assert_eq!(
std::fs::read_to_string(skill_dir.join("SKILL.md")).unwrap(),
DOCUMENTATION_STYLE,
);
for (file_name, expected) in [
("spec.md", DOCUMENTATION_STYLE_SPEC),
("readme.md", DOCUMENTATION_STYLE_README),
("file-level.md", DOCUMENTATION_STYLE_FILE_LEVEL),
("class.md", DOCUMENTATION_STYLE_CLASS),
("method-function.md", DOCUMENTATION_STYLE_METHOD_FUNCTION),
("block-inline.md", DOCUMENTATION_STYLE_BLOCK_INLINE),
] {
let ref_path = skill_dir.join("references").join(file_name);
assert!(
ref_path.is_file(),
"expected reference file at {}",
ref_path.display()
);
assert_eq!(std::fs::read_to_string(&ref_path).unwrap(), expected);
}
}