Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add JasonLo/skill-sommelier --skill "ss-skill-consolidate"
Install specific skill from multi-skill repository
# Description
>-
# SKILL.md
name: ss-skill-consolidate
description: >-
Identify similar or overlapping skills in this repo and merge them into one
coherent skill. Reduces maintenance burden by eliminating redundancy across
skills that share trigger phrases, functionality, or domain. Use when the
skill collection feels bloated, two skills seem to do the same thing, or
after adding many skills and wanting to deduplicate.
Supports a quick mode (trigger overlap only) and full mode (deep analysis).
Triggers on "consolidate skills", "merge skills", "deduplicate skills",
"combine skills", "overlapping skills", "too many similar skills",
"reduce skill count", "skill overlap", "quick overlap check".
allowed-tools:
- Read
- Edit
- Write
- Bash
- Glob
- Grep
- Agent
- AskUserQuestion
metadata:
depends-on: ss-skill-validate
Skill Consolidate
Identify similar or overlapping skills and merge them into fewer, more coherent skills.
When to Use
- Two or more skills cover the same domain or trigger on similar phrases
- After a growth spurt of new skills β time to deduplicate
- Skill validation warns about trigger phrase overlap
- Users report confusion about which skill to use for a task
Mode Selection
| Signal | Mode |
|---|---|
| "quick", "check overlap", "scan" | Quick β Phase 1 + Phase 2a only (trigger overlap). Fast triage, no merging. |
| "consolidate", "merge", "deduplicate" | Full β All phases. Deep analysis + merge execution. |
If unclear, default to Full.
When NOT to Use
- Improving a single skill's quality β use
ss-skill-craftimprove mode - Auditing repo complexity broadly β use
ss-repo-simplify - Skills are genuinely distinct but related β cross-reference with
metadata.related-skillsinstead
Phase 1 β Inventory All Skills
Entry: User triggers consolidation.
- Glob for all
skills/*/SKILL.mdfiles - For each skill, extract from frontmatter:
namedescription(full text)allowed-toolsmetadata.depends-on(if present)- Build an inventory table:
| Skill | Description (first line) | Tools | Depends On |
|---|---|---|---|
Exit: Complete inventory of all skills.
Phase 2 β Detect Overlap
Entry: Inventory from Phase 1.
Analyze skills pairwise across three dimensions:
2a β Trigger phrase overlap
Extract trigger phrases from each skill's description. Compare all pairs. Flag pairs that share 3+ significant trigger keywords (ignore common words like "use", "when", "the").
2b β Functional overlap
Read the body of each skill. Flag pairs where:
- Both skills perform the same core action (e.g., both audit code quality)
- One skill is a strict subset of another
- Both skills produce the same type of output
2c β Domain overlap
Group skills by domain (e.g., "skill management", "code quality", "infrastructure", "discovery"). Flag domains with 3+ skills β these are candidates for consolidation.
Output β Overlap Report
## Overlap Analysis
### High Overlap (strong merge candidates)
| Skill A | Skill B | Shared Triggers | Functional Overlap | Recommendation |
|---------|---------|-----------------|-------------------|----------------|
### Medium Overlap (consider merging or cross-referencing)
| Skill A | Skill B | Shared Triggers | Functional Overlap | Recommendation |
|---------|---------|-----------------|-------------------|----------------|
### Domain Groups
| Domain | Skills | Count | Action |
|--------|--------|-------|--------|
Exit: Overlap report generated with concrete merge recommendations.
Quick mode stops here. Present the overlap report and exit. Do not proceed to Phase 3.
Phase 3 β Propose Merge Plan
Entry: Overlap report from Phase 2.
For each recommended merge:
- Name the merged skill β pick the more general name, or propose a new one (must start with
ss-) - Define the merged description β combine trigger phrases from both, deduplicate
- Outline the merged body β identify which phases/sections to keep from each source skill:
- Sections unique to Skill A β keep
- Sections unique to Skill B β keep
- Overlapping sections β pick the better version or combine
- Conflicting approaches β flag for user decision
- List what gets deleted β which skill directories will be removed after merge
- Check dependents β grep for any skill that has
depends-onor references the skills being merged. These need updating.
Present the merge plan to the user:
## Merge Plan
### Merge 1: ss-skill-a + ss-skill-b β ss-merged-name
**Rationale:** [why these should be one skill]
**Kept from ss-skill-a:**
- [sections/phases]
**Kept from ss-skill-b:**
- [sections/phases]
**Conflicts to resolve:**
- [any conflicting approaches]
**Dependents to update:**
- [skills that reference either source skill]
Exit: Merge plan presented to user.
Phase 4 β Get User Approval
Entry: Merge plan from Phase 3.
Use AskUserQuestion to confirm:
- Approve all merges β proceed with the full plan
- Select specific merges β user picks which merges to execute
- Modify a merge β user wants to change the merged skill name, keep different sections, etc.
- Cancel β abort without changes
Exit: User has approved specific merges to execute.
Phase 5 β Execute Merges
Entry: Approved merge plan from Phase 4.
For each approved merge:
- Create or update the target skill:
- If keeping one skill's directory, edit its SKILL.md in place
- If creating a new name, create the directory and write the merged SKILL.md
- Combine supporting files:
- Merge
scripts/directories if both skills have them - Merge
references/directories if both skills have them - Resolve filename conflicts by prefixing with original skill name
- Update dependents:
- For each skill that had
depends-onreferencing a removed skill, update to the merged name - For any SKILL.md body text referencing the old skill name, update the reference
- Remove the absorbed skill directory (the one that was merged into the other)
- Verify the merged SKILL.md:
- Frontmatter is valid YAML
namematches directorynamestarts withss-- Line count under 500 (move content to
references/if needed)
Exit: All merges applied, old directories removed.
Phase 6 β Validate and Report
Entry: Merges executed from Phase 5.
- Run
ss-skill-validateto verify repo consistency - Show a
git diff --statsummary - Present final report:
## Consolidation Complete
| Merge | Source Skills | Result Skill | Lines Saved |
|-------|-------------|--------------|-------------|
### Summary
- Skills before: N
- Skills after: N
- Skills removed: N
- Dependents updated: N
- Ask user if they want to commit the changes.
Exit: Consolidation complete, repo validated.
Guardrails
- Never delete a skill without user approval β always confirm before removing directories
- Preserve all unique functionality β merging must not lose capabilities from either source skill
- Update all references β broken
depends-onor cross-references are unacceptable - Keep merged skill under 500 lines β use
references/for overflow - One merge at a time β execute and validate each merge before starting the next to prevent cascading errors
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.