nw-ab-optimize-skill

nw-ab-optimize-skill is a skill for Claude Code from nWave-ai/nWave. It costs 41 tokens per session (914 once invoked), scanned A, original, MIT.

A procedure for simplifying an existing AI-agent skill after measuring its size, repeated rules, triggers, and the context it keeps loaded. It keeps the skill's public name and behaviour while separating work that belongs elsewhere.

In plain words
What is it for?
Use it to decide whether a skill needs optimization, remove duplication, split distinct triggers, and verify that callers and expected behaviour remain intact.
Why use it?
Skills can become bloated or trigger for too many unrelated situations, increasing maintenance work and the amount of context an agent must process.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Good fit Use it to decide whether a skill needs optimization, remove duplication, split distinct triggers, and verify that callers and expected behaviour remain intact.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nwave-ai/nwave/nw-ab-optimize-skill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add nWave-ai/nWave --skill nw-ab-optimize-skill
Clone the repo
git clone --depth 1 https://github.com/nWave-ai/nWave

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nw-ab-optimize-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/nwave-ai/nwave/nw-ab-optimize-skill/github.svg)](https://agentmods.dev/skills/nwave-ai/nwave/nw-ab-optimize-skill)
Your own site
<a href="https://agentmods.dev/skills/nwave-ai/nwave/nw-ab-optimize-skill"><img src="https://agentmods.dev/badge/skills/nwave-ai/nwave/nw-ab-optimize-skill/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nw-ab-optimize-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/nwave-ai/nwave/nw-ab-optimize-skill"><img src="https://agentmods.dev/badge/skills/nwave-ai/nwave/nw-ab-optimize-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 914 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.00914
Opus 5.5 $0.00016 $0.00366
Sonnet 5.5 $0.00008 $0.00183
Haiku 4.5 $0.00004 $0.00091

Measured 27d ago against content hash 795a66690510, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

nw-ab-optimize-skill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 27d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

nWave/skills/nw-ab-optimize-skill/SKILL.md · 43 lines

How it starts

The opening of the file, as written. The whole thing — 43 lines — stays where its author put it; the contents beside it link to each section on GitHub.

nw-ab-optimize-skill (PROCEDURE)

Kind: PROCEDURE | One job: optimize one existing skill | One trigger: an existing skill is requested for optimization.

Eligibility

  1. Measure debt — Record source lines, words, bytes; classify every rule and firing condition; identify duplication and resident-context cost. Compute static_resident; compute expected_runtime only from evidenced trigger probabilities, otherwise INDETERMINATE; compute worst_runtime. Use “tokens” only for exact compatible token measurements, otherwise report INDETERMINATE. Stop: a small coherent single-trigger skill; return NOT_ELIGIBLE without edits.
  2. Protect behavior — Inventory the skill's public name, global invariants, referenced callers, textual pins, public/private fan-out, and existing behavioral projections. Stop: baseline red, a pin cannot be preserved, or a public fan-out is missing.

Deterministic workflow

Run these steps in order:

  1. Map ownership — Assign every original rule exactly one owner: original lean core, existing reused skill, or one extracted skill. Reuse first. Stop: duplicate or unowned rule.
  2. Partition triggers — State a concrete trigger for every extracted procedure or knowledge skill. The triggers together cover the original trigger-space, without overlap. Keep one-job/one-trigger skills intact. Stop: trigger gap or overlap.
  3. Construct first — Apply this order: remove, relax, route, construct, then consider an existing check. When an LLM still authors formal bytes, templates, grammars, reviewers, and validators are checks, not construction; prefer a deterministic sole-writer constructor or compiler that accepts semantic input once. Do not add enforcement machinery (validator, hook, gate, test, or mandatory artifact) through this procedure; a deterministic constructor/compiler that replaces LLM formal-byte authoring is allowed.
  4. Recompose — Preserve the original skill name as the lean core. Keep its routing, global invariants, and public contract there; extract only distinct-trigger procedures or knowledge. Wire every extracted skill from the core; no orphan or name change.
  5. Measure outcome — Re-measure core lines, words, bytes, static_resident, expected_runtime when evidenced, and worst_runtime. Retain a step only with evidence that it improves speed, resident/expected context cost, or outcome quality without silently worsening another; otherwise remove or skip it. Claim improvement only for a measured reduction; otherwise label the result STRUCTURAL_ONLY and name no efficiency gain. Stop: resident cost worsens without an explicit decision.
  6. Verify once — Batch edits, run the existing relevant validation once, and execute the existing behavioral projections once. Do not create new validation. Stop: behavior changes or an existing projection is red.
  7. Handoff — Return compact evidence only: ownership map; trigger partition; before/after metrics; executed projections; independent-review-needed; residual INDETERMINATE. Do not create a mandatory report artifact.

Read the full file on GitHub · 43 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 27d ago First seen · 43 lines · 41 tokens per session scan A 795a66690510

Subscribe to this mod's changes

nw-ab-optimize-skill is a skill published in the GitHub repository nWave-ai/nWave (636 stars, last pushed 11d ago), licensed MIT. It adds 41 tokens to every session and 914 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-03.

Related

nw-ab-optimize-skill compared with skills from other repositories

nw-ab-optimize-skill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
nw-ab-optimize-skillnWave-ai/nWaveSkill63611d agoMITA41Claude Code
computer-usekirodotdev/KiroCrewSkill5.1ktodayApache-2.0A67Claude Code, Codex
startcycle-graph-userhybridlabor-api/bdb-dev-optimized-agent-skillsSkill910d agoApache-2.0A102Claude Code, Codex
tddt1/tdderSkill142d agoApache-2.0A102Claude Code
opt-in-workspace-writesfabioc-aloha/Alex_Skill_MallSkill64d agoMITA19Claude Code, Codex
test-driven-developmentaaronnat23/disp8chSkill822mo agoMITA0Claude Code, Codex
harness-loopme-cedric/agent-compassSkill39d agoMITA50Claude Code