typescript

Provide TypeScript style and type-safety guidelines for code quality.

Updated Jul 5, 2026
One-click install
npx skills add https://github.com/xkl2013/lobe --skill typescript-xkl2013
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/xkl2013/lobe/tree/main/.agents/skills/typescript
Command: npx skills add https://github.com/xkl2013/lobe --skill typescript-xkl2013

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps developers adhere to TypeScript best practices, ensuring code quality and type safety.

Core Features & Use Cases

  • TypeScript Best Practices: Offers guidelines on type inference, avoiding any/object, and interface vs type usage.
  • Async Patterns: Provides recommendations for using async/await and promise-based APIs.
  • Imports: Offers guidelines on type imports, alphabetical sorting, and separation of type and value imports.
  • Code Structure: Suggests object destructuring, descriptive naming, and the use of named exports.
  • UI and Theming: Recommends using @lobehub/ui and Ant Design components for UI development.
  • Performance: Encourages reusing existing utilities and querying only required database columns.
  • Time Consistency: Suggests assigning Date.now() to a constant for consistency.
  • Logging: Offers guidelines on avoiding logging user private information and using console.error in catch blocks.
  • Use Case: Ideal for developers working on TypeScript projects, aiming to improve code quality and maintain type safety.

Quick Start

Apply the TypeScript style guide to your project to ensure consistent coding standards and type safety.

Frequently Asked Questions about typescript

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

FAQPage Schema
What are the best practices for TypeScript type safety and code structure?

TypeScript best practices include leveraging type inference, avoiding any and object types, using object destructuring, and defining descriptive names with named exports to improve code maintainability.

How do I handle async patterns and promise-based APIs in TypeScript?

Handle async patterns in TypeScript by using async/await syntax and properly typing promise-based APIs to ensure type safety throughout asynchronous code execution and error catching.

Should I separate type imports from value imports in TypeScript?

Separating type imports from value imports is a recommended TypeScript guideline to optimize code structure, alongside alphabetically sorting imports to maintain consistent coding standards.

Does this TypeScript style guide require specific UI component libraries?

The TypeScript style guide recommends using @lobehub/ui and Ant Design components for UI development, but requires existing TypeScript knowledge and familiarity with your project structure to apply effectively.

What's the best way to ensure time consistency and safe logging in TypeScript?

Ensure time consistency by assigning Date.now() to a constant variable, and maintain safe logging by using console.error in catch blocks while strictly avoiding logging user private information.