use-agently: Skill for Claude Code

.agents/skills/cli-for-agent/SKILL.md

cli-for-agent is a skill for Claude Code, Codex from AgentlyHQ/use-agently. It costs 45 tokens per session (2,487 once invoked), scanned A, original, MIT.

A design guide for command-line tools that AI agents can run. It explains how to provide structured output, clear errors, and useful exit codes without relying on colors, menus, prompts, or other terminal-only interaction.

In plain words
What is it for?
Use it when creating, changing, or reviewing an agent-facing CLI. It is for designing commands that run without human input and are easy for an agent to interpret and retry.
Why use it?
It helps make commands reliable for unattended use in scripts, continuous-integration systems, and agent tool calls. It also explains how to handle destructive actions with explicit confirmation flags.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is AgentlyHQ/use-agently's own configuration. It tells Claude Code and Codex how to work on use-agently itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything use-agently configures →

Reuse

Borrowing it

Nothing to install: this file belongs to AgentlyHQ/use-agently. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/AgentlyHQ/use-agently/main/.agents/skills/cli-for-agent/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/AgentlyHQ/use-agently

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 cli-for-agent

README.md
[![agentmods](https://agentmods.dev/badge/skills/agentlyhq/use-agently/cli-for-agent.svg)](https://agentmods.dev/skills/agentlyhq/use-agently/cli-for-agent)
Your own site
<a href="https://agentmods.dev/skills/agentlyhq/use-agently/cli-for-agent"><img src="https://agentmods.dev/badge/skills/agentlyhq/use-agently/cli-for-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,487 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 3 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Data Exfiltration · line 108
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Excessive Agency · line 171
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Rogue Agent · line 193
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
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.00045 $0.02487
Opus 5 $0.00023 $0.01243
Sonnet 5 $0.00009 $0.00497
Haiku 4.5 $0.00005 $0.00249

Measured 8d ago against content hash 7f7f88b60e26, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

cli-for-agent 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 8d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.agents/skills/cli-for-agent/SKILL.md · 252 lines

How it starts

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

Building CLI Tools for AI Agents

When to Use

Use this skill when:

  • Designing a new CLI tool that AI agents will invoke
  • Adapting an existing CLI to be agent-friendly
  • Reviewing a CLI for agent compatibility issues
  • Adding commands or subcommands to an agent-facing CLI

Core Principle

Agents are not humans. They cannot see colors, navigate interactive menus, interpret spinner animations, or respond to TTY prompts. A CLI built for agents must communicate entirely through structured text on stdout, clear error messages on stderr, and meaningful exit codes. If an agent can't parse your output or recover from your errors in one retry, your CLI has failed.

Design Rules

1. No TTY Assumed — Ever

Never use interactive prompts, confirmation dialogs, readline, cursor movement, or progress spinners. Every command must run unattended in scripts, CI pipelines, and agent tool-call chains without a terminal.

# Bad — blocks waiting for input
Are you sure? [y/N]

# Good — flag-driven, no interaction
$ my-cli delete --confirm resource-id

If a command is destructive, require an explicit --confirm or --yes flag instead of prompting.

TTY-only decoration. Colors, boxes (boxen), tables, spinners, and progress bars are fine — but only when stdout is a TTY. When piped, output must be plain. Check isatty(stdout) (or your language's equivalent) and strip all decoration when it returns false. Never use box-drawing libraries like boxen in non-TTY mode — they break grep and head.

2. Pipeline-Friendly Output

Your output will be piped through head, tail, grep, jq, awk, and wc. Every design decision flows from this.

One record per line. Each line must be a self-contained unit of meaning. This is the single most important rule — it makes every standard Unix tool work for free.

For a single object response, emit one compact JSON line:

$ my-cli status --output json
{"name":"my-service","status":"running","uptime_seconds":13320}

Read the full file on GitHub · 252 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. 8d ago First seen · 252 lines · 45 tokens per session scan A 7f7f88b60e26

Subscribe to this mod's changes

cli-for-agent is a skill published in the GitHub repository AgentlyHQ/use-agently (72 stars, last pushed 1mo ago), licensed MIT. It adds 45 tokens to every session and 2,487 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-08-30.