Optimizes agent skills to reduce context bloat while preserving answer coverage. Use when a skill body exceeds ~250 lines, duplicates references, has a verbose description, or triggers false positives. Also activates proactively when reviewing any skill with both a body and reference files.
Ships in wl-web-configs. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Reduce skill token cost without losing coverage. Every token in SKILL.md body is paid per conversation — references/ files are loaded on-demand.
Measure the current skill before changing anything.
references/ file with line counts.If the skill has no references/ directory, optimization may require creating reference files first. See the playbook for guidance on this edge case.
Output a table:
| Metric | Current |
|---------------------|---------|
| Description chars | ??? |
| Body lines | ??? |
| Body tokens (est.) | ??? |
| Duplication % | ??? |
| Reference files | ??? |
Decide what stays in the body, what moves to references, and what gets compressed.
Body retention criteria — keep a section in the body only if it meets at least one:
Everything else belongs in the appropriate references/ file. See the playbook decision tree for concrete examples of what typically stays vs. moves.
Description compression rules:
Plan the Reference Guide section — for each reference file, write a one-line description of when to read it. This section is load-bearing: it tells agents which file to consult.
Target metrics:
Apply the plan. Work in this order:
description field. Keep all trigger categories; do not remove any "when to use" signals.metadata.version minor if the skill uses versioning.Do NOT:
Use the Task tool to spawn a subagent (opus model) to challenge coverage. Provide it:
AskUserQuestion) to provide questions the skill must answer. If the user declines or has none, derive them from the description trigger categories — see the playbook for derivation rules.The subagent evaluates each question:
Pass criteria:
If gaps are found, determine whether they are pre-existing (never covered) or regressions (lost during optimization). Only regressions require fixes — restore or rewrite the missing content in the body or appropriate reference file, then re-evaluate only the affected questions.
Fallback: If subagent spawning is unavailable, self-evaluate: for each question, attempt to answer it using only the optimized files and rate confidence as HIGH / MEDIUM / LOW. Any LOW-confidence answer on a question that was previously answerable is a regression.
After validation, produce a summary table:
| Metric | Before | After | Change |
|-------------------|--------|--------|--------|
| Description chars | ??? | ??? | -??% |
| Body lines | ??? | ??? | -??% |
| Body tokens (est.)| ??? | ??? | -??% |
| Duplication % | ??? | 0% | -??% |
| Regressions | n/a | 0 | |
For detailed checklists, before/after examples, and the full validation methodology, see optimization-playbook.md.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/wl-web-configs:workleap-skill-optimizerfrom wl-web-configs
npx claudepluginhub workleap/wl-web-configs --plugin wl-web-configs10 skills in this plugin
/workleap-browserslist-configWorkleap's shared Browserslist config (`@workleap/browserslist-config`). Use when adding or customizing a `.browserslistrc` in a project that uses `@workleap/browserslist-config`, adding custom browser targets, listing the supported browser versions, or deciding whether a project (application vs library) should include Browserslist at all.
/workleap-chromatic-best-practicesWorkleap's Chromatic best practices for snapshot cost control and CI optimization. Use when auditing, setting up, or fixing Chromatic configurations — including TurboSnap-disabling patterns, CI workflows, chromatic.config.json, and monorepo setups. Also activate when reviewing PRs that touch Storybook or Chromatic-related files.
/workleap-react-best-practicesReact performance optimization guidelines for Single Page Applications (SPA) at Workleap. Use when writing, reviewing, or refactoring React SPA code. Covers async waterfall elimination, bundle size reduction, re-render optimization, rendering efficiency, JS micro-optimizations, and advanced patterns. Activate even for small component changes — performance regressions compound silently. Does not cover SSR, Next.js, or server components./workleap-rsbuild-configsWorkleap's shared Rsbuild configs for web applications (`@workleap/rsbuild-configs`): `defineDevConfig`, `defineBuildConfig`, `defineStorybookConfig`, and `RsbuildConfigTransformer`. Use when setting up, customizing, or troubleshooting the dev server, production build, or Storybook of a web application that uses `@workleap/rsbuild-configs`, adding SVG / CSS Modules type declarations, configuring Turborepo tasks, upgrading to Rsbuild 2, or migrating an application from `@workleap/webpack-configs`.
/workleap-rslib-configsWorkleap's shared Rslib configs for libraries (`@workleap/rslib-configs`): `defineBuildConfig`, `defineDevConfig`, `defineStorybookConfig`, and `RslibConfigTransformer`. Use when setting up, customizing, or troubleshooting the build, watch mode, or Storybook of a library that uses `@workleap/rslib-configs`, choosing bundleless vs bundle output, configuring `tsconfig.build.json` or type declarations, upgrading to Rslib 2, or migrating a library from `@workleap/tsup-configs`.
/workleap-skill-safety-reviewEvaluate third-party agent skills for security risks before adoption or update. Use when installing, updating, or auditing skills from any source (skills.sh, ClawHub, public registries, PRs). Also activate when building allowlists, investigating suspicious behavior, or answering "is this skill safe?"