use trusty_mpm::core::bundle::{
INTERNAL_COMMS, SYSTEMATIC_DEBUGGING, SYSTEMATIC_DEBUGGING_ANTI_PATTERNS,
SYSTEMATIC_DEBUGGING_EXAMPLES, SYSTEMATIC_DEBUGGING_TROUBLESHOOTING,
SYSTEMATIC_DEBUGGING_WORKFLOW,
};
use crate::commands::install::install_to;
#[test]
fn skill_port_batch1_sample_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(&"internal-comms".to_string()),
"internal-comms must be deployed; got {:?}",
result.deployed
);
assert!(
result
.deployed
.contains(&"systematic-debugging".to_string()),
"systematic-debugging must be deployed; got {:?}",
result.deployed
);
assert!(
result
.deployed
.contains(&"systematic-debugging/references/workflow.md".to_string()),
"systematic-debugging's reference files must deploy alongside it; got {:?}",
result.deployed
);
let internal_comms_deployed = paths
.claude_skills_dir()
.join("internal-comms")
.join("SKILL.md");
assert!(
internal_comms_deployed.is_file(),
"expected skill at {}",
internal_comms_deployed.display()
);
assert_eq!(
std::fs::read_to_string(&internal_comms_deployed).unwrap(),
INTERNAL_COMMS,
);
let debugging_dir = paths.claude_skills_dir().join("systematic-debugging");
assert_eq!(
std::fs::read_to_string(debugging_dir.join("SKILL.md")).unwrap(),
SYSTEMATIC_DEBUGGING,
);
for (file_name, expected) in [
("anti-patterns.md", SYSTEMATIC_DEBUGGING_ANTI_PATTERNS),
("examples.md", SYSTEMATIC_DEBUGGING_EXAMPLES),
("troubleshooting.md", SYSTEMATIC_DEBUGGING_TROUBLESHOOTING),
("workflow.md", SYSTEMATIC_DEBUGGING_WORKFLOW),
] {
let ref_path = debugging_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);
}
}