Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Ui Consolidation

ASecurity

Audit the component hierarchy for fragmented, duplicated, or overlapping UI components and consolidate them into canonical versions at the highest appropriate level — without changing user-visible behaviour. Use when refactoring for maintainability, reducing duplication, or preparing shared components.

2 stars
0 votes
0 copies
1 views
Added 9/22/2026
ai-agentstypescriptgorefactoring

Security Analysis

A100/100

Scanned 9/22/2026

Install to Claude Code

$npx -y skills add dotlas/skills --skill ui-consolidation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ui Consolidation?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Ui Consolidation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dotlas-ui-consolidation/badge)](https://www.skillsdirectory.com/skills/dotlas-ui-consolidation)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: ui-consolidation
description: Audit the component hierarchy for fragmented, duplicated, or overlapping UI components and consolidate them into canonical versions at the highest appropriate level — without changing user-visible behaviour. Use when refactoring for maintainability, reducing duplication, or preparing shared components.
---
# UI Consolidation

Every change this skill produces is an internal refactor — pages render the same UI with
the same behaviour. The goal is fewer components, clearer ownership, and easier future
changes.

## Component hierarchy

Components live at three levels.
Adapt these locations to your repo’s actual package and route structure.

| Level | Location | Scope | What belongs here |
| --- | --- | --- | --- |
| **1. Design primitives** | `<design-system>/components/` | Any app, any page, any context | Context-free building blocks: Button, Dialog, Card, Select, DataTable, Tooltip. No business logic. |
| **2. Feature components** | `<app>/components/shared/` | Shared across multiple pages within the app | Business-aware assemblies built from Level 1 primitives. Understand domain concepts. |
| **3. Page-local components** | Inside a specific route folder (e.g. `<app>/routes/chat/`) | Only that one page | Components that only make sense in one context. If a second page needs the same thing, promote to Level 2. |

**Placement decision:**
- Knows about business concepts?
  → Level 2 or 3, never Level 1.
- Used by more than one page?
  → Level 2.
- Purely visual and context-free?
  → Level 1.
- Used in one place, unlikely to be reused?
  → Level 3.

## Discovery

Scan in order, building a component inventory:
1. `<design-system>/components/` — design primitives
2. `<app>/components/shared/` — shared feature components
3. `<app>/routes/**/` — page-level route folders

For each component, record: name and path, what it renders, props it accepts, where it’s
imported (grep import statements), current level.

Then identify **fragmentation groups** — sets of components that render visually similar
UI, accept similar props with minor variations, contain copy-pasted logic with small
diffs, wrap the same primitive with added business logic in multiple places, or
implement the same pattern independently across pages.

## Analysis

For each fragmentation group:

1. **Pick the most complete implementation** as the canonical version — the one with the
   most features, best error handling, or cleanest code.
2. **Categorise each difference:**
   - **Slot/render-prop candidate** — variants show different content in the same
     structural position.
     Solve with render props or children slots.
   - **Prop/config candidate** — variants differ by a flag or option.
     Solve with a boolean or enum prop.
   - **Genuinely different component** — overlap is superficial; merging would create a
     god-component. Leave separate, rename for clarity.
3. **Decide the target level** — promote to the highest level where it makes sense.

## Consolidation

For each fragmentation group to consolidate:

1. **Extend the canonical component** to handle the differences from Analysis:
   - Add optional props, render-prop slots, or variant flags.
   - Follow the existing prop patterns in this codebase (e.g. if the repo already uses
     render-prop slots like `renderMeta`/`renderActions`, continue that pattern).
   - Do NOT create new wrapper components around the canonical version.
     Merge into it directly.

2. **Update all import sites** to use the canonical component:
   ```ts
   // BEFORE: local duplicate
   import { EntityCard } from './_components/entity-card';

   // AFTER: shared canonical version
   import { EntityCard } from '<app>/components/shared/entity-card';
   // or for design-system promotions:
   import { EntityCard } from '<design-system>/components/entity-card';
   ```

3. **Delete the duplicate files.** Do not leave dead code behind.

## Verify

- Run the repo’s typecheck command — no broken imports or type errors.
- Grep for any remaining imports of deleted files.
- Check for orphan files — components no longer imported anywhere.
- Confirm every component is at the correct level per the three-level rule.

## Patterns to follow

Read your repo’s existing shared components before starting — follow the patterns you
find, don’t introduce new ones.
Common patterns worth looking for:

| Pattern | What to look for | How it works |
| --- | --- | --- |
| **Slot props for customisation** | A drawer or panel component | Optional render functions (e.g. `renderMeta`, `renderActions`) let consumers show different sections without forking. |
| **Scoping prop** | A list component | An optional ID prop lets the same component serve both global and scoped views. |
| **Unified data hook** | A shared hook for the main domain entity | All UI reads from one canonical hook; components don’t create their own data-fetching. |
| **Design system uses relative imports** | `<design-system>/` package | Components here use relative imports, never app-level aliases (`@/`). |

## Anti-patterns to catch

- **God-component creep** — if merging requires more than ~5 new props or 3 render-prop
  slots, the components are probably genuinely different.
  Don’t force a merge.
- **Wrapper components** — a “shared” component that just passes all props through to a
  design-system primitive.
  Delete the wrapper and use the primitive directly.
- **Local type re-definitions** — components that define their own TypeScript types for
  data that already has a canonical schema in `<schemas package>`. Replace with the
  inferred type.
- **Copy-pasted hooks** — two hooks querying the same endpoint with slightly different
  options. Consolidate into one hook with parameters.
- **Stale barrel exports** — `index.ts` files re-exporting deleted or renamed
  components.

## Output

Before making changes, report: fragmentation groups found (with canonical choice and
consolidation strategy), no-merge decisions with rationale, a changes table (Action /
File / Detail), and final typecheck/orphan-grep status.

Attribution

dotlasdotlas
View sourceMore from dotlas →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1074701 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

693621 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

691 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →