frontend-guidelines

Standardize frontend component placement and reuse in a Next.js monorepo.

6|Updated Jan 24, 2025
One-click install
npx skills add https://github.com/Liinkiing/larastack --skill frontend-guidelines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontend-guidelines
Source: https://github.com/Liinkiing/larastack/tree/main/.agents/skills/frontend-guidelines
Command: npx skills add https://github.com/Liinkiing/larastack --skill frontend-guidelines

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides frontend architecture guidelines to ensure consistent component placement, reuse, and maintainable code structure across a Next.js monorepo, reducing onboarding time and ambiguity.

Core Features & Use Cases

  • Collocate page-specific components inside the App Router page directory (the same directory as page.tsx, layout.tsx, etc.) and place them under a _components/ folder.
  • Centralize shared components and utilities under frontend/src/ following the existing project structure (src/ui/, src/shared/, src/theme/, etc.).
  • Promote shared usage when components or utilities are reused across routes, layouts, or features to maintain a single source of truth.

Quick Start

Use these guidelines to organize Next.js app code:

  • Place page-specific components in frontend/app/{route}/_components/ alongside page.tsx and layout.tsx.
  • Keep shared components and utilities in frontend/src/, adhering to the existing architecture and naming conventions.
  • Follow lint/format rules and prefer collocated components first before moving to shared directories.

Frequently Asked Questions about frontend-guidelines

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

FAQPage Schema
How do I organize components in a Next.js App Router monorepo?

To organize components in a Next.js App Router monorepo, colocate page-specific components inside a _components folder alongside the route's page.tsx, and centralize shared utilities under frontend/src/ to maintain a single source of truth.

When should I move a component to the shared frontend/src directory?

Move a component to the shared frontend/src directory when it is reused across multiple routes, layouts, or features. Prefer colocated page-specific components first before promoting them to shared directories to maintain maintainable structure.

What is the best way to structure a multi-page Next.js application?

The best way to structure a multi-page Next.js application is to standardize frontend patterns by colocating route-specific components under _components and organizing shared code under frontend/src/ subdirectories like src/ui/ and src/shared/.

Do I need specific lint rules for frontend component placement?

Yes, you need specific lint rules for frontend component placement to enforce the conventions of colocating page-specific components and maintaining a consistent naming structure across the Next.js App Router project.

Can I use this Next.js frontend architecture guideline for single-page apps?

This Next.js frontend architecture guideline targets multi-page app development using the App Router. While the shared frontend/src patterns might apply, the colocation conventions are specifically designed for multi-route and multi-page monorepo structures.