Required reading
- Read
docs/codebase-map.jsonbefore editing. - Read relevant docs before changing features.
- Read
AGENTS.mdfor repo rules. - Inspect existing patterns before adding code.
- Search the codebase before changing uncertain logic.
Core rules
- Do not create duplicate systems.
- Do not bypass Supabase auth or RLS.
- Preserve
org_idscoping. - Keep dashboard, company admin, and superadmin separate.
- Do not invent routes.
- Do not edit dangerous large files blindly.
- Preserve API contracts.
- Preserve database relationships.
- Use existing components first.
- Follow current layout and auth rules.
- Explain assumptions before major edits.
Add a dashboard page
- Find the existing dashboard route pattern.
- Reuse the dashboard layout.
- Add auth and
org_idchecks. - Add the sidebar item after the route works.
- Update docs if user behavior changes.
Add a company admin page
- Find existing company admin pages.
- Reuse admin role checks.
- Keep settings scoped to one workspace.
- Test member access denial.
Add a superadmin page
- Find existing superadmin pages.
- Use superadmin auth only.
- Keep it out of customer navigation.
- Add audit context for sensitive actions.
Add an API route
- Reuse route handler patterns.
- Validate input.
- Preserve response shape rules.
- Apply auth, rate limits, and
org_idscope where relevant. - Add API docs.
Add an Aria action
- Find current Aria action patterns.
- Keep inputs scoped to one workspace.
- Return structured output.
- Keep human review in the flow.
- Update AI and Aria docs.