2428424081cn/skill-mcp/typescript-strict-guard
Claude Code and agent skill by 2428424081cn/skill-mcp
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install 2428424081cn/skill-mcp/typescript-strict-guardSKILL.md
The same SKILL.md was published earlier as 2428424081cn/skill-mcp/typescript-strict-guard.
TypeScript 严格类型防御准则
在生成任何 TypeScript 代码时,AI 必须严格执行零妥协(Zero-Tolerance)类型安全规则。
一、 铁律(Zero Tolerance)
- 严禁 `any`:绝对禁止直接或间接使用
any。未知数据必须使用unknown并通过 Type Guard / Zod 校验收窄。 - 严禁不安全断言:禁止使用
as unknown as T或随意使用非空断言!(除非能严格证明其前置不变式)。 - 强制导出显式返回类型:所有导出的函数、类方法必须显式标注返回类型,严禁依赖隐式推导。
- 不可变数据优先:对象数组参数优先标注
readonly T[]或Readonly<T>,禁止在函数内直接 mutate 入参。
二、 核心设计模式要求
- Discriminated Unions(可辨识联合):状态模型必须通过唯一的
kind/status/type字段进行状态分支隔离。 - `satisfies` 优于类型标注:在需要保留字面量类型且满足契约时,优先使用
satisfies操作符。
三、 范例对比
- ❌ 反例:
- ✅ 正例:
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/dev/typescript-strict-guard/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/2428424081cn/skill-mcp/typescript-strict-guard)