cli-command-add

A procedure for adding a new verb, or action, to the dhcli command-line tool. It covers command structure, asynchronous work, structured errors, help text, documentation, and output formatting.

In plain words
What is it for?
Use it when adding or editing a command under cli/commands/. It also covers extra conventions when the command wraps an MCP tool, a service that exposes callable program functions.
Why use it?
It prevents common implementation and documentation mistakes, such as running asynchronous code incorrectly, displaying errors in the wrong way, or forgetting the CLI reference.

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/deephaven/deephaven-mcp/cli-command-add
Any agent
npx skills add deephaven/deephaven-mcp --skill cli-command-add
Clone the repo
git clone --depth 1 https://github.com/deephaven/deephaven-mcp

Made for: Claude Code, Codex.

Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,867 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00066 $0.02867
Opus 5 $0.00033 $0.01434
Sonnet 5 $0.00013 $0.00573
Haiku 4.5 $0.00007 $0.00287

Measured 2d ago against content hash 5e344f71355e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cli-command-add 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 2d 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.

.agents/skills/cli-command-add/SKILL.md · 64 lines

How it starts

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

Apply the ref-python-coding-practices skill (rule 15 covers click + @run_async + CliError discipline), the ref-documentation-roles skill (it defines docs/CLI.md's role as the exhaustive CLI reference), the ref-cli-help-standards skill (the help-content contract every command's HelpSpec — rendering both --help and the agents manifest — must satisfy), and the ref-output-serialization-conventions skill for the command's output payload (every OutputField's value vocabulary, casing, and known carve-outs). If the command wraps an MCP tool (any verb under session/system/table/catalog/pq/docs), also apply the ref-cli-tool-wrapping skill — it owns the shared _wrapping helpers, the five wrapper categories, the type-scoping rule, the path-flag locality rule, and the wraps_tool drift contract (step 2's wrapper note has the binding details).

Steps

  1. Pick or create the noun group under src/deephaven_mcp/cli/_commands/.

    • The nouns, with the routing gloss you need to place a verb (run dhcli agents tree for the live tree — it emits summaries, not "which noun should host this"): daemon (lifecycle of the local daemon), tool (inspect / invoke MCP tools — the raw escape hatch), session / system / table / catalog / pq (runtime MCP-tool wrappers — apply ref-cli-tool-wrapping), docs (documentation Q&A — connects directly to the docs MCP server, no daemon), config (inspect, validate, and author the configuration tree — show/validate/get/keys/files/set/unset/edit/init plus session/system add/remove/list; the authoring and inspection verbs declare needs_runtime=False and operate on files directly, making config the principal recovery surface when the tree is broken or empty), context (the sticky default session/system/PQ id, persisted in <runtime_dir>/context.json), self (tool self-management, e.g. shell completion — verbs here declare needs_runtime=False when they must work without a config tree).
    • Not an add target: agents emits machine-readable metadata about the live click tree, not user actions; new commands appear there automatically.
    • Default to an existing noun: add a verb under an existing noun; create a new noun only for a genuinely new domain.
    • Ground the naming in prior art: apply ref-cli-design-prior-art when choosing a noun, verb, or flag name — follow the convention a comparable CLI already established, cite the tool and the specific behavior, and state the reason if you depart from it.
    • File layout: each top-level noun is exactly one module _commands/<noun>.py, holding its group, all its verbs, any sub-groups, and its private helpers — do not create per-verb files or noun packages.
    • Module naming: the file is named for its noun alone (session.py, context.py). self_cmd.py is the sole suffixed filename, because self shadows the conventional instance parameter — do not generalize that _cmd suffix to any other noun.
    • If you add a noun, update the cli/ entry in ref-project-reference in the same changeset — it maps the CLI package and goes stale silently otherwise.
  2. Add the click command. Copy the decorator stack from the model verb tool_call in cli/_commands/tool.py: @<group>.command(name, help_spec=HelpSpec(...)) → click options/arguments → @click.pass_obj (or @click.pass_context) → @run_asyncasync def. Exception: a verb that performs no I/O (pure metadata / self-management — canonical implementations: the agents verbs in agents.py, self completion in self_cmd.py) stays a plain synchronous def with no @run_async; never wrap a synchronous body in async def. Compose the help as a HelpSpec from cli/_help.py per the ref-cli-help-standards Help-content contract, and define the output shape once as an OutputSpec constant passed as the spec's output= field (Output is single-source) — output_spec derives from it automatically.

Read the full file on GitHub · 64 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. 2d ago First seen · 64 lines · 66 tokens per session scan A 5e344f71355e

Subscribe to this mod's changes

cli-command-add is a skill published in the GitHub repository deephaven/deephaven-mcp (5 stars, last pushed 4d ago), licensed Apache-2.0. It adds 66 tokens to every session and 2,867 once invoked, about $0.0003 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-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

agent-host-chat-contributions

Build and review cross-cutting agent-host chat behavior through lifecycle contributions. Use when adding turn lifecycle side effects, prompt or context injection, restored-history transformation, protocol-action observation, or when reviewing changes that add code to AgentSideEffects or AgentService.

microsoft/vscode · 56 tokens