用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/diegosouzapw/awesome-omni-skill --skill cli-ux命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | cli-ux |
| description | Agent-first CLI design: JSON envelope output, Rich human UX, progress indicators, and dual-mode routing. |
| version | 1.0.0 |
| category | dev |
| tags | ["cli","ux","json","rich","terminal","agent-first"] |
| metadata | {"ai-engineering":{"scope":"read-write","token_estimate":900}} |
Agent-first CLI design skill for commands that serve both machine consumers (JSON envelopes via --json) and human operators (Rich terminal output). Covers the dual-output routing pattern, structured JSON envelopes with HATEOAS next actions, Rich progress indicators, data model conventions, and terminal visual language used across the ai-eng CLI.
--json support, improving terminal UX, adding progress indicators.dev:api-design for REST/GraphQL contract-first design.dev:cicd-generate for pipeline setup.dev:code-review for implementation review.dev:test-strategy for test design.Understand output context — determine if the command needs JSON mode, human mode, or both.
src/ai_engineering/cli_output.py for the routing pattern.Design data model — every result gets both to_dict() and to_markdown().
to_dict(): returns a JSON-serializable dict for the envelope.to_markdown(): returns a human-readable markdown string.Path → .as_posix(), dates → .isoformat(), enums → .value.@dataclass — never raw dicts as primary data structures.Implement dual-output routing — branch on is_json_mode().
emit_success(command_name, data_dict, [NextAction(...)]) → stdout.emit_error(command_name, message, error_code, fix, [NextAction(...)]) → stdout.result_header(), kv(), status_line(), suggest_next() → stderr.output() router from cli_output.py for clean branching.Design JSON envelope — follow the SuccessEnvelope/ErrorEnvelope contract.
{ ok: true, command: str, result: dict, next_actions: [...] }.{ ok: false, command: str, error: { message, code }, fix: str, next_actions: [...] }.NextAction: { command: str, description: str, params?: dict } — suggest follow-up commands.truncate_list(items, max_items=20) for large collections to protect agent context windows.Add progress indicators — wrap long operations in spinner() or .
to_dict() and to_markdown() methods.SuccessEnvelope/ErrorEnvelope.SuccessEnvelope/ErrorEnvelope) is a contract — do not modify fields without versioning.cli_ui.py) are shared — additions are welcome, removals require deprecation.--json output validation in tests.json.loads().--json to confirm both paths work.standards/framework/stacks/python.md — Python stack patterns.Read these on-demand when implementing or reviewing CLI commands:
src/ai_engineering/cli_envelope.py — JSON envelope (SuccessEnvelope, ErrorEnvelope, NextAction).src/ai_engineering/cli_ui.py — Rich human output primitives (kv, status_line, result_header, suggest_next).src/ai_engineering/cli_output.py — dual-mode router (is_json_mode, output).src/ai_engineering/cli_progress.py — spinner and step_progress context managers.src/ai_engineering/cli_commands/core.py — reference implementation (install, doctor commands).step_progress()spinner(description): single-step context manager for indeterminate waits.step_progress(total, description): multi-step tracker with tracker.step(msg).is_json_mode()) and non-TTY (CI, piped output).Apply visual language — consistent Rich markup and color semantics.
[success] (green). Error: [error] (red). Warning: [warning] (yellow). Info: [info] (blue).[brand] (teal #00D4AA). Muted: [muted] (dim). Paths: [path] (teal underline).kv(key, value). File counts: file_count(label, count).header(title). Result summary: result_header(label, status, detail).suggest_next([(command, description), ...]).NO_COLOR, TERM=dumb, and non-TTY detection (handled by get_console()).Validate output contract — verify both output modes work correctly.
json.loads().SuccessEnvelope/ErrorEnvelope schema.--json flag produces stdout-only JSON; human mode produces stderr-only Rich output.