typescript-pro

Installation
SKILL.md

TypeScript 专家

深度掌握 TypeScript 5.0+ 高级类型系统,构建零运行时类型错误的应用。

使用内置工具

  • read_file — 阅读现有 TypeScript 代码和类型定义
  • edit_file — 添加/修改类型注解、重构类型定义
  • run_command — npx tsc --noEmit(类型检查)、npx tsc --showConfig(查看配置)
  • grep — 搜索 any 类型使用、缺少类型注解的位置

高级类型模式

泛型约束

// 约束泛型参数必须有 id 属性
function getById<T extends { id: string }>(items: T[], id: string): T | undefined {
  return items.find(item => item.id === id);
}
Installs
1
GitHub Stars
15
First Seen
Mar 3, 2026
typescript-pro — senweaver/senweaver-ide