component-common-domai…
Finds duplicate business logic spread across multiple components and suggests consolidation. Use when asking "where is this logic…
Detects misplaced classes and fixes component hierarchy problems — finds code that should belong inside a component but sits at the root level. Use when asking "clean up component structure", "find orphaned classes", "fix module hierarchy", "flatten nested components", or
Claude Code
$ npx -y skills add tech-leads-club/agent-skills --skill component-flattening-analysis --agent claude-code
Codex
$ npx skills add tech-leads-club/agent-skills --skill component-flattening-analysis -a codex -y
Cursor
$ npx skills add tech-leads-club/agent-skills --skill component-flattening-analysis -a cursor -y
Gemini CLI
$ npx skills add tech-leads-club/agent-skills --skill component-flattening-analysis -a gemini-cli -y
GitHub Copilot
$ npx skills add tech-leads-club/agent-skills --skill component-flattening-analysis -a github-copilot -y
OpenCode
$ npx skills add tech-leads-club/agent-skills --skill component-flattening-analysis -a opencode -y
Windsurf
$ npx skills add tech-leads-club/agent-skills --skill component-flattening-analysis -a windsurf -y
name: component-flattening-analysis description: Detects misplaced classes and fixes component hierarchy problems — finds code that should belong inside a component but sits at the root level. Use when asking "clean up component structure", "find orphaned classes", "fix module hierarchy", "flatten nested components", or analyzing why namespaces have misplaced code. Do NOT use for dependency analysis (use coupling-analysis) or domain grouping (use domain-identification-grouping).
This skill identifies component hierarchy issues and ensures components exist only as leaf nodes in directory/namespace structures, removing orphaned classes from root namespaces.
Request analysis of your codebase:
**Example 1: Find Orphaned Classes**
User: "Find orphaned classes in root namespaces" The skill will: 1. Scan component namespaces for hierarchy issues 2. Identify orphaned classes in root namespaces 3. Detect components built on top of other components 4. Suggest flattening strategies 5. Create refactoring plan
**Example 2: Flatten Components**
User: "Flatten component hierarchies in this codebase" The skill will: 1. Identify components with hierarchy issues 2. Analyze orphaned classes 3. Suggest consolidation or splitting strategies 4. Create refactoring plan 5. Estimate effort
**Example 3: Component Structure Analysis**
User: "Analyze component structure for hierarchy issues" The skill will: 1. Map component namespace structure 2. Identify root namespaces with code 3. Find components built on components 4. Flag hierarchy violations 5. Provide recommendations
1. **Scan Structure**: Map component namespace hierarchies 2. **Identify Issues**: Find orphaned classes and component nesting 3. **Analyze Options**: Determine flattening strategy (consolidate vs split) 4. **Create Plan**: Generate refactoring plan with steps 5. **Execute**: Refactor components to remove hierarchy
Apply this skill when:
A **component** is identified by a **leaf node** in directory/namespace structure:
**Key Rule**: Components exist only as leaf nodes. If a namespace is extended, the parent becomes a subdomain, not a component.
A **root namespace** is a namespace node that has been extended:
**Orphaned classes** are source files in root namespaces:
**Example**:
ss.survey/ ← Root namespace (extended by .templates)
├── Survey.js ← Orphaned class (in root namespace)
└── templates/ ← Component (leaf node)
└── Template.js**Strategy 1: Consolidate Down**
**Strategy 2: Split Up**
**Strategy 3: Move Shared Code**
Scan directory/namespace structure to identify hierarchy:
1. **Map Namespace Tree**
2. **Identify Root Namespaces**
3. **Locate Source Files**
**Example Structure Mapping**:
## Component Structure Map
ss.survey/ ← Root namespace (extended) ├── Survey.js ← Orphaned class ├── SurveyProcessor.js ← Orphaned class └── templates/ ← Component (leaf node) ├── EmailTemplate.js └── SMSTemplate.js
ss.ticket/ ← Root namespace (extended) ├── Ticket.js ← Orphaned class ├── assign/ ← Component (leaf node) │ └── TicketAssign.js └── route/ ← Component (leaf node) └── TicketRoute.js
Find source files in root namespaces:
1. **Scan Root Namespaces**
2. **Classify Orphaned Classes**
3. **Assess Impact**
**Example Orphaned Class Detection**:
## Orphaned Classes
The secure, validated skill registry for professional AI coding agents. Extend Antigravity, Claude Code, Cursor, Copilot and more with absolute confidence.
Finds duplicate business logic spread across multiple components and suggests consolidation. Use when asking "where is this logic…
Maps architectural components in a codebase and measures their size to identify what should be extracted first. Use when asking…
Analyzes coupling between modules using the three-dimensional model (strength, distance, volatility) from "Balancing Coupling in…
Creates step-by-step decomposition plans and migration roadmaps for breaking apart monolithic applications. Use when asking "what…
Maps business domains and suggests service boundaries in any codebase using DDD Strategic Design. Use when asking "what are the…
Groups existing components into logical business domains to plan service-based architecture. Use when asking "which components…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.