JasonLo

ss-skill-consolidate

0
0
# Install this skill:
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-craft improve mode
  • Auditing repo complexity broadly β€” use ss-repo-simplify
  • Skills are genuinely distinct but related β€” cross-reference with metadata.related-skills instead

Phase 1 β€” Inventory All Skills

Entry: User triggers consolidation.

  1. Glob for all skills/*/SKILL.md files
  2. For each skill, extract from frontmatter:
  3. name
  4. description (full text)
  5. allowed-tools
  6. metadata.depends-on (if present)
  7. 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:

  1. Name the merged skill β€” pick the more general name, or propose a new one (must start with ss-)
  2. Define the merged description β€” combine trigger phrases from both, deduplicate
  3. Outline the merged body β€” identify which phases/sections to keep from each source skill:
  4. Sections unique to Skill A β†’ keep
  5. Sections unique to Skill B β†’ keep
  6. Overlapping sections β†’ pick the better version or combine
  7. Conflicting approaches β†’ flag for user decision
  8. List what gets deleted β€” which skill directories will be removed after merge
  9. Check dependents β€” grep for any skill that has depends-on or 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:

  1. Approve all merges β€” proceed with the full plan
  2. Select specific merges β€” user picks which merges to execute
  3. Modify a merge β€” user wants to change the merged skill name, keep different sections, etc.
  4. 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:

  1. Create or update the target skill:
  2. If keeping one skill's directory, edit its SKILL.md in place
  3. If creating a new name, create the directory and write the merged SKILL.md
  4. Combine supporting files:
  5. Merge scripts/ directories if both skills have them
  6. Merge references/ directories if both skills have them
  7. Resolve filename conflicts by prefixing with original skill name
  8. Update dependents:
  9. For each skill that had depends-on referencing a removed skill, update to the merged name
  10. For any SKILL.md body text referencing the old skill name, update the reference
  11. Remove the absorbed skill directory (the one that was merged into the other)
  12. Verify the merged SKILL.md:
  13. Frontmatter is valid YAML
  14. name matches directory
  15. name starts with ss-
  16. 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.

  1. Run ss-skill-validate to verify repo consistency
  2. Show a git diff --stat summary
  3. 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
  1. 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-on or 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.