54 lines
2.3 KiB
Markdown
54 lines
2.3 KiB
Markdown
# Agent Instructions for Meat Farmer Monorepo
|
|
|
|
## Important instructions
|
|
- Don't run any drizzle migrations. User will handle it.
|
|
- don't try to run any test unless user explicitly asks for
|
|
|
|
## Code Style Guidelines
|
|
|
|
### TypeScript & React Native
|
|
- **Strict TypeScript**: `strict: true` enabled in tsconfig
|
|
- **Path aliases**: Use `@/*` for local imports, `common-ui` for shared UI package
|
|
- **Component naming**: PascalCase (e.g., `MyButton`, `ImageCarousel`)
|
|
- **Function naming**: camelCase (e.g., `handleSubmit`, `getCurrentUserId`)
|
|
- **Interface naming**: PascalCase with `Props` suffix (e.g., `ButtonProps`)
|
|
|
|
don't import Text,TextInput,TouchableOpacity and other such primitive components directly from
|
|
react-native. They are available in the common-ui as MyText, MyTextInput, MyTouchableOpacity etc.
|
|
|
|
### Imports
|
|
- React imports first
|
|
- Third-party libraries second
|
|
- Local imports last
|
|
- Use absolute imports with path aliases when possible
|
|
- imports from /packages/ui are aliased as `common-ui` in apps/user-ui and apps/admin-ui
|
|
- For backend, use `@/*` to import from the backend root directory (e.g., `@/src/lib/file-name`)
|
|
|
|
### Error Handling
|
|
- API errors handled via axios interceptors
|
|
- Use `DeviceEventEmitter` for cross-component communication
|
|
- Throw custom errors with descriptive messages
|
|
- Avoid try-catch blocks unless necessary
|
|
|
|
### Formatting & Linting
|
|
- ESLint with Expo config
|
|
- No Prettier configured - follow consistent indentation (2 spaces)
|
|
- No semicolons at end of statements
|
|
- Single quotes for strings
|
|
|
|
### Testing
|
|
- No test framework currently configured
|
|
- When adding tests, use Jest + React Native Testing Library
|
|
- Test files: `*.test.tsx` or `*.spec.tsx`
|
|
|
|
### Architecture
|
|
- Monorepo with Turbo
|
|
- Shared UI components in `packages/ui`
|
|
- Apps: `user-ui`, `admin-ui`, `inspiration-ui`, `inspiration-backend`
|
|
- Database: Drizzle ORM with PostgreSQL
|
|
|
|
## Important Notes
|
|
- Don't do anything with git. Don't do git add or git commit. That will be managed entirely by the user
|
|
|
|
## Change Log
|
|
- there should be a change log file. unless explicitly specified, assume change-log.txt as the name of the log file. Ensure the file exists. If it doesn't exist create it. Before changing any file which is not a md file or txt file write the change to that file exactly. Write the diff to it and then start making changes. for every change add the current time stamp.
|