{"record":{"id":"277b2958552c17a7","repo":"charmbracelet/crush","slug":"name-exceeds-d-characters","errorCode":null,"errorMessage":"name exceeds %d characters","messagePattern":"name exceeds (.+?) characters","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/skills/skills.go","lineNumber":125,"sourceCode":"\n// SetLatestStates stores the given states in the package-level cache so that\n// GetLatestStates can return them synchronously before the first pubsub event\n// arrives.\nfunc SetLatestStates(states []*SkillState) {\n\tlatestStatesMu.Lock()\n\tlatestStates = cloneStates(states)\n\tlatestStatesMu.Unlock()\n}\n\n// Validate checks if the skill meets spec requirements.\nfunc (s *Skill) Validate() error {\n\tvar errs []error\n\n\tif s.Name == \"\" {\n\t\terrs = append(errs, errors.New(\"name is required\"))\n\t} else {\n\t\tif len(s.Name) > MaxNameLength {\n\t\t\terrs = append(errs, fmt.Errorf(\"name exceeds %d characters\", MaxNameLength))\n\t\t}\n\t\tif !namePattern.MatchString(s.Name) {\n\t\t\terrs = append(errs, errors.New(\"name must be alphanumeric with hyphens, no leading/trailing/consecutive hyphens\"))\n\t\t}\n\t\tif s.Path != \"\" && !strings.EqualFold(filepath.Base(s.Path), s.Name) {\n\t\t\terrs = append(errs, fmt.Errorf(\"name %q must match directory %q\", s.Name, filepath.Base(s.Path)))\n\t\t}\n\t}\n\n\tif s.Description == \"\" {\n\t\terrs = append(errs, errors.New(\"description is required\"))\n\t} else if len(s.Description) > MaxDescriptionLength {\n\t\terrs = append(errs, fmt.Errorf(\"description exceeds %d characters\", MaxDescriptionLength))\n\t}\n\n\tif len(s.Compatibility) > MaxCompatibilityLength {\n\t\terrs = append(errs, fmt.Errorf(\"compatibility exceeds %d characters\", MaxCompatibilityLength))\n\t}","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/skills/skills.go#L107-L143","documentation":"Skill.Validate enforces the Agent Skills spec limits: a non-empty name at most MaxNameLength (64) characters. This error is appended when the SKILL.md frontmatter 'name' field exceeds 64 bytes, and is aggregated with other validation errors into the returned error. A skill failing validation is not exposed as active, so it cannot be invoked.","triggerScenarios":"Parsing a SKILL.md whose YAML frontmatter 'name' is longer than 64 characters, then calling Validate (invoked during discovery for every discovered skill file).","commonSituations":"Very descriptive skill names pasted from docs; auto-generated skills with long directory names mirrored into the name field; copied skill templates that keep a long placeholder name; directory-name matching rules pushing authors to long folder names.","solutions":["Shorten the 'name' field in SKILL.md frontmatter to 64 characters or fewer","Rename the skill directory to a short name and keep name matching the directory base (names are matched case-insensitively to filepath.Base(Path))","Re-run discovery and confirm the skill reaches StateNormal in skills.GetLatestStates"],"exampleFix":"// before (SKILL.md frontmatter)\nname: my-extremely-long-descriptive-skill-name-that-goes-on-and-on-for-many-characters\n\n// after (SKILL.md frontmatter) — 64 chars max, alphanumeric + hyphens\nname: my-long-descriptive-skill","handlingStrategy":"validation","validationCode":"const maxNameLength = 64\nfunc validSkillName(name string) error {\n    if name == \"\" { return errors.New(\"name is required\") }\n    if len(name) > maxNameLength { return fmt.Errorf(\"name exceeds %d characters\", maxNameLength) }\n    if !regexp.MustCompile(`^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`).MatchString(name) {\n        return errors.New(\"name must be alphanumeric with hyphens\")\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err := skill.Validate(); err != nil {\n    // Validate aggregates all issues; show them all so the user fixes the frontmatter in one pass\n    return fmt.Errorf(\"invalid SKILL.md %s:\\n%w\", skill.Path, err)\n}","preventionTips":["Keep skill names short (<=64 chars) and let descriptions carry the detail","Ensure the frontmatter name matches the skill directory base name","Validate SKILL.md files in CI before shipping them","Watch skills.GetLatestStates for StateError entries after edits"],"tags":["skills","validation","frontmatter","yaml"],"backgroundTag":"schema-validation-failed","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}