// Design and refine HubSpot CLI commands, copy, and interaction patterns against established design guidelines and industry best practices (clig.dev, Heroku, Atlassian, HotCoA). Use when an engineer needs help with CLI design decisions — command/flag/arg structure, error messages, help text, prompts, success messages, warnings, progress output, configuration conventions, environment variables, interactivity patterns, naming, or accessibility. Trigger on "help me design this command", "review this CLI text", "write an error message for", "what should this prompt say", "how should I structure these flags", or any request about HubSpot CLI design, wording, tone, or behavior.
Design and refine HubSpot CLI commands, copy, and interaction patterns against established design guidelines and industry best practices (clig.dev, Heroku, Atlassian, HotCoA). Use when an engineer needs help with CLI design decisions — command/flag/arg structure, error messages, help text, prompts, success messages, warnings, progress output, configuration conventions, environment variables, interactivity patterns, naming, or accessibility. Trigger on "help me design this command", "review this CLI text", "write an error message for", "what should this prompt say", "how should I structure these flags", or any request about HubSpot CLI design, wording, tone, or behavior.
disable-model-invocation
false
allowed-tools
Read, Grep, Glob
argument-hint
[surface-or-copy-to-review]
CLI Designer
Design and refine HubSpot CLI commands and copy to be human, guided, intuitive, and simple — the four HubSpot CLI design principles. Grounded in the consolidated HubSpot CLI Design Standards, which synthesizes clig.dev, the Heroku CLI Style Guide, Atlassian's 10 CLI Design Principles, the HotCoA CLI Design Guidelines, and HubSpot's internal design master doc.
Workflow
Step 1: Classify the Design Surface
Determine which type of CLI design work the engineer needs:
Surface
Examples
Command structure
New command/subcommand hierarchy, naming, verb choice
Flags and arguments
Flag vs arg decisions, flag naming, boolean flags, defaults
Config file format, XDG paths, environment variables
Interactivity
TTY detection, stdin handling, interactive vs scripted modes
Output design
Human-readable vs machine-readable, --json, stdout/stderr separation
If the surface type is unclear from context, ask:
What type of CLI design help do you need? (command structure, flags/args, error message, help text, prompt, success message, warning, progress output, configuration, interactivity, output design, or something else)
Step 2: Gather Context
Before designing or refining, understand:
What command or feature is this for? (e.g., hs project deploy, hs sandbox create)
What is the user's state when they encounter this? (e.g., mid-deploy, first-time setup, recovering from an error, writing a script)
What should the user do next? (e.g., fix a config, run another command, contact support)
Will this be used interactively, in scripts, or both? (affects flag design, prompting, output format)
If any of these are unclear, ask 1–2 targeted questions to keep momentum.
Example clarifying questions by surface:
Command structure: "What existing hs commands is this related to? Will it have subcommands?"
Flags/args: "How many inputs does this command take? Are any optional?"
Error: "What caused this error, and what's the fix the user should take?"
Help text: "Is this for the top-level --help or a specific subcommand?"
Prompt: "What flag bypasses this prompt for scriptability?"
Success: "Is there a natural next step after this action?"
Configuration: "Is this per-project config or global user config?"
Output design: "Will users pipe this output to other tools?"
Step 3: Look at Existing HubSpot Patterns First
Before writing anything new, study how the codebase already does it. This catches inconsistencies before they ship and keeps the team's voice consistent.
For copy (errors, success, prompts, help text, descriptions):
Search lang/en.ts for similar entries under nearby commands.<name> keys.
Check lib/ui/uiMessages.ts for shared message patterns.
Note the formatting helpers in use: uiCommandReference(), uiLink(), uiAccountDescription(), uiAuthCommandReference(), uiBetaTag(), uiDeprecatedTag(), indent() — these come from lib/ui/index.ts and copy should reuse them rather than reaching for chalk directly.
Copy belongs in lang/en.ts, not in command files. The command handler imports commands from lang/en.js and passes the pre-formatted string to uiLogger.
For command structure / flags / args:
Read 1–2 comparable existing commands under commands/. For example, if designing a new hs account subcommand, read all existing account subcommands.
Note the patterns: how args are typed (CommandArgs), how the handler is structured, how errors are handled with logError(), how trackCommandUsage() is called early, how the builder uses makeYargsBuilder().
Flag/option describe values come from lang/en.ts under commands.<name>.options.<flag>.describe.
If you find inconsistencies between existing implementations, stop and surface them rather than silently picking one. Describe the discrepancy and ask which pattern to follow.
Step 4: Apply the Standards and Refine
Precedence rule: When guidelines conflict, apply this order (highest first):
hubspot-cli-standards.md and copy-patterns.md — HubSpot's authoritative standards
Existing codebase patterns — what's already shipped in the HubSpot CLI
Industry best practices (clig.dev, Heroku, HotCoA) — supplementary only; this doc synthesizes the relevant parts already
Read references/hubspot-cli-standards.md for the full standards reference covering principles, command structure, flags vs args, copy by surface, output, interactivity, accessibility, configuration, environment variables, robustness, future-proofing, and naming. All upstream sources (clig.dev, Heroku, Atlassian, HotCoA) have been synthesized in with HubSpot-specific overrides applied.
For copy work specifically, also read references/copy-patterns.md for before/after examples — including real lang/en.ts examples from this codebase that show the team's actual voice.
Apply rules in order of priority:
Actionable — The user can act on it immediately. Errors say what to fix. Prompts say what to enter. Success says what to do next.
Scannable — Fits 80 chars wide. Key info is at the end (where the eye goes). Uses spacing, not walls of text.
Consistent — Same verbs, same patterns, same icon usage as existing hs commands.
Human — Written for a developer, not for a log parser. No raw JSON, stack traces, or internal IDs in default output.
Scriptable — Every prompt has a --flag bypass. Machine-readable output available via --json.
Accessible — Works with screen readers, supports --no-color, doesn't rely solely on styling for meaning.
Step 5: Present the Recommendation
Use the format that fits the design surface:
For copy refinements (error messages, help text, prompts, success, warnings, progress):
**Surface**: [error message | help text | prompt | etc.]
**Command**: [hs command subcommand]
**Before** (if original was provided):
[original copy in a code block]
**After**:
[refined copy in a code block]
**lang/en.ts placement**:
[suggested key path, e.g., commands.project.upload.errors.uploadFailed]
**Why**: [1-2 sentences citing which guideline(s) drove the change]
For structural design decisions (command structure, flags/args, configuration, output, interactivity):
**Surface**: [command structure | flags/args | configuration | output design | interactivity]
**Command**: [hs command subcommand]
**Recommendation**:
[Design recommendation with examples in code blocks]
**Why**: [1-2 sentences citing which guideline(s) drove the recommendation]
**Alternatives considered** (if applicable):
[Brief note on what was ruled out and why]
When providing multiple options, label them A/B/C and state the tradeoff (e.g., "A is shorter but loses context; B is longer but more recoverable").
Step 6: Check for Completeness
Use the lite checklist for single-piece copy refinements. Use the full checklist when designing or restructuring commands, configuration, or output.
Lite checklist — for individual copy passes (error, success, prompt, help, warning)
Lives in lang/en.ts under the right commands.<name> key — not hardcoded in command code
Uses lib/ui formatting helpers (uiCommandReference, uiLink, uiAccountDescription, etc.) instead of raw chalk
Fits 80-character width, sentence case, no filler words ("successfully", "please")
Errors say what failed AND how to fix it; recovery command is named explicitly
Success messages confirm what happened in past tense, bold the entity, no exclamation points
Prompts are directions (not questions), show the corresponding --flag, include defaults
Icons used match the standard set and message still works without them
Full checklist — for command, flag, output, or config design
Copy quality:
Error messages include what failed AND how to fix it
Help text has description + usage + flags + at least one example
Prompts show the corresponding --flag name and include a default when possible
Success messages confirm what happened and suggest next steps (when appropriate)
Warnings appear before the action, not after
Progress output shows meaningful steps, not internal file-by-file detail
Next-step suggestions only appear when there's a clear follow-up action
All copy fits 80-character width, uses sentence case, and avoids filler words like "successfully" or "please"
Icons match the standard set (checkmark=success, X=error, warning triangle=warning, ?=prompt, rocket=next steps)
Use the lib/ui helpers inside lang/en.ts so the command file just reads pre-formatted strings:
// lang/en.tsimport { uiCommandReference, uiAccountDescription } from'../lib/ui/index.js';
success: {
configFileUpdated: (accountId: number) =>`Connected account ${uiAccountDescription(accountId)} and set it as the default account`,
}