{"record":{"id":"0e32282781c558cf","repo":"block/buzz","slug":"skill-label-name-name-str-differs-from-dire","errorCode":null,"errorMessage":"skill {label}: name \"{name_str}\" differs from directory name \"{dir_name}\"","messagePattern":"skill (.+?): name \"(.+?)\" differs from directory name \"(.+?)\"","errorType":"validation","errorClass":"ValidationDiagnostic::Warning","httpStatus":null,"severity":"warning","filePath":"crates/buzz-persona/src/validate.rs","lineNumber":426,"sourceCode":"            Ok(v) => v,\n            Err(_) => continue,\n        };\n\n        let mapping = match yaml_val.as_mapping() {\n            Some(m) => m,\n            None => continue,\n        };\n\n        if let Some(name_val) = mapping.get(serde_yaml::Value::String(\"name\".into())) {\n            if let Some(name_str) = name_val.as_str() {\n                if let Some(dir_name) = skill_dir.file_name().and_then(|n| n.to_str()) {\n                    if name_str != dir_name {\n                        let label = skill_dir\n                            .strip_prefix(pack_dir)\n                            .unwrap_or(skill_dir)\n                            .display()\n                            .to_string();\n                        report.warn(format!(\n                            \"skill {label}: name \\\"{name_str}\\\" differs from directory name \\\"{dir_name}\\\"\"\n                        ));\n                    }\n                }\n            }\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn exit_code_clean() {\n        let report = ValidationReport::default();\n        assert_eq!(report.exit_code(), 0);\n    }","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/block/buzz/blob/934f3325c3fdaa3a6f23134b74518139aac8ca3f/crates/buzz-persona/src/validate.rs#L408-L444","documentation":"Advisory check over every skill directory referenced by a loaded persona: the YAML front-matter name: field in SKILL.md must equal the skill's directory name. A mismatch is reported as a warning; loading continues, but tooling that resolves or invokes skills by directory name may disagree with the declared name.","triggerScenarios":"Renaming a skill directory without updating the name: field in SKILL.md (or vice versa); copying a skill folder to a new name while keeping the original front-matter; generated packs where directory names are slugified differently from the declared name (spaces, casing).","commonSituations":"Hand-authored persona packs; forks/renames of shared skills; name fields containing spaces or mixed case that cannot survive as a directory name.","solutions":["Make the SKILL.md name: field byte-identical to the directory name — pick one as canonical and align the other","Add a pack CI lint that fails on name/dir mismatches before publishing","When renaming a skill, update both the directory and every persona manifest that references it"],"exampleFix":"# before\nskills/code-review/SKILL.md → name: review-code\n\n# after\nskills/code-review/SKILL.md → name: code-review","handlingStrategy":"validation","validationCode":"import { readFileSync, readdirSync } from \"node:fs\";\nfor (const dir of readdirSync(\"pack/skills\", { withFileTypes: true })) {\n  if (!dir.isDirectory()) continue;\n  const md = readFileSync(`pack/skills/${dir.name}/SKILL.md`, \"utf8\");\n  const name = /^name:\\s*(.+)$/m.exec(md)?.[1]?.trim();\n  if (name !== dir.name) throw new Error(`skill ${dir.name}: SKILL.md name \"${name}\" differs from directory name`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Adopt the convention: directory name IS the skill name; never diverge","When renaming a skill, change the directory, the SKILL.md name: field, and referencing manifests in one commit","Run pack validation in CI so mismatches are caught before publishing"],"tags":["rust","persona","skills","lint","naming","validation"],"backgroundTag":"skill-name-mismatch","analyzedSha":"934f3325c3fdaa3a6f23134b74518139aac8ca3f","analyzedAt":"2026-08-20T04:38:24.874Z","contentChangedAt":"2026-08-20T04:38:24.874Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}