Next.js App Router Client/Server Boundary

Next.js App Router Client/Server Boundary is a skill for Claude Code from s977043/river-review. It costs 32 tokens per session (696 once invoked), scanned A, original, MIT.

A review rule for Next.js App Router components that checks whether server-side components use browser-only React hooks or browser APIs.

In plain words
What is it for?
It reviews changes using useState, useEffect, window, document, localStorage, or similar APIs, while checking for an explicit "use client" directive.
Why use it?
It catches code that crosses the server–browser boundary and can fail during rendering or deployment. It also points to the smallest fix, such as moving that code into a client component.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the river-review plugin — 138 skills, 18 commands, 5 agents, 3 hooks shipped together

Good fit It reviews changes using useState, useEffect, window, document, localStorage, or similar APIs, while checking for an explicit "use client" directive.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/s977043/river-review/nextjs-app-router-boundary
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add s977043/river-review --skill nextjs-app-router-boundary
Clone the repo
git clone --depth 1 https://github.com/s977043/river-review

Made for: Claude Code.

Or install river-review, the plugin that ships this one along with the rest of its 138 skills, 18 commands, 5 agents, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Next.js App Router Client/Server Boundary

README.md
[![agentmods](https://agentmods.dev/badge/skills/s977043/river-review/nextjs-app-router-boundary/github.svg)](https://agentmods.dev/skills/s977043/river-review/nextjs-app-router-boundary)
Your own site
<a href="https://agentmods.dev/skills/s977043/river-review/nextjs-app-router-boundary"><img src="https://agentmods.dev/badge/skills/s977043/river-review/nextjs-app-router-boundary/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Next.js App Router Client/Server Boundary

Your own site · 80×15
<a href="https://agentmods.dev/skills/s977043/river-review/nextjs-app-router-boundary"><img src="https://agentmods.dev/badge/skills/s977043/river-review/nextjs-app-router-boundary.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 696 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00032 $0.00696
Opus 5 $0.00016 $0.00348
Sonnet 5 $0.00006 $0.00139
Haiku 4.5 $0.00003 $0.00070

Measured 7d ago against content hash af3fe3d20b9e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

Next.js App Router Client/Server Boundary scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/midstream/nextjs-app-router-boundary/SKILL.md · 66 lines

What it actually says

Goal / 目的

  • App Router の Server Component でクライアント専用APIを誤って使うミスを減らす。

Non-goals / 扱わないこと

  • 画面設計やUI/UXの是非。
  • App Router 以外のフレームワーク構成。
  • 非同期データ取得の最適化全般(別スキルの対象)。

False-positive guards / 抑制条件

  • ファイル先頭に use client が明示されている場合は指摘しない。
  • コメントで意図的な回避策が明記されている場合は慎重に扱う。

Rule / ルール

  • Server Component で useState / useEffect / useLayoutEffect を使わない。
  • Server Component で window / document / localStorage / sessionStorage を参照しない。

Evidence / 根拠の取り方

  • 差分内にクライアント専用APIが直接登場していることを示す。
  • use client の有無を併記し、境界違反である根拠を示す。

Heuristics / 判定の手がかり

  • use client のないファイルで React Hooks や DOM API を使っている。
  • window 依存の処理が Server Component に残っている。

Actions / 改善案

  • use client が必要な場合は、対象コンポーネントを分割してクライアント側へ移す。
  • DOM API が必要な処理をクライアント専用の子コンポーネントに閉じ込める。

Output / 出力

  • Finding: / Evidence: / Impact: / Fix: を含む短いメッセージにする。

評価指標(Evaluation)

  • 合格基準: 境界違反が差分に紐づき、根拠と最小修正が説明されている。
  • 不合格基準: 差分と無関係な指摘、根拠のない断定、抑制条件の無視。

人間に返す条件(Human Handoff)

  • 設計意図が不明で解釈が分かれる場合は質問として返す。
  • 大規模なコンポーネント分割が必要な場合は人間レビューへ返す。
Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 66 lines · 32 tokens per session scan A af3fe3d20b9e

Subscribe to this mod's changes

Next.js App Router Client/Server Boundary is a skill published in the GitHub repository s977043/river-review (3 stars, last pushed today), licensed MIT. It adds 32 tokens to every session and 696 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

fe-build

Implements frontend components and pages for React / Next.js / Vite SPA + TypeScript projects. Use when: starting implementation after feature.md or a spec is approved, writing components, building pages. Do NOT load for: writing specs, code review, bug analysis.

sh5623/fe-rail · 57 tokens

recipe-front-review

Reviews completed frontend implementation for governing-source compliance, scope economy, repository quality, and security, then applies user-approved React corrections.

shinpr/claude-code-workflows · 29 tokens

spotpatch

A development workflow for React that connects a selected page element to its JSX or TSX source code and gathers context for review.

huanglvjing/spotpatch · 93 tokens

react-frontend

React, TypeScript, and Next.js patterns for frontend development. Use when building React components, managing state, fetching data, optimizing performance, or working with Next.js App Router. Covers React 18-19, hooks, Server Components, and type-safe patterns.

iliaal/whetstone · 57 tokens

testing-react

Writes React/TypeScript tests using Vitest and React Testing Library. Use when "write react tests", "vitest", "component test", "hook test", "RTL", "testing library", "snapshot test", or testing React components, hooks, and utilities.

iliaal/whetstone · 57 tokens

react-effects-audit

Use when auditing React or Next.js components for unnecessary or unsafe useEffect usage -- detects 9 anti-patterns from "You Might Not Need an Effect".

fusengine/agents · 36 tokens