frontend-structure

Creates and reviews Next.js App Router page structures with containers, hooks, and components.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/moking55/migrate-plus --skill frontend-structure-moking55
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: frontend-structure
Source: https://github.com/moking55/migrate-plus/tree/main/.agents/skills/frontend-structure
Command: npx skills add https://github.com/moking55/migrate-plus --skill frontend-structure-moking55

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Keeping a Next.js App Router codebase consistent is hard when multiple features are added over time. This Skill enforces the repo's conventions for pages, containers, components, and hooks so every new screen follows the same structure. ## Core Features & Use Cases - Screen Scaffolding: Guides creation of authenticated or public pages under app/(screens) with server-only page.tsx files that render a single container. - Container & Hook Patterns: Defines the standard container folder layout ([feature]-container.tsx, use-[feature].ts, types.ts, index.ts) with use-immer for state management. - Convention Enforcement: Applies golden rules such as banning export * in favor of explicit export type { ... } re-exports, plus a validation checklist for reviews. - Use Case: When adding a new dashboard screen, use this Skill to generate the page, container, hook, and types files in the correct locations with the correct import and styling conventions. ## Quick Start Use the frontend-structure skill to create a new authenticated screen called "orders" with its container, hook, and types following the repo conventions.

Frequently Asked Questions about frontend-structure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a new page in Next.js App Router?▼

Create a server-only page.tsx under app/(screens) that renders a single container component. Place the container in src/containers/[feature]/ with a dedicated hook, types file, and index re-exports.

How to organize containers and hooks in a Next.js project?▼

Each container lives in src/containers/[feature]/ with [feature]-container.tsx, use-[feature].ts, types.ts, and index.ts. Shared hooks go in src/hooks/[hook-name]/ with the same file pattern.

Should page.tsx be a server or client component in App Router?▼

Keep page.tsx server-only by importing "server-only" and rendering only the container. Move client-side interactivity, state, and effects into the container component marked with "use client".

Why avoid export star in TypeScript index files?▼

export * pollutes the namespace, makes types hard to trace, and can cause circular dependencies. Use explicit export type { ... } statements so only intended types are exposed and IDE autocomplete stays accurate.

What state management does this frontend structure use?▼

Stateful containers use the use-immer library inside their dedicated hook. The hook encapsulates data fetching, loading, and error states, returning them to the container component.