Agent skill
code-review-ts
TypeScript-specific code review guidelines focusing on type safety and TypeScript idioms
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/code-review-ts
SKILL.md
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,instanceof) when the type is known or enforced by TypeScript. - 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
The reviewer MUST:
- Reject
anyunless it is a last-resort boundary with clear justification. - Require immediate narrowing of
unknownwith explicit type guards.
The reviewer SHOULD:
- Prefer generics,
satisfies, and well-scoped interfaces overany.
Type Casting Must Be Justified
The reviewer MUST:
- Require a comment or invariant when using
as, non-null assertions (!), or unsafe casts. - Prefer
satisfiesor type guards before asserting a type.
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
readonlyfor immutable data - Use discriminated unions over type assertions
- Prefer
unknownoveranyfor external data - Use template literal types where appropriate
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?