Skip to main content

typescript

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

Informações da origem

Repositório
ilude/dotfiles
Última atividade na origem
12 de setembro de 2026 às 02:22
Idioma detectado do SKILL.md
inglês
Estrelas
4
Forks
1

Opções de instalação

Por padrão, está selecionado o prompt que primeiro revisa a origem. Você pode mudar para um comando direto ou baixar uma cópia local.

Revise os arquivos de origem

Leia o SKILL.md e os arquivos complementares exibidos pelo SkillsMP antes de decidir se vai instalar.

Exibindo SKILL.md

SKILL.md
Instruções da origem · Visualização somente leitura
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.
Ver no GitHub