スキル一覧に戻る
physics91

nextjs-reviewer

by physics91

Claude Code hooks를 활용하여 세션 컴팩션 시 AGENTS.md 컨텍스트를 자동으로 보존/복원하는 플러그인

0🍴 0📅 2025年12月29日
GitHubで見るManusで実行

SKILL.md


name: nextjs-reviewer description: | WHEN: Next.js project review, App Router patterns, Server/Client Component separation, data fetching WHAT: Router pattern analysis + SC/CC separation + next/image·font optimization + Server Actions review WHEN NOT: General code quality → code-reviewer, Bundle performance → perf-analyzer

Next.js Reviewer Skill

Purpose

Reviews Next.js specific patterns: App Router, Server Components, data fetching, and optimizations.

When to Use

  • Next.js project code review
  • App Router, Server Component mentions
  • Next.js optimization requests
  • Projects with next.config.js or next.config.mjs

Project Detection

  • next.config.js or next.config.mjs
  • next dependency in package.json
  • app/ directory (App Router)
  • pages/ directory (Pages Router)

Workflow

Step 1: Analyze Configuration

**Next.js**: 14.x
**Router**: App Router
**TypeScript**: Enabled

Step 2: Select Review Areas

AskUserQuestion:

"Which areas to review?"
Options:
- Full Next.js pattern check (recommended)
- Server/Client Component separation
- Data fetching patterns
- Image/Font optimization
- Routing and layouts
multiSelect: true

Detection Rules

Server vs Client Components

CheckRecommendationSeverity
Unnecessary 'use client'Remove if SC possibleMEDIUM
async in Client ComponentMove to SCHIGH
useState/useEffectCheck 'use client' needINFO
// BAD: Unnecessary 'use client'
'use client'
export default function StaticPage() {
  return <div>Static content</div>
}

// GOOD: Keep as Server Component
export default function StaticPage() {
  return <div>Static content</div>
}

App Router Files

FilePurposeCheck
page.tsxRoute pageDefault export
layout.tsxLayoutchildren prop
loading.tsxLoading UISuspense alternative
error.tsxError handling'use client' required

Data Fetching

PatternRecommendation
SC fetchRecommended (auto caching)
Route HandlerAPI endpoints
Client SWR/React QueryReal-time data
// GOOD: Direct fetch in Server Component
async function ProductPage({ params }) {
  const product = await fetch(`/api/products/${params.id}`)
  return <Product data={product} />
}

// WARNING: useEffect fetch in Client
'use client'
function ProductPage({ params }) {
  useEffect(() => { fetch(...) }, [])
  // Recommend: Move to Server Component
}

Image Optimization

CheckIssueSeverity
<img> tagUse next/imageHIGH
Missing width/heightLayout shiftMEDIUM
Missing priorityLCP image needs itMEDIUM

Server Actions

CheckDescriptionSeverity
'use server' locationTop of function/fileHIGH
Input validationUse zodHIGH
Error handlingtry-catchMEDIUM

Response Template

## Next.js Review Results

**Project**: [name]
**Next.js**: 14.x (App Router)

### Server/Client Components
| Status | File | Issue |
|--------|------|-------|
| WARNING | app/products/page.tsx | Unnecessary 'use client' |

### Data Fetching
| Status | Location | Recommendation |
|--------|----------|----------------|
| WARNING | app/dashboard/page.tsx | Move useEffect fetch to SC |

### Optimization
| Area | Status | Details |
|------|--------|---------|
| Images | WARNING | 3 files using <img> |
| Fonts | OK | Using next/font |

### Actions
1. [ ] Remove 'use client' from `app/products/page.tsx`
2. [ ] Move fetch to Server Component
3. [ ] Use next/image in `components/Banner.tsx`

Best Practices

  1. Server First: Keep SC when possible
  2. Colocation: Fetch data where needed
  3. Streaming: Use loading.tsx and Suspense
  4. Caching: Explicit fetch caching strategy
  5. Metadata: Use generateMetadata

Integration

  • code-reviewer skill
  • perf-analyzer skill
  • security-scanner skill

Notes

  • Based on Next.js 13+ App Router
  • Pages Router has different rules
  • Review next.config.js settings too

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です