Agent Skills
› wibus-wee/see
› typescript-best-practices
typescript-best-practices
GitHub提供 TypeScript 编码最佳实践,涵盖边界数据解析、类型建模、泛型使用及测试策略,辅助开发者编写更安全、可维护的 TS 代码。
Trigger Scenarios
阅读或编辑 TypeScript 代码
需要应用 TypeScript 类型约束和模式
Install
npx skills add wibus-wee/see --skill typescript-best-practices -g -y
SKILL.md
Frontmatter
{
"name": "typescript-best-practices",
"description": "Apply disciplined TypeScript modeling and boundary parsing. Use when reading or editing TypeScript."
}
TypeScript Best Practices
- Parse unknown external data at the boundary; keep
unknownuntil validated. - Prefer discriminated unions for mutually exclusive states and exhaustive handling for closed variants.
- Give domain meaning to primitives when accidental mixing would be costly.
- Avoid widening useful literal information and avoid
anyas an escape hatch. - Let callers consume one coherent return shape instead of correlated optional fields.
- Use generics only when they express a real relationship between inputs and outputs.
- Keep async/error states explicit at the public boundary.
- Test behavior through exported APIs, not private helper choreography.
Version History
- b47adae Current 2026-11-26 00:12


