Skip to main content

typescript

Write or review TypeScript and JavaScript, especially typed object construction, runtime boundaries, modules, async resources, package configuration, and tests.

ソース情報

リポジトリ
ilude/dotfiles
ソースの最終更新活動
2026年9月12日 02:22
検出された SKILL.md の言語
英語
スター
4
フォーク
1

インストール方法

デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。

ソースファイルを確認

インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。

SKILL.md を表示中

SKILL.md
ソースの指示 · 読み取り専用プレビュー
name
typescript
description
Write or review TypeScript and JavaScript, especially typed object construction, runtime boundaries, modules, async resources, package configuration, and tests.
# TypeScript and JavaScript Identify the owning package from its manifest, lockfile, scripts, and compiler configuration. Use its configured package manager, module format, formatter, linter, typecheck, and test runner. ## Type safety - Do not use `any` when `unknown`, a generic, or a specific type works. Narrow `unknown` before use. - Do not use a type assertion merely to silence an error. Assertions neither validate nor transform values. - Prefer a typed declaration over an object-literal assertion. Use `satisfies` when checking an object while preserving its inferred type. - At RPC, serialization, persistence, subprocess, and public API boundaries, explicitly construct the boundary type. Do not spread a broader internal object and assert it to a narrower type. ```ts // Checks and transmits only the declared contract. const request: Request = { id: input.id, prompt, }; ``` ## Runtime boundaries - Static types disappear at runtime. Validate untrusted files, environment values, decoded JSON, and network responses. - Keep runtime dependencies separate from serializable data. Treat serialized shape as an explicit contract and test which fields cross it. - Preserve public types, serialization, and error behavior unless the request changes that contract. ## Modules and resources - Preserve the package's ESM/CJS mode, exports, runtime resolution, and supported import paths. Test the actual entry path when these change. - Keep exports minimal and avoid mutable exported state. - Make ownership and cleanup explicit for processes, sockets, timers, subscriptions, file handles, and temporary state. Use `finally` or the package's teardown mechanism. - Keep dependency and external failures visible. Do not hide them with broad catches or silent fallbacks. ## Checks - Read test scripts before passing filters or options. - Run the smallest configured typecheck and focused tests that can falsify the change. - Test observable behavior at the relevant runtime boundary. A typecheck alone does not prove validation, serialization, module resolution, or cleanup behavior.
GitHubで見る