← スキル一覧に戻る

typescript
by aster-void
Everything has been nixified.
⭐ 1🍴 0📅 2026年1月25日
SKILL.md
name: typescript description: Write type-safe TypeScript. Use when writing or reviewing TypeScript code. Covers type safety best practices, avoiding dangerous features (any/as), and proper narrowing techniques.
TypeScript
Checklist
- No
any- Useunknownand validate with valibot - No
as- Fix types at source - No
!- Explicit checks instead - NO
value is T- Use a validator library like valibot instead - Discriminated unions - Add
typefield to narrow
Good Practices
as const- For literal types onlyvalue satisfies T- Type-checks value without changing its type (safe, unlikeis T)- Builtin narrowing -
typeof,Array.isArray,in,instanceofare always safe T extends SomeTypeif T is required to have some traitfoo?.bar- Use?.for safe property access- Tagged unions -
type User = { role: "admin"; permissions: string[] } | { role: "guest"; expiresAt: Date }then narrow withif (user.role === "admin") - When refactoring - Fix ONE type error at a time (type inference changes)
- Const string unions -
type Status = "pending" | "active" | "done"instead of enums
When Stuck - NEVER Give Up
IMPORTANT: Every time you encounter a type error, repeat this checklist in your response before attempting a fix.
When you're stuck and considering any or as, STOP:
- Read the library's documentation - Most type issues come from misunderstanding the library API
- Search GitHub issues (library repo) - Someone likely faced the same problem
- Read error message more carefully
- Use valibot to validate (if the type is unknown at runtime)
- Ask the user
any and as are admitting defeat. Always use choose another method.
スコア
総合スコア
40/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です