
Typescript
Enforces LobeHub's opinionated TypeScript conventions automatically when you touch any .ts or .tsx file. You'll get nudges toward interface over type for object shapes, Record<PropertyKey, unknown> instead of any, separate type imports (not inline), and @ts-expect-error with explanations instead of @ts-ignore. It also pushes async/await with Promise.all, named exports over default, and crucially, forbids silent .catch(() => fallback) blocks that swallow errors. The guide is very specific about module augmentation patterns and where to declare extensible metadata fields. If you're joining a codebase with strong style opinions or want to stop debating the same type decisions in PR reviews, this codifies the answers.
- skills.sh installs
- 1.4K
- GitHub stars
- 79.8K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add lobehub/lobe-chat --skill typescript --agent claude-codeInstalls into .claude/skills of the current project.
Files
TypeScript Code Style Guide
Types and Type Safety
- Avoid explicit type annotations when TypeScript can infer
- Avoid implicitly
any; explicitly type when necessary - Use accurate types: prefer
Record<PropertyKey, unknown>overobjectorany - Prefer
interfacefor object shapes (e.g., React props); usetypefor unions/intersections - Prefer
as const satisfies XyzInterfaceover plainas const - Prefer
@ts-expect-errorover@ts-ignoreoveras any - Avoid meaningless null/undefined parameters; design strict function contracts
- Prefer ES module augmentation (
declare module '...') overnamespace; do not introducenamespace-based extension patterns - When a type needs extensibility, expose a small mergeable interface at the source type and let each feature/plugin augment it locally instead of centralizing all extension fields in one registry file
- For package-local extensibility patterns like
PipelineContext.metadata, define the metadata fields next to the processor/provider/plugin that reads or writes them
Async Patterns
Sponsors
Details
- Repository
- github.com/lobehub/lobe-chat
- First seen
- May 16, 2026