优化命令行输出、日志与报错文案,提升终端交互可读性与诊断体验
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "cli-logging-ux" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/apm/main/.apm/skills/cli-logging-ux/SKILL.md 2. 保存为 ~/.claude/skills/cli-logging-ux/SKILL.md 3. 装好后重载技能,告诉我可以用了
请优化这个 CLI 报错信息,让用户更容易理解原因、影响和下一步操作。保留技术准确性,并给出更清晰的终端输出格式:'Upload failed: invalid config.'
一版更清晰、可执行的错误提示,包含原因说明、修复建议和更友好的终端呈现方式
我在修改命令行工具的日志输出。请为 success、warning、error、info 四类消息制定统一风格规范,包括语气、长度、图标/符号使用、颜色建议和示例文案。
一套适用于命令行日志的文案与视觉规范,便于在不同消息类型中保持一致体验
请帮我设计 CLI 的进度提示和诊断摘要输出,要求让用户快速知道当前阶段、已完成内容、失败项以及下一步建议,并给出示例输出。
结构清晰的进度提示与诊断摘要方案,附带可直接参考的终端输出示例
CLI Logging UX expert persona
Apply these three tests to every piece of user-facing output. If a message fails any test, redesign it.
Every warning must answer: what should the user do about this?
# Fails — not actionable, user can't do anything
Sub-skill 'my-skill' from 'my-package' overwrites existing skill
# Passes — tells the user exactly what to do
Skipping my-skill — local file exists (not managed by APM). Use 'apm install --force' to overwrite.
If the user can't act on it, it's not a warning — it's noise. Demote to --verbose or remove.
Use color semantics consistently. Never use a warning color for an informational state.
| Color | Helper | Meaning | When to use |
|---|---|---|---|
| Green | _rich_success() | Success / completed | Operation finished as expected |
| Yellow | _rich_warning() | User action needed | Something requires user decision |
| Red | _rich_error() | Error / failure | Operation failed, cannot continue |
| Blue | _rich_info() | Informational | Status updates, progress, summaries |
| Dim | _rich_echo(color="dim") | Secondary detail | Verbose-mode details, grouping headers |
Can the user scan output like headlines? Top-level = what happened. Details = drill down.
# Bad — warnings break the visual flow between status and summary
[checkmark] package-name
[warning] something happened
[warning] something else happened
[tree] 3 skill(s) integrated
# Good — clean tree, diagnostics at the end
[checkmark] package-name
[tree] 3 skill(s) integrated
── Diagnostics ──
[warning] 2 skills replaced by a different package (last installed wins)
Run with --verbose to see details
_rich_success)_rich_info with indented └─ prefix)_rich_error)# Bad — inline warning repeated per file, clutters output
for file in files:
if collision:
_rich_warning(f"Skipping {file}...")
# Good — collect during loop, render grouped summary at the end
for file in files:
if collision:
diagnostics.skip(file, package=pkg_name)
# Later, after the loop:
if diagnostics.has_diagnostics:
diagnostics.render_summary()
DiagnosticCollector categories: skip() for collisions, overwrite() for cross-package replacements, warn() for general warnings, error() for failures.
Always use the helpers from apm_cli.utils.console — never raw print() or bare click.echo().
Emojis are banned. Never use emoji characters anywhere in CLI output — not in messages, symbols, help text, or status indicators. Use ASCII text symbols exclusively via STATUS_SYMBOLS.
from apm_cli.utils.console import (
_rich_success, _rich_error, _rich_warning, _rich_info, _rich_echo
)
_rich_success("Installed 3 APM dependencies") # green, bold
_rich_info(" └─ 2 prompts integrated → .github/prompts/") # blue
_rich_warning("Config drift detected — re-run apm install") # yellow
_rich_error("Failed to download package") # red
_rich_echo(" [pkg-name]", color="dim") # dim, for verbose details
Use STATUS_SYMBOLS dict with symbol= parameter for consistent ASCII prefixes:
_rich_info("Starting operation...", symbol="gear") # renders as "[*] Starting operation..."
Follow this visual hierarchy for multi-package operations:
…
为 microsoft/apm 的拉取请求自动撰写结构完整、证据充分的 PR 描述。
帮助团队处理 apm 项目的定位调整、发布沟通与破坏性变更决策。
将文档影响判定细化为逐页逐段的同步执行任务清单
帮助团队制定 APM 项目定位、发布沟通与破坏性变更决策策略。
帮助开发者规划 Python 模块结构、重构类层次并设计跨文件架构变更方案。
对整套技术文档逐页对照源码审计,并给出精准过时内容修复建议
优化 APM CLI 的命令体验、帮助文案与首次使用流程设计
帮助你基于接口文档或脚本快速生成可组合的命令行工具
通过分析 JSONL 调试日志,快速定位聊天代理异常、耗时与调用原因
帮助 LLM 通过 MCP 安全执行命令并管理会话进程
压缩测试、构建与云日志噪声,提炼关键信号并显著减少 AI 读日志成本。
压缩安装、构建与测试日志,减少 AI 读取终端输出的上下文消耗。