{"record":{"id":"81bc8f0aa63f8fac","repo":"charmbracelet/crush","slug":"description-exceeds-d-characters","errorCode":null,"errorMessage":"description exceeds %d characters","messagePattern":"description exceeds (.+?) characters","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/skills/skills.go","lineNumber":138,"sourceCode":"\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}\n\n\treturn errors.Join(errs...)\n}\n\n// Parse parses a SKILL.md file from disk.\nfunc Parse(path string) (*Skill, error) {\n\tcontent, err := os.ReadFile(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tskill, err := ParseContent(content)\n\tif err != nil {","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/skills/skills.go#L120-L156","documentation":"Skill.Validate() limits the Description field to MaxDescriptionLength (1024) characters because descriptions are injected into system prompts/agent context and must stay compact. This error is thrown when len(s.Description) > 1024 after parsing SKILL.md frontmatter.","triggerScenarios":"Calling Validate() on a Skill whose Description exceeds 1024 characters, typically after Parse/ParseContent reads a SKILL.md whose `description:` frontmatter value is too long.","commonSituations":"Writing multi-paragraph prose into the description instead of a one-liner; embedding usage examples or full instructions in the description (those belong in the body); auto-generated descriptions from long docstrings.","solutions":["Shorten the `description:` field in SKILL.md frontmatter to under 1024 characters, keeping it to a concise when-to-use summary","Move detailed instructions, examples, and workflows into the markdown body of SKILL.md (skill.Instructions)","Trim boilerplate or duplicated text from the description"],"exampleFix":"// before\n// description: This skill does X. It works by... [1500 chars of prose including full examples]\n// after\n// description: Use this skill to do X when the user asks for Y. See body for detailed workflow.","handlingStrategy":"validation","validationCode":"const maxDescription = 1024\nif len(strings.TrimSpace(frontmatter.Description)) > maxDescription {\n\treturn fmt.Errorf(\"description is %d chars, limit %d\", len(frontmatter.Description), maxDescription)\n}","typeGuard":null,"tryCatchPattern":"skill, err := skills.Parse(path)\nif err != nil {\n\treturn fmt.Errorf(\"skipping skill %s: %w\", path, err) // log and continue with other skills\n}","preventionTips":["Write descriptions as one-sentence 'when to use' summaries under ~200 characters","Put workflows, examples, and details in the SKILL.md body, not the description","Add a lint check (CI or pre-commit) that parses each SKILL.md and enforces the 1024-char limit"],"tags":["skills","validation","frontmatter","length-limit"],"backgroundTag":"field-exceeds-max-length","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}