协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
software-devtools【开发与工程】Builds developer tools. Use when writing a codemod, SDK, CLI, language server (LSP), IDE extension, or package distribution; dependency audits go to dev-dependency-management.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
| Concern | Defaults |
|---|---|
| CLI framework (Node.js) | Commander.js, oclif, Ink (React for CLI) |
| CLI framework (Go) | Cobra + Viper |
| CLI framework (Rust) | clap + dialoguer |
| CLI framework (Python) | Click / Typer |
| SDK design | Typed clients, builder pattern, progressive disclosure |
| Code generation | OpenAPI Generator (self-hosted), Stainless/Fern/Speakeasy (managed; compare generated runtime contracts), GraphQL Codegen, Protobuf/Connect, custom AST transforms |
| IDE extensions | VS Code Extension API, JetBrains Plugin SDK, LSP (Language Server Protocol) |
| Package publishing | npm, PyPI, crates.io, NuGet, Maven Central |
| Developer docs | Mintlify, Docusaurus, Starlight, ReadMe, Fern |
| DX metrics | Time-to-first-API-call, SDK adoption, error rate, support tickets |
What kind of developer tool?
├─ Interactive terminal tool
│ └─ CLI framework per language (Commander.js / Cobra / clap / Typer)
│ ├─ Needs interactive prompts? → Ink, dialoguer, Typer, survey
│ └─ Needs scriptable output? → --json flag, structured stdout
├─ Library other devs import
│ └─ SDK with typed API, clear errors, minimal dependencies
│ ├─ Wrapping a REST API? → Typed client from OpenAPI spec
│ ├─ Wrapping a GraphQL API? → Codegen typed operations
│ └─ General-purpose library? → Builder pattern, progressive disclosure
├─ Editor integration
│ ├─ VS Code only? → VS Code Extension API
│ ├─ Multiple editors? → Language Server Protocol (LSP)
│ └─ JetBrains only? → IntelliJ Plugin SDK
├─ Generate code from schema
│ ├─ OpenAPI → OpenAPI Generator or custom templates
│ ├─ GraphQL → GraphQL Codegen with typed plugins
│ └─ Protobuf → buf + Connect or gRPC codegen
├─ Transform existing code
│ ├─ JavaScript/TypeScript → jscodeshift or ts-morph
│ ├─ Python → libcst
│ └─ Multi-language → custom AST tooling per parser
└─ Developer documentation portal
├─ Fast setup, good defaults → Mintlify or Starlight
└─ Full React flexibility → Docusaurus
Keep the API surface small. Every public method is a commitment.
client.send(message) works out of the box; client.send(message, { retries: 3, timeout: 5000 }) is there when needed.new ClientBuilder().withAuth(token).withRetries(3).build(). Avoid deep option objects with 20 fields.Automation contract.
Treat exit codes, stdout, stderr, and machine-readable output as a public API. Human progress belongs on stderr; requested data belongs on stdout; --json must remain parseable with no banners or color. Use one documented scheme: 0 = complete success, 1 = execution failure (including validation, transient dependency failure, and partial completion), 2 = invalid invocation. Put distinct error codes, retryability, and completed/failed item lists in JSON rather than inventing extra process statuses. Test under pipes, non-interactive CI, and cancellation; document signal-exit behavior separately.
tool <command> [args] [--flags] is the universal pattern.tool auth login, tool auth logout, tool config set. Keep depth to two levels maximum.--yes approves.--quiet / --silent flag.NO_COLOR environment variable and --no-color flag.~/.config/toolname/config.yaml, .toolnamerc, toolname.config.js — support a sensible hierarchy with local overrides.tool completions <shell> command.--json flag: every command that produces output should support --json for machine-readable structured output. Scriptability is not optional.sh and ps1 install scripts, and set halt criteria before a rollout. Checklist: references/publishing-and-support.md.Agents are now primary CLI consumers alongside humans. Design for both.
--help discovery: don't dump all docs upfront. An agent runs mycli, sees subcommands, picks one, runs mycli deploy --help, gets what it needs. No wasted context on commands it won't use.--help: agents pattern-match off mycli deploy --env staging --tag v1.2.3 faster than they read a description. Every subcommand's help should include at least two usage examples.--stdin for config import, support --output tag-only for chaining. Don't require positional args in unusual orders.--dry-run for destructive actions: agents should preview what a deploy or deletion would do before committing. Let them validate the plan, then run it for real.--yes approves the stated plan; --force may change overwrite policy. Neither may disable credential checks, signature validation, or authorization.mycli service list, it should be able to guess mycli deploy list and mycli config list. Pick a pattern (resource + verb or verb + resource) and use it everywhere.Load sdk-and-cli-checklist.md before selecting a generator or shipping a client; define its runtime, cancellation and retry contract. Treat generated code as a product surface: schema-driven (OpenAPI/GraphQL/Protobuf) where a schema exists, AST-based transforms instead of fragile regex, output run through the project's formatter, clear generated-file markers plus linguist-generated=true for review, and safe --dry-run/partial regeneration. Patterns: references/sdk-and-cli-checklist.md.
Keep activate() lightweight, prefer LSP for multi-editor language features, keep webview bundles small, test LSP servers at the protocol level, and publish to both the VS Code Marketplace and Open VSX when fork users matter. Details: references/sdk-and-cli-checklist.md.
feat:, fix:; mark breaking changes with ! before the colon, e.g. feat!:, or a BREAKING CHANGE: footer — breaking: is not a spec type and will not trigger a major bump) and auto-generate changelogs. Keep a human-readable CHANGELOG.md for significant releases.require(esm) is unflagged in Node v20.19 / v22.12 / v23+, so CommonJS consumers can require() an ESM-only package. If your supported Node floor is ^20.19 || >=22.12, ship ESM-only (declare it in engines) and avoid the dual-package hazard; only synchronous ESM can be require()d, so keep top-level await out of the entry graph. Ship dual CJS/ESM (conditional exports, test both entry points) only when you must support older runtimes or tooling that cannot load ESM.sideEffects: false only when imports have no required side effects; preserve CSS/polyfill initialization in explicit entries (webpack guidance). Test consumer bundling and export granularly.npm deprecate or equivalent. Provide migration guides. Declare which previous majors receive security fixes and for how long; make that support commitment match maintenance capacity.Before release, test the packed artifact, every supported entry point and runtime, and the publishing identity. Publisher hardening: references/publishing-and-support.md.
Toolchain selection, dependency audits and upgrade policy use dev-dependency-management. Here, measure the tool you publish: feedback-loop time, compatibility failures and migration effort.
Measure local feedback-loop time, time-to-first-API-call, onboarding drop-off per step, latest-major adoption, error rate by method, support-ticket clustering, and developer satisfaction. Targets and off-signals: references/publishing-and-support.md.
The Do/Avoid list, common anti-patterns, and step-by-step recipes (S1 SDK release with changesets, S2 agent-consumable CLI, S3 OpenAPI-to-SDK pipeline, S4 LSP for a custom DSL, S5 IDE-extension auth and token refresh) live in references/dx-scenarios-and-antipatterns.md.
Before selecting a generator, check its supported schema features and languages at the vendor docs linked in data/sources.json. Before publishing, look up registry identity/provenance requirements and test the CLI’s target OS/runtime installation matrix using publishing-and-support.md. For editor integrations, check the selected host API and LSP capability support; retain the tested version in the project’s release configuration.
When prior decisions or pitfalls are relevant, consult learnings.consolidated.md if present; use learnings.md only for needed history or as the available fallback. Otherwise skip both.
After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.