frontend-page-structure

Organize React/TypeScript frontend pages with a cohesion-driven screens folder structure.

1|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/p-iknow/fullstack-forge --skill frontend-page-structure
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: frontend-page-structure
Source: https://github.com/p-iknow/fullstack-forge/tree/main/.claude/skills/frontend-page-structure
Command: npx skills add https://github.com/p-iknow/fullstack-forge --skill frontend-page-structure

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This guide eliminates inconsistent page layouts, unclear filenames, and brittle imports in frontend apps by prescribing a cohesion-driven screens folder convention and clear split rules so teams can navigate, maintain, and refactor pages with confidence.

Core Features & Use Cases

  • Cohesion-driven screens folder: Keep route wrappers thin and place actual page components under src/screens to separate routing from page implementation.
  • 500-line rule for splitting: Keep files under ~500 lines; split into *.sub, then into *.helper or *.ui when sub internals grow complex.
  • Naming and folder conventions: Use context-page.tsx filenames, kebab-case, avoid barrel index exports, and prefer direct relative imports.
  • Folder roles and @shared model: Use *.sub for subcomponents, *.views for alternative full UIs, *.helper for business logic, *.ui for presentational pieces, and an @shared three-tier hierarchy for cross-page reuse.
  • Anti-pattern guidance: Avoid over-nesting, premature splitting, premature sharing, and generic filenames to preserve clarity and tree-shaking.

Quick Start

Create a new page by adding a context-page.tsx under src/screens/your-domain/your-context/, keep the file under 500 lines and split into *.sub or *.helper folders only when the content exceeds the 500-line guideline, and move any item into @shared as soon as it is used by two or more consumers.

Frequently Asked Questions about frontend-page-structure

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

FAQPage Schema
How do I structure a React frontend project to keep page components maintainable?▼

Apply a cohesion-driven screens folder convention by keeping route wrappers thin and placing actual page components under src/screens to separate routing from implementation.

When should I split a React component file into separate subcomponents?▼

Split a React component file when it exceeds the 500-line rule, breaking it into *.sub folders for subcomponents, then into *.helper or *.ui folders when those internals grow complex.

What naming conventions should I use for frontend page files and folders?▼

Use context-page.tsx filenames with kebab-case, avoid barrel index exports, and prefer direct relative imports to eliminate unclear filenames and brittle imports in frontend apps.

Does this frontend page structure convention work with TypeScript apps?▼

Yes, this convention is designed for React/TypeScript frontend apps, enforcing context-based naming and explicit folder types like *.sub, *.ui, *.helper, and *.views during page creation and refactors.

How do I manage shared components across different frontend domains and features?▼

Manage cross-page reuse with a three-tier @shared sharing model, moving any item into @shared as soon as it is used by two or more consumers to control reuse and avoid premature sharing.

What anti-patterns should I avoid when refactoring frontend page structure?▼

Avoid over-nesting, premature splitting, premature sharing, and generic filenames when refactoring frontend page structure, as these anti-patterns reduce clarity and harm tree-shaking.