clean-typescript
1
总安装量
1
周安装量
#52495
全站排名
安装命令
npx skills add https://github.com/neversight/skills_feed --skill clean-typescript
Agent 安装分布
replit
1
amp
1
opencode
1
cursor
1
kimi-cli
1
codex
1
Skill 文档
Clean TypeScript
We use TypeScript as a correctness and clarity tool, not as ceremony. Types should reduce bugs and cognitive load.
Type Philosophy
- PREFER explicit, readable types over clever or overly generic ones
- AVOID
anyand unsafe type assertions - Use
unknowninstead ofanywhen necessary - Let TypeScript infer types when inference is clear and stable
Types & Interfaces
- PREFER
typealiases for most use cases - Use
interfaceprimarily for public, extendable object shapes - Keep types small, composable, and well-named
Functions & APIs
- PREFER explicit return types for public functions
- Avoid function overloads unless they meaningfully improve the API
- Keep function signatures simple and predictable
Nullability & Safety
- Handle
nullandundefinedexplicitly - DO NOT rely on non-null assertions (
!) except as a last resort - Prefer narrowing via control flow and guards
Enums & Constants
- AVOID
enum - PREFER union types or
as constobjects - Keep runtime output predictable and minimal
Error Handling
- Type errors and error states explicitly
- Prefer result objects or typed errors over throwing where appropriate
- Do not hide failure modes behind broad types
General Principles
- Types should explain intent
- If a type is hard to understand, itâs probably wrong
- Favor maintainability over theoretical completeness