Goal
Build organization management UI in settings.
Requirements
- apps/ctrl/src/routes/_ctrl/settings/org.tsx: org tab
- Member table: avatar, name, email, role badge, joined date. Admins see "Change Role" dropdown and "Remove" button
- Role selector component: dropdown with admin/member/viewer options. PATCH on change, optimistic update
- Invite dialog: email input + role dropdown. Submit creates invitation. Success toast
- Pending invitations list: email, role, expiry date, revoke button
- Remove member: confirmation dialog with "This cannot be undone"
- Error states: cannot remove last admin, cannot change own role
Out of Scope
- Permission matrix display (separate issue)
- Multi-org switching
Complete when: Member list renders, role changes work, invitations can be sent/revoked, safety checks enforced.
Dev Workflow
Each step is mandatory. No exceptions. No skipping steps. No committing to main. No solo merges.
- Branch -- Create
feat/<issue#>-<description> from main. Use git worktrees for parallel work.
- Implement -- Write the feature. Write tests alongside code. Run
pnpm test, pnpm check (oxlint + oxc-format). All must pass.
- Commit -- Commit to the feature branch. Descriptive message focused on the "why."
- Simplify -- Run
/simplify on all changed files. Accept structural improvements, flatten unnecessary abstractions, remove dead code. Commit the result.
- PR -- Create the PR. Reference this issue number.
- PR Review -- Run
/review-pr which launches parallel review agents (code review, silent failure hunter, type design analysis). Fix every issue found. Re-run tests after fixes.
- Team Review -- Post PR to the legion bullpen. Get consensus from the team before merging.
- Request Merge -- Only after consensus. Never merge your own PR without review.
Platform Rules
- No
any -- use unknown and narrow
- No emoji in code, comments, or commits
- UUIDv7 for all identifiers
- Zod is source of truth for schemas
- Wrangler owns all D1 migrations (never drizzle-kit)
- pnpm only (never npm/yarn)
- Tests in
tests/ mirroring source tree, never colocated
Done When
Goal
Build organization management UI in settings.
Requirements
Out of Scope
Complete when: Member list renders, role changes work, invitations can be sent/revoked, safety checks enforced.
Dev Workflow
Each step is mandatory. No exceptions. No skipping steps. No committing to main. No solo merges.
feat/<issue#>-<description>from main. Use git worktrees for parallel work.pnpm test,pnpm check(oxlint + oxc-format). All must pass./simplifyon all changed files. Accept structural improvements, flatten unnecessary abstractions, remove dead code. Commit the result./review-prwhich launches parallel review agents (code review, silent failure hunter, type design analysis). Fix every issue found. Re-run tests after fixes.Platform Rules
any-- useunknownand narrowtests/mirroring source tree, never colocatedDone When