typescript-strict
Enforce strict TypeScript standards
こちらからも入手できます: Doyajin174
TypeScript projects often suffer from implicit any types and loose error handling. This skill provides clear rules and examples for writing type-safe, production-ready TypeScript code that prevents runtime errors.
スキルZIPをダウンロード
Claudeでアップロード
設定 → 機能 → スキル → スキルをアップロードへ移動
オンにして利用開始
テストする
「typescript-strict」を使用しています。 Write a function that processes user data with proper error handling
期待される結果:
- Use unknown instead of any for input parameters
- Add explicit return type: Promise<User | null>
- Type catch block errors with instanceof checks
- Use discriminated union for result: { success: true, data: T } | { success: false, error: string }
- Add null check before accessing optional properties
「typescript-strict」を使用しています。 Create a type-safe API response handler
期待される結果:
- Define discriminated union for success and error states
- Use exhaustive type checking with switch statements
- Validate external data with type guards
- Add explicit return type annotations
- Handle unknown errors with proper typing
セキュリティ監査
安全This skill contains only markdown documentation with TypeScript code examples. All 31 static findings are false positives: template literal backticks were misidentified as shell execution, base64 hashes were flagged as crypto, and code examples were misidentified as reconnaissance. Pure documentation skill with zero risk.
リスク要因
🌐 ネットワークアクセス (1)
品質スコア
作れるもの
Enforce Team Coding Standards
Ensure all team members follow consistent TypeScript patterns for better maintainability.
Generate Type-Safe Code
Guide AI tools to produce TypeScript code with proper types and error handling.
Review TypeScript PRs
Quickly identify violations of TypeScript best practices during code reviews.
これらのプロンプトを試す
Write a TypeScript function called fetchUser that takes a user ID and returns user data. Use strict types and proper error handling.
Refactor this function to remove all any types. Use unknown with type guards where appropriate.
Add proper error handling to this function. Use discriminated unions for success and failure cases.
Review this TypeScript code for strict mode compliance. Identify any violations of the rules and suggest fixes.
ベストプラクティス
- Always use unknown instead of any and validate with type guards before use
- Explicitly type all function signatures including return types for public APIs
- Handle errors with proper typing using instanceof checks or type predicates
回避
- Using any to silence TypeScript errors instead of properly typing the data
- Non-null assertions to bypass strict null checks without proper null handling
- Swallowing errors with empty catch blocks or generic console.log without proper error typing
よくある質問
Does this skill work with all TypeScript versions?
Can I use this with JavaScript projects?
How does this integrate with my IDE?
Does this skill store any data?
How is this different from ESLint?
Should I follow these rules in legacy code?
開発者の詳細
ライセンス
MIT
リポジトリ
https://github.com/Barnhardt-Enterprises-Inc/quetrex-claude/tree/main/skills/typescript-strict参照
main
ファイル構成
📄 SKILL.md