| name | code-review |
| description | AI-assisted code review for bugs, style, performance, and security issues. Use this skill when reviewing code changes, pull requests, or when asked to check code quality. |
🔍 Code Review Skill
Checklist
1. Correctness
2. Edge Cases
3. Style
4. Performance
5. Security
🤖 AI-Assisted Review Features
Auto-Fix Patterns
| Issue | Auto-Fix Command |
|---|
| Lint errors | npm run lint -- --fix |
| Unused imports | ESLint auto-fix |
| Formatting | npx prettier --write . |
| Type errors | Add type annotations |
Common Fix Templates
const name = user.name;
const name = user?.name ?? 'Unknown';
fetchData();
fetchData().catch(console.error);
📝 PR Summary Generator
Template
## Summary
[Brief description of changes]
## Changes
- ✅ Added: [new features]
- 🔧 Modified: [changed files]
- 🗑️ Removed: [deleted files]
## Testing
- [ ] Unit tests pass
- [ ] Manual testing done
- [ ] No breaking changes
## Screenshots (if UI changes)
[Before/After images]
Auto-Generate Summary
git log --oneline -10
git diff --stat main
Review Output Format
Severity Levels
| Level | Icon | Action Required |
|---|
| Critical | 🔴 | Must fix before merge |
| Warning | 🟡 | Should fix, can be deferred |
| Suggestion | 🔵 | Nice to have |
| Praise | 🟢 | Good code! |
Feedback Format
🔴 **Critical**: [file.js:L15]
Issue: SQL injection vulnerability
```javascript
// Current
const query = `SELECT * FROM users WHERE id = '${id}'`;
// Suggested fix
const query = 'SELECT * FROM users WHERE id = $1';
const result = await db.query(query, [id]);
Feedback Guidelines
- Be specific - ชี้บรรทัดและอธิบายปัญหา
- Suggest fix - เสนอวิธีแก้ไข code พร้อมใช้
- Prioritize - Critical > Warning > Suggestion
- Be constructive - ชมเมื่อเห็นโค้ดดี
- Batch similar issues - รวมปัญหาที่คล้ายกัน