component-flattening-analysis

Analyze component hierarchies and detect orphaned classes in root namespaces.

1|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/Matheusrlr/payment-orchestrator --skill component-flattening-analysis-matheusrlr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-flattening-analysis
Source: https://github.com/Matheusrlr/payment-orchestrator/tree/main/skills-catalog/skills/%28architecture%29/component-flattening-analysis
Command: npx skills add https://github.com/Matheusrlr/payment-orchestrator --skill component-flattening-analysis-matheusrlr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses complex and nested component hierarchies by identifying and rectifying issues like orphaned classes in root namespaces, ensuring a cleaner, more maintainable codebase.

Core Features & Use Cases

  • Orphaned Class Detection: Pinpoints source files residing in non-leaf namespaces.
  • Flattening Strategy Analysis: Recommends consolidation, splitting, or shared code extraction.
  • Use Case: When a codebase has grown organically, leading to scattered logic in root namespaces, this Skill provides a clear plan to refactor it into well-defined, leaf-node components.

Quick Start

Analyze the component structure of the current project for hierarchy issues.

Frequently Asked Questions about component-flattening-analysis

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

FAQPage Schema
How do I find orphaned classes in my root namespaces?

To find orphaned classes in root namespaces, you need to analyze your component structure to pinpoint source files residing in non-leaf namespaces. This identifies scattered logic and provides a clear plan to refactor it into well-defined components.

What is the best way to flatten a nested component hierarchy?

The best way to flatten a nested component hierarchy is to analyze the codebase and ensure components exist solely as leaf nodes. This involves identifying orphaned classes and applying consolidation, splitting, or shared code extraction strategies.

When do I need to refactor code structure for component flattening?

You need to refactor code structure for component flattening when your codebase has grown organically and suffers from complex, nested component hierarchies. This process rectifies scattered logic in root namespaces to ensure a cleaner, more maintainable architecture.

How does shared code extraction work during component refactoring?

Shared code extraction works during component refactoring by identifying common logic across orphaned classes in root namespaces and pulling it into dedicated modules. This flattening strategy consolidates scattered code into well-defined, leaf-node components.

Can I split components that have grown too large during code structure analysis?

Yes, you can split components during code structure analysis. When examining your nested component hierarchy, the analysis recommends splitting as a strategy to ensure components exist solely as manageable leaf nodes.

Why does my codebase have scattered logic in root namespaces?

Your codebase has scattered logic in root namespaces due to organic growth, which leads to complex component hierarchies and orphaned classes. Analyzing the component structure identifies these non-leaf source files so you can refactor them into well-defined components.