import re


def auto_code(name: str, max_len: int = 10) -> str:
    """Generate a short code from a name.
    Single word → truncate to max_len.
    Multiple words → first letter of each word, uppercase.
    """
    words = re.findall(r'\w+', name.upper())
    if len(words) == 1:
        return words[0][:max_len]
    return ''.join(w[0] for w in words)[:max_len]
