component-flattening-analysis

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

5.0k|454|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/tech-leads-club/agent-skills --skill component-flattening-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-flattening-analysis
Source: https://github.com/tech-leads-club/agent-skills/tree/main/packages/skills-catalog/skills/%28architecture%29/component-flattening-analysis
Command: npx skills add https://github.com/tech-leads-club/agent-skills --skill component-flattening-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill identifies and fixes component hierarchy issues by detecting orphaned classes in root namespaces and ensuring components exist only as leaf nodes. Use it when analyzing component structure, finding orphaned classes, flattening component hierarchies, removing component nesting, or when the user asks about component flattening, orphaned classes, or component structure cleanup.

Core Features & Use Cases

  • Map component namespace structures to identify root namespaces and leaf components.
  • Detect orphaned classes in root namespaces and classify as shared/domain/mixed.
  • Propose flattening strategies (Consolidate Down, Split Up, Move Shared Code) and produce actionable refactoring plans.
  • Generate structured outputs (flattening plans, hierarchy reports) to guide safe refactors.

Quick Start

  • Request analysis of your codebase using phrases like:
  • "Find orphaned classes in root namespaces"
  • "Flatten component hierarchies"
  • "Analyze component structure 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 root namespaces during component refactoring?

To find orphaned classes in root namespaces, you map the component namespace structure to detect root namespaces and identify files lacking proper hierarchy. The analysis classifies these orphaned files as shared, domain, or mixed to guide safe refactoring.

What is component flattening and when do I need to flatten component hierarchies?

Component flattening is the process of removing component nesting by ensuring components exist only as leaf nodes. You need to flatten component hierarchies when orphaned classes appear in root namespaces, violating the structural architecture of your codebase.

How do I create a refactoring plan to flatten component structure?

To create a refactoring plan, you assess orphaned files and analyze flattening strategies like Consolidate Down, Split Up, or Move Shared Code. This produces a structured flattening plan with prioritized steps to guide safe component hierarchy refactoring.

Can I analyze component structure for hierarchy violations without moving files first?

Yes, you can analyze component structure to map namespace structures and detect hierarchy violations without moving files. The analysis generates hierarchy reports and proposes flattening strategies before any actual file movement or import updates occur.

What are the limitations of component flattening analysis for large codebases?

Component flattening analysis limitations include the requirement to move files and update imports to execute the proposed plan. While it maps namespaces and detects violations, applying the actionable refactoring plan requires safe execution steps to avoid breaking dependencies.