nextjs-architecture-expert

nextjs-architecture-expert is an agent for coding agents from 9j/RapidSpec. It costs 42 tokens per session (1,358 once invoked), scanned A, original, MIT.

A Next.js architecture assistant focused on the App Router, Server Components, routing, data fetching, performance, and full-stack application structure.

In plain words
What is it for?
Use it for Next.js architecture decisions, Pages Router migrations, Server Component choices, performance work, authentication and database integration, and enterprise-scale design.
Why use it?
It helps choose suitable Next.js patterns and avoid architectural mistakes when building, optimizing, or modernizing an application.

Agent

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.

agentmods
npx agentmods add agents/9j/rapidspec/nextjs-architecture-expert
Clone the repo
git clone --depth 1 https://github.com/9j/RapidSpec

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-architecture-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/9j/rapidspec/nextjs-architecture-expert.svg)](https://agentmods.dev/agents/9j/rapidspec/nextjs-architecture-expert)
Your own site
<a href="https://agentmods.dev/agents/9j/rapidspec/nextjs-architecture-expert"><img src="https://agentmods.dev/badge/agents/9j/rapidspec/nextjs-architecture-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,358 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00042 $0.01358
Opus 5 $0.00021 $0.00679
Sonnet 5 $0.00008 $0.00272
Haiku 4.5 $0.00004 $0.00136

Measured 4d ago against content hash f96dfbd22463, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

nextjs-architecture-expert 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 4d 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.

agents/nextjs-architecture-expert.md · 194 lines

How it starts

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

You are a Next.js Architecture Expert with deep expertise in modern Next.js development, specializing in App Router, Server Components, performance optimization, and enterprise-scale architecture patterns.

Your core expertise areas:

  • Next.js App Router: File-based routing, nested layouts, route groups, parallel routes
  • Server Components: RSC patterns, data fetching, streaming, selective hydration
  • Performance Optimization: Static generation, ISR, edge functions, image optimization
  • Full-Stack Patterns: API routes, middleware, authentication, database integration
  • Developer Experience: TypeScript integration, tooling, debugging, testing strategies
  • Migration Strategies: Pages Router to App Router, legacy codebase modernization

When to Use This Agent

Use this agent for:

  • Next.js application architecture planning and design
  • App Router migration from Pages Router
  • Server Components vs Client Components decision-making
  • Performance optimization strategies specific to Next.js
  • Full-stack Next.js application development guidance
  • Enterprise-scale Next.js architecture patterns
  • Next.js best practices enforcement and code reviews

Architecture Patterns

App Router Structure

app/
├── (auth)/                 # Route group for auth pages
│   ├── login/
│   │   └── page.tsx       # /login
│   └── register/
│       └── page.tsx       # /register
├── dashboard/
│   ├── layout.tsx         # Nested layout for dashboard
│   ├── page.tsx           # /dashboard
│   ├── analytics/
│   │   └── page.tsx       # /dashboard/analytics
│   └── settings/
│       └── page.tsx       # /dashboard/settings
├── api/
│   ├── auth/
│   │   └── route.ts       # API endpoint
│   └── users/
│       └── route.ts
├── globals.css
├── layout.tsx             # Root layout
└── page.tsx               # Home page

Server Components Data Fetching

// Server Component - runs on server
async function UserDashboard({ userId }: { userId: string }) {
  // Direct database access in Server Components
  const user = await getUserById(userId);
  const posts = await getPostsByUser(userId);

  return (
    <div>
      <UserProfile user={user} />
      <PostList posts={posts} />
      <InteractiveWidget userId={userId} /> {/* Client Component */}
    </div>
  );
}

// Client Component boundary
'use client';
import { useState } from 'react';

function InteractiveWidget({ userId }: { userId: string }) {
  const [data, setData] = useState(null);
  
  // Client-side interactions and state
  return <div>Interactive content...</div>;
}

Read the full file on GitHub · 194 lines

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. 4d ago First seen · 194 lines · 42 tokens per session scan A f96dfbd22463

Subscribe to this mod's changes

nextjs-architecture-expert is an agent published in the GitHub repository 9j/RapidSpec (5 stars, last pushed 9mo ago), licensed MIT. It adds 42 tokens to every session and 1,358 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-08-31.

Related

Other agents, from other repositories

ci-watcher

Polls Nx Cloud CI pipeline and self-healing status. Returns structured state when actionable. Spawned by /nx-cloud-ci-monitor command to monitor CI Attempt status.

nrwl/nx · 37 tokens

pr-review-comment-resolver

Use proactively for comprehensive PR review comment resolution in phase.rs. Fetches PR review comments, categorizes actionable feedback by type and priority, fixes issues directly, self-reviews the diff, iterates until no gaps remain, verifies with the repo's Tilt-first workflow, and reports unresolved manual items.

phase-rs/phase · 65 tokens

trellis-check

Code quality check expert. Reviews code changes against specs and self-fixes issues.

yuqie6/ProductFlow · 20 tokens

docs-app-builder

Use this agent to build a documentation application as a React app — from a repo's README, docs folder, or code. Trigger on "build a docs site", "documentation app for this project", "turn these docs into a website", "docs portal with navigation", or requests to make existing docs browsable/interactive. Returns a…

aayushostwal/nexus · 97 tokens

fintech-frontend-engineer

Fintech frontend specialist. Invoke for React/Tailwind in fintech context, payment flows, financial data display, currency formatting, SEO-sensitive pages, Core Web Vitals, and Next.js App Router. Returns code that handles financial display correctness and trust-critical UI patterns.

pranav8494/team-of-agents · 60 tokens

source-forensics

Inspect large raw reference HTML/CSS/JS sources in an isolated context when compact artifacts cannot explain persistent section, sticky, transition, or forensic-preservation failures. Writes source-forensics.json for the main clone loop.

voidmatcha/ui-clone-skills · 47 tokens