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.
npx skills add s977043/river-review --skill nextjs-server-action-securitygit clone --depth 1 https://github.com/s977043/river-reviewWrote 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.
[](https://agentmods.dev/skills/s977043/river-review/nextjs-server-action-security)<a href="https://agentmods.dev/skills/s977043/river-review/nextjs-server-action-security"><img src="https://agentmods.dev/badge/skills/s977043/river-review/nextjs-server-action-security/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.
<a href="https://agentmods.dev/skills/s977043/river-review/nextjs-server-action-security"><img src="https://agentmods.dev/badge/skills/s977043/river-review/nextjs-server-action-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00046 | $0.01201 |
| Opus 5.5 | $0.00018 | $0.00480 |
| Sonnet 5.5 | $0.00009 | $0.00240 |
| Haiku 4.5 | $0.00005 | $0.00120 |
Grade A, and why
Next.js Server Action Security Review 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Pattern declaration
Primary pattern: Reviewer Secondary patterns: Inversion Why: Server Action を「誰でも呼べる公開エンドポイント」と仮定し、認証・認可・入力検証の欠落をチェックリスト型で検査する。
Goal / 目的
'use server'で公開される Server Action は 認証なしに誰でも呼べる公開 HTTP エンドポイントである、という前提に立つ。- mutation(DB の更新・削除・課金など)前に、セッション/認証と認可(リソース所有者確認)が検証されていない欠落を検出する。
formDataや引数を検証せず DB へ直接渡す入力バリデーション欠如、クライアントから渡る ID をなりすまし可能なまま信頼する誤りを検出する。
Non-goals / 扱わないこと
- client/server 境界判定(
use client誤用)はnextjs-app-router-boundaryの領域。本スキルでは扱わない。 - read-only の Server Action(mutation を伴わないもの)への認可指摘。
- 認証ライブラリ・バリデーションライブラリの選定や設計全般。
- CSRF / レート制限などインフラ層の防御(フレームワーク・基盤の責務)。
Pre-execution Gate / 実行前ゲート
このスキルは以下の条件がすべて満たされない限りNO_REVIEWを返す。
- 差分に
'use server'関数 / Server Action(actions.ts など)の追加・変更が含まれている - diff コンテキストが利用可能である
ゲート不成立時の出力: NO_REVIEW: nextjs-server-action-security — Server Action の変更なし
False-positive guards / 抑制条件
- 認証チェックを共通ヘルパー(
requireUser()/requireAuth()等)に委譲しており、差分内にその呼び出しが見える場合は指摘しない。 - 公開フォーム(問い合わせ・ニュースレター登録など、認証不要が要件上正当なもの)で、その旨がコメントで明記されている mutation は、認可指摘を質問に留める。
- read-only の Server Action(mutation なし)は認可指摘の対象外。
- 入力検証を共通ヘルパーやスキーマ(zod 等)へ委譲し、差分内でその呼び出しが見える場合は指摘しない。
Rule / ルール
- mutation を行う Server Action は、処理前に認証(例:
auth()/getServerSession()/requireUser()等)でセッションを確認する。 - mutation 対象がユーザー固有リソースなら、認可(リソース所有者がセッションユーザーと一致するか)を確認する。
formData/ 引数は zod 等で検証してから利用する。型は信頼できない(Server Action の引数はクライアント由来)。formData.get('userId')のようにクライアントから渡る ID を所有者として信頼しない。所有者はセッションから導出する。
Evidence / 根拠の取り方
- 指摘は
<file>:<line>で差分に紐づけ、mutation 呼び出しと認証/認可/検証の欠落箇所を併記する。 - 抑制条件に該当しないこと(差分内にヘルパー呼び出しが見えないこと)を根拠として示す。
Output / 出力(短文版の推奨)
コメントは日本語で返す。
- Finding: どの防御が欠落しているか(1文)
- Impact: 不正な mutation / なりすまし / 不正入力の DB 反映 等
- Fix: 認証チェック / 所有者確認 / zod 検証の最小修正案
Sources / 出典
- Next.js — Server Actions and Mutations (Authentication and Authorization): https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations#authentication-and-authorization
- Next.js — How to Think About Security in Next.js: https://nextjs.org/blog/security-nextjs-server-components-actions
What ships with it
3 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.
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.
- 1mo ago First seen · 78 lines · 46 tokens per session scan A 3894a9b5add3
Next.js Server Action Security Review is a skill published in the GitHub repository s977043/river-review (7 stars, last pushed yesterday), licensed MIT. It adds 46 tokens to every session and 1,201 once invoked, about $0.0002 per session on Opus 5.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.
Other skills, from other repositories
python-services
Python patterns for CLI tools, async parallelism, and backend services. Use when building CLI apps, async/parallel Python, FastAPI services, background jobs, or configuring Python project tooling (uv, ruff, ty).
nodejs-backend
Node.js backend patterns: framework selection, layered architecture, TypeScript, validation, error handling, security, production deployment. Use when building REST APIs, Express/Fastify servers, microservices, or server-side TypeScript.
ia-php-laravel
Modern PHP 8.4 and Laravel patterns: architecture, Eloquent, migrations, queues, testing. Use when working with Laravel, Eloquent, Blade, artisan, or building/testing a framework-based PHP app. Not for php-src internals, standalone PHP libraries, or general PHP language discussion.
php-laravel
Modern PHP 8.2+ and Laravel patterns: architecture, Eloquent, queues, Pest testing. Use when asked to "write PHP", "build a Laravel app", "fix Eloquent query", "add a queue job", "write a Pest test", or mentions PHP, Laravel, Eloquent, Blade, artisan, or migrations.
run-iteration-eval
Run the Logic-Lens content-eval pipeline for one iteration and produce a scored summary.json — use to measure a skill change. Wraps scripts/run-content-evals.sh (runner, costs tokens) and scripts/grade-iteration.py (grader, free, re-runnable). ALWAYS sync the plugin cache first. Use when the user wants to "run the…
api-contract
API contract & type-safety audit of changed code: breaking signature/route/response changes without versioning, schema drift, serialization issues, any/cast at boundaries, back-compat-breaking enum/union changes. Use for API contract review, back-compat check, schema or type-boundary audit of a diff.