typescript

Enforce TypeScript type-safety and code style across .ts, .tsx, and .mts files.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/kingheu0818-sketch/lobehub_yu --skill typescript-kingheu0818-sketch
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/kingheu0818-sketch/lobehub_yu/tree/main/.agents/skills/typescript
Command: npx skills add https://github.com/kingheu0818-sketch/lobehub_yu --skill typescript-kingheu0818-sketch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

LobeHub’s TypeScript codebase can degrade over time without consistent type-safety practices, leading to unsafe casts, untyped values, brittle APIs, and harder-to-debug runtime issues.

Core Features & Use Cases

  • Type safety conventions: prefer well-scoped type/interface, use Record<PropertyKey, unknown> instead of any/object, and apply as const satisfies for safer literal typing.
  • Error-handling and safety: use @ts-expect-error instead of suppressing with @ts-ignore, and avoid silent fallbacks via .catch(() => fallback).
  • Maintainable architecture patterns: favor ES module augmentation (declare module) over namespace, and design extensible metadata patterns alongside the code that consumes/produces them (e.g., PipelineContext.metadata).
  • Team-wide consistency: standardize import rules (separate type imports), concurrency with Promise.all, and code structure preferences that improve readability and reduce refactor drift.

Quick Start

Ask an AI to review a changed .ts or .tsx file and flag any violations of LobeHub’s TypeScript type-safety, import, and error-handling rules.

Frequently Asked Questions about typescript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce TypeScript type-safety and prevent unsafe casts in my codebase?▼

To enforce TypeScript type-safety, apply guarded typing patterns like `Record<PropertyKey, unknown>` and `as const satisfies`, and review `.ts` or `.tsx` files to flag and fix problematic `any` usage or unsafe casts.

What is the best way to handle TypeScript error suppression without degrading maintainability?▼

The best way to handle TypeScript error suppression is to use strict `@ts-expect-error` annotations instead of `@ts-ignore`, and avoid silent fallbacks via `.catch(() => fallback)` to ensure maintainable and debuggable code.

How do I standardize TypeScript imports and async patterns for team-wide consistency?▼

To standardize TypeScript imports and async patterns, use separate type imports with `import type` and manage concurrency safely using `async`/`await` combined with `Promise.all` for predictable code structure.

Does this TypeScript review approach support extensible metadata and module augmentation?▼

Yes, this approach supports extensible metadata by designing patterns alongside consuming code, and favors ES module augmentation using `declare module` over namespaces for maintainable architecture.

When do I need to choose between `interface` and `type` in TypeScript?▼

You need to choose between `interface` and `type` during edits and refactors by applying consistent type-safety conventions, using well-scoped definitions based on metadata extensibility requirements.