improve-skill
Analyzes and optimizes existing Claude Code skills for better trigger precision, structural compliance, instruction quality, and agent efficiency. Produces measurable before/after scorecards. Use when the user asks to "improve a skill", "optimize a skill", "review a skill", "audit skill quality", "fix skill triggers", or references an existing SKILL.md that needs work. Do NOT use for creating new skills (use create-skill instead) or for reviewing non-skill code (use code-review instead).
What this skill does
## Critical Rules
- ALWAYS use AskUserQuestion for decisions and approvals — never plain text questions
- ALWAYS use Edit for applying changes — surgical modifications, never full rewrites
- ALWAYS present before/after diffs via AskUserQuestion with preview before applying
- ALWAYS update the spec before modifying skill artifacts when design intent has shifted
- Read shared knowledge base from `${CLAUDE_PLUGIN_ROOT}/shared/` for scoring criteria
- When auditing a skill, also check for outdated patterns: `TodoWrite` references (should be `TaskCreate`/`TaskUpdate`), old model IDs (`claude-sonnet-4-5` → `claude-sonnet-4-6`, `claude-opus-4-1` → `claude-opus-4-7`), hooks-template references that pre-date `prompt`/`mcp_tool`/`http`/`agent` handler types, plugin.json missing `displayName`/`userConfig`/`dependencies` where they'd add value
- Non-destructive: every individual change must be approved before applying
## Step 1 — Locate Skill & Gather Context
Accept a skill path and an optional braindump from the command or conversation context.
- **Path**: provided directly or discovered via search
- **Braindump** (optional): the user's own improvement ideas, specific complaints, or desired changes
If a path was provided, read the SKILL.md at that path.
If a name was provided (no `/`, does not end in `.md`), search these locations in order and use the first match:
1. `.claude/skills/{name}/SKILL.md` (project-local)
2. `~/.claude/skills/{name}/SKILL.md` (global)
3. `plugins/*/skills/{name}/SKILL.md` (marketplace)
4. `**/skills/{name}/SKILL.md` (anywhere in working directory)
If multiple matches exist, use AskUserQuestion to ask the user to select one.
After locating SKILL.md, also read:
- All other files in the same skill directory
- `plugin.json` in the parent plugin directory (if it exists)
- Any agent `.md` files referenced by or co-located with the plugin
- Any command `.md` files in the plugin's `commands/` directory
- `hooks/hooks.json` (if it exists)
- All files under `references/` in the skill directory (if it exists)
### Spec Context
Determine the skill's root directory (the directory containing `skills/`, `agents/`, etc.). Check whether `{skill-root}/docs/` exists, and if so, read:
- `{skill-root}/docs/contract.md` — design intent document
- `{skill-root}/docs/spec.md` — execution plan document
- `{skill-root}/docs/learnings.md` — accumulated observations
- `{skill-root}/docs/history.json` — iteration tracking data
Record whether a spec exists or not — this determines Step 2's behavior.
If a braindump was provided, hold it for Step 2 — the user's ideas are passed to the optimizer alongside the skill content so the analysis addresses both systematic quality issues and the user's specific concerns.
## Step 2 — Analysis & Scoring
### When a spec exists
Spawn the `skill-forge:skill-optimizer` agent (Sonnet) with all collected skill content AND spec content provided in the prompt. Include spec files under a `## Spec Context` section containing the full text of contract.md and spec.md.
If `history.json` exists, include it under a `## Iteration History` section so the optimizer can identify trends across runs.
If the user provided a braindump, include it under a `## User-Requested Improvements` section.
The optimizer performs a three-way analysis:
1. **Spec vs reality drift**: has the skill diverged from its spec? Are there components in the spec that don't exist, or components that exist but aren't in the spec?
2. **Braindump vs spec alignment**: is the user's request consistent with the original design intent?
3. **Braindump vs spec conflict**: does the user want something the spec explicitly excluded or scoped out?
After the three-way analysis, the optimizer scores the standard four dimensions (0-25 each):
- Description Quality
- Structural Compliance
- Instruction Quality
- Agent/Tool Optimization
Each braindump item is mapped to the most relevant dimension. Braindump items that conflict with best practices are flagged with trade-off explanations.
### When no spec exists
Before running the optimizer, offer retroactive spec generation via AskUserQuestion:
- **Option A**: "Generate spec from current skill state"
- **Option B**: "Skip, improve without spec"
If the user selects **Option A**:
1. Spawn the `skill-forge:skill-optimizer` agent with skill content and a directive to reverse-engineer a contract.md and spec.md from the current skill state
2. The optimizer generates both documents using the templates in `${CLAUDE_PLUGIN_ROOT}/shared/templates/`
3. Create `{skill-root}/docs/` if it doesn't exist
4. Write the generated contract.md and spec.md to `{skill-root}/docs/`
5. Create an empty learnings.md with a header explaining its purpose
6. Present the generated spec to the user via AskUserQuestion for approval
7. Once approved, proceed with the full three-way analysis as if a spec had existed
If the user selects **Option B**:
Spawn the `skill-forge:skill-optimizer` agent with skill content only (no spec context). The optimizer performs the standard scored analysis — four dimensions scored 0-25 each. This is the current behavior with no regression.
Wait for the agent to return the full scored analysis before proceeding.
## Step 3 — Recommendations
Present the scorecard via AskUserQuestion. Show each dimension score and the most impactful improvement for that dimension. If braindump items were provided, show how they map to dimensions.
### When spec alignment findings exist
Present spec alignment issues alongside the scorecard:
- **Spec drift**: list each divergence between spec and current skill state
- **Braindump conflicts**: list any user requests that conflict with the spec's scope boundaries
- **Braindump alignment**: confirm which user requests are consistent with the spec
If spec updates are needed (due to drift or intentional design changes), present the proposed spec changes FIRST, before skill improvements. The spec is the source of truth — it must be updated before downstream artifacts change.
### User selection
Ask the user which improvements to apply. Options:
- "Improve all"
- "Description only"
- "Structure only"
- "Instructions only"
- "Agents/Tools only"
- "Update spec only"
- "I'm satisfied"
If the user selects "I'm satisfied", stop here and summarize the scores.
For each selected dimension, generate specific improvements with concrete before/after examples drawn from the agent's recommendations.
## Step 4 — Apply Changes
### Spec-first updates
If spec updates were approved (either from drift findings or design intent changes):
1. Edit contract.md first — update problem statement, goals, scope boundaries, or design decisions as needed
2. Edit spec.md second — update component manifest, architecture, or execution plan as needed
3. Present each spec change via AskUserQuestion with before/after text before applying
### Skill improvements
For each improvement identified in the selected dimensions:
1. Use AskUserQuestion to show the user the old text vs the proposed new text
2. Options: "Apply", "Skip", "Modify"
3. If "Apply": use Edit to make the surgical change
4. If "Modify": use AskUserQuestion to collect the desired modification, then apply
5. If "Skip": record it as skipped
6. Use TaskCreate/TaskUpdate to track which improvements have been applied and which were skipped
Never rewrite entire files. Every Edit must be the minimum change needed for the improvement.
### Optional: Eval Comparison
After changes are applied, offer eval comparison via AskUserQuestion:
- "Run eval comparison (old vs new)" — compares the skill before and after this improve run
- "Skip to re-validation"
If the user selects eval comparison:
1. Use the `/eval-skill` command flow in improve mode (old_skill vs new_skill)
2. The "old" version is the skill state before this improve run — use `git stash` to create a temp copy, or read from the last committed version
3. The "new" version is the current state after Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.