[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69B5G96NSWAE0YMPZXA48M1":3,"skill-same:01M69B5G96NSWAE0YMPZXA48M1":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":17,"ownerHtmlUrl":46,"ownerBlogUrl":47,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M69B5G96NSWAE0YMPZXA48M1","system-type-cli-tool","CLI工具与SDK设计模式","Domain patterns for CLI tools and developer SDKs — command structure, configuration layering, plugin architecture, distribution, backward compatibility, shell integration, and failure modes. Use when designing or evaluating command-line tools, developer platforms, or SDK libraries.","CLI 工具和开发者 SDK 的领域模式——命令结构、配置分层、插件架构、分发、向后兼容、shell 集成和失败模式。在设计或评估命令行工具、开发者平台或 SDK 库时使用。","microsoft\u002Famplifier-bundle-systems-design","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69B51GBR7WTZ199PCPYGB6S",5,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-systems-design\u002Fblob\u002Fmain\u002Fskills\u002Fsystem-type-cli-tool\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TKQDF2K4KQS863Q79P4","开发参考","SCENARIO","使用场景",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",[31,32,33,34,35],"cli","system type cli tool","sdk","architecture","plugin","2026-11-10 10:12:30",false,"---\nname: system-type-cli-tool\ndescription: \"Domain patterns for CLI tools and developer SDKs — command structure, configuration layering, plugin architecture, distribution, backward compatibility, shell integration, and failure modes. Use when designing or evaluating command-line tools, developer platforms, or SDK libraries.\"\n---\n\n# System Type: CLI Tool & Developer SDK\n\nPatterns, failure modes, and anti-patterns for command-line tools and developer-facing libraries.\n\n---\n\n## Command Structure Patterns\n\n### Subcommand Trees (git-style)\n**What it is.** Top-level command dispatches to subcommands, each with its own flags and arguments. `tool \u003Csubcommand> [flags] [args]`. The dominant pattern for non-trivial CLIs.\n**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.\n**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.\n**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.\n\n### Flag Conventions\n**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.\n**GNU long flags.** Double dash, full words: `--verbose`, `--output-format`. Self-documenting. Use hyphens, not underscores.\n**Boolean flags.** `--color` enables, `--no-color` disables. Pick a sensible default and provide the negation. Don't require `--color=true`.\n**Value flags.** `--output json` or `--output=json`. Support both forms. Be consistent across all flags.\n**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?).\n\n### Positional Arguments vs. Flags\n**Positional args** are for the primary noun — the thing being operated on. `tool build .\u002Fsrc`, `tool deploy production`. One or two positional args maximum. After that, you need flags.\n**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.\n**Rule of thumb.** If you're reading the help text to remember which positional arg is which, they should be flags.\n\n### Global vs. Local Flags\n**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.\n**Local flags** belong to a specific subcommand. Don't pollute the global namespace with flags only one subcommand uses.\n\n### Interactive Prompts vs. Flags\n**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.\n**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.\n\n### stdin\u002Fstdout\u002Fstderr Discipline\n**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.\n**stderr** is for human messages — progress indicators, warnings, debug info, error messages. Everything that isn't the requested data.\n**stdin** is for data input. Accept `-` as a filename to mean stdin. Support piping: `cat file | tool process` and `tool process \u003C file`.\n**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.\n\n## Configuration Layering\n\n### The Hierarchy\nHighest precedence wins. The standard order:\n\n1. **Command-line flags.** Always win. The user is explicitly telling you what to do right now.\n2. **Environment variables.** Useful for CI, containers, and temporary overrides. Convention: `TOOLNAME_FLAGNAME` (e.g., `GIT_AUTHOR_NAME`).\n3. **Project config.** `.toolrc`, `tool.toml`, or a section in `pyproject.toml` \u002F `package.json`. Checked in to version control. Shared by the team.\n4. **User config.** `~\u002F.config\u002Ftool\u002Fconfig.toml` (XDG) or `~\u002F.toolrc`. Personal preferences that apply across all projects.\n5. **System config.** `\u002Fetc\u002Ftool\u002Fconfig.toml`. Org-wide defaults set by admins. Rare in practice.\n6. **Compiled defaults.** The values your code uses when nothing else is specified.\n\nEvery layer is optional. Missing layers are silently skipped. The tool works with zero configuration.\n\n### XDG Base Directory Spec\n**Config:** `$XDG_CONFIG_HOME\u002Ftool\u002F` (default `~\u002F.config\u002Ftool\u002F`). User settings.\n**Data:** `$XDG_DATA_HOME\u002Ftool\u002F` (default `~\u002F.local\u002Fshare\u002Ftool\u002F`). Persistent data the user didn't explicitly create (caches of fetched schemas, downloaded plugins).\n**State:** `$XDG_STATE_HOME\u002Ftool\u002F` (default `~\u002F.local\u002Fstate\u002Ftool\u002F`). Logs, history, undo state — data that can be deleted without data loss.\n**Cache:** `$XDG_CACHE_HOME\u002Ftool\u002F` (default `~\u002F.cache\u002Ftool\u002F`). Regeneratable data. Safe to delete at any time.\n**Why it matters.** Dotfile pollution in `$HOME` is a real problem. Respecting XDG makes your tool a good citizen on Linux. On macOS, `~\u002FLibrary\u002FApplication Support\u002F` is the equivalent convention. On Windows, `%APPDATA%`.\n\n### Config File Formats\n**TOML.** Best for CLIs. Human-readable, supports comments, unambiguous types, no indentation wars. Used by Cargo, pip, and most modern Rust\u002FPython CLIs.\n**YAML.** Dangerous at scale (Norway problem, implicit type coercion, indentation sensitivity). Acceptable when your ecosystem already uses it (Kubernetes, GitHub Actions). Always use a strict parser.\n**JSON.** No comments. Painful to hand-edit. Fine for machine-generated config. Never use for user-facing config files unless you also accept JSON5 or JSONC.\n**INI.** Simple but limited — no nested structures, no standard for lists. Acceptable for very simple tools. `git config` makes it work, but git is the exception, not the rule.\n\n### Config Discovery and Merging\n**Walk-up discovery.** Search for `.toolrc` starting from the current directory, walking up to filesystem root or `$HOME`. The nearest config wins (or configs are merged, with nearer taking precedence).\n**Explicit path.** `--config path\u002Fto\u002Fconfig.toml` overrides all discovery. Always support this.\n**Debug command.** `tool config show` or `tool config list` should print the resolved configuration with the source of each value (which file, which env var, or default). Without this, config debugging is guesswork.\n\n## Plugin and Extension Architecture\n\n### Plugin Discovery\n**PATH-based.** Plugins are executables named `tool-pluginname` on `$PATH`. `tool foo` finds and runs `tool-foo`. Git uses this pattern. Simple, works with any language. Downsides: namespace collisions, no version management, no metadata.\n**Directory-based.** Plugins live in a known directory (`~\u002F.tool\u002Fplugins\u002F`, or a path set via config). Tool scans the directory at startup. Allows metadata files alongside plugins. Used by kubectl (krew), fish shell.\n**Registry-based.** Plugins are declared in a config file or remote registry. Installed explicitly (`tool plugin install foo`). Provides version management, dependency resolution, and discoverability. More complex to implement. Used by Terraform providers, VS Code extensions.\n\n### Plugin API Stability Contracts\n**The plugin API is a public API.** Breaking it breaks the ecosystem. Version it from day one.\n**Minimal surface area.** Expose the smallest possible interface. Every function you expose is a function you maintain forever. Prefer data exchange (JSON on stdin\u002Fstdout, structured file formats) over shared libraries.\n**Capability negotiation.** Plugins declare which API version they support. The host checks compatibility before loading. Fail loudly on mismatch: \"Plugin X requires API v3, but tool is at v2. Upgrade tool or downgrade plugin.\"\n\n### Hook Points vs. Full Extensions\n**Hook points** are specific lifecycle moments where plugins can inject behavior: pre-commit, post-deploy, on-error. Narrow scope, easy to reason about, low risk of plugins interfering with each other.\n**Full extensions** add new subcommands, new output formats, or new resource types. More powerful, but harder to maintain compatibility. Plugins can step on each other — two plugins adding the same subcommand is a conflict you need to handle.\n**Start with hooks.** Add full extensions only when hooks are demonstrably insufficient.\n\n## Distribution and Installation\n\n### Package Managers\n**Language-native.** `pip install tool`, `npm install -g tool`, `cargo install tool`. Lowest friction for developers already in that ecosystem. Downside: requires the language runtime.\n**System-native.** `brew install tool`, `apt install tool`, `choco install tool`. Best for tools that transcend a single language ecosystem. Requires maintaining package definitions for each manager.\n**The reality.** Support at least one language-native and one system-native method. Provide a `curl | sh` installer as a fallback. Accept that users will find your installation instructions confusing no matter what you do.\n\n### Single-Binary Distribution\n**Why.** No runtime dependencies, no version conflicts, trivial installation. Download, chmod +x, run. The gold standard for CLI distribution.\n**How.** Go and Rust compile to static binaries by default. Python tools can use PyInstaller or Nuitka (with caveats). Node tools can use pkg or bun compile (with caveats).\n**Cross-compilation.** Build for linux\u002Famd64, linux\u002Farm64, darwin\u002Famd64, darwin\u002Farm64, windows\u002Famd64 at minimum. CI matrix builds or cross-compilation toolchains (cross for Rust, GOOS\u002FGOARCH for Go).\n\n### Auto-Update Mechanisms\n**Opt-in, not opt-out.** Never update without the user's knowledge. A tool that silently changes behavior between invocations is a tool that can't be trusted in CI.\n**Check frequency.** Check for updates at most once per day. Cache the result. Never block startup on an update check — do it in the background or after the command completes.\n**Version pinning for CI.** Provide a way to install a specific version: `tool@1.2.3`, `pip install tool==1.2.3`. CI pipelines must be reproducible. `latest` is not a version.\n\n### Cross-Platform Considerations\n**Path separators.** Use your language's path library. Never hardcode `\u002F` or `\\\\`.\n**Line endings.** Emit `\\n` on all platforms unless you have a specific reason not to. Windows terminals handle `\\n` fine; Unix tools choke on `\\r\\n`.\n**Home directory.** Don't hardcode `~`. Use the platform's API to find the home directory.\n**File permissions.** Windows doesn't have Unix permissions. Handle this gracefully (skip `chmod` on Windows rather than failing).\n\n## Backward Compatibility\n\n### Your Output Is an API\nThe most important principle for CLI tools: **people write scripts against your output.** Changing output format is the CLI equivalent of changing a REST API response — it breaks consumers silently.\n\n**Machine-readable output.** Always provide `--output json` (or `--json`). JSON output is your stable API contract. Human-readable output can change between minor versions; JSON output follows semver strictly.\n**Structured output contract.** Document the JSON schema. Adding fields is backward-compatible. Removing or renaming fields is a breaking change. Changing the type of a field is a breaking change.\n**Table output.** Human-readable tables are for humans. Never promise column positions or exact formatting. If users are parsing your table output with `awk`, give them `--output json` and stop worrying about it.\n\n### Semantic Versioning for CLIs\n**Major version (2.0.0).** Breaking changes to: JSON output schema, exit codes, flag names, subcommand names, or config file format.\n**Minor version (1.1.0).** New subcommands, new flags, new output fields, new config options. Existing behavior unchanged.\n**Patch version (1.1.1).** Bug fixes only.\n**The hard part.** Fixing a bug in exit codes is technically a breaking change if anyone depended on the buggy behavior. Use judgment. If the bug was clearly a bug, fix it in a patch. If it was ambiguous, fix it in a minor with a deprecation notice.\n\n### Flag Deprecation Strategy\n**Phase 1 (minor version).** Old flag still works. Prints a warning to stderr: \"Warning: --old-flag is deprecated, use --new-flag instead. Will be removed in v3.0.\"\n**Phase 2 (next major version).** Old flag is removed. Clear error message: \"Error: --old-flag was removed in v3.0. Use --new-flag instead.\"\n**Never silently change flag semantics.** If `--force` meant \"skip confirmation\" in v1 and you want it to mean \"overwrite existing\" in v2, that's a new flag with a new name, not a semantic change to an existing flag.\n\n### UI Changes vs. API Changes\n**UI (human-facing).** Colors, progress bars, table formatting, help text, error message wording. Can change freely between minor versions.\n**API (machine-facing).** Exit codes, JSON output, flag names, environment variable names, config file keys, file paths written to disk. Semver-protected.\n**The gray area.** stderr messages that users parse with grep. This is unsupported but common. Provide a structured alternative (`--output json` for errors too) and document that stderr format is not stable.\n\n## Shell Integration\n\n### Completions\n**Generate, don't hand-write.** Use your framework's completion generation (cobra, clap, click, argparse). Hand-maintained completions drift from the actual flags.\n**Install command.** `tool completion bash > \u002Fetc\u002Fbash_completion.d\u002Ftool` or `tool completion --install`. Make it a one-liner. Document it in `--help`.\n**Support bash, zsh, and fish at minimum.** PowerShell if you have Windows users. Each shell has different completion mechanisms — use a library that handles this.\n\n### Exit Codes as API\n**0:** Success.\n**1:** General error.\n**2:** Usage error (bad flags, wrong arguments). The user called the tool wrong.\n**Distinguish machine-actionable failures.** If callers need to branch on different error types, assign distinct exit codes and document them. `diff` returns 1 for \"files differ\" and 2 for \"trouble\" — callers rely on this distinction.\n**Don't go wild.** More than ~10 distinct exit codes is a sign you should use structured error output (`--output json`) instead of encoding error taxonomy in a single integer.\n**Never use exit codes above 125.** Shells reserve 126 (command not executable), 127 (command not found), and 128+N (killed by signal N). Your exit codes will collide with these.\n\n### Signal Handling\n**SIGINT (Ctrl+C).** Clean up and exit promptly. Don't trap SIGINT to print \"are you sure?\" — that breaks pipeline behavior. If you need confirmation, use a flag (`--interactive`), not a signal trap.\n**SIGTERM.** Graceful shutdown. Finish in-progress writes, clean up temp files, exit. Same as SIGINT for most CLIs.\n**SIGPIPE.** Die silently. If the reader of your pipe closes early (`tool list | head -5`), don't print an error. Most languages handle this correctly by default; Python notably does not — add `signal.signal(signal.SIGPIPE, signal.SIG_DFL)`.\n**Temp file cleanup.** Use OS-level temp directories and clean up on exit. Register cleanup handlers for signal cases. A tool that leaves temp files on Ctrl+C is a tool that slowly fills disks.\n\n### TTY Detection and Formatting\n**Detect the TTY.** `isatty(stdout)` determines whether you're writing to a terminal or a pipe. When piped, disable colors, progress bars, spinners, and interactive formatting.\n**Color.** Respect `NO_COLOR` (https:\u002F\u002Fno-color.org\u002F) and `FORCE_COLOR` environment variables. Support `--color=auto|always|never`. Default to `auto` (color when TTY, no color when piped).\n**Width.** Use terminal width for wrapping and table layout. Fall back to 80 columns when not a TTY. Don't hard-wrap at 80 when the terminal is 200 columns wide.\n\n## Error Handling and UX\n\n### Progressive Disclosure\n**Default output.** Short, actionable error message. One or two lines. Enough to fix the problem in the common case.\n**`--verbose`.** Include context: what the tool was trying to do, what it expected, what it got. Include paths, URLs, and relevant config values.\n**`--debug`.** Full diagnostic dump: HTTP request\u002Fresponse bodies, config resolution trace, plugin loading order, system info. Intended for bug reports, not normal use.\n**Environment variable override.** `TOOL_LOG=debug` or `TOOL_DEBUG=1` as an alternative to `--debug`. Useful when the error occurs before flag parsing.\n\n### Actionable Error Messages\n**Bad:** `Error: invalid configuration`\n**Good:** `Error: config file ~\u002F.config\u002Ftool\u002Fconfig.toml has invalid syntax at line 12: expected string, got integer for field 'timeout'. Run 'tool config validate' to check your configuration.`\n\n**Every error message should answer:** What happened? Why? What should the user do next?\n\n### Typo Suggestions\nWhen the user types `tool biuld`, suggest `tool build`. Levenshtein distance of 1-2 on subcommands and flags. This is table stakes for modern CLIs. Libraries like `clap` and `cobra` provide this out of the box.\n\n### Dry-Run Mode\n`--dry-run` shows what the tool would do without doing it. Essential for destructive operations (delete, deploy, migrate). The output should be specific enough that the user can predict exactly what will happen. \"Would delete 3 files\" is useless. \"Would delete: .\u002Fa.txt, .\u002Fb.txt, .\u002Fc.txt\" is useful.\n\n### Progress Indicators\n**Bounded work:** Progress bars with percentage and ETA. Update no more than ~10 times per second.\n**Unbounded work:** Spinners or activity indicators. Show what's currently happening (\"Downloading index...\", \"Resolving dependencies...\").\n**Output to stderr.** Always. Progress indicators on stdout corrupt pipeable output.\n**Non-TTY.** When not a TTY, print milestone lines instead of progress bars: \"Downloaded 50\u002F100 packages\". Or print nothing — silence is better than a flood of progress lines in a log file.\n\n## Common Failure Modes\n\n- **Breaking output format that scripts depend on.** Changing human-readable output that turns out to be parsed by `awk`\u002F`grep` in CI pipelines. Mitigation: always provide `--output json`, treat JSON schema as semver-protected, document that human output is unstable.\n- **Config file conflicts between versions.** v2 writes a config file that v1 can't read, or vice versa. Users with multiple projects on different versions hit this constantly. Mitigation: version the config file format. Be forward-compatible (ignore unknown keys rather than erroring).\n- **PATH pollution from plugins.** PATH-based plugin discovery means every `tool-*` binary on PATH is a potential plugin, including unrelated tools. Mitigation: use a plugin directory instead of PATH, or namespace aggressively.\n- **Slow startup time.** CLI tools are invoked hundreds of times per day, often in tight loops. A 500ms startup time is a productivity tax. Mitigation: lazy-load heavy dependencies, avoid dynamic plugin scanning on every invocation (cache the scan), consider compiled languages for hot-path tools. Measure startup time in CI.\n- **Missing offline support.** Tools that phone home on every invocation, fail without network, or require auth for read-only local operations. Mitigation: cache aggressively, degrade gracefully, separate \"needs network\" from \"works locally\".\n- **Platform-specific bugs.** Works on macOS, breaks on Linux (or vice versa). Path handling, line endings, locale differences, missing commands (`readlink -f` doesn't work on macOS). Mitigation: CI matrix testing on all supported platforms. Use portable standard library functions instead of shelling out.\n- **Locale and encoding assumptions.** Assuming UTF-8 when the system locale is different, or vice versa. Filenames containing spaces, unicode, or special characters breaking argument parsing. Mitigation: always handle bytes or explicitly decode with error handling. Test with adversarial filenames.\n- **Conflicting global installs.** Two projects need different versions of the same global tool. Mitigation: support project-local installation (`npx`, `uvx`, `cargo run`), version pinning in project config, lockfiles for tool versions.\n\n## Anti-Patterns\n\n- **The Chatty Default.** Printing banners, tips, version info, and update notices on every invocation. Your tool's output is someone else's input. Default to quiet; let users opt into noise.\n- **Flag Salad.** Dozens of top-level flags with no subcommand structure. If `--help` scrolls for three screens, you need subcommands and flag groups.\n- **The Unscriptable Tool.** Interactive prompts with no flag equivalents. Colored output with no `--no-color`. Human-readable output with no `--json`. Requires a TTY to function. This tool cannot be used in CI.\n- **Silent Failure.** Exiting with code 0 when something went wrong. Tools that claim success but didn't actually do the work. Exit code 0 means success — if it wasn't a success, don't return 0.\n- **Config File as Only Interface.** Requiring a config file for basic operations instead of accepting flags. The first invocation should work with zero files on disk. Config files are for persistent preferences, not required inputs.\n- **Reinventing the Shell.** Building a REPL when a subcommand would do. Adding shell-like features (history, piping, scripting) inside the tool instead of composing with the actual shell. Unless you're building a database client or interactive debugger, you probably don't need a REPL.\n- **Version Gatekeeping.** Refusing to run unless every dependency is the exact right version. Warn about version mismatches; only error on known incompatibilities. Overly strict version checks block users who know what they're doing.\n- **The Everything Binary.** Bundling unrelated functionality into one tool because distribution is easier. A tool that does builds, deploys, monitors, and manages infrastructure is four tools wearing a trenchcoat. Separate concerns, share libraries.\n- **Undocumented Environment Variables.** Using env vars for configuration without listing them in `--help` or docs. If `TOOL_SECRET_FLAG=1` changes behavior, it must be discoverable. Hidden knobs are untestable knobs.\n- **Stdout Pollution.** Mixing data output with status messages, warnings, or diagnostic info on stdout. One warning in stdout breaks every pipeline that parses your output. Status goes to stderr. Always.\n","# System Type: CLI Tool & Developer SDK\n\nPatterns, failure modes, and anti-patterns for command-line tools and developer-facing libraries.\n\n---\n\n## Command Structure Patterns\n\n### Subcommand Trees (git-style)\n**What it is.** Top-level command dispatches to subcommands, each with its own flags and arguments. `tool \u003Csubcommand> [flags] [args]`. The dominant pattern for non-trivial CLIs.\n**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.\n**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.\n**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.\n\n### Flag Conventions\n**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.\n**GNU long flags.** Double dash, full words: `--verbose`, `--output-format`. Self-documenting. Use hyphens, not underscores.\n**Boolean flags.** `--color` enables, `--no-color` disables. Pick a sensible default and provide the negation. Don't require `--color=true`.\n**Value flags.** `--output json` or `--output=json`. Support both forms. Be consistent across all flags.\n**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?).\n\n### Positional Arguments vs. Flags\n**Positional args** are for the primary noun — the thing being operated on. `tool build .\u002Fsrc`, `tool deploy production`. One or two positional args maximum. After that, you need flags.\n**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.\n**Rule of thumb.** If you're reading the help text to remember which positional arg is which, they should be flags.\n\n### Global vs. Local Flags\n**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.\n**Local flags** belong to a specific subcommand. Don't pollute the global namespace with flags only one subcommand uses.\n\n### Interactive Prompts vs. Flags\n**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.\n**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.\n\n### stdin\u002Fstdout\u002Fstderr Discipline\n**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.\n**stderr** is for human messages — progress indicators, warnings, debug info, error messages. Everything that isn't the requested data.\n**stdin** is for data input. Accept `-` as a filename to mean stdin. Support piping: `cat file | tool process` and `tool process \u003C file`.\n**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.\n\n## Configuration Layering\n\n### The Hierarchy\nHighest precedence wins. The standard order:\n\n1. **Command-line flags.** Always win. The user is explicitly telling you what to do right now.\n2. **Environment variables.** Useful for CI, containers, and temporary overrides. Convention: `TOOLNAME_FLAGNAME` (e.g., `GIT_AUTHOR_NAME`).\n3. **Project config.** `.toolrc`, `tool.toml`, or a section in `pyproject.toml` \u002F `package.json`. Checked in to version control. Shared by the team.\n4. **User config.** `~\u002F.config\u002Ftool\u002Fconfig.toml` (XDG) or `~\u002F.toolrc`. Personal preferences that apply across all projects.\n5. **System config.** `\u002Fetc\u002Ftool\u002Fconfig.toml`. Org-wide defaults set by admins. Rare in practice.\n6. **Compiled defaults.** The values your code uses when nothing else is specified.\n\nEvery layer is optional. Missing layers are silently skipped. The tool works with zero configuration.\n\n### XDG Base Directory Spec\n**Config:** `$XDG_CONFIG_HOME\u002Ftool\u002F` (default `~\u002F.config\u002Ftool\u002F`). User settings.\n**Data:** `$XDG_DATA_HOME\u002Ftool\u002F` (default `~\u002F.local\u002Fshare\u002Ftool\u002F`). Persistent data the user didn't explicitly create (caches of fetched schemas, downloaded plugins).\n**State:** `$XDG_STATE_HOME\u002Ftool\u002F` (default `~\u002F.local\u002Fstate\u002Ftool\u002F`). Logs, history, undo state — data that can be deleted without data loss.\n**Cache:** `$XDG_CACHE_HOME\u002Ftool\u002F` (default `~\u002F.cache\u002Ftool\u002F`). Regeneratable data. Safe to delete at any time.\n**Why it matters.** Dotfile pollution in `$HOME` is a real problem. Respecting XDG makes your tool a good citizen on Linux. On macOS, `~\u002FLibrary\u002FApplication Support\u002F` is the equivalent convention. On Windows, `%APPDATA%`.\n\n### Config File Formats\n**TOML.** Best for CLIs. Human-readable, supports comments, unambiguous types, no indentation wars. Used by Cargo, pip, and most modern Rust\u002FPython CLIs.\n**YAML.** Dangerous at scale (Norway problem, implicit type coercion, indentation sensitivity). Acceptable when your ecosystem already uses it (Kubernetes, GitHub Actions). Always use a strict parser.\n**JSON.** No comments. Painful to hand-edit. Fine for machine-generated config. Never use for user-facing config files unless you also accept JSON5 or JSONC.\n**INI.** Simple but limited — no nested structures, no standard for lists. Acceptable for very simple tools. `git config` makes it work, but git is the exception, not the rule.\n\n### Config Discovery and Merging\n**Walk-up discovery.** Search for `.toolrc` starting from the current directory, walking up to filesystem root or `$HOME`. The nearest config wins (or configs are merged, with nearer taking precedence).\n**Explicit path.** `--config path\u002Fto\u002Fconfig.toml` overrides all discovery. Always support this.\n**Debug command.** `tool config show` or `tool config list` should print the resolved configuration with the source of each value (which file, which env var, or default). Without this, config debugging is guesswork.\n\n## Plugin and Extension Architecture\n\n### Plugin Discovery\n**PATH-based.** Plugins are executables named `tool-pluginname` on `$PATH`. `tool foo` finds and runs `tool-foo`. Git uses this pattern. Simple, works with any language. Downsides: namespace collisions, no version management, no metadata.\n**Directory-based.** Plugins live in a known directory (`~\u002F.tool\u002Fplugins\u002F`, or a path set via config). Tool scans the directory at startup. Allows metadata files alongside plugins. Used by kubectl (krew), fish shell.\n**Registry-based.** Plugins are declared in a config file or remote registry. Installed explicitly (`tool plugin install foo`). Provides version management, dependency resolution, and discoverability. More complex to implement. Used by Terraform providers, VS Code extensions.\n\n### Plugin API Stability Contracts\n**The plugin API is a public API.** Breaking it breaks the ecosystem. Version it from day one.\n**Minimal surface area.** Expose the smallest possible interface. Every function you expose is a function you maintain forever. Prefer data exchange (JSON on stdin\u002Fstdout, structured file formats) over shared libraries.\n**Capability negotiation.** Plugins declare which API version they support. The host checks compatibility before loading. Fail loudly on mismatch: \"Plugin X requires API v3, but tool is at v2. Upgrade tool or downgrade plugin.\"\n\n### Hook Points vs. Full Extensions\n**Hook points** are specific lifecycle moments where plugins can inject behavior: pre-commit, post-deploy, on-error. Narrow scope, easy to reason about, low risk of plugins interfering with each other.\n**Full extensions** add new subcommands, new output formats, or new resource types. More powerful, but harder to maintain compatibility. Plugins can step on each other — two plugins adding the same subcommand is a conflict you need to handle.\n**Start with hooks.** Add full extensions only when hooks are demonstrably insufficient.\n\n## Distribution and Installation\n\n### Package Managers\n**Language-native.** `pip install tool`, `npm install -g tool`, `cargo install tool`. Lowest friction for developers already in that ecosystem. Downside: requires the language runtime.\n**System-native.** `brew install tool`, `apt install tool`, `choco install tool`. Best for tools that transcend a single language ecosystem. Requires maintaining package definitions for each manager.\n**The reality.** Support at least one language-native and one system-native method. Provide a `curl | sh` installer as a fallback. Accept that users will find your installation instructions confusing no matter what you do.\n\n### Single-Binary Distribution\n**Why.** No runtime dependencies, no version conflicts, trivial installation. Download, chmod +x, run. The gold standard for CLI distribution.\n**How.** Go and Rust compile to static binaries by default. Python tools can use PyInstaller or Nuitka (with caveats). Node tools can use pkg or bun compile (with caveats).\n**Cross-compilation.** Build for linux\u002Famd64, linux\u002Farm64, darwin\u002Famd64, darwin\u002Farm64, windows\u002Famd64 at minimum. CI matrix builds or cross-compilation toolchains (cross for Rust, GOOS\u002FGOARCH for Go).\n\n### Auto-Update Mechanisms\n**Opt-in, not opt-out.** Never update without the user's knowledge. A tool that silently changes behavior between invocations is a tool that can't be trusted in CI.\n**Check frequency.** Check for updates at most once per day. Cache the result. Never block startup on an update check — do it in the background or after the command completes.\n**Version pinning for CI.** Provide a way to install a specific version: `tool@1.2.3`, `pip install tool==1.2.3`. CI pipelines must be reproducible. `latest` is not a version.\n\n### Cross-Platform Considerations\n**Path separators.** Use your language's path library. Never hardcode `\u002F` or `\\\\`.\n**Line endings.** Emit `\\n` on all platforms unless you have a specific reason not to. Windows terminals handle `\\n` fine; Unix tools choke on `\\r\\n`.\n**Home directory.** Don't hardcode `~`. Use the platform's API to find the home directory.\n**File permissions.** Windows doesn't have Unix permissions. Handle this gracefully (skip `chmod` on Windows rather than failing).\n\n## Backward Compatibility\n\n### Your Output Is an API\nThe most important principle for CLI tools: **people write scripts against your output.** Changing output format is the CLI equivalent of changing a REST API response — it breaks consumers silently.\n\n**Machine-readable output.** Always provide `--output json` (or `--json`). JSON output is your stable API contract. Human-readable output can change between minor versions; JSON output follows semver strictly.\n**Structured output contract.** Document the JSON schema. Adding fields is backward-compatible. Removing or renaming fields is a breaking change. Changing the type of a field is a breaking change.\n**Table output.** Human-readable tables are for humans. Never promise column positions or exact formatting. If users are parsing your table output with `awk`, give them `--output json` and stop worrying about it.\n\n### Semantic Versioning for CLIs\n**Major version (2.0.0).** Breaking changes to: JSON output schema, exit codes, flag names, subcommand names, or config file format.\n**Minor version (1.1.0).** New subcommands, new flags, new output fields, new config options. Existing behavior unchanged.\n**Patch version (1.1.1).** Bug fixes only.\n**The hard part.** Fixing a bug in exit codes is technically a breaking change if anyone depended on the buggy behavior. Use judgment. If the bug was clearly a bug, fix it in a patch. If it was ambiguous, fix it in a minor with a deprecation notice.\n\n### Flag Deprecation Strategy\n**Phase 1 (minor version).** Old flag still works. Prints a warning to stderr: \"Warning: --old-flag is deprecated, use --new-flag instead. Will be removed in v3.0.\"\n**Phase 2 (next major version).** Old flag is removed. Clear error message: \"Error: --old-flag was removed in v3.0. Use --new-flag instead.\"\n**Never silently change flag semantics.** If `--force` meant \"skip confirmation\" in v1 and you want it to mean \"overwrite existing\" in v2, that's a new flag with a new name, not a semantic change to an existing flag.\n\n### UI Changes vs. API Changes\n**UI (human-facing).** Colors, progress bars, table formatting, help text, error message wording. Can change freely between minor versions.\n**API (machine-facing).** Exit codes, JSON output, flag names, environment variable names, config file keys, file paths written to disk. Semver-protected.\n**The gray area.** stderr messages that users parse with grep. This is unsupported but common. Provide a structured alternative (`--output json` for errors too) and document that stderr format is not stable.\n\n## Shell Integration\n\n### Completions\n**Generate, don't hand-write.** Use your framework's completion generation (cobra, clap, click, argparse). Hand-maintained completions drift from the actual flags.\n**Install command.** `tool completion bash > \u002Fetc\u002Fbash_completion.d\u002Ftool` or `tool completion --install`. Make it a one-liner. Document it in `--help`.\n**Support bash, zsh, and fish at minimum.** PowerShell if you have Windows users. Each shell has different completion mechanisms — use a library that handles this.\n\n### Exit Codes as API\n**0:** Success.\n**1:** General error.\n**2:** Usage error (bad flags, wrong arguments). The user called the tool wrong.\n**Distinguish machine-actionable failures.** If callers need to branch on different error types, assign distinct exit codes and document them. `diff` returns 1 for \"files differ\" and 2 for \"trouble\" — callers rely on this distinction.\n**Don't go wild.** More than ~10 distinct exit codes is a sign you should use structured error output (`--output json`) instead of encoding error taxonomy in a single integer.\n**Never use exit codes above 125.** Shells reserve 126 (command not executable), 127 (command not found), and 128+N (killed by signal N). Your exit codes will collide with these.\n\n### Signal Handling\n**SIGINT (Ctrl+C).** Clean up and exit promptly. Don't trap SIGINT to print \"are you sure?\" — that breaks pipeline behavior. If you need confirmation, use a flag (`--interactive`), not a signal trap.\n**SIGTERM.** Graceful shutdown. Finish in-progress writes, clean up temp files, exit. Same as SIGINT for most CLIs.\n**SIGPIPE.** Die silently. If the reader of your pipe closes early (`tool list | head -5`), don't print an error. Most languages handle this correctly by default; Python notably does not — add `signal.signal(signal.SIGPIPE, signal.SIG_DFL)`.\n**Temp file cleanup.** Use OS-level temp directories and clean up on exit. Register cleanup handlers for signal cases. A tool that leaves temp files on Ctrl+C is a tool that slowly fills disks.\n\n### TTY Detection and Formatting\n**Detect the TTY.** `isatty(stdout)` determines whether you're writing to a terminal or a pipe. When piped, disable colors, progress bars, spinners, and interactive formatting.\n**Color.** Respect `NO_COLOR` (https:\u002F\u002Fno-color.org\u002F) and `FORCE_COLOR` environment variables. Support `--color=auto|always|never`. Default to `auto` (color when TTY, no color when piped).\n**Width.** Use terminal width for wrapping and table layout. Fall back to 80 columns when not a TTY. Don't hard-wrap at 80 when the terminal is 200 columns wide.\n\n## Error Handling and UX\n\n### Progressive Disclosure\n**Default output.** Short, actionable error message. One or two lines. Enough to fix the problem in the common case.\n**`--verbose`.** Include context: what the tool was trying to do, what it expected, what it got. Include paths, URLs, and relevant config values.\n**`--debug`.** Full diagnostic dump: HTTP request\u002Fresponse bodies, config resolution trace, plugin loading order, system info. Intended for bug reports, not normal use.\n**Environment variable override.** `TOOL_LOG=debug` or `TOOL_DEBUG=1` as an alternative to `--debug`. Useful when the error occurs before flag parsing.\n\n### Actionable Error Messages\n**Bad:** `Error: invalid configuration`\n**Good:** `Error: config file ~\u002F.config\u002Ftool\u002Fconfig.toml has invalid syntax at line 12: expected string, got integer for field 'timeout'. Run 'tool config validate' to check your configuration.`\n\n**Every error message should answer:** What happened? Why? What should the user do next?\n\n### Typo Suggestions\nWhen the user types `tool biuld`, suggest `tool build`. Levenshtein distance of 1-2 on subcommands and flags. This is table stakes for modern CLIs. Libraries like `clap` and `cobra` provide this out of the box.\n\n### Dry-Run Mode\n`--dry-run` shows what the tool would do without doing it. Essential for destructive operations (delete, deploy, migrate). The output should be specific enough that the user can predict exactly what will happen. \"Would delete 3 files\" is useless. \"Would delete: .\u002Fa.txt, .\u002Fb.txt, .\u002Fc.txt\" is useful.\n\n### Progress Indicators\n**Bounded work:** Progress bars with percentage and ETA. Update no more than ~10 times per second.\n**Unbounded work:** Spinners or activity indicators. Show what's currently happening (\"Downloading index...\", \"Resolving dependencies...\").\n**Output to stderr.** Always. Progress indicators on stdout corrupt pipeable output.\n**Non-TTY.** When not a TTY, print milestone lines instead of progress bars: \"Downloaded 50\u002F100 packages\". Or print nothing — silence is better than a flood of progress lines in a log file.\n\n## Common Failure Modes\n\n- **Breaking output format that scripts depend on.** Changing human-readable output that turns out to be parsed by `awk`\u002F`grep` in CI pipelines. Mitigation: always provide `--output json`, treat JSON schema as semver-protected, document that human output is unstable.\n- **Config file conflicts between versions.** v2 writes a config file that v1 can't read, or vice versa. Users with multiple projects on different versions hit this constantly. Mitigation: version the config file format. Be forward-compatible (ignore unknown keys rather than erroring).\n- **PATH pollution from plugins.** PATH-based plugin discovery means every `tool-*` binary on PATH is a potential plugin, including unrelated tools. Mitigation: use a plugin directory instead of PATH, or namespace aggressively.\n- **Slow startup time.** CLI tools are invoked hundreds of times per day, often in tight loops. A 500ms startup time is a productivity tax. Mitigation: lazy-load heavy dependencies, avoid dynamic plugin scanning on every invocation (cache the scan), consider compiled languages for hot-path tools. Measure startup time in CI.\n- **Missing offline support.** Tools that phone home on every invocation, fail without network, or require auth for read-only local operations. Mitigation: cache aggressively, degrade gracefully, separate \"needs network\" from \"works locally\".\n- **Platform-specific bugs.** Works on macOS, breaks on Linux (or vice versa). Path handling, line endings, locale differences, missing commands (`readlink -f` doesn't work on macOS). Mitigation: CI matrix testing on all supported platforms. Use portable standard library functions instead of shelling out.\n- **Locale and encoding assumptions.** Assuming UTF-8 when the system locale is different, or vice versa. Filenames containing spaces, unicode, or special characters breaking argument parsing. Mitigation: always handle bytes or explicitly decode with error handling. Test with adversarial filenames.\n- **Conflicting global installs.** Two projects need different versions of the same global tool. Mitigation: support project-local installation (`npx`, `uvx`, `cargo run`), version pinning in project config, lockfiles for tool versions.\n\n## Anti-Patterns\n\n- **The Chatty Default.** Printing banners, tips, version info, and update notices on every invocation. Your tool's output is someone else's input. Default to quiet; let users opt into noise.\n- **Flag Salad.** Dozens of top-level flags with no subcommand structure. If `--help` scrolls for three screens, you need subcommands and flag groups.\n- **The Unscriptable Tool.** Interactive prompts with no flag equivalents. Colored output with no `--no-color`. Human-readable output with no `--json`. Requires a TTY to function. This tool cannot be used in CI.\n- **Silent Failure.** Exiting with code 0 when something went wrong. Tools that claim success but didn't actually do the work. Exit code 0 means success — if it wasn't a success, don't return 0.\n- **Config File as Only Interface.** Requiring a config file for basic operations instead of accepting flags. The first invocation should work with zero files on disk. Config files are for persistent preferences, not required inputs.\n- **Reinventing the Shell.** Building a REPL when a subcommand would do. Adding shell-like features (history, piping, scripting) inside the tool instead of composing with the actual shell. Unless you're building a database client or interactive debugger, you probably don't need a REPL.\n- **Version Gatekeeping.** Refusing to run unless every dependency is the exact right version. Warn about version mismatches; only error on known incompatibilities. Overly strict version checks block users who know what they're doing.\n- **The Everything Binary.** Bundling unrelated functionality into one tool because distribution is easier. A tool that does builds, deploys, monitors, and manages infrastructure is four tools wearing a trenchcoat. Separate concerns, share libraries.\n- **Undocumented Environment Variables.** Using env vars for configuration without listing them in `--help` or docs. If `TOOL_SECRET_FLAG=1` changes behavior, it must be discoverable. Hidden knobs are untestable knobs.\n- **Stdout Pollution.** Mixing data output with status messages, warnings, or diagnostic info on stdout. One warning in stdout breaks every pipeline that parses your output. Status goes to stderr. Always.\n",{"name":5,"description":7},"main","1eff6a2bcebe7c42d5d8d4962e1937a3bb932b0c","skills\u002Fsystem-type-cli-tool",2,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-systems-design","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-05-18 08:17:41",{"source":9,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add microsoft\u002Famplifier-bundle-systems-design --skill system-type-cli-tool",{"tool":56,"command":57},"bunx","bunx skills add microsoft\u002Famplifier-bundle-systems-design --skill system-type-cli-tool",{"tool":59,"command":60},"pnpm","pnpm dlx skills add microsoft\u002Famplifier-bundle-systems-design --skill system-type-cli-tool","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-systems-design\u002Fblob\u002Fmain\u002Fskills\u002Fsystem-type-cli-tool\u002FSKILL.md",true,[],[65,82,96,111,125,139],{"skillNo":66,"name":67,"nameZh":68,"description":69,"descriptionZh":70,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":71,"categories":72,"keywords":79,"publishedAt":36},"01M69B6EYN524WJM12A67ASYHS","tradeoff-analysis","方案权衡分析方法","Structured tradeoff analysis methodology — the 8-dimension comparison frame, tradeoff matrix template, and common tradeoff patterns. Use when evaluating design alternatives, comparing technology choices, or when the answer is 'it depends.'","结构化权衡分析方法论——8 维度比较框架、权衡矩阵模板和常见权衡模式。在评估设计备选方案、比较技术选型或答案“视情况而定”时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-systems-design\u002Fblob\u002Fmain\u002Fskills\u002Ftradeoff-analysis\u002FSKILL.md",[73,76],{"categoryNo":74,"categoryName":75,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BT7QTSZKB08EAW9P9ZCDNQ","设计评审与架构优化",{"categoryNo":77,"categoryName":78,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C4ZVS0ZJKF2T2G58PW5VR2","系统架构师",[80,81],"tradeoff analysis","design",{"skillNo":83,"name":84,"nameZh":85,"description":86,"descriptionZh":87,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":88,"categories":89,"keywords":92,"publishedAt":36},"01M69B6DE6YFEZS2D8RWSFPAVC","systems-design-review-methodology","系统设计评审方法论","Use when the \u002Fsystems-design-review mode is active. 7-step design review methodology -- understand the design, classify the system, evaluate against codebase, adversarial analysis, tradeoff validation, synthesis, and action items. Governs conversation flow, delegation patterns, and user validation checkpoints.","当 \u002Fsystems-design-review 模式激活时使用。7 步设计评审方法论——理解设计、系统分类、对照代码库评估、对抗性分析、权衡验证、综合归纳以及行动项。用于管控对话流程、委派模式和用户验证检查点。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-systems-design\u002Fblob\u002Fmain\u002Fskills\u002Fsystems-design-review-methodology\u002FSKILL.md",[90,91],{"categoryNo":74,"categoryName":75,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":77,"categoryName":78,"taxonomyType":28,"taxonomyTypeDesc":29},[93,94,95,81],"systems design review methodology","design review","review",{"skillNo":97,"name":98,"nameZh":99,"description":100,"descriptionZh":101,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":102,"categories":103,"keywords":108,"publishedAt":36},"01M69B6BG8XVGB2QMNFKFYBZVX","systems-design-methodology","系统结构设计方法论","Use when the \u002Fsystems-design mode is active. 9-phase structured design methodology -- problem framing, system classification, constraints, candidate architectures, tradeoff analysis, risk review, refinement, migration planning, and documentation. Governs conversation flow, delegation patterns, and user validation checkpoints.","当 \u002Fsystems-design 模式激活时使用。9 阶段结构化设计方法论——问题界定、系统分类、约束条件、候选架构、权衡分析、风险评审、细化完善、迁移规划以及文档编制。用于管控对话流程、委派模式和用户验证检查点。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-systems-design\u002Fblob\u002Fmain\u002Fskills\u002Fsystems-design-methodology\u002FSKILL.md",[104,105],{"categoryNo":77,"categoryName":78,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":106,"categoryName":107,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8C535MHXGXDSGN98VJTMCSK","系统架构设计模式",[109,81,95,110],"systems design methodology","documentation",{"skillNo":112,"name":113,"nameZh":114,"description":115,"descriptionZh":116,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":117,"categories":118,"keywords":121,"publishedAt":36},"01M69B69R21TMX6E7WVH241YW7","system-type-workflow-orchestration","工作流编排架构设计","Domain patterns for workflow orchestration systems — long-running processes, state machines, saga coordination, human-in-the-loop gates, retry and timeout hierarchies, and failure modes. Use when designing or evaluating workflow engines, job orchestrators, or multi-step business process systems.","工作流编排系统的领域模式——长时间运行的流程、状态机、saga 协调、人工介入（human-in-the-loop）关卡、重试与超时层级以及故障模式。在设计和评估工作流引擎、作业编排器或多步骤业务流程系统时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-systems-design\u002Fblob\u002Fmain\u002Fskills\u002Fsystem-type-workflow-orchestration\u002FSKILL.md",[119,120],{"categoryNo":77,"categoryName":78,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":106,"categoryName":107,"taxonomyType":23,"taxonomyTypeDesc":24},[122,123,124],"workflow","system type workflow orchestration","orchestration",{"skillNo":126,"name":127,"nameZh":128,"description":129,"descriptionZh":130,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":131,"categories":132,"keywords":135,"publishedAt":36},"01M69B67T9XSXZFZMS8BA8XTN4","system-type-web-service","Web 服务架构设计","Domain patterns for web service architecture — API design (REST\u002FGraphQL\u002FgRPC), scaling, data layer, observability, failure modes, and anti-patterns. Use when designing or evaluating a web service, API, or request\u002Fresponse system.","Web 服务架构的领域模式——API 设计（REST\u002FGraphQL\u002FgRPC）、扩展、数据层、可观测性、故障模式和反模式。在设计和评估 Web 服务、API 或请求\u002F响应系统时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-systems-design\u002Fblob\u002Fmain\u002Fskills\u002Fsystem-type-web-service\u002FSKILL.md",[133,134],{"categoryNo":77,"categoryName":78,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":106,"categoryName":107,"taxonomyType":23,"taxonomyTypeDesc":24},[136,137,138,34,81],"system type web service","web","api design",{"skillNo":140,"name":141,"nameZh":142,"description":143,"descriptionZh":144,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":145,"categories":146,"keywords":149,"publishedAt":36},"01M69B6478TS22P136B0N54HJX","system-type-spa","SPA 单页应用架构设计","Domain patterns for single-page application architecture — client-side routing, state management, rendering strategies, authentication, performance, and offline support. Use when designing or evaluating a browser-based SPA, progressive web app, or rich client-side application.","单页应用（SPA）架构的领域模式——客户端路由、状态管理、渲染策略、认证、性能和离线支持。在设计和评估基于浏览器的 SPA、渐进式 Web 应用（PWA）或富客户端应用时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-systems-design\u002Fblob\u002Fmain\u002Fskills\u002Fsystem-type-spa\u002FSKILL.md",[147,148],{"categoryNo":77,"categoryName":78,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":106,"categoryName":107,"taxonomyType":23,"taxonomyTypeDesc":24},[150,151,34,137,152],"system type spa","performance","support"]