mcpField
T
tech-stack:add-typescript-best-practices

tech-stack:add-typescript-best-practices

github.com/neolabhq開発1.8k440 回インストール10 週間前に更新
リポジトリ

tech-stack:add-typescript-best-practices について

指定された TypeScript のベストプラクティスをそのまま記載し、CLAUDE.md を作成または更新する Claude スキルです。内容を要約・追加せずにルールを記録したいプロジェクト向けです。

主な機能

  1. 01CLAUDE.md の作成・更新
  2. 02指定内容の逐語的な記載
  3. 03TypeScript コード規則の記録

活用シーン

  1. 01プロジェクトへの TypeScript 規則追加
  2. 02既存 CLAUDE.md のガイド更新

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/neolabhq/context-engineering-kit --skill tech-stack:add-typescript-best-practices

インストール後、Claude Code で/tech-stack:add-typescript-best-practicesを入力して読み込まれたか確認します。

詳細

TypeScript のベストプラクティスをセットアップする

以下の内容で CLAUDE.md を作成または更新してください。厳密にそのまま記述してください、要約したり、新たな情報を追加したりしないでください:

## Code Style Rules

### General Principles

- **TypeScript**: All code must be strictly typed, leverage TypeScript's type safety features

### Code style rules

- Interfaces over types - use interfaces for object types
- Use enum for constant values, prefer them over string literals
- Export all types by default
- Use type guards instead of type assertions

### Best Practices

#### Library-First Approach

- Common areas where libraries should be preferred:
  - Date/time manipulation → date-fns, dayjs
  - Form validation → joi, yup, zod
  - HTTP requests → axios, got
  - State management → Redux, MobX, Zustand
  - Utility functions → lodash, ramda

#### Code Quality

- Use destructuring of objects where possible:
  - Instead of `const name = user.name` use `const { name } = user`
  - Instead of `const result = await getUser(userId)` use `const { data: user } = await getUser(userId)`
  - Instead of `const parseData = (data) => data.name` use `const parseData = ({ name }) => name`
- Use `ms` package for time related configuration and environment variables, instead of multiplying numbers by 1000

コメント