component-common-domain-detection

Detects duplicate domain logic across components and recommends consolidation approaches.

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/Peterson-Benhame/agent-skills --skill component-common-domain-detection-peterson-benhame
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-common-domain-detection
Source: https://github.com/Peterson-Benhame/agent-skills/tree/main/packages/skills-catalog/skills/%28architecture%29/component-common-domain-detection
Command: npx skills add https://github.com/Peterson-Benhame/agent-skills --skill component-common-domain-detection-peterson-benhame

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Large codebases often accumulate duplicate business logic—notification, audit, validation, and formatting code copied across multiple components. This duplication increases maintenance cost and inconsistency, but consolidating blindly can create dangerous coupling bottlenecks. This Skill finds the duplication and tells you whether consolidating it is safe. ## Core Features & Use Cases - Namespace Pattern Detection: Scans component namespaces for common leaf-node patterns like *.notification, *.audit, and *.validation to group similar components. - Shared Class Detection: Identifies classes imported by multiple components and classifies them as domain logic versus infrastructure concerns. - Coupling Impact Analysis: Calculates afferent coupling (CA) before and after proposed consolidation to verify it does not create a bottleneck. - Consolidation Recommendations: Suggests the right approach—shared service, shared library, or component merge—based on change frequency and complexity. - Use Case: Ask whether three notification components in customer, ticket, and survey services should be merged, and receive a feasibility verdict with a step-by-step consolidation plan. ## Quick Start Ask the agent to find common domain functionality across components and analyze consolidation opportunities in your codebase.

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 find duplicate business logic across microservices?

Scan component namespaces for common leaf-node patterns like notification, audit, or validation, then detect classes imported by multiple components. Verify functionality similarity by reading the source code before assuming consolidation is appropriate.

How to decide between a shared service and a shared library?

Choose a shared service when functionality changes frequently, involves complex operations, or needs independent scaling. Choose a shared library for stable, simple utilities where a compile-time dependency is acceptable.

What is afferent coupling and why does it matter for consolidation?

Afferent coupling (CA) counts how many components depend on a given component. Consolidation is safe when total CA stays flat; a large increase signals the merged component could become a coupling bottleneck.

Should infrastructure code like logging be consolidated with this approach?

No. Infrastructure functionality such as logging, metrics, and security is common to all processes and handled separately. This analysis targets domain functionality like notification, auditing, and validation that is shared by only some processes.

When should I not consolidate duplicate components?

Avoid consolidation when the components serve different business contexts despite similar names, when differences cannot be abstracted, or when the coupling increase would create a bottleneck. Some duplication is acceptable if it reduces coupling.