component-common-domain-detection

Identify duplicate domain functionality across service components via namespace and import scanning, then recommend consolidation strategies with coupling analysis.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill reduces duplicated domain logic scattered across multiple components by detecting common functionality, analyzing similarity, and recommending safe consolidation strategies. It helps teams lower maintenance burden, avoid hidden coupling regressions, and centralize reusable business logic without accidentally merging infrastructure concerns.

Core Features & Use Cases

  • Namespace Pattern Detection: Finds components with identical leaf-node names such as notification, audit, validation, or formatting.
  • Shared Class Detection: Identifies classes or modules imported across multiple components and classifies domain vs infrastructure usage.
  • Functionality & Coupling Analysis: Compares implementation similarities, computes afferent coupling before and after consolidation, and evaluates feasibility.
  • Recommendations & Plans: Suggests shared service, shared library, or component merge approaches and provides step-by-step consolidation plans and templates.
  • Use Case: Consolidating multiple notification components into a single notification service while verifying coupling does not introduce a bottleneck.

Quick Start

Find common domain functionality across components and produce a consolidation recommendation with coupling analysis.

Frequently Asked Questions about component-common-domain-detection

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

FAQPage Schema
How do I consolidate duplicate domain components across a service-oriented codebase?

Consolidate duplicate domain components by scanning namespaces and imports to group identical leaf-node logic, then comparing functionality to recommend a shared service, shared library, or merge approach. This identifies overlapping notification, audit, or validation logic for safe refactoring.

What is afferent coupling analysis and when do I need it for refactoring?

Afferent coupling analysis measures how many other components depend on a specific module before and after consolidation. You need it during refactoring to verify that merging duplicate domain logic does not accidentally introduce hidden coupling regressions or architectural bottlenecks.

How do I detect shared classes imported across multiple components?

Detect shared classes by scanning import statements across the codebase and classifying usage as either domain or infrastructure. This identifies modules reused in multiple components, enabling accurate functionality comparison and safe consolidation planning for domain-specific logic.

Can I use namespace pattern detection to find duplicate notification and validation logic?

Yes, namespace pattern detection scans for identical leaf-node names like notification, validation, formatting, and audit across components. It groups these matching namespaces to evaluate implementation similarity and determine if a shared library or service consolidation is feasible.

What is the best way to refactor shared services without merging infrastructure concerns?

Refactor shared services by classifying detected imports as domain versus infrastructure before consolidation. This distinction ensures that only reusable business logic is centralized into a shared service or library, preventing accidental coupling with unrelated infrastructure code.

When should I not use a component merge approach for consolidation?

Avoid a component merge when afferent coupling analysis reveals that combining duplicate domain logic would create a dependency bottleneck. If post-consolidation coupling is too high, a shared library or shared service approach is recommended instead of a full component merge.