From rcc
Discovers all project skills via file search, analyzes for overlaps and weaknesses, classifies for refactor/merge/delete, executes refactoring plan, extracts conventions, validates, and reports.
npx claudepluginhub wayne930242/reflexive-claude-codeThis skill uses the workspace's default tool permissions.
**Refactoring skills IS applying clean code principles to documentation.**
Audits Claude Code skills against project state and usage, detects redundancies, consolidates/merges/archives safely with backups, confirmations, and rollbacks.
Optimizes a single existing Claude Code skill through task-based workflow: analyze structure, gather context, research best practices, identify/apply improvements, validate/review. For 'improve skill' or similar.
Refines and validates existing Claude Code skills for clarity, efficiency, and production readiness. Use for improving structure, best practices, token reduction, and production checks.
Share bugs, ideas, or general feedback.
Refactoring skills IS applying clean code principles to documentation.
Consolidate, simplify, extract shared conventions, remove redundancy.
Core principle: Fewer focused skills > many overlapping skills.
Violating the letter of the rules is violating the spirit of the rules.
Pattern: Tree
Handoff: mixed (auto-invoke per classification)
Next: analyzing-agent-systems | writing-skills | writing-rules
Chain: maintenance
Before ANY action, create task list using TaskCreate:
TaskCreate for EACH task below:
- Subject: "[refactoring-skills] Task N: <action>"
- ActiveForm: "<doing action>"
Tasks:
Announce: "Created 6 tasks. Starting execution..."
Execution rules:
TaskUpdate status="in_progress" BEFORE starting each taskTaskUpdate status="completed" ONLY after verification passesTaskList to confirm all completedGoal: Find all skills in the project.
Search locations:
find . -name "SKILL.md" -type f 2>/dev/null
ls -la .claude/skills/ 2>/dev/null
Also check:
~/.claude/skills/)Document:
Verification: Complete list of all skills with locations.
Goal: Classify each skill for action, informed by systematic weakness analysis.
First: Invoke analyzing-agent-systems skill to get a comprehensive analysis report covering all 8 weakness categories. This replaces manual analysis.
Then classify each skill using both the analysis report and manual assessment:
| Status | Criteria | Action |
|---|---|---|
| Keep | Well-structured, unique purpose, no weaknesses flagged | None |
| Refactor | Analysis flagged weaknesses but valuable | Use writing-skills to improve |
| Merge | Analysis found overlap with another skill | Consolidate into primary |
| Extract | Analysis found duplicated conventions | Move to rule file |
| Delete | Redundant, unused, or superseded | Remove entirely |
For each skill, check against analysis report:
Optional: External Search
If claude-skills-mcp is available:
mcp__claude-skills-mcp__search_skills query="[skill domain]"
Compare with community implementations. Better patterns exist?
Verification: Each skill has a classification and action, informed by analysis report.
Goal: Apply the classified actions.
Invoke the writing-skills skill with the existing skill path.
CRITICAL: One action at a time. Verify after each.
Verification: All classified actions executed.
Goal: Move duplicated conventions to rule files.
Signs of shared conventions:
Process:
writing-rules skill to create ruleVerification: No duplicated conventions across skills.
Goal: Verify all remaining skills are valid.
For each skill:
python3 scripts/validate_skill.py <skill-path>
Or manual checklist:
Verification: All remaining skills pass validation.
Goal: Document what was done.
## Refactoring Summary
### Skills Analyzed: N
### Actions Taken:
| Skill | Action | Notes |
|-------|--------|-------|
| skill-name | kept/refactored/merged/deleted | details |
### Rules Extracted:
| Rule | Source Skills |
|------|--------------|
| rule-name | skill-a, skill-b |
### Recommendations:
- [Future improvements]
Verification: Report accurately reflects all changes.
These thoughts mean you're rationalizing. STOP and reconsider:
All of these mean: You're about to leave mess behind. Follow the process.
| Excuse | Reality |
|---|---|
| "Keep everything" | Unused skills are clutter. Delete them. |
| "Overlap is fine" | Overlap = confusion. Merge or differentiate. |
| "Skip extraction" | Duplicated conventions drift. Extract to rules. |
| "Skip validation" | Fixed skills can still be broken. Validate. |
| "Skip report" | Report documents decisions for future you. |
digraph refactor_skills {
rankdir=TB;
start [label="Refactor skills", shape=doublecircle];
discover [label="Task 1: Discover\nall skills", shape=box];
analyze [label="Task 2: Analyze\nand classify", shape=box];
execute [label="Task 3: Execute\nrefactoring plan", shape=box];
extract [label="Task 4: Extract\nshared conventions", shape=box];
validate [label="Task 5: Validate\nresults", shape=box];
valid [label="All\nvalid?", shape=diamond];
report [label="Task 6: Generate\nreport", shape=box];
done [label="Refactoring complete", shape=doublecircle];
start -> discover;
discover -> analyze;
analyze -> execute;
execute -> extract;
extract -> validate;
validate -> valid;
valid -> report [label="yes"];
valid -> execute [label="no\nfix"];
report -> done;
}
| Step | Skill | Purpose |
|---|---|---|
| 1 | analyzing-agent-systems | Weakness analysis (invoked in Task 2) |
| 2 | writing-skills | Refactor individual skills (invoked in Task 3) |
| 3 | writing-rules | Extract shared conventions (invoked in Task 4) |
| 4 | skill-reviewer | Quality validation (subagent, Task 5) |
writing-skills skill for improving skillswriting-rules skill for extracting conventionsskill-reviewer subagent for quality checks