{"record":{"id":"3c19b39ec51a3768","repo":"larksuite/cli","slug":"s-skill-q-has-invalid-metadata-w","errorCode":null,"errorMessage":"%s: skill %q has invalid metadata: %w","messagePattern":"(.+?): skill %q has invalid metadata: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/skillpolicy/resolver.go","lineNumber":192,"sourceCode":"\t}\n\tfor _, e := range entries {\n\t\tname := e.Name()\n\t\tif !e.IsDir() {\n\t\t\treturn snapshot, fmt.Errorf(\"%s: %q is not a directory; every %s entry must be a <skill>/ dir\", label, name, label)\n\t\t}\n\t\tif !isSkillName(name) {\n\t\t\treturn snapshot, fmt.Errorf(\"%s: %q is not a valid skill name\", label, name)\n\t\t}\n\t\tok, err := skillExists(source, name)\n\t\tif err != nil {\n\t\t\treturn snapshot, fmt.Errorf(\"%s: probing skill %q: %w\", label, name, err)\n\t\t}\n\t\tif !ok {\n\t\t\treturn snapshot, fmt.Errorf(\"%s: skill %q is missing SKILL.md\", label, name)\n\t\t}\n\t\tmanifest, err := readSkillManifest(source, name)\n\t\tif err != nil {\n\t\t\treturn snapshot, fmt.Errorf(\"%s: skill %q has invalid metadata: %w\", label, name, err)\n\t\t}\n\t\tsnapshot.skills[name] = manifest\n\t}\n\treturn snapshot, nil\n}\n\n// validateSelection rejects allow/remove entries that cannot compose against\n// the already-validated base snapshot.\nfunc validateSelection(lower skillTreeSnapshot, spec *platform.SkillsOverlay) error {\n\tif err := validateSkillNames(\"Allow\", spec.Allow); err != nil {\n\t\treturn err\n\t}\n\tif err := validateSkillNames(\"Remove\", spec.Remove); err != nil {\n\t\treturn err\n\t}\n\tif len(lower.skills) == 0 && (len(spec.Allow) > 0 || len(spec.Remove) > 0) {\n\t\treturn fmt.Errorf(\"%w; Allow/Remove require skills in the base tree\", ErrNoBaseSkillContent)\n\t}","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/skillpolicy/resolver.go#L174-L210","documentation":"scanSkillTree calls readSkillManifest to parse each skill's SKILL.md frontmatter. If parsing or validation fails, composition aborts with this error, labeled by which tree (host base, plugin Base, plugin Overlay) held the bad manifest. It keeps malformed skill metadata out of the composed tree used by skills list/read and --help pointers.","triggerScenarios":"ResolveWithReferences encounters a SKILL.md whose frontmatter is unparseable or fails manifest validation (missing/invalid required fields), for any skill in the base or overlay FS.","commonSituations":"Hand-edited frontmatter with broken YAML; missing required description field; a skill shipped by a plugin with an older manifest format than the host expects.","solutions":["Fix the SKILL.md frontmatter for the named skill; validate with the CLI's schema/format checks.","Run the skill format check (node scripts/skill-format-check/index.js) on the offending skill before rebuilding.","If the plugin is third-party, pin/upgrade the plugin to a version whose manifests match the host CLI.","Diff the manifest against a known-good shipped skill to spot missing or mistyped frontmatter fields."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for _, name := range skillNames {\n    if err := validateManifest(fsys, name); err != nil {\n        return fmt.Errorf(\"skill %s has invalid metadata: %w\", name, err)\n    }\n}","typeGuard":null,"tryCatchPattern":"if _, err := skillpolicy.ResolveWithReferences(base, specs); err != nil {\n    var wrapped interface{ Unwrap() error }\n    // log full chain; fix the SKILL.md frontmatter identified by the label\n    return fmt.Errorf(\"skill tree invalid: %w\", err)\n}","preventionTips":["Keep SKILL.md frontmatter in the canonical format of a recently shipped skill and diff before publishing","Run scripts/skill-format-check in CI for every skill change","Bump and re-validate plugin manifests after CLI manifest-format upgrades"],"tags":["go","skill-policy","manifest-validation","frontmatter"],"backgroundTag":"invalid-skill-manifest","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}