Skip to content
Back to skills

Add Typescript Best Practices

ASecurity

Setup TypeScript best practices and code style rules in CLAUDE.md

  • 11 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 10, 2026
developmenttypescriptgo

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add luokai0/ai-agent-skills-by-luo-kai --skill add-typescript-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Add Typescript Best Practices?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Add Typescript Best Practices
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/luokai0-add-typescript-best-practices/badge)](https://www.skillsdirectory.com/skills/luokai0-add-typescript-best-practices)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
author: luo-kai
name: tech-stack:add-typescript-best-practices
description: Setup TypeScript best practices and code style rules in CLAUDE.md
argument-hint: Optional argument which practices to add or avoid
---

# Setup TypeScript Best Practices

Create or update CLAUDE.md in with following content, <critical>write it strictly as it is<critical>, do not summaraise or introduce and new additional information:

```markdown
## Code Style Rules

### General Principles

- **TypeScript**: All code must be strictly typed, leverage TypeScript's type safety features

### Code style rules

- Interfaces over types - use interfaces for object types
- Use enum for constant values, prefer them over string literals
- Export all types by default
- Use type guards instead of type assertions

### Best Practices

#### Library-First Approach

- Common areas where libraries should be preferred:
  - Date/time manipulation → date-fns, dayjs
  - Form validation → joi, yup, zod
  - HTTP requests → axios, got
  - State management → Redux, MobX, Zustand
  - Utility functions → lodash, ramda

#### Code Quality

- Use destructuring of objects where possible:
  - Instead of `const name = user.name` use `const { name } = user`
  - Instead of `const result = await getUser(userId)` use `const { data: user } = await getUser(userId)`
  - Instead of `const parseData = (data) => data.name` use `const parseData = ({ name }) => name`
- Use `ms` package for time related configuration and environment variables, instead of multiplying numbers by 1000
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…