code-review
Review PHP code for quality, security, performance, and best practices. Use when asked to review, audit, or analyze code quality.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
PHP Code Review
Overview
Perform comprehensive code reviews for PHP projects, checking for quality, security vulnerabilities, performance issues, and adherence to best practices.
Review Checklist
1. Security Review
- Check for SQL injection vulnerabilities (use parameterized queries)
- Check for XSS vulnerabilities (escape output properly)
- Check for CSRF protection
- Validate all user input at system boundaries
- Check for insecure file operations
- Look for hardcoded credentials or secrets
- Verify proper authentication and authorization checks
2. Code Quality
- Verify proper type declarations (PHP 8.1+ features)
- Check for proper error handling and exception usage
- Ensure single responsibility principle
- Check for code duplication
- Verify naming conventions (PSR-12 compliance)
- Check cyclomatic complexity
- Look for dead code
3. Performance
- Check for N+1 query problems
- Verify proper use of caching
- Check for memory leaks in loops
- Look for unnecessary object instantiation
- Verify efficient string operations
- Check for proper database indexing usage
4. Testing
- Verify test coverage for critical paths
- Check for proper mocking and test isolation
- Ensure edge cases are tested
- Verify integration test coverage
Output Format
Provide findings organized by severity:
- Critical - Security vulnerabilities, data loss risks
- Major - Bugs, significant performance issues
- Minor - Code style, minor improvements
- Info - Suggestions, best practices
For each finding, include:
- File and line reference
- Description of the issue
- Suggested fix with code example
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!