Skip to content

Description length counts UTF-8 bytes but reports "characters" — multibyte descriptions rejected below 1024 chars #94

Description

@BoneLiu

Summary

The 1024-character description limit is enforced with Go's len(desc), which counts UTF-8 bytes, while the error message and the spec both speak of characters. Multibyte (CJK, emoji) descriptions are therefore rejected well below 1024 real characters.

Evidence

structure/frontmatter.go:47:

results = append(results, ctx.Errorf("description exceeds 1024 characters (%d)", len(desc)))

Real-world case from our skill tree:

  • a SKILL.md description measuring 984 characters (compliant) and 1200 UTF-8 bytes (rejected)
  • the skill is flagged description exceeds 1024 characters (1200)

The spec's reference implementation enforces the same limit with Python len(), i.e. characters (skill-creator/scripts/quick_validate.py:83).

The existing test cannot catch this because its long-description fixture is ASCII (structure/frontmatter_test.go:107, strings.Repeat("x", 1025)) — bytes == chars there.

Suggested fix

results = append(results, ctx.Errorf("description exceeds 1024 characters (%d)", utf8.RuneCountInString(desc)))

plus a regression test with a CJK description, e.g. 342 CJK chars = 1026 bytes = 342 characters (must pass).

Happy to send a PR if you tell me which branch to base on.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions