⚠️ MACHINE CONSUMPTION ONLY⚠️ This instructions file is designed for AI assistants and automated tools to produce comprehensive and awesome code solutions in this repository. It contains detailed guidelines, standards, and specifications that should be followed when developing features, writing tests, and maintaining code quality.
- Use consistent indentation (2 spaces for JavaScript/JSX)
- Follow ESLint and Prettier configurations if present
- Use meaningful variable and function names
- Prefer const/let over var
- Use arrow functions for consistency
- Add semicolons at the end of statements
- Use single quotes for strings unless double quotes are required
- Keep lines under 80-100 characters when possible
- Add JSDoc comments for all functions and components
- Include parameter descriptions, return types, and examples
- Document complex business logic with inline comments
- Update README.md with setup and usage instructions
- Add component prop documentation using PropTypes or TypeScript
- Include usage examples in component documentation
- Create unit tests for all utility functions
- Write component tests using React Testing Library
- Test user interactions and component behavior
- Aim for at least 80% code coverage
- Mock external dependencies appropriately
- Test error handling and edge cases
- Use descriptive test names that explain the expected behavior
- Follow React best practices (hooks, functional components)
- Implement proper error boundaries
- Use appropriate state management patterns
- Optimize performance (memo, useMemo, useCallback when needed)
- Implement accessibility features (ARIA labels, keyboard navigation)
- Follow DRY principles and avoid code duplication
- Use TypeScript when possible for better type safety
- Organize files logically by feature or functionality
- Keep components small and focused on single responsibilities
- Separate business logic from UI components
- Use consistent file naming conventions
- Group related files in appropriate directories
- Sanitize user inputs
- Implement proper authentication and authorization
- Use environment variables for sensitive configuration
- Optimize bundle size and loading performance
- Implement lazy loading for routes and components
- Use proper caching strategies
- Write clear, descriptive commit messages
- Use conventional commit format when possible
- Create feature branches for new development
- Keep commits atomic and focused
- Update package.json and dependencies appropriately
- Explain the reasoning behind your approach
- Consider multiple solutions and their trade-offs
- Provide code examples with explanations
- Consider backward compatibility and migration paths
- Suggest testing strategies for the proposed solution
- Include performance and security considerations
- Always validate user inputs
- Implement proper error handling
- Consider mobile responsiveness
- Follow accessibility guidelines (WCAG)
- Use semantic HTML elements
- Implement proper loading states
- Add meaningful error messages for users
- File Location: Create and maintain a
specifications.mdfile in the root directory - Purpose: Log all development specifications, requirements, and implementation details for future reference and re-execution
- Create the specifications file if it doesn't exist
- Add a new entry with the following format:
## [Feature/Component Name] - [Date] **Description**: Brief description of what needs to be implemented **Requirements**: - [ ] Requirement 1 - [ ] Requirement 2 - [ ] Requirement 3 **Technical Details**: - Component structure - State management approach - API integrations - Performance considerations **Testing Strategy**: - Unit test coverage - Integration test scenarios - User acceptance criteria **Dependencies**: - External packages - Internal components - Environment requirements **Implementation Notes**: - Key decisions made - Alternative approaches considered - Performance optimizations applied **Status**: [Not Started | In Progress | Completed | Testing | Deployed]
- Chronological Order: Newest specifications at the top
- Status Tracking: Update status as work progresses
- Cross-References: Link related specifications and components
- Version History: Include commit hashes and deployment information
- Reference First: Always check existing specifications before starting new work
- Update Status: Keep specifications current as work progresses
- Document Decisions: Record important technical decisions and their rationale
- Link Implementation: Connect specifications to actual code commits
- Review & Refine: Periodically review and update specifications for accuracy
- Reusability: Execute similar features consistently
- Knowledge Transfer: New team members can understand implementation patterns
- Quality Assurance: Ensure all requirements are met systematically
- Maintenance: Track what was built and why decisions were made
- Scalability: Build upon previous work with clear documentation