improve-frontend-architecture

Identifies shallow frontend modules and proposes deepening refactors for React routes, hooks, and forms.

Updated Apr 28, 2026
One-click install
npx skills add https://github.com/GregM1991/skills --skill improve-frontend-architecture-gregm1991
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: improve-frontend-architecture
Source: https://github.com/GregM1991/skills/tree/main/skills/improve-frontend-architecture
Command: npx skills add https://github.com/GregM1991/skills --skill improve-frontend-architecture-gregm1991

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Frontend codebases accumulate shallow modules where callers must know nearly as much as the implementation, spreading interaction rules, accessibility obligations, and state handling across routes and call sites. This Skill surfaces that architectural friction and proposes deepening refactors that concentrate behaviour behind small interfaces. ## Core Features & Use Cases - Deepening candidate discovery: Explores the frontend codebase to find shallow UI modules, routes owning feature behaviour inline, repeated loading/error/empty states, and accessibility rules leaking to callers. - Dependency classification: Categorizes dependencies (in-process, React-local, route-provided, data-fetching, form/action, browser/platform, design-system, external) to decide where seams and adapters belong. - Parallel interface design: Spawns multiple sub-agents to produce radically different interface proposals for a chosen candidate, then compares them by depth, locality, and test surface. - Use Case: A route component has grown to own artifact downloads, status mapping, and form lifecycle inline. Use this Skill to identify the deep modules hiding inside it, then design a small interface like a SessionArtifactsPanel that owns the behaviour. ## Quick Start Ask the assistant to review the frontend code in this project and list deepening opportunities for shallow modules and overloaded routes.

Frequently Asked Questions about improve-frontend-architecture

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

FAQPage Schema
How do I find shallow modules in a React codebase?▼

Look for modules where callers must know nearly as much as the implementation: routes owning feature behaviour inline, repeated loading/error/empty states, and accessibility rules leaking to callers. Apply the deletion test — if deleting the module makes complexity reappear across callers, it deserves a deeper interface.

What is a deep module in frontend architecture?▼

A deep module hides substantial UI behaviour — rendering branches, state transitions, accessibility wiring, validation display — behind a small interface of props or hook returns. Depth is a property of the interface, not file size; a tiny wrapper that only renames props is shallow.

When should I extract a hook versus a UI component?▼

Extract a Hook Module when behaviour and rendering have separate reasons to change or need separate tests. Extract a UI Module when the unit owns visual and interaction behaviour including markup, accessibility, and styling. Route-local extraction is worthwhile even with a single caller.

Should I create an adapter for every data-fetching dependency?▼

No. One adapter equals a hypothetical seam; two adapters equal a real seam. Only introduce an adapter when you need production plus test/fake behaviour or multiple production data sources. Do not mock internal UI modules you control.

How should frontend modules be tested after refactoring?▼

Test through the same interface callers use, asserting user-observable outcomes like text, roles, enabled state, and submitted form data. Delete old tests on shallow helpers once interface-level tests exist, and avoid asserting on hook internals or private state.