Imported from yuramol/soft-bee-tracker (
AGENTS.md). Install upstream withnpx skills add yuramol/soft-bee-tracker. Copyright stays with the author.
This is NOT the Next.js you know
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in node_modules/next/dist/docs/ before writing any code. Heed deprecation notices.
Project context and commands
- Stack: Next.js 16, React 19, TypeScript 6, Supabase, TanStack Query, Zustand 5, and Vitest.
- Package manager: Yarn 4.
- Run unit tests with
yarn test. - Run targeted ESLint for touched files before broader validation; the repository may contain unrelated legacy formatting findings.
Data and state architecture
- Keep Supabase access in
src/lib/api/<entity>/queries.tsandmutations.ts; UI code must not call Supabase directly. - Export each domain's public contract through
src/lib/api/<entity>/index.ts. - Zustand-backed domains keep typed stores beside their API files under
src/lib/api/<entity>/. - Keep independent async operations in independent stores (for example, project loading and project creation); do not share one
isLoadingorerrorlifecycle between unrelated operations. - Keep entities separate:
projectsandproject-ratesmust not share a store or domain types. - Do not duplicate the same server data in both TanStack Query and Zustand. Follow the state owner already selected for that domain.
Database / RLS
- Follow
.cursor/rules/supabase-db.mdcfor migrations and RLS. - Role checks in RLS must use JWT helpers (
private.is_manager_or_admin(),private.jwt_role()), neverselect … from public.usersfor role.
Scope filter for frontend conventions
- Apply the function conventions below only when editing
src/components/**andsrc/app/**/page.tsx. - For changes outside those paths, prioritize local file conventions and existing project rules.
Function conventions for scoped files
- Follow
.cursor/rules/naming-conventions.mdcfor file and folder paths (kebab-caseonly). - Prefer named function declarations and extracted handler functions over inline JSX lambdas.
- For callbacks that must return
void, keep async work in a separate function and invoke it via avoid-safe wrapper.
