Add AGENTS.md with codebase guidelines and commands
This commit is contained in:
parent
ae4fc1c9ce
commit
0ed08e894d
61
AGENTS.md
Normal file
61
AGENTS.md
Normal file
@ -0,0 +1,61 @@
|
||||
# AGENTS.md
|
||||
|
||||
## Build, Lint, and Test Commands
|
||||
|
||||
### Build Commands
|
||||
- `npm run build` - Build the application for production
|
||||
- `npm run dev` - Start development server with hot reloading
|
||||
- `npm run preview` - Preview the production build
|
||||
|
||||
### Lint Commands
|
||||
- `npm run lint` - Run ESLint on the entire codebase
|
||||
- `npm run lint -- --fix` - Run ESLint with auto-fix capabilities
|
||||
|
||||
### Test Commands
|
||||
- No test framework configured yet
|
||||
- For running individual tests, add a test runner like Vitest or Jest
|
||||
- Example with Vitest: `npm run test -- --run --reporter=verbose`
|
||||
|
||||
## Code Style Guidelines
|
||||
|
||||
### Imports
|
||||
- Use ES6 module syntax: `import { foo } from 'bar'`
|
||||
- Group imports: standard library, external dependencies, internal modules
|
||||
- Avoid wildcard imports: `import * as React from 'react'`
|
||||
- Use named imports for better tree-shaking
|
||||
|
||||
### Formatting
|
||||
- Use Prettier for code formatting (configured via .prettierrc)
|
||||
- 2-space indentation
|
||||
- No semicolons
|
||||
- Arrow functions for component methods
|
||||
- Type annotations for all props and state
|
||||
|
||||
### Types
|
||||
- TypeScript strict mode enabled
|
||||
- Use interfaces for component props and state shapes
|
||||
- Use type aliases for primitive types
|
||||
- Use `Partial<T>` for optional updates
|
||||
- Use `Record<string, unknown>` for generic object types
|
||||
|
||||
### Naming Conventions
|
||||
- PascalCase for components and interfaces
|
||||
- camelCase for variables and functions
|
||||
- UPPER_CASE for constants
|
||||
- `use*` prefix for custom hooks
|
||||
- `is*`, `has*`, `should*` for boolean values
|
||||
|
||||
### Error Handling
|
||||
- Use try/catch blocks for async operations
|
||||
- Handle errors gracefully in API calls with meaningful error messages
|
||||
- Localized error states in components
|
||||
- Use custom error boundaries for React components
|
||||
- Log errors to console in development only
|
||||
|
||||
### React Specific
|
||||
- Use functional components with hooks
|
||||
- Prefer hooks over class components
|
||||
- Use useCallback and useMemo for performance optimization
|
||||
- Use StrictMode for development
|
||||
- Component composition over inheritance
|
||||
- Proper cleanup in useEffect hooks
|
||||
Loading…
x
Reference in New Issue
Block a user