/workflow-skills:optimizefrom 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.
Ships in workflow-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
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 runningThe agent-config checkout lives in different places per machine. Resolve it once, remember the concrete path, and substitute it for $AGENT_CONFIG in every command below:
# 1. Directory-source marketplace: the path is in ~/.claude/settings.json
AGENT_CONFIG=$(jq -r '.extraKnownMarketplaces["arosenkranz-claude-plugins"].source.path // empty' ~/.claude/settings.json 2>/dev/null)
# 2. Known checkout locations (personal machine: ~/Code; work machine: ~/workspace)
if [ -z "$AGENT_CONFIG" ] || [ ! -d "$AGENT_CONFIG" ]; then
for c in ~/Code/agent-config ~/workspace/tools/agent-config; do
[ -d "$c/.git" ] && AGENT_CONFIG="$c" && break
done
fi
# 3. GitHub-marketplace cache fallback
if [ -z "$AGENT_CONFIG" ] || [ ! -d "$AGENT_CONFIG" ]; then
AGENT_CONFIG=~/.claude/plugins/marketplaces/arosenkranz-claude-plugins
fi
echo "AGENT_CONFIG=$AGENT_CONFIG"
If nothing resolves, ask the user where the checkout lives before continuing.
Run the analysis script to gather usage data:
bash <this skill's directory>/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/ 2>/dev/null
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 <agents-directory>/<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 |
|-----------|------|-----------|----------------|--------|
| /ship | skill | 2 | - | Active |
| some-skill | skill | 0 | yes | Stale? |
| ... | | | | |
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:
cd "$AGENT_CONFIG"
mkdir -p plugins/workflow-skills/skills/archived
mv plugins/workflow-skills/skills/<name>/ plugins/workflow-skills/skills/archived/
The archived skill stops appearing once the marketplace/plugin cache re-syncs.~/.claude/skills/ — move to ~/.claude/skills/archived/ (create if needed)<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 "$AGENT_CONFIG" && git add -A && git commit -m "chore: optimize skills and agents based on usage analysis"
~/.claude/plugins/marketplaces/) — edit the repo source in plugins/<plugin>/skills/, never the cache~/.claude/skills/ holds standalone skills only; some entries are symlinks with targets that vary per machine (e.g. ~/.agents/skills/) — check with readlink before editing or removing anythingSkill tool auto-trigger count (from homunculus) is more reliable than slash-command counts for skills that are auto-triggered by contextWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub arosenkranz/agent-config --plugin workflow-skills10 skills in this plugin
/captureQuick capture to the Obsidian vault. Routes content to daily note or Inbox based on type. Use when the user says "capture", "note this", "jot down", "quick note", "add to inbox", or "meeting note"./herdr-cheatsheetLook up herdr keybindings, mouse actions, copy-mode and picker keys, agent states, and config syntax — resolved against the user's own ~/.config/herdr/config.toml overrides — or open the herdr cheatsheet web page. Use for "how do I X in herdr", "what's the herdr shortcut for", or "show the herdr cheatsheet". For actually driving herdr (splitting panes, running commands, reading output, waiting on agents), use the `herdr` skill instead./herdr-fanoutSplit a coding task into up to 3 independent parts and run each in its own herdr git worktree with its own Claude Code or pi worker, each landing its own reviewed PR, hands-off. Also cleans up merged fan-out worktrees. Runs only when the user explicitly asks to fan out, parallelize, or run parallel agents/workers with herdr (or invokes /herdr-fanout). Also load it, inside herdr (HERDR_ENV=1), when the user gives you a task that clearly splits into 2-3 independent parts touching different files — but then only SUGGEST fan-out in one line and wait; never start it without the user's yes./herdr-layoutAuto-detect a project's dev server, test, and log commands (package.json, Makefile, docker compose, pyproject, go.mod, Cargo.toml) and open them as named panes in a herdr "dev" tab that the agent can watch, plus a lazygit diffs pane showing what files are changing, with test pass/fail and a changed-files count in the herdr sidebar. Use only when the user explicitly asks to set up a herdr layout/dev tab or to check the herdr test/server/diffs panes (or invokes /herdr-layout). Requires HERDR_ENV=1./herdr-reviewGet a second opinion from a different agent — any Claude Code or pi model, chosen each time — running next to you in herdr. The reviewer reviews the PR or branch diff, posts its findings as a PR comment, and hands back a PASS/CHANGES verdict that also shows in the herdr sidebar. Use only when the user explicitly asks for a cross-agent or second-agent review with herdr (or invokes /herdr-review); also used by /herdr-fanout. Requires HERDR_ENV=1./plan-reviewGenerate an interactive HTML review page for an implementation plan — runs the plan past two parallel critique agents (an adversarial reviewer and an architecture reviewer), then renders the plan and critique as a page with per-section and general feedback boxes that copy to clipboard as Markdown. Use before a non-trivial plan is presented for approval, or on demand via /plan-review <path-to-plan.md>. Triggers on "review this plan", "plan review", "pressure-test this plan".