Claude Code Plugins

Community-maintained marketplace

Feedback

type-parameters

@jasonkuhrt/dotfiles
1
0

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

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

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!