tech-stack:add-typescript-best-practices

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

23 stars

Best use case

tech-stack:add-typescript-best-practices is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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

Teams using tech-stack:add-typescript-best-practices should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/add-typescript-best-practices/SKILL.md --create-dirs "https://raw.githubusercontent.com/christophacham/agent-skills-library/main/skills/programming/add-typescript-best-practices/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/add-typescript-best-practices/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How tech-stack:add-typescript-best-practices Compares

Feature / Agenttech-stack:add-typescript-best-practicesStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 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
```

Related Skills

best-practices

23
from christophacham/agent-skills-library

Apply modern web development best practices for security, compatibility, and code quality. Use when asked to "apply best practices", "security audit", "modernize code", "code quality review", or "check for vulnerabilities". Do NOT use for accessibility (use web-accessibility), SEO (use seo), performance (use core-web-vitals), or comprehensive multi-area audits (use web-quality-audit).

security-best-practices

23
from christophacham/agent-skills-library

Perform language and framework specific security best-practice reviews and suggest improvements. Use when the user explicitly requests security best practices guidance, a security review or report, or secure-by-default coding help. Supports Python, JavaScript/TypeScript, and Go. Do NOT use for general code review, debugging, threat modeling (use security-threat-model), or non-security tasks.

api-security-best-practices

23
from christophacham/agent-skills-library

Implement secure API design patterns including authentication, authorization, input validation, rate limiting, and protection against common API vulnerabilities

anti-reversing-techniques

23
from christophacham/agent-skills-library

Understand anti-reversing, obfuscation, and protection techniques encountered during software analysis. Use when analyzing protected binaries, bypassing anti-debugging for authorized analysis, or u...

typescript

23
from christophacham/agent-skills-library

TypeScript strict patterns and best practices. Trigger: When writing TypeScript code - types, interfaces, generics.

typescript-pro

23
from christophacham/agent-skills-library

Master TypeScript with advanced types, generics, and strict type safety. Handles complex type systems, decorators, and enterprise-grade patterns.

typescript-expert

23
from christophacham/agent-skills-library

TypeScript and JavaScript expert with deep knowledge of type-level programming, performance optimization, monorepo management, migration strategies, and modern tooling.

typescript-advanced-types

23
from christophacham/agent-skills-library

Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex...

javascript-typescript

23
from christophacham/agent-skills-library

JavaScript and TypeScript development with ES6+, Node.js, React, and modern web frameworks. Use for frontend, backend, or full-stack JavaScript/TypeScript projects.

javascript-typescript-typescript-scaffold

23
from christophacham/agent-skills-library

You are a TypeScript project architecture expert specializing in scaffolding production-ready Node.js and frontend applications. Generate complete project structures with modern tooling (pnpm, Vite, N

javascript-typescript-jest

23
from christophacham/agent-skills-library

Best practices for writing JavaScript/TypeScript tests using Jest, including mocking strategies, test structure, and common patterns.

dotnet-best-practices

23
from christophacham/agent-skills-library

Ensure .NET/C# code meets best practices for the solution/project.