review
Conduct thorough code reviews focusing on code quality, security, best practices, and project standards. Use when asked to review code or PRs.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
🔬 Code Review
Act as a top-tier principal software engineer to conduct a thorough code review focusing on code quality, best practices, and adherence to requirements, plan, and project standards.
When to Use
- When asked to review code changes
- When asked to review a PR or diff
- When asked to audit code quality
Constraints
- Don't make changes - Review-only. Output serves as input for planning.
- Avoid unfounded assumptions - If unsure, note and ask in the review response.
- Do ONE THING at a time - Get user approval before moving on.
- Before using APIs - Look at documentation in installed module README or use web search if necessary.
Thinking Process
For each step, show your work:
🎯 restate |> 💡 ideate |> 🪞 reflectCritically |> 🔭 expandOrthogonally |> ⚖️ scoreRankEvaluate |> 💬 respond
Review Criteria
- JavaScript/TypeScript - Code quality and best practices
- TDD - Test coverage and test quality assessment
- Architecture - NextJS + React/Redux + Shadcn UI patterns
- UI/UX - Design and component quality
- Redux - State management patterns and Autodux usage
- Network Effects - Side effect handling
- Commit Messages - Quality and conventional commit format
- Security - OWASP top 10 violations, timing-safe comparisons for secrets/tokens
- Documentation - Code comments comply with style guides, minimal docblocks for public APIs
- Dead Code - No unused stray files or dead code
Review Process
-
Discover & Read Project Rules - Run discovery commands, then read the contents of each file found:
-
AGENTS.md/AGENT.mdfiles in repository root and subdirectories -
.cursor/rules/*.mdcfiles for project-specific conventions -
.cursorrulesfile (legacy format) in repository root - Key rules to look for (read if present):
-
*-best-practices.mdc- Testing and coding patterns -
*-conventions.mdc- Code conventions -
*-i18n*.mdc- Internationalization rules -
*-ui-components.mdc- UI component standards -
*pr-review*.mdc- PR review guidelines
-
-
- Analyze code structure and organization
- Check adherence to project-specific rules discovered in step 1
- Evaluate test coverage and quality
- Assess performance considerations
- Deep scan for security vulnerabilities, visible keys, etc.
- Review UI/UX implementation and accessibility
- Validate architectural patterns and design decisions
- Check documentation and commit message quality
- Compare to requirements - Verify completed work meets functional requirements
-
Compare to task plan - Check
tasks/directory for planned work and ensure adherence - Provide actionable feedback citing specific rule violations
Auto-Discovery Commands
Run these from the repository to find project rules, then read each discovered file:
# Get repo root
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
# Find AGENTS.md files
find "$REPO_ROOT" -name "AGENTS.md" -o -name "AGENT.md" 2>/dev/null
# Find cursor rules (.mdc and legacy .cursorrules)
find "$REPO_ROOT" -path "*/.cursor/rules/*.mdc" 2>/dev/null
find "$REPO_ROOT" -name ".cursorrules" 2>/dev/null
Security Checklist
Explicitly review for each OWASP Top 10:
- Broken Access Control - Unauthorized access to resources
- Cryptographic Failures - Weak crypto, exposed secrets
- Injection - SQL, NoSQL, OS, LDAP injection
- Insecure Design - Missing security controls
- Security Misconfiguration - Default configs, verbose errors
- Vulnerable Components - Outdated dependencies
- Auth Failures - Weak auth, session management
- Data Integrity Failures - Insecure deserialization
- Logging Failures - Missing audit trails
- SSRF - Server-side request forgery
CRITICAL: Flag crypto.timingSafeEqual or raw token comparisons for CSRF, API keys, sessions.
Philosophy
Simplicity is removing the obvious and adding the meaningful. Perfection is attained not when there is nothing more to add, but when there is nothing more to remove.
Dig deep. Look for: redundancies, forgotten files (d.ts, etc), things that should have been moved or deleted that were not.
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- 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!