typescript-skills

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

TypeScript Skills Router

TypeScript技能路由

This skill routes TypeScript work to the smallest relevant focused skill. It is not the source of truth for design rules.
Default: open one primary skill first. Add secondary skills only when the task crosses a real boundary. Do not load every TypeScript skill by default.
本技能会将TypeScript相关工作路由到最相关的聚焦型技能。它并非设计规则的权威来源。
默认规则:先打开一个核心技能。仅当任务跨越实际边界时,再添加次要技能。默认不要加载所有TypeScript技能。

Open First

优先打开

If the task involves...Open
naming, abstractions, classes, cutovers, local reasoning,
!
,
as
, forced types
typescript-coding-standards/SKILL.md
provider, SDK, API, request, response, generated types, mapper, mapping, transform, translator, anti-corruption layer
typescript-boundaries/SKILL.md
dependency construction, factories, lifecycle, singletons, runtime selection
typescript-composition/SKILL.md
env, config parsing, defaults, typed config exposure, config migration
typescript-configs/SKILL.md
logging, tracing, OpenTelemetry, X-Ray, actionable diagnostics, branch observability
typescript-observability/SKILL.md
secrets, crypto choices, redaction, credentials, secret sources
typescript-security/SKILL.md
tests, characterization, boundary contracts, brittle assertions, config tests
typescript-testing/SKILL.md
throw vs return, Result type, retryable, error classification, error contract, custom Error subclass, swallowed fallback after error, error factory/helper missing required metadata/context
typescript-error-handling/SKILL.md
Promise.all
, sequential awaits, bounded concurrency, AbortSignal, cleanup, SIGTERM, graceful shutdown
typescript-async/SKILL.md
如果任务涉及...打开
命名、抽象、类、切换、本地推理、
!
as
、强制类型
typescript-coding-standards/SKILL.md
提供者、SDK、API、请求、响应、生成类型、映射器、转换、转换器、防腐层
typescript-boundaries/SKILL.md
依赖构建、工厂、生命周期、单例、运行时选择
typescript-composition/SKILL.md
环境变量、配置解析、默认值、类型化配置暴露、配置迁移
typescript-configs/SKILL.md
日志、追踪、OpenTelemetry、X-Ray、可操作诊断、分支可观测性
typescript-observability/SKILL.md
密钥、加密选择、脱敏、凭证、密钥来源
typescript-security/SKILL.md
测试、特性描述、边界契约、脆弱断言、配置测试
typescript-testing/SKILL.md
抛出vs返回、Result类型、可重试、错误分类、错误契约、自定义Error子类、错误后吞入回退、错误工厂/助手缺少必要元数据/上下文
typescript-error-handling/SKILL.md
Promise.all
、顺序await、有限并发、AbortSignal、清理、SIGTERM、优雅关闭
typescript-async/SKILL.md

Tie-breakers

平局裁决

SituationPrimarySecondary
Provider response shape enters business logic
typescript-boundaries
typescript-coding-standards
for naming
Provider selection happens at startup
typescript-composition
typescript-boundaries
if provider shapes cross inward
Secret source pointer appears in config
typescript-security
typescript-configs
for parsing/exposure
Config parsing needs tests
typescript-testing
typescript-configs
Broad app/framework config enters feature modules
typescript-configs
typescript-composition
if framework assembly is involved
Secret-bearing log or trace attributes
typescript-security
typescript-observability
for meaningful diagnostic shape
Refactor before behavior change
typescript-testing
relevant design skill
Local model name comes from provider data
typescript-boundaries
typescript-coding-standards
Factory or singleton choice affects tests
typescript-composition
typescript-testing
OpenTelemetry/X-Ray setup or exporter lifecycle
typescript-observability
typescript-composition
for construction/lifecycle
as
cast on
JSON.parse
, env, or unknown response
typescript-coding-standards
(hard-gate: no assertion)
typescript-configs
for the parser shape,
typescript-boundaries
if the data is HTTP/transport
localhost
/
sandbox
/
test-token
fallback in code
typescript-security
typescript-configs
only for non-secret behavior defaults
Stage-conditional resource selection (
stage === "prod" ? ... : ...
)
typescript-configs
(
feature-decisions.md
)
typescript-configs
(
validation-vs-verification.md
) for the explicit pointer
Function may fail and caller has multiple branches
typescript-error-handling
(
throw-vs-result.md
)
typescript-error-handling
(
error-shape-and-metadata.md
) for metadata consistency
Retry loop retries everything including 4xx
typescript-error-handling
(
error-classification.md
)
typescript-async
for the retry mechanism
Handler returns library/SDK error shape directly to client
typescript-error-handling
(
error-boundary-contract.md
)
typescript-boundaries
for the inbound side
Sequential
await
s where independent ops would parallelize
typescript-async
(
parallel-and-dependencies.md
)
500 IDs in
Promise.all
causing rate-limit
typescript-async
(
parallel-and-dependencies.md
— bounded concurrency)
fetch
without
signal:
and caller may walk away
typescript-async
(
cancellation-and-abort.md
)
Resource leaks on error, missing
finally
/
using
typescript-async
(
cleanup-and-teardown.md
)
SIGTERM/SIGKILL kills mid-request, no graceful shutdown, swallowed
unhandledRejection
typescript-async
(
process-lifecycle.md
)
typescript-observability
for flush before exit
Missing
errorId
, no stable
code
, support cannot correlate response to logs
typescript-error-handling
(
error-shape-and-metadata.md
)
typescript-observability
for log shape
Retry loop with constant sleep / no jitter / no Retry-After
typescript-async
(
retry-and-backoff.md
)
typescript-error-handling
for retryable classification
error factory/helper has too many optional fields and important metadata/context keeps getting forgotten
typescript-error-handling
(
define-app-error-semantics-early.md
)
typescript-coding-standards
for API/signature clarity
catch
returns fallback/default/skip with no log, span event, metric, or explicit error result
typescript-error-handling
(
error-boundary-contract.md
)
typescript-observability
for the signal shape
场景核心技能次要技能
提供者响应结构进入业务逻辑
typescript-boundaries
typescript-coding-standards
(用于命名)
提供者选择在启动时进行
typescript-composition
typescript-boundaries
(若提供者结构向内渗透)
配置中出现密钥来源指针
typescript-security
typescript-configs
(用于解析/暴露)
配置解析需要测试
typescript-testing
typescript-configs
宽泛的应用/框架配置进入功能模块
typescript-configs
typescript-composition
(若涉及框架组装)
日志或追踪属性包含密钥
typescript-security
typescript-observability
(用于有意义的诊断结构)
行为变更前的重构
typescript-testing
相关设计技能
本地模型名称来自提供者数据
typescript-boundaries
typescript-coding-standards
工厂或单例选择影响测试
typescript-composition
typescript-testing
OpenTelemetry/X-Ray设置或导出器生命周期
typescript-observability
typescript-composition
(用于构建/生命周期)
JSON.parse
、环境变量或未知响应使用
as
断言
typescript-coding-standards
(严格限制:禁止断言)
typescript-configs
(用于解析器结构),
typescript-boundaries
(若数据来自HTTP/传输层)
代码中存在
localhost
/
sandbox
/
test-token
回退
typescript-security
typescript-configs
(仅用于非密钥行为默认值)
基于阶段的资源选择(
stage === "prod" ? ... : ...
typescript-configs
feature-decisions.md
typescript-configs
validation-vs-verification.md
,用于显式指针)
函数可能失败且调用方有多分支
typescript-error-handling
throw-vs-result.md
typescript-error-handling
error-shape-and-metadata.md
,用于元数据一致性)
重试循环重试所有请求包括4xx
typescript-error-handling
error-classification.md
typescript-async
(用于重试机制)
处理器直接将库/SDK错误结构返回给客户端
typescript-error-handling
error-boundary-contract.md
typescript-boundaries
(用于入站侧)
顺序
await
可并行执行独立操作
typescript-async
parallel-and-dependencies.md
Promise.all
中包含500个ID导致速率限制
typescript-async
parallel-and-dependencies.md
— 有限并发)
fetch
未使用
signal:
且调用方可能中断
typescript-async
cancellation-and-abort.md
错误时资源泄漏,缺少
finally
/
using
typescript-async
cleanup-and-teardown.md
SIGTERM/SIGKILL在请求中途终止进程,无优雅关闭,吞入
unhandledRejection
typescript-async
process-lifecycle.md
typescript-observability
(用于退出前刷新)
缺少
errorId
,无稳定
code
,支持团队无法将响应与日志关联
typescript-error-handling
error-shape-and-metadata.md
typescript-observability
(用于日志结构)
重试循环使用固定休眠/无抖动/无Retry-After
typescript-async
retry-and-backoff.md
typescript-error-handling
(用于可重试分类)
错误工厂/助手有太多可选字段,重要元数据/上下文常被遗漏
typescript-error-handling
define-app-error-semantics-early.md
typescript-coding-standards
(用于API/签名清晰度)
catch
返回回退/默认值/跳过但无日志、span事件、指标或显式错误结果
typescript-error-handling
error-boundary-contract.md
typescript-observability
(用于信号结构)

Router Rule

路由规则

Use the focused skill as the source of truth. This router only chooses where to start.
For topic ownership and authoring rules, see
references/ownership.md
and
references/authoring-checklist.md
.
以聚焦型技能作为权威来源。本路由仅用于选择起始点。
关于主题归属和编写规则,请查看
references/ownership.md
references/authoring-checklist.md