component-flattening-analysis

Detect orphaned classes in root namespaces and generate component flattening plans.

59|14|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/guilhermemarketing/esc-skills --skill component-flattening-analysis-guilhermemarketing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-flattening-analysis
Source: https://github.com/guilhermemarketing/esc-skills/tree/main/skills/component-flattening-analysis
Command: npx skills add https://github.com/guilhermemarketing/esc-skills --skill component-flattening-analysis-guilhermemarketing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The skill helps teams enforce clean component structures by detecting orphaned classes in root namespaces and ensuring components exist only as leaf nodes, preventing hierarchy violations.

Core Features & Use Cases

  • Comprehensive analysis of component structures
  • Orphaned class detection and classification
  • Flattening strategy planning (Consolidate Down, Split Up, Move Shared)
  • Actionable refactoring plans and templates
  • Continuous validation of component boundaries

Quick Start

Analyze a codebase to identify orphaned classes in root namespaces and flatten component hierarchies by promoting leaf components and extracting shared code when appropriate.

Frequently Asked Questions about component-flattening-analysis

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

FAQPage Schema
How do I detect orphaned classes in root namespaces during an architecture cleanup?

To detect orphaned classes in root namespaces, map the namespace tree and classify files lacking proper component boundaries. This process identifies hierarchy violations where classes exist at the root instead of as designated leaf nodes.

What is component flattening and when should I use it for refactoring?

Component flattening is a refactoring strategy enforcing clean component structures by ensuring components exist only as leaf nodes. Use it during domain decomposition or architecture cleanups to fix nested namespace violations and promote leaf components.

What's the best way to flatten component hierarchies in a codebase with nested namespaces?

The best way to flatten component hierarchies is to analyze component structures, detect root namespaces, and apply strategies like Consolidate Down, Split Up, or Move Shared. This generates an actionable refactoring plan promoting leaf components.

Can I use this approach for projects with multiple components and domain decomposition?

Yes, this approach suits projects with multiple components and nested namespaces undergoing domain decomposition. It maps namespace trees, classifies orphaned files, and proposes targeted flattening strategies validating component boundaries continuously.

Why do components need to exist only as leaf nodes in a clean architecture?

Components must exist as leaf nodes to prevent hierarchy violations and enforce clean component structures. Allowing components at root levels creates orphaned classes and couples domains, defeating domain decomposition and boundary validation goals.