learn
免费Extract reusable patterns from non-trivial work in the is-kit repository and store them as project knowledge. Use after meaningful API design, type-system work, debugging, or compatibility discoveries.
中文简介正在准备中。当前显示原文说明。
Create, compose, migrate, and review TypeScript runtime type guards with is-kit. Use when adding reusable guards; replacing typeof, null checks, or handwritten type predicates; narrowing unknown values; validating JSON or API responses; building collection or object schemas with struct or typedStruct; or reviewing existing is-kit usage. Do not use for one-off environment checks or validation that requires data transformation or rich error reporting.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Build runtime checks that preserve TypeScript control-flow narrowing without inventing project architecture or duplicating guards that already exist.
is-kit version from the package manifest and lockfile.Do not add a wrapper layer merely because this skill mentions one. If the
project already has an is-kit boundary, respect it; otherwise import from
is-kit directly.
Read guard-selection.md when choosing between built-ins, logical combinators, custom predicates, equality guards, and collection combinators.
For object or API response validation, always read
object-validation.md before choosing
struct, typedStruct, optionalKey, or safeParse.
For replacement or cleanup work, read migration-checklist.md before changing manual checks.
Prefer composition over a handwritten type-predicate signature. Keep guards total, deterministic, and side-effect free.
Avoid creating a global guard from a one-off payload projection. Avoid moving domain knowledge into a generic guard module.
unknown.as assertion when the new guard makes it unnecessary.safeParse when the success branch consumes the validated value; call a
guard directly when only a boolean decision is needed.Add focused tests using the project's existing test tools:
Run the narrowest relevant test, typecheck, lint, and formatting commands. Inspect the final diff for unrelated formatting or generated-file changes.
typeof window === 'undefined' merely for stylistic consistency.is-kit unless the task requires an API unavailable in the
installed version or the user requests the upgrade.还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Extract reusable patterns from non-trivial work in the is-kit repository and store them as project knowledge. Use after meaningful API design, type-system work, debugging, or compatibility discoveries.
中文简介正在准备中。当前显示原文说明。
Run Prettier for the is-kit repository. Use when asked to format or check formatting in this project. Always consult AGENTS.md in the repo root before executing commands.
中文简介正在准备中。当前显示原文说明。