nw-command-design-patterns

nw-command-design-patterns is a skill for Claude Code, Codex from nWave-ai/nWave. It costs 31 tokens per session (2,260 once invoked), scanned A, original, MIT.

Best practices for command definition files - size targets, declarative template, anti-patterns, and canonical examples based on research evidence.

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-design-patterns
Any agent
npx skills add nWave-ai/nWave --skill nw-command-design-patterns
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-design-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/nwave-ai/nwave/nw-command-design-patterns.svg)](https://agentmods.dev/skills/nwave-ai/nwave/nw-command-design-patterns)
Your own site
<a href="https://agentmods.dev/skills/nwave-ai/nwave/nw-command-design-patterns"><img src="https://agentmods.dev/badge/skills/nwave-ai/nwave/nw-command-design-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,260 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.00031 $0.02260
Opus 5 $0.00015 $0.01130
Sonnet 5 $0.00006 $0.00452
Haiku 4.5 $0.00003 $0.00226

Measured today against content hash a406791ea417, 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-design-patterns 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-design-patterns/SKILL.md · 282 lines

How it starts

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

Command Design Patterns

The Forge Model (Gold Standard)

forge.md at 40 lines is the reference dispatcher. Contains: header (wave, agent, overview) | Agent invocation (name + command + config) | Success criteria (checklist) | Next wave handoff | Expected outputs. Every dispatcher should aspire to this pattern.

Command Categories

Category Description Size Target Examples
Simple Direct action, minimal delegation 40-80 lines forge, start, version, git
Dispatcher Delegates to one agent with context 40-150 lines research, review, execute
Orchestrator Coordinates multiple agents/phases 100-300 lines develop, document

Declarative Command Template

Commands declare WHAT, not HOW. The agent knows how to do its job.

# DW-{NAME}: {Title}

**Wave**: {WAVE_NAME}
**Agent**: {persona} ({agent-id})

## Overview

One paragraph: what this command does and when to use it.

## Context Files Required

- {path} - {why needed}

## Agent Invocation

@{agent-id}

Execute \*{command} for {parameters}.

**Context Files:**
- {files the orchestrator reads and passes}

**Configuration:**
- {key}: {value} # {comment}

## Success Criteria

- [ ] {measurable outcome}
- [ ] {quality gate}

## Next Wave

**Handoff To**: {next wave or workflow step}
**Deliverables**: {what this command produces}

# Expected outputs:
# - {file paths}

Size Targets and Evidence

Research (Chroma Research, Anthropic context engineering): focused prompts (~300 tokens) outperform full prompts (~113k tokens) | Claude shows most pronounced performance gap | Information buried mid-prompt gets deprioritized ("Lost in the Middle") | Opus 4.6 is proactive/self-directing; verbose instructions cause overtriggering

Targets: Dispatchers 40-150 lines | Orchestrators 100-300 lines | Current average 437 lines; target under 150

The Duplication Triangle

Commands duplicate content in three directions, all waste tokens:

Read the full file on GitHub · 282 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 · 282 lines · 31 tokens per session scan A a406791ea417

Subscribe to this mod's changes

nw-command-design-patterns is a skill published in the GitHub repository nWave-ai/nWave (604 stars, last pushed 4d ago), licensed MIT. It adds 31 tokens to every session and 2,260 once invoked, about $0.0002 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.