Claude-skill-registry code-review-ts
TypeScript-specific code review guidelines focusing on type safety and TypeScript idioms
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/code-review-ts" ~/.claude/skills/majiayu000-claude-skill-registry-code-review-ts && rm -rf "$T"
manifest:
skills/data/code-review-ts/SKILL.mdsource content
TypeScript Code Review
Includes all guidelines from code-review skill, plus TypeScript-specific rules.
Prefer Strong Types; Avoid Type Inspection on Known Types
The reviewer MUST:
- Avoid runtime type inspection (
,typeof
) when the type is known or enforced by TypeScript.instanceof - Restrict runtime checks to untyped inputs or boundary validation (e.g., API payloads).
Discouraged:
function labelCount(count: number) { if (typeof count === "number") return `${count} items`; return "n/a"; }
Avoid any
and unknown
When Possible
anyunknownThe reviewer MUST:
- Reject
unless it is a last-resort boundary with clear justification.any - Require immediate narrowing of
with explicit type guards.unknown
The reviewer SHOULD:
- Prefer generics,
, and well-scoped interfaces oversatisfies
.any
Type Casting Must Be Justified
The reviewer MUST:
- Require a comment or invariant when using
, non-null assertions (as
), or unsafe casts.! - Prefer
or type guards before asserting a type.satisfies
Acceptable with proof:
const payload = parse(input) as Payload; // validated by parse schema
Additional TypeScript Guidelines
The reviewer SHOULD:
- Encourage use of strict TypeScript compiler options
- Prefer
for immutable datareadonly - Use discriminated unions over type assertions
- Prefer
overunknown
for external dataany - Use template literal types where appropriate