charmbracelet/crush · error

compatibility exceeds %d characters

Error message

compatibility exceeds %d characters

What it means

Skill.Validate() limits the Compatibility field to MaxCompatibilityLength (500) characters. The compatibility field is free-form metadata describing environment requirements, and this error is thrown when it exceeds that cap.

Source

Thrown at internal/skills/skills.go:142

		if len(s.Name) > MaxNameLength {
			errs = append(errs, fmt.Errorf("name exceeds %d characters", MaxNameLength))
		}
		if !namePattern.MatchString(s.Name) {
			errs = append(errs, errors.New("name must be alphanumeric with hyphens, no leading/trailing/consecutive hyphens"))
		}
		if s.Path != "" && !strings.EqualFold(filepath.Base(s.Path), s.Name) {
			errs = append(errs, fmt.Errorf("name %q must match directory %q", s.Name, filepath.Base(s.Path)))
		}
	}

	if s.Description == "" {
		errs = append(errs, errors.New("description is required"))
	} else if len(s.Description) > MaxDescriptionLength {
		errs = append(errs, fmt.Errorf("description exceeds %d characters", MaxDescriptionLength))
	}

	if len(s.Compatibility) > MaxCompatibilityLength {
		errs = append(errs, fmt.Errorf("compatibility exceeds %d characters", MaxCompatibilityLength))
	}

	return errors.Join(errs...)
}

// Parse parses a SKILL.md file from disk.
func Parse(path string) (*Skill, error) {
	content, err := os.ReadFile(path)
	if err != nil {
		return nil, err
	}

	skill, err := ParseContent(content)
	if err != nil {
		return nil, err
	}

	skill.Path = filepath.Dir(path)

View on GitHub (pinned to 7944b8e522)

Solutions

  1. Shorten `compatibility:` in SKILL.md frontmatter to under 500 characters
  2. Keep only the essential environment requirements (e.g. "requires: git, go 1.21+") and move details into the body
  3. Split environment notes across description or instructions where appropriate

Example fix

// before
// compatibility: Requires Linux, macOS, or Windows with WSL; git >= 2.30; go >= 1.21; node >= 20; ... [600+ chars]
// after
// compatibility: requires git >= 2.30 and go >= 1.21
Defensive patterns

Strategy: validation

Validate before calling

const maxCompatibility = 500
if len(frontmatter.Compatibility) > maxCompatibility {
	return fmt.Errorf("compatibility is %d chars, limit %d", len(frontmatter.Compatibility), maxCompatibility)
}

Try / catch

skill, err := skills.Parse(path)
if err != nil {
	return fmt.Errorf("skipping skill %s: %w", path, err)
}

Prevention

When it happens

Trigger: Calling Validate() on a Skill whose Compatibility string exceeds 500 characters, usually from an over-long `compatibility:` frontmatter entry in SKILL.md.

Common situations: Listing every OS/version/dependency combination in prose instead of a terse summary; concatenating tool version matrices into the compatibility field.

Related errors


AI-assisted analysis of charmbracelet/crush@7944b8e522 (2026-08-29). Data as JSON: /api/errors/056b758ca18c4ff8. Report an issue: GitHub.