component-flattening-analysis

Detect orphaned classes in root namespaces and flag nesting violations for refactoring planning and dependency analysis.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Projects often accumulate source files in parent namespaces that have child components, creating "orphaned" classes with unclear ownership, brittle imports, and poor modular boundaries. This skill detects those root-namespace violations, explains their impact on maintainability and coupling, and provides pragmatic refactoring strategies to restore clear, leaf-only component structure.

Core Features & Use Cases

  • Namespace Mapping: Scan directory or package trees and produce a component/namespace map that highlights leaf nodes and extended (root) namespaces.
  • Orphaned Class Detection & Classification: Locate source files in root namespaces, classify them as domain/shared/mixed, and show their consuming components and dependencies.
  • Flattening Recommendations & Plans: For each violation propose consolidate, split, or extract-shared strategies, generate step-by-step refactoring plans, and estimate effort and risk for execution.
  • Use Case: Prepare a legacy codebase for domain grouping by identifying orphaned classes in parent packages, extracting shared utilities, and consolidating small leaf components into single components.

Quick Start

Find orphaned classes in my repository, map component namespaces, and produce a recommended flattening plan with priorities.

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 and fix component nesting violations?

To find orphaned classes in root namespaces, scan your directory or package tree to map component hierarchies. The analysis classifies files as domain or shared, flags nesting violations, and recommends consolidate, split, or extract strategies to restore clear leaf-only component structure.

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

Component flattening is the process of removing source files accumulated in parent namespaces to eliminate unclear ownership and brittle imports. You need it when child components exist alongside orphaned classes, causing poor modular boundaries and high coupling within a codebase.

Can I use this namespace mapping analysis on any codebase organized by directory or package?

Yes, namespace mapping analysis applies to any codebase organized by directory or package namespaces. It scans the structural tree to produce a component map highlighting leaf nodes and extended root namespaces for dependency analysis and refactoring preparation.

What is the best way to prepare a legacy codebase for domain grouping and remove parent package violations?

The best way to prepare a legacy codebase for domain grouping is identifying orphaned classes in parent packages, extracting shared utilities, and consolidating small leaf components. This restores modular boundaries and produces a prioritized flattening plan.