component-flattening-analysis

Detect orphaned root-namespace classes and generate flattening refactoring plans.

Updated Jun 18, 2026
One-click install
npx skills add https://github.com/rodrigotoledo/trading-exchange --skill component-flattening-analysis-rodrigotoledo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-flattening-analysis
Source: https://github.com/rodrigotoledo/trading-exchange/tree/main/packages/skills-catalog/skills/%28architecture%29/component-flattening-analysis
Command: npx skills add https://github.com/rodrigotoledo/trading-exchange --skill component-flattening-analysis-rodrigotoledo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Detects misplaced classes and enforces leaf-only components by removing orphaned root-namespace code, enabling cleaner, more maintainable architectures.

Core Features & Use Cases

  • Detect orphaned classes in root namespaces.
  • Analyze component hierarchies to identify leaf vs non-leaf components.
  • Propose flattening strategies (Consolidate Down, Split Up, Extract Shared) and generate actionable refactoring plans.

Quick Start

Scan a codebase to identify orphaned root-namespace classes and generate a safe flattening plan.

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?

To detect orphaned classes in root namespaces, you scan hierarchical codebase structures to identify misplaced code and enforce leaf-only components. This skill evaluates your architecture to find orphaned root-namespace code automatically and prepare it for safe removal.

What is component flattening in software architecture?

Component flattening is a refactoring technique that removes orphaned root-namespace code and enforces leaf-only components to clarify component hierarchies. It restructures architectures by consolidating or splitting code to ensure cleaner, more maintainable boundaries.

How do I generate a refactoring plan for flattening component hierarchies?

To generate a refactoring plan for flattening component hierarchies, analyze the codebase to detect orphaned classes and evaluate flattening options. This skill proposes consolidation, split, or shared extraction strategies and produces a step-by-step flattening plan.

What's the best way to refactor misplaced classes in a codebase?

The best way to refactor misplaced classes is to analyze component hierarchies to identify leaf versus non-leaf components, then apply a flattening strategy. This skill proposes consolidating down, splitting up, or extracting shared code to enforce architectural boundaries.

When should I extract shared code instead of consolidating down or splitting up?

You should extract shared code when flattening analysis reveals common dependencies across multiple leaf components that cannot be cleanly consolidated down or split up. This skill evaluates your hierarchical structures to recommend the correct strategy for your specific architecture.