nextjs-react

nextjs-react is a skill for Claude Code, Codex from kouroshez/coding-os. It costs 65 tokens per session (3,261 once invoked), scanned A, original, Apache-2.0.

A set of rules for building React interfaces in the Next.js web framework. It covers server-rendered components, loading and error states, browser storage, accessibility, search visibility, and TypeScript code.

In plain words
What is it for?
Use it when changing Next.js pages, layouts, React components, hooks, data fetching, or styling in the frontend.
Why use it?
It helps prevent server-and-browser rendering mismatches, unsafe browser API use, unclear error handling, and inconsistent component structure.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when changing Next.js pages, layouts, React components, hooks, data fetching, or styling in the frontend.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kouroshez/coding-os/nextjs-react
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 kouroshez/coding-os --skill nextjs-react
Clone the repo
git clone --depth 1 https://github.com/kouroshez/coding-os

Made for: Claude Code, Codex.

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 nextjs-react

README.md
[![agentmods](https://agentmods.dev/badge/skills/kouroshez/coding-os/nextjs-react/github.svg)](https://agentmods.dev/skills/kouroshez/coding-os/nextjs-react)
Your own site
<a href="https://agentmods.dev/skills/kouroshez/coding-os/nextjs-react"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/nextjs-react/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 nextjs-react

Your own site · 80×15
<a href="https://agentmods.dev/skills/kouroshez/coding-os/nextjs-react"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/nextjs-react.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,261 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.00065 $0.03261
Opus 5 $0.00032 $0.01631
Sonnet 5 $0.00013 $0.00652
Haiku 4.5 $0.00006 $0.00326

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

Security

Grade A, and why

nextjs-react 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 5d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/new_component.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

src/templates/nextjs/skills/nextjs-react/SKILL.md · 486 lines

How it starts

The opening of the file, as written. The whole thing — 486 lines — stays where its author put it; the contents beside it link to each section on GitHub.

This skill enforces Next.js 16 App Router and React patterns. It depends_on: [clean-code, frontend-fundamentals] which are loaded transitively — clean-code gives universal code quality, frontend-fundamentals gives stack-agnostic UI patterns (three-state async, hydration, a11y, SEO). This skill adds ONLY Next.js-App-Router and React-version-specific layering on top.

Pre-Code Checklist

Before writing or modifying any .ts/.tsx file:

  • Read docs/engineering/frontend-rules.md
  • If touching data fetching or rendering logic: read docs/engineering/frontend-rendering-rules.md
  • If touching design, layout, or styling: read STYLE_GUIDE.md + the relevant file in docs/design/
  • If touching API calls or error handling: read docs/api-contracts/error-format.md
  • Search the repo for existing components and hooks before creating new ones (use Grep/Glob)

1. Server Components First

Default to Server Components. Never add 'use client' unless the component genuinely requires it.

When to use 'use client'

  • Browser APIs (window, document, navigator, localStorage)
  • Event handlers (onClick, onChange, onSubmit)
  • React state or effects (useState, useEffect, useReducer, useRef with mutations)
  • Third-party client-only libraries (e.g., motion, chart libraries)

Correct — Server Component (default)

// app/products/[slug]/page.tsx
// No 'use client' — this is a Server Component
import { getProduct } from "@/lib/api/products";
import { ProductDetails } from "@/components/products/product-details";

export default async function ProductPage({
  params,
}: {
  params: Promise<{ slug: string }>;
}) {
  const { slug } = await params;
  const product = await getProduct(slug);

  return <ProductDetails product={product} />;
}

Correct — Client Component (only when needed)

// components/products/add-to-cart-button.tsx
"use client";

import { useState } from "react";

interface AddToCartButtonProps {
  productId: string;
  onAdd: (id: string) => void;
}

export function AddToCartButton({ productId, onAdd }: AddToCartButtonProps) {
  const [isAdding, setIsAdding] = useState(false);

  async function handleClick() {
    setIsAdding(true);
    try {
      await onAdd(productId);
    } finally {
      setIsAdding(false);
    }
  }

  return (
    <button onClick={handleClick} disabled={isAdding}>
      {isAdding ? "Adding..." : "Add to Cart"}
    </button>
  );
}

Read the full file on GitHub · 486 lines

Files

What ships with it

2 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. 5d ago First seen · 486 lines · 65 tokens per session scan A 7e331ec58bd6

Subscribe to this mod's changes

nextjs-react is a skill published in the GitHub repository kouroshez/coding-os (6 stars, last pushed yesterday), licensed Apache-2.0. It adds 65 tokens to every session and 3,261 once invoked, about $0.0003 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.