Summary
Add a team splitter at app/api/routes-f/random-team/route.ts. Given a list of names and a number of teams, randomly partition names into balanced teams.
Requirements
- POST body { names: string[], teams: number, seed?: number, team_names?: string[] }
- Return { teams: [{ name: string, members: string[] }] }
- Team sizes must differ by at most 1
- Seed makes output deterministic
- If team_names provided, must match teams count
- Validate teams >= 2, names.length >= teams, no duplicates
- Cap at 1000 names
- Fisher-Yates shuffle implemented inline
- Tests verify balance and determinism
Scope Constraint - READ BEFORE STARTING
All files for this task must live inside app/api/routes-f/. This includes the route handler, helpers/utilities, types, and tests. Do NOT modify, import from, or add files to lib/, utils/, types/, components/, or anywhere else outside app/api/routes-f/. If you need shared logic, duplicate it inside your subfolder. Keeping everything scoped to this folder is intentional - it keeps these tasks independent and mergeable in any order.
Summary
Add a team splitter at app/api/routes-f/random-team/route.ts. Given a list of names and a number of teams, randomly partition names into balanced teams.
Requirements
Scope Constraint - READ BEFORE STARTING
All files for this task must live inside app/api/routes-f/. This includes the route handler, helpers/utilities, types, and tests. Do NOT modify, import from, or add files to lib/, utils/, types/, components/, or anywhere else outside app/api/routes-f/. If you need shared logic, duplicate it inside your subfolder. Keeping everything scoped to this folder is intentional - it keeps these tasks independent and mergeable in any order.