frontend-architecture-patterns
Advanced structural patterns for Landing Pages, SaaS apps, and Data Visualization. Use when determining the macro-level layout, conversion flows, and ergonomic hierarchy of a new frontend project.
SKILL.mdskills/frontend-architecture-patterns/SKILL.md
GitHubFrontend Architecture & Interface Patterns
Purpose
Provide strict structural and ergonomic rules for assembling high-conversion landing pages, complex SaaS shells, and dense data visualizations. This bridges the gap between atomic UI design and full-page composition.
When to Use This Skill
Use when structuring a new frontend project, deciding on the layout of a landing page or SaaS dashboard, optimizing conversion funnels, or building complex data charts.
Phase 1: Macro-Architecture Selection
Identify the target product type to enforce the correct UI shell:
A. Landing Page Architecture (Conversion Optimized)
Select the correct sequence based on the product:
- Classic SaaS: Hero -> Value Prop -> Key Features -> Social Proof -> Pricing -> CTA
- Product-Led Growth: Hero (Interactive Demo) -> Social Proof -> Features -> Interactive Pricing -> CTA
- Enterprise: Hero (Video) -> Client Logos -> Solutions by Industry -> Security/Compliance -> Contact Sales
- Developer Tool: Hero (Code snippet/Terminal) -> Quick Start -> Technical Features -> Documentation link -> Github CTA
B. SaaS / App Interface Shells
- Sidebar Navigation: Width 64px (collapsed) / 240px (expanded). Main content area scrollable independently.
- Top Bar: Reserved for global search, profile management, and notification centers. Sticky blur.
- Bento Grid Dashboards: Asymmetric tile layouts prioritizing the highest-value data metric in the top left.
Phase 2: Micro-Architecture & Ergonomics
- Fitts's Law: Make primary CTAs large and easy to click. Minimum touch target:
44x44px. Place crucial actions at screen edges (bottom right floating action button). - Hick's Law: Minimize choices. Never show more than 3 primary pricing tiers or 5 main navigation links.
- Contrast: Maintain strict 4.5:1 text-to-background contrast ratio (WCAG AA).
Phase 3: Data Visualization Patterns
- Fonts: All numerical data and tabular data must use monospace fonts (
font-mono) to prevent layout shifting. - Legends: Bottom-aligned or right-aligned. Use distinct shape markers (dots/squares) to aid colorblind users.
- Interactivity: Charts must feature tooltips on hover. Empty states must be designed ("No data available").
Output Format / Delivery
- A complete layout specification or skeleton code (e.g., Next.js layout.tsx).
- Component architecture mapped to the chosen conversion pattern.
Behavior Rules
- Structure first, style second: Do not apply colors or animations until the structural sequence (Hero -> Features -> CTA) is locked.
- Adhere to standard shells: Do not reinvent navigation unless the product specifically demands experimental interaction.
- Data density: SaaS dashboards must optimize for data density without clutter; use spacing over borders to separate elements.
- State Management Boundaries: Explicitly decide state managers. Use local state for atomic components,
ZustandorJotaifor lightweight global state, and React Context only for dependency injection, avoiding prop-drilling in complex SaaS shells.
Hard Usage Rules (Tier 2: Conditional)
- ALLOWED: Initializing App Router files (
layout.tsx,page.tsx). - FORBIDDEN: Writing complex reactive state logic.
- CONSTRAINT: Every file generated must contain an explicit
"use client"or a comment explaining why it is a Server Component.
Safety Guardrails & Patched Prevention
- Client/Server Bleed Patch: If
useState,useEffect, or any event listener (onClick) is present, the file MUST start with"use client". - Prop Drilling Patch: If a prop is passed more than two component levels deep, halt generation and implement Context or Zustand.
- Layout Shift Patch: All
<Suspense>boundaries must have a<Skeleton>fallback with deterministic height and width. - Self-Rejection Clause: If the output violates boundary validation or generates uncapped prop chains, ABORT OUTPUT and self-correct.
Maintenance Notes
- Merged from legacy
pro-max-landing-page-architecture,pro-max-app-interface-patterns,pro-max-ux-guidelines, andpro-max-data-visualization.