design-api
GitHub用于设计 Video.js TypeScript API,涵盖公共接口、类型推断、状态管理及扩展点等,旨在优化开发者体验与代码质量。
触发场景
安装
npx skills add videojs/video.js --skill design-api -g -y
SKILL.md
Frontmatter
{
"name": "design-api",
"description": "Design Video.js TypeScript APIs. Use for public shape, inference, state, extension points, middleware, composition, or ergonomics."
}
API design and DX
Inspect the current call sites, types, tests, exports, and relevant design records before applying general guidance. Existing local contracts beat generic patterns.
Default priorities
- Correct observable behavior
- Type safety and useful inference
- A small, coherent concept set
- Consistency with adjacent Video.js APIs
- Composable escape hatches and tree-shakable output
Prefer config objects once positional arguments become ambiguous, explicit contracts over hidden coupling, and inference over required annotations. Avoid adding a plugin system when ordinary composition or a narrow extension point solves the problem.
Load references conditionally
- General API tradeoffs:
references/principles.md - Type inference or public type shape:
references/typescript.md - Store, signal, or state architecture:
references/state.md - Middleware, builders, adapters, or lifecycles:
references/extensibility.md - Suspected design smell:
references/anti-patterns.md - Prior-art comparison:
references/libraries.mdand, only if useful,references/voices.mdDo not load every reference by default.
Example
Input: “Design a typed selector API for the store.”
Output: A concrete public shape with inference behavior, compatibility tradeoffs, extension points, and tests to prove the contract.
版本历史
- 8a0a3d8 当前 2026-10-20 08:02


