Step 1 of 9
Audit the current auth and workspace model
Make the AI inspect the existing app structure before changing anything so the invite system fits the current data model and authorization rules.
If your app uses organizations, teams, accounts, or tenants instead of workspaces, tell the builder to map the feature to that exact model.
Analyze this SaaS app and map the current auth and team structure. Identify the user table or model, workspace or organization table, membership table, role system, and any existing settings or members page. Based on the current architecture, propose the minimal set of additions needed for a working invite system: database changes, API endpoints, server actions, auth checks, pages, and components. Do not implement yet; first give me a concrete plan aligned to the existing codebase.
Expected after this step
A code-aware implementation plan showing the existing user/workspace/membership setup and the exact files or areas to update.
Should not happen
- ✕Building only a modal or form without any backend invite persistence
- ✕Creating invite links that are not validated server-side
- ✕Marking invites as accepted in the UI without creating membership records
- ✕Letting any logged-in user send invites regardless of role
Verify before continuing
Do not move on until every check is true. The complete button stays locked until then.
Do not continue if…
- !Building only a modal or form without any backend invite persistence
- !Creating invite links that are not validated server-side
- !Marking invites as accepted in the UI without creating membership records
- !Letting any logged-in user send invites regardless of role
- !Forgetting expiration, duplicate invite handling, or revoke logic
- !Accept flow works for existing users only and breaks for new signups
If the AI messes this up
Use this when the AI fakes progress or breaks the feature. It forces a real fix.
You gave a generic plan. Re-scan the actual codebase and map the existing auth, workspace, and membership structure from real files. Show the exact models, routes, and pages that already exist, then revise the invite implementation plan to fit them.