Home
cd ../playbooks
Developer ToolsIntermediate

Agent DX CLI Scale

A 7-axis, 0-21 scoring scale for evaluating how well a CLI is designed for AI agents rather than humans — machine-readable output, raw payload input, schema introspection, context-window discipline, input hardening, safety rails, and agent knowledge packaging.

5 minutes
By Google LabsSource
#cli-design#agent-tooling#developer-experience#mcp#api-design#prompt-injection

Human DX optimizes for discoverability and forgiveness; agent DX optimizes for predictability and defense-in-depth — two different design goals that most CLIs quietly conflate, which is exactly why an agent driving a human-optimized CLI wastes tokens, hallucinates flags, and fails silently.

Who it's for: developers building CLIs that AI agents will drive, platform teams deciding whether to build a dedicated agent-facing mode, engineers debugging why an agent keeps mishandling a specific tool, anyone designing MCP servers or agent tool surfaces on top of an existing CLI

Example

"Score our CLI for agent-readiness" → A 0-21 score across 7 axes with cited evidence per axis (which command, which flag), a clear identification of the lowest-scoring gaps — often safety rails (no dry-run, no response sanitization) — and a rating from Human-only through Agent-first that tells the team exactly what to fix next instead of a vague 'needs work' verdict

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

# Agent DX CLI Scale

A scoring scale for evaluating how well a CLI is designed for AI agents rather than humans. Human DX optimizes for discoverability and forgiveness; agent DX optimizes for predictability and defense-in-depth. Use this to evaluate an existing CLI, or as a design checklist when building a new one that agents will drive.

## When to Use

- Auditing whether a CLI your agents rely on is actually agent-ready
- Deciding whether to build a dedicated agent-facing mode for an existing CLI
- Designing a new CLI or tool surface that AI agents will operate
- Diagnosing why an agent keeps hallucinating flags, wasting tokens, or failing silently against a specific tool

## Scoring Axes

Score each axis 0–3, then sum for a total out of 21.

### 1. Machine-Readable Output

Can an agent parse the CLI's output without heuristics?

| Score | Criteria |
|---|---|
| 0 | Human-only output (tables, color codes, prose). No structured format available. |
| 1 | `--output json` or equivalent exists but is incomplete or inconsistent across commands. |
| 2 | Consistent JSON output across all commands. Errors also return structured JSON. |
| 3 | Streaming structured output (NDJSON) for paginated results. Structured output is the default in non-TTY (piped) contexts. |

### 2. Raw Payload Input

Can an agent send the full API payload without translation through bespoke flags?

| Score | Criteria |
|---|---|
| 0 | Only bespoke flags. No way to pass structured input. |
| 1 | Accepts `--json` or stdin JSON for some commands, but most require flags. |
| 2 | All mutating commands accept a raw JSON payload that maps directly to the underlying API schema. |
| 3 | Raw payload is first-class alongside convenience flags. The agent can use the API schema itself as documentation, with zero translation loss. |

### 3. Schema Introspection

Can an agent discover what the CLI accepts at runtime, without pre-stuffed documentation?

| Score | Criteria |
|---|---|
| 0 | Only `--help` text. No machine-readable schema. |
| 1 | `--help --json` or a `describe` command exists for some surfaces, but incomplete. |
| 2 | Full schema introspection for all commands — params, types, required fields — as JSON. |
| 3 | Live, runtime-resolved schemas that always reflect the current version, including scopes, enums, and nested types. |

### 4. Context Window Discipline

Does the CLI help agents control response size to protect their context window?

| Score | Criteria |
|---|---|
| 0 | Returns full responses with no way to limit fields or paginate. |
| 1 | Supports field masks or filters on some commands. |
| 2 | Field masks on all read commands, plus a way to page through results in full. |
| 3 | Streaming pagination, explicit in-tool guidance on field-mask usage, and active protection of the agent from token waste as a design goal. |

### 5. Input Hardening

Does the CLI defend against the specific ways agents fail — hallucinations, not typos?

| Score | Criteria |
|---|---|
| 0 | No input validation beyond basic type checks. |
| 1 | Validates some inputs but doesn't cover agent-specific hallucination patterns (path traversal, embedded query params, double encoding). |
| 2 | Rejects control characters, path traversal (`../`), percent-encoded segments, and embedded query params in resource IDs. |
| 3 | Comprehensive hardening: all of the above, plus output-path sandboxing, HTTP-layer encoding, and an explicit posture that the agent is not a trusted operator. |

### 6. Safety Rails

Can agents validate before acting, and are responses sanitized against prompt injection?

| Score | Criteria |
|---|---|
| 0 | No dry-run mode. No response sanitization. |
| 1 | A dry-run flag exists for some mutating commands. |
| 2 | Dry-run for all mutating commands, so the agent can validate a request without side effects. |
| 3 | Dry-run plus response sanitization against prompt injection embedded in returned data. The full request-response loop is defended, not just the request side. |

### 7. Agent Knowledge Packaging

Does the CLI ship knowledge in formats agents can consume at conversation start?

| Score | Criteria |
|---|---|
| 0 | Only `--help` and a docs site. No agent-specific context files. |
| 1 | A basic agent-context file with general usage guidance. |
| 2 | Structured skill files covering per-command or per-surface workflows and invariants. |
| 3 | A comprehensive, versioned skill library encoding agent-specific guardrails ("always use dry-run," "always use field masks") that's discoverable and follows a real packaging standard. |

## Interpreting the Total

| Range | Rating | Description |
|---|---|---|
| 0–5 | Human-only | Built for humans. Agents will struggle to parse output, hallucinate inputs, and lack safety rails. |
| 6–10 | Agent-tolerant | Agents can use it, but they'll waste tokens, make avoidable errors, and need heavy prompt engineering to compensate. |
| 11–15 | Agent-ready | Solid agent support. Structured I/O, input validation, and some introspection, with a few real gaps. |
| 16–21 | Agent-first | Purpose-built for agents: full schema introspection, comprehensive input hardening, safety rails, and packaged agent knowledge. |

## Bonus: Multi-Surface Readiness (Not Scored)

Note whether the CLI exposes multiple agent surfaces from the same binary — each is a genuine capability multiplier even though it doesn't add to the numeric score:

- **MCP support** (stdio JSON-RPC) — typed tool invocation, no shell-escaping risk.
- **Extension or plugin install** — the agent treats the CLI as a native capability rather than a shelled-out subprocess.
- **Headless auth** — environment-variable tokens or credentials, no browser redirect required.

## How to Use This Scale

1. **Score the CLI as it stands today**, axis by axis, citing the specific command or flag that justifies each score — a score without evidence isn't auditable later.
2. **Identify the lowest-scoring axes first.** A CLI scoring 3/3 on machine-readable output but 0/3 on input hardening has a specific, fixable gap, not a general "needs work" verdict.
3. **When designing a new CLI**, treat the level-2 criteria as the real target for a first release — level 3 is where a CLI should grow toward as agent usage proves out, not where day one needs to land.
4. **Re-score after a redesign** to confirm the change actually moved the needle on the axis it targeted, not just on the axes that were easy to fix.

## Tips

- The safety-rails axis (dry-run plus response sanitization) is the one teams most often skip entirely — it's easy to add structured output and call it "agent-ready" while leaving the CLI wide open to prompt injection riding in on API responses.
- A CLI that scores well on raw payload input but poorly on schema introspection creates a specific, painful failure mode: an agent that can send anything but has no reliable way to know what's valid, so it guesses and gets it wrong just often enough to be expensive.
- Treat the agent-knowledge-packaging axis as cheap, high-leverage effort — a well-written skill file describing invariants ("always dry-run before a delete") often closes gaps that would otherwise require actual code changes on the other axes.

## Limitations

- A scoring framework for CLI design, not a security audit tool — a CLI can score well here and still have vulnerabilities this scale doesn't probe for.
- Assumes the CLI's primary consumer is an autonomous or semi-autonomous agent; a CLI built purely for human interactive use isn't failing by scoring low here, it's just serving a different audience.
- The bonus multi-surface criteria are non-scored on purpose — don't let a high MCP/plugin score paper over a low score on the seven core axes.

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

A concrete, evidence-based scoring scale for whether a CLI is actually designed for AI agents to drive — as distinct from a CLI that's merely usable by one. Seven axes, each scored 0–3: machine-readable output (structured JSON, not tables and color codes), raw payload input (can an agent send the API schema directly instead of translating through bespoke flags?), schema introspection (can it discover what's valid at runtime?), context-window discipline (field masks and pagination that protect the agent's token budget), input hardening against agent-specific failure modes (hallucinated paths, embedded query params — not typos), safety rails (dry-run plus sanitization against prompt injection riding in on API responses), and agent knowledge packaging (does it ship the skill files an agent needs at conversation start?).

The total (0–21) maps to four ratings — Human-only, Agent-tolerant, Agent-ready, Agent-first — but the real value is per-axis: a CLI that scores well on structured output and poorly on safety rails has a specific, fixable gap, not a general "needs work" verdict. A non-scored bonus section flags multi-surface readiness (MCP support, plugin install, headless auth) as a separate capability multiplier worth noting even though it doesn't count toward the total.


Quick Start

Step 1: Create a Project Folder

mkdir cli-scale && cd cli-scale

Step 2: Download the Template

Click Download above, then:

mv ~/Downloads/CLAUDE.md ./

Step 3: Score a CLI

claude

Point Claude at a CLI's --help output, its documentation, or its source, and ask it to score the CLI against the 7 axes. For a new CLI, ask it to use the scale as a design checklist instead.


Tips & Best Practices

  • The safety-rails axis is the one teams most often skip entirely — it's easy to add structured output and call a CLI "agent-ready" while leaving it wide open to prompt injection riding in on API responses.
  • A CLI that scores well on raw payload input but poorly on schema introspection creates a specific, painful failure mode: an agent that can send anything but has no reliable way to know what's valid, so it guesses and gets it wrong just often enough to be expensive.
  • Treat agent knowledge packaging as cheap, high-leverage effort — a well-written skill file describing invariants ("always dry-run before a delete") often closes gaps that would otherwise require actual code changes on the other axes.

Limitations

  • A scoring framework for CLI design, not a security audit tool — a CLI can score well here and still have vulnerabilities this scale doesn't probe for.
  • Assumes the CLI's primary consumer is an autonomous or semi-autonomous agent; a CLI built purely for human interactive use isn't failing by scoring low here, it's serving a different audience.
  • The bonus multi-surface criteria are intentionally non-scored — don't let a high MCP or plugin score paper over a low score on the seven core axes.

$Related Playbooks

Developer Tools

Agent Design Philosophy

A mental model for designing AI agents in any domain — the model already knows how to be an agent, so design is about capabilities, knowledge, and context, added only as far as a Progressive Complexity ladder (basic → planning → subagents → skills) that real usage actually demands.

10 minutes
Intermediate
Developer Tools

Agent Prompt Architect

A compact seven-field skeleton (Role, Goal, Inputs, Constraints, Process, Output, Verification, Fallback) and a fast refinement loop for turning vague intent into a prompt an agent can execute reliably every time.

5 minutes
Beginner
Developer Tools

CEO-Mode Plan Review

Review a technical or product plan the way a great CEO would — pick a mode (expand scope, cherry-pick expansions, hold scope, or cut ruthlessly), then apply nine prime directives and eleven cognitive patterns to catch every silent failure, missing edge case, and unnamed error before it ships.

10 minutes
Advanced
Developer Tools

Agent SDK App Builder

Scaffold new Claude Agent SDK applications in TypeScript or Python, and verify existing ones against official SDK patterns before you ship.

10 minutes
Intermediate
Developer Tools

Brandkit Generator: Premium Identity Board Creator

An image-direction rule set that produces a complete brand-guidelines board in one image: logo concept, color system, typography, and applications, grounded in brand strategy instead of random logo generation

5 minutes
Beginner
Developer Tools

Brutalist UI Skill: Industrial & Tactical Interface Design

A design language that forces Claude to build raw, mechanical interfaces — Swiss industrial print or CRT terminal telemetry, with rigid grids and zero rounded corners

5 minutes
Intermediate
Developer Tools

Programmatic Screen Capture

Capture screenshots programmatically on macOS — find window IDs, control application windows via AppleScript, and capture specific windows for documentation and visual workflows.

10 minutes
Intermediate
Developer Tools

AI Agent Builder

Build AI agents with tools, memory, and multi-step reasoning - ChatGPT, Claude, Gemini integration patterns

10 minutes
Advanced
Developer Tools

Browser Automation Assistant

Automate web browser interactions, scraping, testing, and workflow automation with Puppeteer/Playwright

10 minutes
Advanced
Developer Tools

Automated PR Code Review

High-signal automated PR review using parallel agents with a validation pass that filters out false positives before anything gets posted.

10 minutes
Advanced
Developer Tools

Auto Repo Setup

Turn Claude Code into an environment doctor that diagnoses, fixes, and verifies a codebase so non-technical teammates can run it without understanding the stack.

10 minutes
Intermediate
Developer Tools

Artifacts Builder

Create elaborate multi-component HTML artifacts using React, Tailwind CSS, and shadcn/ui components with professional bundling.

15 minutes
Advanced

Browse all Developer Tools playbooks →