Files
mev-beta/.opencode/commands/code-review.md
2025-09-14 10:09:55 -05:00

70 lines
2.5 KiB
Markdown

# Perform Code Review
Perform a comprehensive code review for the following changes: $ARGUMENTS
## Code Review Framework:
1. **Functional Review**: Verify code correctness and requirements implementation
2. **Quality Review**: Assess code quality, readability, and maintainability
3. **Security Review**: Identify potential security vulnerabilities
4. **Performance Review**: Evaluate performance implications
5. **Testing Review**: Check test coverage and quality
## Review Standards:
### Go Code Review
- **Error Handling**: Proper error wrapping and handling
- **Concurrency**: Correct use of goroutines, channels, and mutexes
- **Interfaces**: Appropriate interface design and usage
- **Documentation**: Clear comments and godoc compliance
- **Testing**: Adequate test coverage and quality
### Solidity Code Review
- **Security**: Reentrancy, overflow/underflow, access controls
- **Gas Optimization**: Efficient use of gas and state variables
- **Best Practices**: Follow Solidity and DeFi security best practices
- **Documentation**: Proper NatSpec comments
- **Testing**: Comprehensive test coverage
### JavaScript Code Review
- **Vue Patterns**: Proper use of Composition API and reactivity
- **State Management**: Correct Pinia usage and state handling
- **Web3 Integration**: Secure and efficient web3 interactions
- **Performance**: Optimal component rendering and data fetching
- **Testing**: Adequate Vue component and unit tests
## Review Checklist:
### General
- [ ] Code follows project style guidelines
- [ ] Naming conventions are consistent and meaningful
- [ ] Code is well-documented with comments
- [ ] No dead or commented-out code
- [ ] Dependencies are properly managed
### Security
- [ ] Input validation is implemented
- [ ] Sensitive data is handled securely
- [ ] No hardcoded secrets or credentials
- [ ] Proper access controls are in place
- [ ] Security best practices are followed
### Performance
- [ ] No obvious performance bottlenecks
- [ ] Memory usage is optimized
- [ ] Database queries are efficient
- [ ] Caching strategies are appropriate
- [ ] Concurrency patterns are efficient
### Testing
- [ ] Adequate test coverage
- [ ] Tests are well-structured and readable
- [ ] Edge cases are covered
- [ ] Mocks and stubs are used appropriately
- [ ] Performance tests are included for critical paths
## Output Requirements:
- Detailed feedback with specific line references
- Priority levels for issues (Critical/High/Medium/Low)
- Suggestions for improvements
- Approval or rejection recommendation
- Follow-up actions if needed