·typescript-satisfies-operator
</>

typescript-satisfies-operator

flpbalada/my-opencode-config

指导正确使用 TypeScript 的满足运算符与类型注释。在类型注释(冒号)和满足之间做出决定、在保留文字类型的同时验证对象形状或解决类型推断问题时,请使用此技能。

0安装·0热度·@flpbalada

安装

$npx skills add https://github.com/flpbalada/my-opencode-config --skill typescript-satisfies-operator

SKILL.md

The satisfies operator validates that an expression matches a type without changing the inferred type. This is different from type annotations (:) which widen the type.

| Annotation Style | Type vs Value | Use Case |

| : Type (colon) | Type wins | Need wider type for reassignment | | satisfies Type | Value wins | Need validation + narrow inference | | as Type | Lies to TS | Escape hatch (use sparingly!) | | No annotation | Inference | Most common - let TS infer |

指导正确使用 TypeScript 的满足运算符与类型注释。在类型注释(冒号)和满足之间做出决定、在保留文字类型的同时验证对象形状或解决类型推断问题时,请使用此技能。 来源:flpbalada/my-opencode-config。

查看原文

可引用信息

为搜索与 AI 引用准备的稳定字段与命令。

安装命令
npx skills add https://github.com/flpbalada/my-opencode-config --skill typescript-satisfies-operator
分类
</>开发工具
认证
收录时间
2026-02-01
更新时间
2026-02-18

快速解答

什么是 typescript-satisfies-operator?

指导正确使用 TypeScript 的满足运算符与类型注释。在类型注释(冒号)和满足之间做出决定、在保留文字类型的同时验证对象形状或解决类型推断问题时,请使用此技能。 来源:flpbalada/my-opencode-config。

如何安装 typescript-satisfies-operator?

打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/flpbalada/my-opencode-config --skill typescript-satisfies-operator 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用

这个 Skill 的源码在哪?

https://github.com/flpbalada/my-opencode-config