typescript-skills
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTypeScript 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, | |
| provider, SDK, API, request, response, generated types, mapper, mapping, transform, translator, anti-corruption layer | |
| dependency construction, factories, lifecycle, singletons, runtime selection | |
| env, config parsing, defaults, typed config exposure, config migration | |
| logging, tracing, OpenTelemetry, X-Ray, actionable diagnostics, branch observability | |
| secrets, crypto choices, redaction, credentials, secret sources | |
| tests, characterization, boundary contracts, brittle assertions, config tests | |
| throw vs return, Result type, retryable, error classification, error contract, custom Error subclass, swallowed fallback after error, error factory/helper missing required metadata/context | |
| |
| 如果任务涉及... | 打开 |
|---|---|
命名、抽象、类、切换、本地推理、 | |
| 提供者、SDK、API、请求、响应、生成类型、映射器、转换、转换器、防腐层 | |
| 依赖构建、工厂、生命周期、单例、运行时选择 | |
| 环境变量、配置解析、默认值、类型化配置暴露、配置迁移 | |
| 日志、追踪、OpenTelemetry、X-Ray、可操作诊断、分支可观测性 | |
| 密钥、加密选择、脱敏、凭证、密钥来源 | |
| 测试、特性描述、边界契约、脆弱断言、配置测试 | |
| 抛出vs返回、Result类型、可重试、错误分类、错误契约、自定义Error子类、错误后吞入回退、错误工厂/助手缺少必要元数据/上下文 | |
| |
Tie-breakers
平局裁决
| Situation | Primary | Secondary |
|---|---|---|
| Provider response shape enters business logic | | |
| Provider selection happens at startup | | |
| Secret source pointer appears in config | | |
| Config parsing needs tests | | |
| Broad app/framework config enters feature modules | | |
| Secret-bearing log or trace attributes | | |
| Refactor before behavior change | | relevant design skill |
| Local model name comes from provider data | | |
| Factory or singleton choice affects tests | | |
| OpenTelemetry/X-Ray setup or exporter lifecycle | | |
| | |
| | |
Stage-conditional resource selection ( | | |
| Function may fail and caller has multiple branches | | |
| Retry loop retries everything including 4xx | | |
| Handler returns library/SDK error shape directly to client | | |
Sequential | | — |
500 IDs in | | — |
| | — |
Resource leaks on error, missing | | — |
SIGTERM/SIGKILL kills mid-request, no graceful shutdown, swallowed | | |
Missing | | |
| Retry loop with constant sleep / no jitter / no Retry-After | | |
| error factory/helper has too many optional fields and important metadata/context keeps getting forgotten | | |
| | |
| 场景 | 核心技能 | 次要技能 |
|---|---|---|
| 提供者响应结构进入业务逻辑 | | |
| 提供者选择在启动时进行 | | |
| 配置中出现密钥来源指针 | | |
| 配置解析需要测试 | | |
| 宽泛的应用/框架配置进入功能模块 | | |
| 日志或追踪属性包含密钥 | | |
| 行为变更前的重构 | | 相关设计技能 |
| 本地模型名称来自提供者数据 | | |
| 工厂或单例选择影响测试 | | |
| OpenTelemetry/X-Ray设置或导出器生命周期 | | |
对 | | |
代码中存在 | | |
基于阶段的资源选择( | | |
| 函数可能失败且调用方有多分支 | | |
| 重试循环重试所有请求包括4xx | | |
| 处理器直接将库/SDK错误结构返回给客户端 | | |
顺序 | | — |
| | — |
| | — |
错误时资源泄漏,缺少 | | — |
SIGTERM/SIGKILL在请求中途终止进程,无优雅关闭,吞入 | | |
缺少 | | |
| 重试循环使用固定休眠/无抖动/无Retry-After | | |
| 错误工厂/助手有太多可选字段,重要元数据/上下文常被遗漏 | | |
| | |
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 and .
references/ownership.mdreferences/authoring-checklist.md以聚焦型技能作为权威来源。本路由仅用于选择起始点。
关于主题归属和编写规则,请查看和。
references/ownership.mdreferences/authoring-checklist.md