帮助设计或评估命令行工具与开发者 SDK 的架构、兼容性和使用体验
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "system-type-cli-tool" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/amplifier-bundle-systems-design/main/skills/system-type-cli-tool/SKILL.md 2. 保存为 ~/.claude/skills/system-type-cli-tool/SKILL.md 3. 装好后重载技能,告诉我可以用了
请为一个云部署 CLI 设计命令结构,包含子命令分层、全局参数、配置优先级、错误码规范,并给出示例命令。
一套清晰的 CLI 信息架构,含命令树、参数约定、配置加载顺序与示例用法。
请评估这个开发者 SDK 的版本升级方案,重点检查 API 兼容性、弃用策略、插件扩展点和迁移成本,并提出改进建议。
一份兼容性评估结果,指出风险点、破坏性变更及更稳妥的演进方案。
请为一个本地开发 CLI 制定 shell 自动补全、环境变量支持、输出格式规范,以及常见失败场景的处理策略。
一套可实施的集成与健壮性方案,提升命令行体验、可观测性和容错性。
Patterns, failure modes, and anti-patterns for command-line tools and developer-facing libraries.
What it is. Top-level command dispatches to subcommands, each with its own flags and arguments. tool <subcommand> [flags] [args]. The dominant pattern for non-trivial CLIs.
When to use. Tools with more than ~5 distinct operations. When operations have different flag sets. When you want discoverability — tool help lists all subcommands.
When to avoid. Single-purpose tools that do one thing (e.g., curl, jq). Adding subcommands to a tool that does one thing well makes it do many things poorly.
Nesting depth. Two levels (tool resource action) is the practical limit. Three levels (tool group resource action) works if the grouping is obvious (e.g., kubectl get pods). Four levels means your CLI needs a redesign.
POSIX short flags. Single dash, single letter: -v, -f. Combinable: -vvv for verbosity levels, -rf for multiple flags. Every short flag should have a long equivalent.
GNU long flags. Double dash, full words: --verbose, --output-format. Self-documenting. Use hyphens, not underscores.
Boolean flags. --color enables, --no-color disables. Pick a sensible default and provide the negation. Don't require --color=true.
Value flags. --output json or --output=json. Support both forms. Be consistent across all flags.
The -- separator. Everything after -- is a positional argument, not a flag. Mandatory for tools that accept arbitrary user input — without it, tool delete --force is ambiguous (is --force a flag or an argument?).
Positional args are for the primary noun — the thing being operated on. tool build ./src, tool deploy production. One or two positional args maximum. After that, you need flags.
Flags are for everything that modifies behavior. If the user could reasonably forget to provide it and get a useful default, it's a flag, not a positional arg.
Rule of thumb. If you're reading the help text to remember which positional arg is which, they should be flags.
Global flags apply to every subcommand: --verbose, --config, --output-format, --no-color. Define them once at the root. They should be few and genuinely universal.
Local flags belong to a specific subcommand. Don't pollute the global namespace with flags only one subcommand uses.
Interactive prompts are for first-run setup, destructive confirmations, and guided workflows (tool init). Always provide a flag equivalent (--yes, --name=foo) so scripts can bypass prompts.
TTY detection. If stdin is not a TTY, never prompt. Fail with an actionable error telling the user which flag to pass. A CI pipeline hanging on a prompt is a production incident.
stdout is for program output — the data the user asked for. It must be parseable. If someone pipes your output, only the data should flow through.
stderr is for human messages — progress indicators, warnings, debug info, error messages. Everything that isn't the requested data.
stdin is for data input. Accept - as a filename to mean stdin. Support piping: cat file | tool process and tool process < file.
The test. tool list | wc -l should return a correct count. If your progress spinner or status message contaminates stdout, you've broken the Unix contract.
Highest precedence wins. The standard order:
TOOLNAME_FLAGNAME (e.g., GIT_AUTHOR_NAME).…
帮助设计可离线运行的边缘系统,处理同步、冲突恢复与弱网故障场景。
帮助设计与评估企业系统集成方案,覆盖遗留改造、网关、事件与失效模式。
用于按七步法系统审查架构设计,识别风险、权衡并产出改进建议。
用 Unix/Linux 设计哲学评估系统方案的可组合性、简洁性与关注点分离。
帮助用户设计或评估基于 Azure 的系统架构与运维方案
帮助设计和评估多租户SaaS的平台隔离、计量计费与稳定性方案
帮助你设计或评估Web服务架构、API模式、扩展性与可靠性问题。
帮助设计或评估单页应用架构,涵盖路由、状态、性能与离线能力。
帮助开发者设计易安装、易扩展且配置分层清晰的 CLI 工具模式。
帮助设计和评估事件驱动、消息驱动与异步工作流系统架构。
帮助设计与评估机器学习训练、部署及实验平台架构方案
帮助设计与评估实时协作系统的连接、同步、冲突处理与故障模式