nw-command-optimization-workflow

nw-command-optimization-workflow is a skill for Claude Code, Codex from nWave-ai/nWave. It costs 22 tokens per session (1,038 once invoked), scanned A, original, MIT.

Step-by-step workflow for converting bloated command files to lean declarative definitions.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/nwave-ai/nwave/nw-command-optimization-workflow
Any agent
npx skills add nWave-ai/nWave --skill nw-command-optimization-workflow
Clone the repo
git clone --depth 1 https://github.com/nWave-ai/nWave

Made for: Claude Code, Codex.

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-command-optimization-workflow

README.md
[![agentmods](https://agentmods.dev/badge/skills/nwave-ai/nwave/nw-command-optimization-workflow.svg)](https://agentmods.dev/skills/nwave-ai/nwave/nw-command-optimization-workflow)
Your own site
<a href="https://agentmods.dev/skills/nwave-ai/nwave/nw-command-optimization-workflow"><img src="https://agentmods.dev/badge/skills/nwave-ai/nwave/nw-command-optimization-workflow.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,038 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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 $0.00022 $0.01038
Opus 5 $0.00011 $0.00519
Sonnet 5 $0.00004 $0.00208
Haiku 4.5 $0.00002 $0.00104

Measured today against content hash 360652060579, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

nw-command-optimization-workflow 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 today.

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-command-optimization-workflow/SKILL.md · 99 lines

How it starts

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

Command Optimization Workflow

Overview

Convert oversized commands (500-2400 lines) to lean declarative definitions (40-300 lines) by removing duplication, extracting domain knowledge to agents, and adopting the forge.md pattern.

Phase 1: Analyze

  1. Classify: dispatcher, orchestrator, or simple
  2. Measure: wc -l the file
  3. Identify content categories (approximate %): parameter parsing/validation | Workflow/orchestration logic | Agent prompt templates | Examples/documentation | Error handling | Boilerplate (orchestrator briefing, agent registry)
  4. Flag reducible content: Duplication from other commands (orchestrator briefing, agent registry, parameter parsing) | Domain knowledge belonging in agents (TDD phases, review criteria, methodology) | Dead code (deprecated formats, aspirational features, old signatures) | Verbose examples (JSON blocks exceeding 3 examples) | Aggressive language (count CRITICAL/MANDATORY/MUST)

Phase 2: Extract

2a: Remove shared boilerplate

These blocks appear in 5-12 commands, extract to shared orchestrator preamble skill:

  • "Sub-agents have NO ACCESS to Skill tool" briefing (~20-30 lines/file)
  • Agent registry with capabilities (~15-20 lines/file)
  • Parameter parsing rules (~10-15 lines/file)
  • Pre-invocation validation checklist (~10-15 lines/file)
  • "What NOT to include" blocks (~8-12 lines/file)

After extraction, command references preamble.

2b: Move domain knowledge to agents

If command contains HOW the agent works, move to agent definition or skill:

  • TDD phase details -> nw-software-crafter | DIVIO templates -> nw-documentarist | Refactoring hierarchies -> nw-software-crafter | BDD/Gherkin -> nw-acceptance-designer | Review criteria -> reviewer agent | Mutation testing config -> nw-software-crafter

Command retains WHAT and success criteria. Agent owns HOW.

2c: Delete dead content

Remove: deprecated format references | Aspirational unimplemented features | Verbose JSON contradicting current format | BUILD:INJECT placeholders | Mixed-language comments

Read the full file on GitHub · 99 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. today First seen · 99 lines · 22 tokens per session scan A 360652060579

Subscribe to this mod's changes

nw-command-optimization-workflow is a skill published in the GitHub repository nWave-ai/nWave (603 stars, last pushed 4d ago), licensed MIT. It adds 22 tokens to every session and 1,038 once invoked, about $0.0001 per session on Opus 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-09-03.