cgw-best-practices
Use before writing or changing TypeScript in safe-client-gateway PRODUCTION code (src/, excluding spec files) - the cross-cutting dos and don'ts that no domain guide owns and biome does not fully catch. Covers parse-don't-assert (no `as X` or `as unknown as X` on data whose shape the compiler cannot guarantee), no `any` and no @ts-ignore/@ts-expect-error, no non-null assertions, `import type` for type-only imports (with the Symbol-DI-token exception), ILoggingService instead of console.*, no silently swallowed errors in a catch block, `private readonly` injected dependencies, explicit return types on exported methods, and named constants over inline magic values. Triggers on any production TypeScript edit, plus "type error", "cast", "as unknown", "as any", "catch block", "console.log", "magic number". For casts inside a spec file load cgw-testing and cgw-remarks instead - the test-mock cast idiom is the one sanctioned exception and those two own it.
来源信息
- 仓库
- safe-global/safe-client-gateway
- 最近来源活动
- 2026年8月7日 12:46
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 50
- 分支
- 102
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。