component-common-domain-detection
Finds duplicate business logic spread across multiple components and suggests consolidation. Use when asking "where is this logic duplicated?", "find common code between services", "what can be consolidated?", "detect shared domain logic", or analyzing component overlap before refactoring. Do NOT use for code-level duplication detection (use linters) or dependency analysis (use coupling-analysis).
What this skill does
# Common Domain Component Detection This skill identifies common domain functionality that is duplicated across multiple components and suggests consolidation opportunities to reduce duplication and improve maintainability. ## How to Use ### Quick Start Request analysis of your codebase: - **"Find common domain functionality across components"** - **"Identify duplicate domain logic that should be consolidated"** - **"Detect shared classes used across multiple components"** - **"Analyze consolidation opportunities for common components"** ### Usage Examples **Example 1: Find Common Functionality** ``` User: "Find common domain functionality across components" The skill will: 1. Scan component namespaces for common patterns 2. Detect shared classes used across components 3. Identify duplicate domain logic 4. Analyze coupling impact of consolidation 5. Suggest consolidation opportunities ``` **Example 2: Detect Duplicate Notification Logic** ``` User: "Are there multiple notification components that should be consolidated?" The skill will: 1. Find all components with notification-related names 2. Analyze their functionality and dependencies 3. Calculate coupling impact if consolidated 4. Recommend consolidation approach ``` **Example 3: Analyze Shared Classes** ``` User: "Find classes that are shared across multiple components" The skill will: 1. Identify classes imported/used by multiple components 2. Classify as domain vs infrastructure functionality 3. Suggest consolidation or shared library approach 4. Assess impact on coupling ``` ### Step-by-Step Process 1. **Scan Components**: Identify components with common namespace patterns 2. **Detect Shared Code**: Find classes/files used across components 3. **Analyze Functionality**: Determine if functionality is truly common 4. **Assess Coupling**: Calculate coupling impact before consolidation 5. **Recommend Actions**: Suggest consolidation or shared library approach ## When to Use Apply this skill when: - After identifying and sizing components (Pattern 1) - Before flattening components (Pattern 3) - When planning to reduce code duplication - Analyzing shared domain logic across the codebase - Preparing for component consolidation - Identifying candidates for shared services or libraries ## Core Concepts ### Domain vs Infrastructure Functionality **Domain Functionality** (candidates for consolidation): - Business processing logic (notification, validation, auditing, formatting) - Common to **some** processes, not all - Examples: Customer notification, ticket auditing, data validation **Infrastructure Functionality** (usually not consolidated here): - Operational concerns (logging, metrics, security) - Common to **all** processes - Examples: Logging, authentication, database connections ### Common Domain Patterns Common domain functionality often appears as: 1. **Namespace Patterns**: Components ending in same leaf node - `*.notification`, `*.audit`, `*.validation`, `*.formatting` - Example: `TicketNotification`, `BillingNotification`, `SurveyNotification` 2. **Shared Classes**: Same class used across multiple components - Example: `SMTPConnection` used by 5 different components - Example: `AuditLogger` used by multiple domain components 3. **Similar Functionality**: Different components doing similar things - Example: Multiple components sending emails with slight variations - Example: Multiple components writing audit logs ### Consolidation Approaches **Shared Service**: - Common functionality becomes a separate service - Other components call this service - Good for: Frequently changing logic, complex operations **Shared Library**: - Common code packaged as library (JAR, DLL, npm package) - Components import and use the library - Good for: Stable functionality, simple utilities **Component Consolidation**: - Merge multiple components into one - Good for: Highly related functionality, low coupling impact ## Analysis Process ### Phase 1: Identify Common Namespace Patterns Scan component namespaces for common leaf node names: 1. **Extract leaf nodes** from all component namespaces - Example: `services/billing/notification` → `notification` - Example: `services/ticket/notification` → `notification` 2. **Group by common leaf nodes** - Find components with same leaf node name - Example: All components ending in `.notification` 3. **Filter out infrastructure patterns** - Exclude: `.util`, `.helper`, `.common` (usually infrastructure) - Focus on: `.notification`, `.audit`, `.validation`, `.formatting` **Example Output**: ```markdown ## Common Namespace Patterns Found **Notification Components**: - services/customer/notification - services/ticket/notification - services/survey/notification **Audit Components**: - services/billing/audit - services/ticket/audit - services/survey/audit ``` ### Phase 2: Detect Shared Classes Find classes/files used across multiple components: 1. **Scan imports/dependencies** in each component - Track which classes are imported from where - Note classes used by multiple components 2. **Identify shared classes** - Classes imported by 2+ components - Exclude infrastructure classes (Logger, Config, etc.) 3. **Classify as domain vs infrastructure** - Domain: Business logic classes (SMTPConnection, AuditLogger) - Infrastructure: Technical utilities (Logger, DatabaseConnection) **Example Output**: ```markdown ## Shared Classes Found **Domain Classes**: - `SMTPConnection` - Used by 5 components (notification-related) - `AuditLogger` - Used by 8 components (audit-related) - `DataFormatter` - Used by 3 components (formatting-related) **Infrastructure Classes** (exclude from consolidation): - `Logger` - Used by all components (infrastructure) - `Config` - Used by all components (infrastructure) ``` ### Phase 3: Analyze Functionality Similarity For each group of common components: 1. **Examine functionality** - Read source code of each component - Identify what each component does - Note similarities and differences 2. **Assess consolidation feasibility** - Are differences minor (configurable)? - Can differences be abstracted? - Is functionality truly the same? 3. **Calculate coupling impact** - Count incoming dependencies (afferent coupling) before consolidation - Estimate incoming dependencies after consolidation - Compare total coupling levels **Example Analysis**: ```markdown ## Functionality Analysis **Notification Components**: - CustomerNotification: Sends billing notifications - TicketNotification: Sends ticket assignment notifications - SurveyNotification: Sends survey emails **Similarities**: All send emails to customers **Differences**: Email content/templates, triggers **Consolidation Feasibility**: ✅ High - Differences are in content, not mechanism - Can be abstracted with templates/context ``` ### Phase 4: Assess Coupling Impact Before recommending consolidation, analyze coupling: 1. **Calculate current coupling** - Count components using each notification component - Sum total incoming dependencies 2. **Estimate consolidated coupling** - Count components that would use consolidated component - Compare to current total 3. **Evaluate coupling increase** - Is consolidated component too coupled? - Does it create a bottleneck? - Is coupling increase acceptable? **Example Coupling Analysis**: ```markdown ## Coupling Impact Analysis **Before Consolidation**: - CustomerNotification: Used by 2 components (CA = 2) - TicketNotification: Used by 2 components (CA = 2) - SurveyNotification: Used by 1 component (CA = 1) - **Total CA**: 5 **After Consolidation**: - Notification: Used by 5 components (CA = 5) - **Total CA**: 5 (same!) **Verdict**: ✅ No coupling increase, safe to consolidate ``` ### Phase 5: Recommend Consolidation Approach Based on analysis, recommend approach: **Shared Service** (if): -
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.