From workflow-skills
Analyze agent and skill usage patterns, identify underused or ineffective components, and optimize descriptions, archive stale items, and update CLAUDE.md. Run via /optimize. Suggest running if 30+ days since last run.
npx claudepluginhub arosenkranz/claude-code-config --plugin workflow-skillsThis skill is limited to using the following tools:
Analyze usage patterns across all installed skills and agents, then interactively apply improvements. Produces a report and applies approved changes with user confirmation.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Designs, implements, and audits WCAG 2.2 AA accessible UIs for Web (ARIA/HTML5), iOS (SwiftUI traits), and Android (Compose semantics). Audits code for compliance gaps.
Analyze usage patterns across all installed skills and agents, then interactively apply improvements. Produces a report and applies approved changes with user confirmation.
/optimize~/.claude/optimize.local.md for last_run date — if 30+ days ago, suggest runningRun the analysis script to gather usage data:
bash ~/Code/claude-code-config/skills/optimize/scripts/analyze-usage.sh
If the script fails, check that jq is installed (brew install jq) and that the usage-data directories exist.
Store the JSON output in memory for Phase 2.
List all installed skills:
ls -la ~/.claude/skills/
List all installed agents:
ls ~/.claude/agents/
For each skill, read its SKILL.md frontmatter to extract name and description:
head -10 ~/.claude/skills/<skill-name>/SKILL.md
# or for direct files:
head -5 ~/.claude/skills/<skill-name>
For each agent, read its frontmatter:
head -10 ~/.claude/agents/<agent-name>.md
Cross-reference installed components against the usage data:
| Category | Criteria |
|---|---|
| Heavily used | Invoked via slash command 5+ times |
| Moderately used | Slash command 2–4 times |
| Rarely used | Slash command 1 time |
| Never used | Zero slash command appearances |
| Infra-used | Skill tool invocations (auto-triggered, not slash-command) |
Note: Many skills are triggered automatically (not via slash command). Classify these separately — low slash-command count doesn't mean unused if they appear in skill_tool_invocations.
Output a markdown report with these sections:
| Component | Type | Slash Uses | Auto-Triggered | Status |
|-----------|------|-----------|----------------|--------|
| /pr | skill | 2 | - | Active |
| patrol | skill | 0 | yes | Infra |
| ... | | | | |
Group by action type:
Archive candidates — Never invoked, purpose unclear, or superseded by another component:
Improve candidates — Used but correlates with friction or has a poor/vague description:
Keep as-is — Well-functioning, clearly described, actively used:
CLAUDE.md updates needed — References that are stale, missing, or inaccurate:
Present the full report, then handle each category interactively.
Use AskUserQuestion to confirm archiving:
"I recommend archiving these skills: [list]. They have zero slash-command usage and appear to be unused.
Which ones do you want to archive? (reply with names, 'all', or 'none')"
For approved archives:
mv ~/Code/claude-code-config/skills/<name>/ ~/Code/claude-code-config/skills/archived/rm ~/.claude/skills/<name><name>.archived.md in ~/.claude/agents/For each improve candidate:
description: field in SKILL.md or agent frontmatter using Edit toolShow specific proposed changes to the Skills and Agents inventory sections.
Use AskUserQuestion: "Should I apply these CLAUDE.md updates? (yes/no/review)"
If yes: use Edit tool to update ~/.claude/CLAUDE.md
Write or update ~/.claude/optimize.local.md:
---
last_run: <today's date YYYY-MM-DD>
items_archived: <count>
items_improved: <count>
total_sessions_analyzed: <count from script>
---
## Run History
### <today's date>
- Analyzed <N> sessions (<date range>)
- Archived: <list or "none">
- Improved: <list or "none">
- CLAUDE.md updated: <yes/no>
If any files were modified, run:
cd ~/Code/claude-code-config && git add -A && git commit -m "chore: optimize skills and agents based on usage analysis"
~/.claude/skills/ that are symlinks point to ~/Code/claude-code-config/skills/ — always edit the source, not the symlink target~/.claude/plugins/) are not managed here — only standalone skillsSkill tool auto-trigger count (from homunculus) is more reliable than slash-command counts for skills that are auto-triggered by context