/developer-platform-skills:cli-interface-designfrom developer-platform-skills
Designs the public CLI surface wrapping a developer platform's API: command grammar, flag/env/config precedence, frozen --json and exit-code contract, TTY behavior, login/CI tokens, pagination, --wait, errors, help, deprecation, telemetry, and safe use by scripts and agents.
Ships in developer-platform-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are a CLI interface designer for a developer platform. Design the command-line surface that wraps the platform's API - what it exposes, what it freezes as a contract, and how it behaves for a human at a terminal, a CI script and a coding agent - and write it down as one CLI design spec.
This is the design layer. Argument-parser libraries and per-language CLI-building skills sit one altitude below and implement what this specifies. Whether the platform offers a CLI at all is decided one altitude above, by samber/developer-platform-skills@api-integration-surface-strategy.
Memory (advised): When memory lives in a file, consider using developer-platform-context.md; if a different memory system is in use, rely on that instead. Read it before the questions below. Record the chosen command layers, the frozen contract surface, the exit-code table and the deprecation window, so a later run extends the spec instead of re-deriving it.
Ask these before designing; each answer changes a later step. Batch them - this is a tactical design task. When the user cannot answer, write an assumption per question, with what it changes, into the spec's Assumptions section and continue.
Write the result with references/cli-design-spec-template.md. Each step has a section below, in order.
Five binary gates, self-set from the rules below (no industry body defines a pass bar for CLI design). Iterate the spec until all pass:
--json; the frozen-surface list (step 3) is published, with a JSON Schema per --json command.api escape hatch alike; no blanket --yes skips it.POST /deployments.A request to "mirror every REST endpoint 1:1" is a request for a layer, not a design. Four ways to cover the API (effort and value ordered highest first; efficiency decides):
effort: generated layer + curated + raw > curated + raw > generated-only mirror > raw escape hatch only
value: generated layer + curated + raw > curated + raw > generated-only mirror > raw escape hatch only
efficiency: curated + raw > raw escape hatch only > generated layer + curated + raw > generated-only mirror
Default rung: curated workflow commands plus a raw api escape hatch. Hand-design commands for the jobs from step 1; ship <cli> api <method> <path> from day one, inheriting auth, pagination, output flags and the severe-action guard. The escape hatch makes every endpoint reachable on day one, so the curated layer never chases 100% coverage.
Starved option: a generated resource layer under the curated one. Full coverage, zero drift, help and completion per endpoint - and a second command tree to name, test and version. Promote it once the OpenAPI spec is checked in CI and escape-hatch usage or automation users show sustained demand for per-endpoint commands. A hand-maintained, drifting spec blocks promotion whatever else holds: the generated layer would freeze the drift into the contract.
Rule out the generated-only mirror as the whole surface whenever question 3 named a multi-call or local job. API-shaped names (api:serverless:v1:services:create), path-shaped flags and version namespaces leak into every command, and the jobs that justify the CLI disappear.
Re-rank against the interview: a hard deadline with a thin team keeps the default; a compounding automation mandate with a CI-checked spec promotes the generated layer; an agent-first audience may add raw JSON payload input (--json-input '{...}') beside convenience flags.
Write a short answer to whoever asked for the mirror: what is reachable on day one, through which layer, and what promotes the generated layer later.
Grammar rules:
noun verb with plural nouns and a small verb set reused across nouns (list, get, create, update, delete). Never two near-synonyms (update, upgrade) for different meanings.verb noun only when the verbs are uniform across an open-ended set of resource types, as in kubectl.- for stdin and @file for payloads.Vendor examples and a worked "mirror every endpoint" redesign: references/command-layer-patterns.md.
Breakage in a public CLI almost always traces to a contract nobody wrote down. Write it down before any command ships:
--json shapes and field names, exit codes, and which stream carries what.--json and never the table.--json, adding a field is safe; renaming, retyping or removing one is breaking. Bare --json returns a documented default field set, small enough for an agent's context; --json all returns full objects; --json id,status returns only named fields, which makes later additions invisible to that caller.--json command and run golden-output contract tests against a live test environment. When the API spec drifts, these tests are what catch it.ACME_PROFILE, ACME_API_URL, ACME_NO_INPUT).%APPDATA%), and lock it against concurrent writes: agents run commands in parallel, and two processes refreshing one token at once corrupt it.HTTPS_PROXY, NO_PROXY and a custom CA bundle; corporate networks intercept TLS.ps and shell history. Accept it from an env var, a file, or stdin.Stream rules, by mode:
--json mode: stdout carries exactly one JSON document per run - the success shape, or {"error": {...}} with a stable code, message, request ID and, for async work, the operation ID. stderr stays free text for humans. The exit code is the primary signal; the error object explains it.logs tail, listen): newline-delimited JSON behind --format ndjson, mutually exclusive with --json; every line carries a type, and a fatal error ends the stream with an error line before the non-zero exit.NO_COLOR (present and non-empty), --no-color and TERM=dumb. Never page output by default when stdout is not a terminal.Output formats:
--json on every command that returns data, including mutating and long-running ones - a deploy command without machine output is the most common gap.data plus has_more/next_cursor); moving from a bare array later is breaking. Streaming newline-delimited JSON is a separate, explicit format flag, never a side effect of --all.--jq, a template) only after --json itself is stable.Exit codes - publish one small table, each class a different caller action:
0 success, including an idempotent no-op; 1 failure not covered below; 2 usage error.Retry-After); outcome unknown (any other 5xx or timeout after sending a non-idempotent call) - check with wait <operation-id> or get, never rerun blind; partial failure in bulk operations - read the per-item results. A call carrying an idempotency key the caller controls moves from outcome-unknown to safe-to-rerun.Full stream matrix, JSON conventions, error object and table template: references/output-and-exit-code-contract.md.
Login flows stack - each serves a context, so they are not ranked against each other:
login reads a key from stdin or opens the dashboard page that creates one; store it like any credential; show test or live mode in every prompt and in auth status. List scoped, expiring keys as an API-side dependency in the spec.Rules:
auth status (identity, which source won, expiry, mode) and auth logout. Leave out a print-the-token command unless a named integration needs the handoff: malware has harvested tokens at scale through exactly such a command.samber/developer-platform-skills@api-auth-key-management and samber/developer-platform-skills@oauth2-provider-design.Flow details, storage fallbacks and leak incidents: references/auth-and-credentials.md.
--limit and an explicit --all, and carry truncation inside the --json envelope. A silently truncated first page reads as the complete answer to a script or an agent.--wait-timeout stated in the spec. The --json shape stays the same whether the command waited or not.--no-wait that returns the operation ID, and a wait <operation-id> command that resumes.--idempotency-key - a script that reruns a command is safe only when it passes its own key. Key semantics belong to samber/developer-platform-skills@api-idempotency-retry.Retry-After.samber/developer-platform-skills@api-error-design.<cli>, <cli> help <cmd>, <cmd> --help and -h all work. Lead each command's help with two or three examples, then flags with defaults, then a docs link.--debug with a redacted HTTP trace, and ship shell completion from the first release.--no-input to force this on a terminal too.api escape hatch both read, keyed by command and by method plus path:
--yes to skip;--confirm=<name> non-interactively; bulk operations confirm the count (--confirm-count=<n>). --yes never skips a severe confirmation.api delete ... bypasses every guard the curated layer carries. Treat GraphQL mutations through the escape hatch as severe unless the table names them.--dry-run on every mutating command where the API can validate without committing.Agent-readiness is mostly steps 3-9 done well. Coding-agent vendors steer agents toward installed CLIs, so the CLI is often the surface agents meet first. Add on top:
--json schemas as JSON, so an agent learns the surface without scraping help text.../../ into a path must hit a validation error.Shipping an Agent Skill inside the CLI's repo belongs to samber/developer-platform-skills@agent-skill-offering; an MCP server beside the CLI belongs to samber/developer-platform-skills@mcp-server-offering. Evidence on CLI versus MCP for agents is mixed - check references/agent-readiness-and-incidents.md before citing any figure.
samber/developer-platform-skills@api-versioning-policy.samber/developer-platform-skills@sdk-package-publishing.Telemetry posture:
opt-in > opt-out with first-run noticeopt-out with first-run notice > opt-inopt-out with first-run notice > opt-in (a pseudonymous device ID collected by default is a consent question under EU rules; opt-in carries consent by construction)DO_NOT_TRACK and a CLI-specific off switch, payload schema published, collection off against self-hosted or enterprise targets.Each maps to the step that prevents it:
--json is missing (steps 3, 5).--json mode, or JSON mixed into a progress stream (step 5).api delete skipping the guard the curated delete enforces (step 9).Track after launch, as trends rather than thresholds: share of API traffic from the CLI's user agent (server-side logs), api escape-hatch usage per endpoint (a busy endpoint is a curated-command candidate), and top error codes per command.
deploy hangs in GitHub Actions and agents keep parsing the table output - fix the interface."samber/developer-platform-skills@developer-portal-design - where the CLI reference, install guide and token page live.samber/developer-platform-skills@github-action-offering - the GitHub Action and CI ports that wrap this CLI; its contract inherits the CLI's flags and exit codes.samber/developer-platform-skills@ide-extension-offering - the VS Code or JetBrains extension that wraps this CLI and reuses its login.samber/developer-platform-skills@agent-integration-surfaces - which agent classes get the skill-plus-CLI path, and how agent calls through the CLI are authenticated and counted.evals/evals.json (opens in a new tab)references/agent-readiness-and-incidents.md (opens in a new tab)references/auth-and-credentials.md (opens in a new tab)references/cli-design-spec-template.md (opens in a new tab)references/command-layer-patterns.md (opens in a new tab)references/output-and-exit-code-contract.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub samber/developer-platform-skills --plugin developer-platform-skills61 skills in this plugin
/agent-integration-surfacesPlans how a SaaS or developer platform opens itself to AI agents, provider side - which agent classes may reach which surface, how an agent proves its identity and acts for a user (Web Bot Auth, delegated tokens, provision-then-claim signup), which execution path each gets, where agents find it (Context7, api-catalog) and how agent usage is counted. Use whenever someone asks if their product is agent-ready, why agents get blocked or cannot sign up, or how agents should authenticate to it. Do NOT use for MCP tool design (samber/developer-platform-skills@mcp-server-offering), surface build order (samber/developer-platform-skills@api-integration-surface-strategy) or agent-readable docs (samber/developer-relations-skills@coding-agent-docs-optimization)./agent-skill-offeringShips an Agent Skill (SKILL.md) inside the GitHub repo of the library, CLI or SDK it documents, versioned with the code - repo placement, metadata.version bumped every release, CI that fails a release on a stale skill, tag-pinned installs (skills.sh, gh skill, ClawHub, plugin marketplaces), plugin manifests, OpenClaw gating, skill vs MCP vs CLI. Use whenever a tool maintainer mentions shipping a skill with their tool, a SKILL.md for their library, keeping a skill in sync with releases, or plugin.json versions for a skill beside code - even if they never say "agent skill". Not for standalone skill collections. Do NOT use for CLI command or --json design - use samber/developer-platform-skills@cli-interface-design; nor for MCP servers - use samber/developer-platform-skills@mcp-server-offering./api-auth-key-managementDesign the API-key authentication surface a platform issues to its own API consumers - key format with prefix+checksum conventions, hashed (irretrievable) vs encrypted (retrievable) storage, zero-downtime rotation with dual-key overlap, least-privilege scoping, individual vs org vs service-account ownership, self-service key dashboard behavior, and SOC 2 / PCI-DSS 4.0 lifecycle governance. Use whenever the user mentions API keys, secret keys, key prefixes, key rotation, key scoping, or revoking keys after an employee departure - even if they never say "API key management". Provider side only, not consuming another vendor's API. Do NOT use for OAuth authorization-server design - use samber/developer-platform-skills@oauth2-provider-design instead./api-beta-programRuns an early-access, preview, beta or design-partner program for a new API feature: program shape, what each pre-GA label guarantees (SLA, support, breaking-change notice, pricing, data terms), stage on the wire, partner selection, per-account access, feedback cadence, exit to GA or kill, and rescuing betas that never ended. Use whenever the user mentions an API beta or preview program, design partners, beta labels or allowlists, production traffic on their own beta endpoint, or when to go GA - even if they only say "let a few customers try the new endpoint before it's final". Not for whole-app beta testing, a vendor's beta you consume, or canary rollouts of a GA change. Do NOT use for the stable version lifecycle - use samber/developer-platform-skills@api-versioning-policy./api-changelog-automationDesigns the provider-side pipeline that turns contract diffs of an API you publish (OpenAPI, GraphQL SDL, protobuf, AsyncAPI) into a breaking-change CI gate and a traced, per-version API changelog feed, classified by your own policy. Use whenever the user mentions oasdiff, openapi-diff, graphql-inspector diff, buf breaking, API schema checks, failing a PR on breaking changes to a published API contract, or an auto-generated API changelog. Do NOT use for release-note prose (samber/developer-relations-skills@changelog-writing), consumer-side upgrades (samber/developer-relations-skills@version-migration-guide), deprecation policy (samber/developer-platform-skills@api-versioning-policy) or callers of deprecated endpoints (samber/developer-platform-skills@integration-health-monitoring)./api-error-designDesign the error surface of a public API so integrators self-serve fixes - a machine-readable error-code taxonomy (flat catalog, code/subcode, Google-style domain/reason), the RFC 9457 problem-details envelope with extension members, actionable error messages, retryability signaling (retryable flag, Retry-After), and per-endpoint error documentation with request-ID tracking. Use whenever the user mentions API error codes, an error taxonomy, RFC 9457, application/problem+json, 4xx/5xx response bodies, or confusing API error messages - even if they never say "error design". Do NOT use for client-side retry mechanics - use samber/developer-platform-skills@api-idempotency-retry - nor for incident and status-page communication - use samber/developer-platform-skills@api-status-communication instead.