Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    nextjs feature architecture

    1

    Scalable feature-based architecture for Next.js App Router projects to eliminate folder clutter and circular imports.

    $4.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    nextjs feature architecture

    nextjs feature architecture

    Example session with this skill installed

    I need to add a checkout flow to my Next.js app. Where should I put the payment processing logic and the success page?

    • Read your context and instructions
    • Compiled the nextjs feature architecture
    • Generated the UI component

    I will help you architect the checkout feature using a domain-driven structure. This keeps your payment logic isolated from your UI and ensures your routes remain thin.

    Checkout Feature Architecture

    File / FolderPathResponsibility
    Routesrc/app/checkout/success/page.tsxEntry point for the success view.
    Actionsrc/features/checkout/actions/process-payment.tsServer action for Stripe/LemonSqueezy processing.
    Querysrc/features/checkout/queries/get-order-summary.tsServer-side read for the final order state.
    Schemasrc/features/checkout/schema.tsZod validation for payment methods and addresses.
    Libsrc/lib/stripe.tsInitialized Stripe client used by the action.

    Implementation Detail

    // src/features/checkout/actions/process-payment.ts
    "use server"
    
    import { stripe } from "@/lib/stripe";
    import { checkoutSchema } from "../schema";
    
    export async function processPayment(formData: FormData) {
      // 1. Validate input with schema
      // 2. Check auth
      // 3. Call Stripe SDK from lib
      // 4. Invalidate relevant tags
    }
    

    Next steps

    1. Create the src/features/checkout/ directory and subfolders for actions and queries.
    2. Initialize your payment provider client in src/lib/.
    3. Map the checkout/success route to a clean component in the feature folder.

    page.tsx

    TSX · React component

    Generated

    Example file from a real run - the skill writes it into your workspace.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Stop dumping every component, hook, and utility into a global folder that becomes impossible to navigate as your project grows. This skill implements a scalable, domain-driven architecture for Next.js App Router projects, ensuring your codebase remains maintainable by grouping code by business capability.

    What it does

    • Domain-based grouping organizes code into features like auth, cart, or products instead of technical file types.
    • Dependency enforcement ensures a clean flow from app to features to shared to lib layers.
    • Server/Client boundary management keeps routes thin and prevents data clients from leaking into UI components.
    • Backend-agnostic integration provides clear placement for Supabase, Prisma, Drizzle, or external SDKs within the lib layer.
    • Feature anatomy scaling guides the growth of features from flat files to structured subdirectories only when complexity demands it.

    How it works

    1. Project Inspection analyzes your current src structure to identify existing features and architectural patterns.
    2. Placement Mapping determines exactly where new logic belongs, whether it is a server action, a query, or a shared UI component.
    3. Scaffold & Refactor generates the necessary file structure for new features or suggests targeted moves to fix circular dependencies.
    4. Boundary Verification checks that feature-specific state and hooks are not being illegally accessed by unrelated domains.

    Frameworks & tools

    Specifically designed for Next.js App Router projects using TypeScript. It works with any data layer including Prisma, Drizzle, Supabase, and standard REST/GraphQL clients.

    Why this beats prompting it yourself

    Generic prompts often result in "folder soup" where everything is flat in src/components. This skill applies a specific, tested hierarchy that prevents circular imports and keeps your server-side logic strictly separated from client interactivity.

    Use cases

    • Migrating a messy src/components folder into a clean feature-based structure.
    • Scaffolding a new business module with its associated queries, actions, and schemas.
    • Determining if a new hook should be feature-scoped or moved to a shared utility layer.
    • Refactoring fat page.tsx files into thin route handlers and domain components.

    Known limitations

    Does not automatically restructure existing projects unless requested. It defers to official Next.js documentation for specific API syntax which varies between versions.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Frontend & Web Apps.

    Does not automatically restructure legacy code without a specific request. Defer to official docs for version-specific Next.js API syntax.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 5 days ago

    Requires

    Nothing to install.

    Permissions

    Read Files
    Write Files
    Network Access
    Listed5 days ago

    What's inside

    Frequently Asked Questions

    This skill organizes your codebase into domain-specific modules (like 'auth' or 'cart') instead of technical folders, preventing the 'folder soup' and circular dependencies common in large Next.js projects.

    It is specifically designed for Next.js projects using the App Router and TypeScript, and it is compatible with major AI agents that support file system operations and architectural scaffolding.

    The skill includes architectural templates, dependency enforcement rules, and a logic-mapping framework that guides your AI agent in scaffolding new features or refactoring old ones.

    Yes, the architecture is backend-agnostic and includes specific guidelines for placing data layers like Supabase, Prisma, or Drizzle within a dedicated 'lib' layer to keep your UI components clean.

    While it excels at scaffolding new features, it also provides a 'Placement Mapping' and 'Refactor' process to help you systematically migrate a messy existing project into the new structure.

    By enforcing a strict flow from the App layer down to Shared and Lib layers, the skill ensures that feature-specific state and hooks remain encapsulated, preventing illegal cross-domain access.

    New in Frontend & Web Apps