Spec a 30-character limit for display names

Vibe codingHard20 min

Your task

Your app shows each user's public display name on a card that fits 30 characters. People sign up from everywhere, so names include accents, Hindi and Korean script, flags and family emoji. An agent will write the Python function that checks the limit and shortens longer names for the card.

Write the spec you would hand the agent.

What you know:

  • Python 3.12, and the team allows one new dependency if the spec names it
  • names are stored exactly as typed, and the short form is for display only
  • a shortened name ends with "…", and the ellipsis counts toward the 30

Then, in a few sentences: what does "limit the name to 30 characters and truncate" get wrong?