Token导航 LogoToken导航

Agent Skill · 前端设计

typescript-master(TypeScript master 前端)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

typescript-master 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 4,989。

总安装 759周安装 31GitHub Stars 公开资料未说明下载 243核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:typescript-master(TypeScript master 前端)
来源仓库:https://github.com/tomlord1122/tomtom-skill
仓库路径:skills/typescript-master
安装命令:
npx skills add https://github.com/tomlord1122/tomtom-skill --skill typescript-master
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/tomlord1122/tomtom-skill --skill typescript-master

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

安装命令:npx skills add https://github.com/tomlord1122/tomtom-skill --skill typescript-master 适用于 Codex、Claude、Cursor、Gemini CLI 等宿主环境

来源仓库内路径:skills/typescript-master

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/tomlord1122/tomtom-skill --skill typescript-ma…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

typescript-master 怎么安装?

在终端执行 npx skills add https://github.com/tomlord1122/tomtom-skill --skill typescript-master。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

typescript-master 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

typescript-master 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

typescript-master 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

typescript-master 用的人多吗?

公开数据是累计安装 759 次,近一周安装 31 次,下载 243 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

typescript-master 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
typescript-master

TypeScript master 前端 · 本页

759—需要联网MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

TypeScript Language Expert

Expert assistant for TypeScript type system mastery including generics, conditional types, mapped types, type inference, and advanced patterns.

Thinking Process

When activated, follow this structured thinking approach to solve TypeScript type challenges:

Step 1: Problem Classification

Goal: Understand what type of TypeScript challenge this is.

Key Questions to Ask:

  • Is this a type design problem? (creating new types, modeling data)
  • Is this a type error problem? (debugging, fixing type mismatches)
  • Is this a type inference problem? (generics, conditional types)
  • Is this a type safety problem? (runtime validation, narrowing)
  • Is this a library typing problem? (third-party types, declaration files)

Decision Point: Classify to select appropriate approach:

  • Type Design → Focus on modeling domain correctly
  • Type Error → Trace the type mismatch source
  • Type Inference → Design generics and constraints
  • Type Safety → Add runtime validation with type guards
  • Library Typing → Check @types packages, create declarations

Step 2: Context Analysis

Goal: Understand the TypeScript environment and constraints.

Key Questions to Ask:

  • What TypeScript version is in use? (5.0+ has new features)
  • What is the strictness level? (strict, noUncheckedIndexedAccess, etc.)
  • What is the module system? (ESM, CommonJS, bundler)
  • Are there existing type patterns to follow?

Actions:

  1. Check tsconfig.json for compiler options
  2. Identify TypeScript version in package.json
  3. Review existing type patterns in the codebase

Version-Specific Features:

FeatureMinimum Version
Generics2.0
Conditional Types2.8
Template Literal Types4.1
Const Type Parameters5.0
satisfies Operator4.9

Step 3: Type Design Principles

Goal: Apply TypeScript best practices to the solution.

Thinking Framework - Core Principles:

  1. Prefer Inference Over Annotation

- Let TypeScript infer when possible - Annotate function parameters, return types for public APIs - Use satisfies to check without widening

  1. Use unknown Over any

- unknown forces type checking before use - any disables all type checking - Exception: truly dynamic scenarios (rare)

  1. Discriminated Unions for Variants

- Use literal type discriminators - Enables exhaustive checking - Self-documenting code

  1. Narrow Types, Don't Widen

- Prefer as const for literal types - Use type guards to narrow - Avoid unnecessary type assertions

Type Design Questions:

  • "What is the minimal type that describes this?"
  • "Can TypeScript infer this, or must I annotate?"
  • "Is this union exhaustive?"

Step 4: Error Diagnosis

Goal: Systematically diagnose type errors.

Thinking Framework:

  • "What does TypeScript expect vs what it received?"
  • "Where did the unexpected type originate?"
  • "Is this a structural or nominal mismatch?"

Common Error Patterns:

Error PatternLikely CauseSolution
Type 'X' is not assignable to 'Y'Missing property or wrong typeAdd missing prop, fix type
Property does not existOptional prop or wrong union memberAdd type guard, check optional
Type 'X' has no call signaturesNot a function typeCheck function type
Argument not assignable to 'never'Exhausted union without handlingAdd missing case handler

Debugging Strategy:

  1. Hover over variables to see inferred types
  2. Trace back to where the type was assigned
  3. Check for implicit any (enable noImplicitAny)
  4. Use // @ts-expect-error temporarily to isolate issues

Step 5: Generic Type Design

Goal: Design reusable, type-safe generic functions and types.

Thinking Framework:

  • "What type information flows through this function?"
  • "What constraints are needed on the type parameter?"
  • "Can I infer more than I'm currently inferring?"

Generic Design Patterns:

PatternUse CaseExample
Identity GenericPreserve input type<T>(x: T) => T
Constrained GenericLimit to subset<T extends object>
Mapped TypeTransform all props{[K in keyof T]:...}
Conditional TypeType-level branchingT extends U? X: Y
Infer KeywordExtract nested typeT extends Promise<infer U>? U: T

Generic Best Practices:

  • Name parameters meaningfully (TItem not just T)
  • Add constraints that document intent
  • Provide defaults when sensible (<T = string>)
  • Test with edge cases (empty arrays, undefined, etc.)

Step 6: Type Narrowing Strategy

Goal: Safely narrow types for runtime operations.

Thinking Framework:

  • "How do I know this is type X at runtime?"
  • "What is the most reliable way to check?"
  • "Does this narrowing work for TypeScript?"

Narrowing Techniques:

TechniqueBest ForExample
typeofPrimitivestypeof x === 'string'
instanceofClass instancesx instanceof Date
in operatorProperty presence'name' in x
DiscriminantTagged unionsx.type === 'success'
Custom guardComplex objectsfunction isUser(x): x is User
Assertion functionThrow on invalidasserts x is User

Type Guard Pattern:

function isUser(obj: unknown): obj is User {
  return (
    typeof obj === 'object' &&
    obj !== null &&
    'id' in obj &&
    'name' in obj &&
    typeof (obj as User).id === 'string'
  );
}

Step 7: Advanced Type Patterns

Goal: Apply advanced patterns for complex scenarios.

Thinking Framework:

  • "Is there a utility type that does this?"
  • "Can I compose existing types?"
  • "Is the type readable and maintainable?"

Advanced Patterns:

PatternPurpose
Template Literal TypesString manipulation at type level
Recursive TypesTree structures, nested objects
Branded TypesNominal typing for primitives
Builder Pattern TypesAccumulate type information

Branded Type Example:

type UserId = string & { readonly __brand: unique symbol };

function createUserId(id: string): UserId {
  return id as UserId;
}

function fetchUser(id: UserId) { /* ... */ }

// Type error: string is not UserId
fetchUser("abc"); // Error!
fetchUser(createUserId("abc")); // OK

Step 8: Validation and Testing

Goal: Ensure types are correct and maintainable.

Type Testing Strategies:

  1. Use @ts-expect-error to test that invalid code fails
  2. Create type test files with assertions
  3. Use Expect<Equal<A, B>> utility for type assertions

Type Test Pattern:

// Type tests (no runtime code)
type cases = [
  Expect<Equal<ReturnType<typeof fn>, string>>,
  Expect<Equal<Parameters<typeof fn>, [number, string]>>,
];

// Compile-time assertion utility
type Expect<T extends true> = T;
type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends
  (<T>() => T extends Y ? 1 : 2) ? true : false;

Maintainability Checklist:

  • Types are documented with JSDoc
  • Complex types are broken into smaller pieces
  • Type names are descriptive
  • Exported types have explicit documentation

Usage

Run Type Check

bash /mnt/skills/user/typescript-master/scripts/type-check.sh [project-dir] [strict-mode]

Arguments:

  • project-dir - Project directory (default: current directory)
  • strict-mode - Enable strict checks: true/false (default: true)

Examples:

bash /mnt/skills/user/typescript-master/scripts/type-check.sh
bash /mnt/skills/user/typescript-master/scripts/type-check.sh ./my-project
bash /mnt/skills/user/typescript-master/scripts/type-check.sh ./my-project false

Checks:

  • TypeScript compilation (noEmit)
  • Strict type checking
  • Unused variables/imports
  • tsconfig recommendations

Documentation Resources

Official Documentation:

  • TypeScript Handbook: https://www.typescriptlang.org/docs/handbook/
  • Type Challenges: https://github.com/type-challenges/type-challenges

Type System Fundamentals

Utility Types

// Built-in utilities
type Partial<T> = { [P in keyof T]?: T[P] };
type Required<T> = { [P in keyof T]-?: T[P] };
type Readonly<T> = { readonly [P in keyof T]: T[P] };
type Pick<T, K extends keyof T> = { [P in K]: T[P] };
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
type Record<K extends keyof any, T> = { [P in K]: T };

Custom Utility Types

// Deep Partial
type DeepPartial<T> = {
  [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
};

// Strict Omit (only known keys)
type StrictOmit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;

// Make specific keys required
type RequireKeys<T, K extends keyof T> = T & Required<Pick<T, K>>;

// Nullable
type Nullable<T> = T | null;

Generics Patterns

Constrained Generics

// Key constraint
function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
  return obj[key];
}

// Type constraint
function merge<T extends object, U extends object>(a: T, b: U): T & U {
  return { ...a, ...b };
}

Inference with infer

// Extract return type
type ReturnType<T> = T extends (...args: any[]) => infer R ? R : never;

// Extract promise value
type Awaited<T> = T extends Promise<infer U> ? Awaited<U> : T;

// Extract array element
type ArrayElement<T> = T extends (infer E)[] ? E : never;

// Extract function parameters
type Parameters<T> = T extends (...args: infer P) => any ? P : never;

Conditional Types

Basic Conditional

type IsString<T> = T extends string ? true : false;
type IsArray<T> = T extends any[] ? true : false;

Distributive Conditional

// Distributes over union
type ToArray<T> = T extends any ? T[] : never;
type Result = ToArray<string | number>; // string[] | number[]

// Prevent distribution
type ToArrayNonDist<T> = [T] extends [any] ? T[] : never;
type Result2 = ToArrayNonDist<string | number>; // (string | number)[]

Discriminated Unions

type Result<T, E = Error> =
  | { success: true; data: T }
  | { success: false; error: E };

function handleResult<T>(result: Result<T>): T | null {
  if (result.success) {
    return result.data; // TypeScript knows data exists
  } else {
    console.error(result.error); // TypeScript knows error exists
    return null;
  }
}

Type Guards

// Custom type guard
function isUser(obj: unknown): obj is User {
  return (
    typeof obj === 'object' &&
    obj !== null &&
    'id' in obj &&
    'name' in obj &&
    typeof (obj as User).id === 'string'
  );
}

// Assertion function
function assertNonNull<T>(
  value: T,
  message?: string
): asserts value is NonNullable<T> {
  if (value === null || value === undefined) {
    throw new Error(message ?? 'Value is null or undefined');
  }
}

Template Literal Types

type EventName = 'click' | 'focus' | 'blur';
type Handler = `on${Capitalize<EventName>}`;
// "onClick" | "onFocus" | "onBlur"

type PropKey<T extends string> = `get${Capitalize<T>}` | `set${Capitalize<T>}`;
type NameProps = PropKey<'name'>; // "getName" | "setName"

Recommended tsconfig

{
  "compilerOptions": {
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "exactOptionalPropertyTypes": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "noPropertyAccessFromIndexSignature": true,
    "moduleResolution": "bundler",
    "verbatimModuleSyntax": true
  }
}

Present Results to User

When providing TypeScript solutions:

  • Prefer type inference over explicit annotations
  • Use unknown instead of any
  • Leverage discriminated unions
  • Provide type test examples
  • Note TypeScript version features (5.0+: const type parameters)

Troubleshooting

"Type 'X' is not assignable to type 'Y'"

  • Check for missing properties
  • Verify nullability handling
  • Look for literal vs widened types

"Property does not exist on type"

  • Add type guard before access
  • Check if property is optional
  • Verify union type narrowing

"Excessive type complexity"

  • Break into smaller types
  • Use intermediate type aliases
  • Consider simplifying generics

平台分布

Claude Code

30.96%
按下载量换算75

OpenCode

24.2%
按下载量换算59

Antigravity

18.19%
按下载量换算44

trae

12.98%
按下载量换算32

Cursor

7.89%
按下载量换算19

Gemini CLI

3.88%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills