component-common-domain-detection

Detect duplicated domain logic across components and recommend consolidation with coupling impact.

1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/barateza/dubweave --skill component-common-domain-detection-barateza
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-common-domain-detection
Source: https://github.com/barateza/dubweave/tree/main/.agent/skills/component-common-domain-detection
Command: npx skills add https://github.com/barateza/dubweave --skill component-common-domain-detection-barateza

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you identify duplicated business (domain) logic scattered across multiple components and turn it into actionable consolidation recommendations, avoiding accidental infrastructure consolidation and reducing long-term maintainability costs.

Core Features & Use Cases

  • Detect common domain patterns by grouping components using shared namespace/leaf-node naming conventions (e.g., notification/audit/validation/formatting patterns).
  • Find shared classes/assets in code usage by locating classes used across 2+ components and distinguishing likely domain logic from infrastructure (logging/config/security).
  • Assess consolidation feasibility with coupling impact by estimating afferent coupling (CA) before vs. after consolidation to reduce the risk of creating bottlenecks.
  • Recommend consolidation approach (shared service, shared library, or component merge) and provide a prioritized consolidation plan and expected impact.

Use cases: preparing a refactor, reducing duplication in service/component boundaries, and planning safe extraction prior to flattening or deeper dependency analysis.

Quick Start

Ask: "Find common domain functionality across components and recommend what to consolidate, including coupling impact and a consolidation plan."

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 duplicated domain logic across components before refactoring?

To find duplicated domain logic across components, group shared classes by namespace and naming conventions, then filter domain functionality from infrastructure to identify safe consolidation candidates. This prevents accidental infrastructure merging during refactoring.

What is the best way to assess coupling impact when consolidating shared services?

Assess coupling impact when consolidating shared services by estimating afferent coupling before and after the merge. Evaluating this coupling metric helps reduce the risk of creating architectural bottlenecks and ensures safe extraction.

When do I need domain modeling for component consolidation?

You need domain modeling for component consolidation when multiple components share business logic and require pattern-based grouping. It distinguishes domain logic from infrastructure to prevent accidental coupling of unrelated services.

Should I use a shared library or component merge for duplicate logic?

Choosing a shared library or component merge for duplicate logic depends on functionality similarity and afferent coupling impact. Analyze these metrics to recommend the safest consolidation approach and produce a prioritized refactor plan.

How do I prepare a codebase for dependency flattening?

Prepare a codebase for dependency flattening by locating classes used across multiple components and assessing consolidation feasibility. Identifying shared domain logic beforehand reduces maintainability issues and ensures safe architectural extraction.

Can I detect duplicate business logic without accidentally consolidating infrastructure?

You can detect duplicate business logic without accidentally consolidating infrastructure by applying domain-vs-infrastructure filtering during similarity assessment. This ensures only true domain patterns are grouped for refactoring.