```ts
/** Group items into slots of a fixed capacity, in order. */
export function slotPack(items: string[], capacity: number): string[][] {
  if (capacity <= 0) {
    throw new Error("Capacity must be greater than zero.");
  }
  const slots: string[][] = [];
  for (let i = 0; i < items.length; i += capacity) {
    const subArray = items.slice(i, Math.min(i + capacity, items.length));
    if (subArray.length > 0) {
      slots.push(subArray);
    }
  }
  return slots;
}
```