Back to list
jasonkuhrt

type-parameters

by jasonkuhrt

Tool configurations

1🍴 0📅 Jan 22, 2026

SKILL.md


name: type-parameters description: Type parameter naming conventions for personal TypeScript projects. Triggers on generic type/function creation, type-level code, or when asking about TypeScript generics.

Type Parameter Naming

Convention

  • Type aliases and interfaces: Use $ prefix

    • type Transform<$Input> = $Input extends string ? number : boolean
    • interface Container<$T> { value: $T }
  • Functions and methods: Use $ prefix matching the value parameter name

    • function process<$value>(value: $value): $value
    • function map<$item, $result>(item: $item, fn: ($item) => $result): $result
  • Type guard exception: Add _ suffix to avoid conflict with narrowed type

    • function isString<$value_>(value: unknown): value is $value_
  • Generic returns exception: When type param is NOT mapped to value parameter

    • function create<$T>(): $T
  • Utility internals: Parameters with ___ prefix are implementation details

    • type Utility<$T, ___Internal = SomeDefault<$T>> = ...
  • Mapped types: Use specific single-letter iterators

    • Objects: k (key) - { [k in keyof $T]: $T[k] }
    • Tuples/arrays: i (index) - { [i in keyof $T]: Transform<$T[i]> }
  • Infer clauses: Use __lowercase__ pattern

    • $T extends Array<infer __element__> ? __element__ : never

Type Parameter Defaults

Default type parameters to their widest possible variant:

// GOOD - Defaults to widest
type ParserContext<
  $Schema = Schema | undefined,
  $SDDM = any,
  $TypeHooks = never
> = ...

// Usage with clean constraints
function parse<$Context extends ParserContext>(...) // Clean!

// BAD - Cluttered constraint
function parse<$Context extends ParserContext<any, any, any>>(...) // Ugly!

Score

Total Score

55/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon