Role code review
Personal agent skills
npx -y skills add pecigonzalo/agent-skills --skill role-code-reviewAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 21 days oldThe repository was created 21 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use this skill for pull request and code quality reviews, including pre-commit self-review. Provides systematic review methodology with severity categorization.
SKILL.md
8.5 KB, as published. Nobody here has run it
Provides: Systematic code review methodology, severity categorization, quality checklists, and feedback patterns.
Quick Reference
Golden Rule: Review code as you'd want yours reviewed - thoroughly but kindly
Checklist: Functionality, Code Quality, Security, Testing, Performance, Maintainability
Report Format: Summary, Assessment, Issues (π΄π‘π΅), Positive Observations, Recommendations
Principles: Constructive, Thorough, Timely
Review Principles
Constructive: Focus on code not person, explain WHY, suggest improvements, acknowledge good practices
Thorough: Check functionality not just style, consider edge cases, think maintainability, look for security
Timely: Review promptly, don't block unnecessarily, prioritize critical issues
Review Checklist
Functionality
- Does what it's supposed to do
- Edge cases handled
- Error cases handled
- No obvious bugs
Code Quality
- Clear, descriptive naming
- Functions small and focused
- No unnecessary complexity
- Follows coding standards
- DRY - no duplication
Security (Basic Checks)
- No obvious security issues
- Input validation present
- No hardcoded secrets
- Auth/authorization checks present
For comprehensive security review, use role-security-auditor skill
Testing
- Tests present
- Happy path covered
- Edge cases covered
- Error cases covered
- All tests pass
Performance
- No obvious performance issues
- Efficient algorithms
- No unnecessary operations
- Resources properly managed
Maintainability
- Easy to understand
- Complex logic documented
- Follows project conventions
- Easy to modify/extend
Review Report Format
## Code Review: {Feature/PR Name}
**Summary:** {Brief overview}
**Assessment:** Approve / Needs Work / Requires Changes
---
### Issues Found
#### π΄ Critical (Must Fix)
- **File:** `src/auth.js:42`
**Issue:** Password stored in plain text
**Fix:** Hash password before storing
#### π‘ Warnings (Should Fix)
- **File:** `src/user.js:15`
**Issue:** No input validation
**Fix:** Validate email format
#### π΅ Suggestions (Nice to Have)
- **File:** `src/utils.js:28`
**Issue:** Could be more concise
**Fix:** Use array methods instead of loop
---
### Positive Observations
- β
Good test coverage (95%)
- β
Clear function names
- β
Proper error handling
---
### Recommendations
{Next steps, improvements, follow-up items}
Common Issues
Security (Surface-Level)
π΄ Hardcoded credentials (obvious) π΄ Missing input validation π΄ Missing authentication/authorization
For comprehensive security review, use role-security-auditor skill
Code Quality
π‘ Large functions (>50 lines) π‘ Deep nesting (>3 levels) π‘ Code duplication π‘ Unclear naming π‘ Missing documentation π‘ Inconsistent style
Testing
π‘ Missing tests π‘ Low coverage (<80%) π‘ Flaky tests π‘ Tests testing implementation π‘ No edge case coverage
Performance
π΅ Inefficient algorithms π΅ Unnecessary database queries π΅ Missing caching π΅ Large object allocations π΅ No lazy loading
Review Process
Before Reviewing
- Understand the purpose of the changes
- Read the PR description or requirements
- Identify the files changed
- Load relevant code standards
- Check for related dependencies
During Review
- Read through all changes
- Check against code standards
- Look for security issues first
- Verify edge cases are handled
- Check test coverage
- Consider performance implications
- Think about maintainability
- Note positive patterns
After Review
- Categorize issues by severity
- Provide specific, actionable feedback
- Explain WHY changes are needed
- Suggest specific fixes
- Acknowledge good work
- Estimate effort for fixes
- Provide overall assessment
Best Practices
β Review within 24 hours β Provide specific, actionable feedback β Explain WHY, not just WHAT β Suggest alternatives β Acknowledge good work β Use severity levels (Critical/Warning/Suggestion) β Test the code if possible β Check for security issues first β Consider edge cases β Think about future maintenance β Be thorough but kind β Prioritize critical issues β Offer help with fixes
Security Review Checklist
For comprehensive security reviews, use the role-security-auditor skill.
For basic security checks during code review:
Input Validation
- All user inputs validated
- Type checking present
- Sanitization for output
Authentication & Authorization
- Proper authentication required
- Resource ownership verified
- Session management secure
Data Protection
- No sensitive data in logs
- Proper secret management
Example Review
## Code Review: User Authentication
**Summary:** Adds login, registration, and password reset functionality to the auth module.
**Assessment:** Needs Work
---
### Issues Found
#### π΄ Critical (Must Fix)
- **File:** `src/controllers/auth.js:45`
**Issue:** Password stored in plain text
**Fix:** Hash password using bcrypt before saving to database
- **File:** `src/routes/auth.js:23`
**Issue:** SQL injection vulnerability in login query
**Fix:** Use parameterized queries with prepared statements
#### π‘ Warnings (Should Fix)
- **File:** `src/utils/validation.js:12`
**Issue:** Email regex too permissive, allows invalid emails
**Fix:** Use a more restrictive email validation pattern
- **File:** `src/services/email.js:8`
**Issue:** No rate limiting on password reset requests
**Fix:** Add rate limiting (e.g., 3 requests per hour per email)
#### π΅ Suggestions (Nice to Have)
- **File:** `src/controllers/auth.js:30`
**Issue:** Function is 75 lines, could be split
**Fix:** Extract email sending logic to separate function
- **File:** `src/models/user.js:15`
**Issue:** Consider adding emailVerified field
**Fix:** Add boolean field for email verification status
---
### Positive Observations
- β
Good separation of concerns (routes, controllers, services)
- β
Comprehensive error handling
- β
Good use of async/await
- β
Proper HTTP status codes
- β
Clear, descriptive function names
- β
Test coverage at 85%
---
### Recommendations
1. Fix critical security issues before merging
2. Add rate limiting to prevent abuse
3. Improve email validation
4. Consider adding email verification flow
5. Extract large functions for better readability
6. Add integration tests for complete auth flow
**Overall:** Good foundation but security issues must be addressed before deployment.
Review Assessment Levels
Approve
- No critical issues
- Minor warnings are optional improvements
- Code is production-ready
- Tests are comprehensive and passing
Needs Work
- No critical issues
- Some warnings that should be addressed
- Code is close to production-ready
- Minor fixes needed before merge
Requires Changes
- Critical issues present
- Major concerns with functionality or security
- Code not ready for production
- Significant work needed
Feedback Style Guidelines
Constructive Feedback
- Focus on the code, not the person
- Provide specific examples
- Explain the impact of the issue
- Suggest concrete improvements
- Offer to help with implementation
Tone Examples
β Too harsh: "This is terrible code. You don't understand security at all."
β Constructive: "I notice the password is stored in plain text. This creates a security vulnerability where user passwords could be exposed if the database is compromised. I recommend using bcrypt to hash passwords before storing them."
β Too vague: "This function is too long."
β
Constructive: "The authenticateUser function is 75 lines long, which makes it harder to test and maintain. Consider extracting the email sending logic into a separate function, which would improve readability and make it easier to test each piece independently."
When to Escalate
Escalate to team or security team when:
- Critical security vulnerabilities found
- Architectural concerns beyond scope of review
- Potential legal or compliance issues
- Major disagreements on approach
- Need for security audit
Golden Rule: Review code as you'd want yours reviewed - thoroughly but kindly.