INNER CODE UNIT · Rust
get
ShurikenTrade/shuriken-skills · src/lib.rs:62
pub fn get(name: &str) -> Option<&'static Skill> {
let local = name
.strip_prefix(&format!("{NAMESPACE}:"))
.unwrap_or(name);
list().iter().find(|s| s.name == local)
}
pub fn render_index() -> String {
let mut out = String::from("# Shuriken skills\n\n");
out.push_str(
"The following guidance skills are available. Call `get_skill(name)` to load the full body of any that match the user's question.\n\n",
);
for skill in list() {
// Skip internal fixture skills in production rendering.
if skill.name.starts_with("__") {
continue;
}
out.push_str(&format!(