next-application-structure

next-application-structure is a skill for Claude Code, Codex from soulcodex/agentic. It costs 64 tokens per session (624 once invoked), scanned A, original, MIT.

A guide for organising Next.js 14+ applications that use the App Router, a system where folders define web routes. It covers folders, server and browser code, data loading, updates, and tests.

In plain words
What is it for?
Use it when starting or reviewing a Next.js application, defining App Router conventions, separating features, or checking whether the architecture supports the intended React behaviour.
Why use it?
It helps prevent unclear project structure, unsafe mixing of server and browser code, and inconsistent ways of loading or changing data.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex; mentions OpenCode.

Good fit Use it when starting or reviewing a Next.js application, defining App Router conventions, separating features, or checking whether the architecture supports the intended React behaviour.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/soulcodex/agentic/next-application-structure
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 soulcodex/agentic --skill next-application-structure
Clone the repo
git clone --depth 1 https://github.com/soulcodex/agentic

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 next-application-structure

README.md
[![agentmods](https://agentmods.dev/badge/skills/soulcodex/agentic/next-application-structure/github.svg)](https://agentmods.dev/skills/soulcodex/agentic/next-application-structure)
Your own site
<a href="https://agentmods.dev/skills/soulcodex/agentic/next-application-structure"><img src="https://agentmods.dev/badge/skills/soulcodex/agentic/next-application-structure/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-application-structure

Your own site · 80×15
<a href="https://agentmods.dev/skills/soulcodex/agentic/next-application-structure"><img src="https://agentmods.dev/badge/skills/soulcodex/agentic/next-application-structure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 624 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00064 $0.00624
Opus 5.5 $0.00026 $0.00250
Sonnet 5.5 $0.00013 $0.00125
Haiku 4.5 $0.00006 $0.00062

Measured 1mo ago against content hash cc50c7a525fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

next-application-structure 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.

skills/ui/next-application-structure/SKILL.md · 92 lines

How it starts

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

Next Application Structure Skill

Step 1 — App Router Directory Layout

Organise by route segment and feature ownership:

src/
  app/
    (marketing)/
      page.tsx
    (app)/
      dashboard/
        page.tsx
        loading.tsx
        error.tsx
    api/
      auth/
        route.ts
    layout.tsx
  features/
    auth/
      components/
      server/
      client/
      auth.types.ts
  components/
    ui/
  lib/
    db/
    auth/
    validation/

Step 2 — Server and Client Boundaries

  • Default to Server Components; add 'use client' only when interactivity or browser APIs are needed.
  • Keep data fetching and secrets in server modules/route handlers.
  • Pass serialized data to client components via props.
  • Avoid importing server-only modules into client components.
  • Use alias imports for cross-directory modules and ESM import/export syntax only.

Step 3 — Data Fetching and Mutations

  • Read data in Server Components when possible.
  • Use Route Handlers or Server Actions for mutations.
  • Revalidate with revalidatePath/revalidateTag after mutations.
  • Centralize schema validation (for example Zod) at request boundaries.

Step 4 — State and Caching Strategy

  • URL and route params: App Router primitives.
  • Shared client interaction state: React context or local store in client layer.
  • Remote data cache: Next fetch cache + query library only when client-side refetching is needed.

Step 5 — Testing Parity with React Stack

  • Unit and component tests: Vitest + React Testing Library.
  • E2E flows: Playwright.
  • For Server Components and route handlers, test logic in extracted server utilities where possible.

Step 6 — Verify

  • App Router segments contain page.tsx/layout.tsx and special files only where needed
  • Server-first component model is respected, with minimal 'use client'
  • Secrets and privileged logic stay server-side
  • Mutation flows trigger explicit revalidation
  • pnpm tsc --noEmit and pnpm test pass

Read the full file on GitHub · 92 lines

Files

What ships with it

1 file 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. 1mo ago First seen · 92 lines · 64 tokens per session scan A cc50c7a525fb

Subscribe to this mod's changes

next-application-structure is a skill published in the GitHub repository soulcodex/agentic (10 stars, last pushed 29d ago), licensed MIT. It adds 64 tokens to every session and 624 once invoked, about $0.0003 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-08-31.

Related

Other skills, from other repositories