• Build the ordered, subtype-labeled skill groups for the Skills tab. Every subtype in order (the display subtype order) is emitted — including empty ones — so the template can decide (via {{#if group.skills.length}}) which to show; only populated subtypes render, each carrying its own "+ Add" control. Subtypes present on skills but absent from order are appended after the ordered ones, in first-seen order, so nothing is silently dropped.

    Labels are resolved through the supplied callback so this stays Foundry-free (the sheet passes a game.i18n-backed resolver).

    Parameters

    • skills: readonly SkillLike[]

      The skills to group, in display order.

    • order: readonly string[]

      The subtype keys in their canonical display order.

    • subTypeLabel: (subType: string) => string

      Resolves a subtype key to its display label.

    Returns SkillGroup[]

    The ordered skill groups.