The skill an installed file is, if it is one. Nested layouts install ` /SKILL.md`; flat ones (Cline, agy) install ` .md`, which is only recognisable as a skill when the declared skill list is known.
(dst: &Path, declared: Option<&[String]>)
| 1086 | /// `<name>.md`, which is only recognisable as a skill when the declared skill |
| 1087 | /// list is known. |
| 1088 | fn skill_name(dst: &Path, declared: Option<&[String]>) -> Option<String> { |
| 1089 | let file_name = dst.file_name()?.to_str()?; |
| 1090 | if file_name == "SKILL.md" { |
| 1091 | let name = dst.parent()?.file_name()?.to_str()?.to_string(); |
| 1092 | return match declared { |
| 1093 | Some(declared) if !declared.contains(&name) => None, |
| 1094 | _ => Some(name), |
| 1095 | }; |
| 1096 | } |
| 1097 | let stem = file_name.strip_suffix(".md")?; |
| 1098 | declared? |
| 1099 | .iter() |
| 1100 | .any(|name| name == stem) |
| 1101 | .then(|| stem.to_string()) |
| 1102 | } |
| 1103 | |
| 1104 | fn skill_metadata(path: &Path) -> SkillMetadata { |
| 1105 | match std::fs::read_to_string(path) { |
no test coverage detected