AgentSkillsCN

code-review

针对 Next.js 和 TypeScript 项目进行代码审查。当被要求“审查这段代码”“检查这个 PR”“审阅我的改动”“查看这个组件”,或收到任何代码审查请求时,可使用此技能。本技能严格遵循团队在 TypeScript 类型、React 组件模式、错误处理、无障碍设计以及性能优化等方面的规范标准。

SKILL.md
--- frontmatter
name: code-review
description: Code review for Next.js and TypeScript projects. Use when asked to "review this code", "check this PR", "review my changes", "look at this component", or any code review request. Applies team standards for TypeScript types, React component patterns, error handling, accessibility, and performance.
metadata:
  author: atef-ataya
  version: '1.0.0'

Code Review

Review Process

  1. Understand Intent — What is this code trying to accomplish?
  2. Check Standards — TypeScript types, component patterns, error handling
  3. Review Logic — Bugs, edge cases, correctness
  4. Security Scan — Common vulnerabilities (XSS, injection, exposed secrets)
  5. Synthesize Feedback — Actionable recommendations

Output Format

Always structure reviews as follows:

Summary

One paragraph: What does this code do? Is it ready to merge?

Critical Issues (Must Fix)

  • Security vulnerabilities
  • Logic errors / bugs
  • Breaking changes

Improvements (Should Fix)

  • Missing TypeScript types
  • Component structure issues
  • Missing error handling

Suggestions (Nice to Have)

  • Performance optimizations
  • Refactoring opportunities
  • Better naming

Tech Stack Context

This project uses:

  • Next.js 16 (App Router)
  • React 19
  • TypeScript 5 (strict mode)
  • Tailwind CSS 4
  • Prisma ORM

Component Conventions

  • Functional components only
  • PascalCase file names: BlogCard.tsx
  • Props defined with type not interface
  • Use "use client" directive only when needed
  • Prefer Server Components by default