スキル一覧に戻る
channingwalton

typescript-development

by channingwalton

3🍴 0📅 2026年1月22日
GitHubで見るManusで実行

SKILL.md


name: TypeScript Development description: Senior TypeScript developer using functional programming patterns. Use when writing TypeScript code, implementing features, or working with Node.js/Deno/Bun projects. Used as a part of the XP skill.

TypeScript Development

Principles

  • Functional programming techniques
  • Strict type safety (strict: true in tsconfig)
  • Avoid any, null, and unsafe patterns
  • Prefer immutable data (readonly, as const)
  • Use ADTs for domain modelling (discriminated unions)
  • Errors as values (Result pattern, Effect, neverthrow)
  • Prefer pure functions over side effects

Functional Patterns

Transform with map:

// ❌ Imperative
const results: Output[] = []
for (const item of items) {
  results.push(transform(item))
}

// ✅ Functional
const results = items.map(transform)

Pipeline with reduce:

const pipeline = <T>(...fns: Array<(x: T) => T>) =>
  (initial: T): T =>
    fns.reduce((acc, fn) => fn(acc), initial)

Option type for nullable values:

type Option<T> = T | undefined

const map = <T, U>(opt: Option<T>, fn: (t: T) => U): Option<U> =>
  opt !== undefined ? fn(opt) : undefined

const getOrElse = <T>(opt: Option<T>, defaultValue: T): T =>
  opt !== undefined ? opt : defaultValue

Error Handling

Result pattern:

type ParseError = { message: string; line: number }

const parse = (input: string): Result<Value, ParseError> => {
  try {
    return ok(JSON.parse(input))
  } catch (e) {
    return err({ message: String(e), line: 0 })
  }
}

// Pattern match on result
const handle = (result: Result<Value, ParseError>) => {
  switch (result._tag) {
    case 'Ok':
      return processValue(result.value)
    case 'Err':
      return handleError(result.error)
  }
}

Common Libraries

  • Effect - Typed functional effects
  • zod - Schema validation
  • neverthrow - Result type
  • fp-ts - Functional programming utilities
  • tsx - TypeScript execution

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

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

+20
LICENSE

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

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

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

0/5
Issue管理

オープンIssueが50未満

+5
言語

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

+5
タグ

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

0/5

レビュー

💬

レビュー機能は近日公開予定です