Skip to main content
skill CX Codex

typescript · mindrally — Claude Code skill: what it does, how to install

Enforces strict TypeScript standards and functional code patterns in your AI assistant. It bans any, replaces enums with maps, and caps function length at 20 lines.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Mindrally/skills --skill typescript -a claude-code
Open on GitHub

What typescript does

The skill configures the model to generate declarative TypeScript without classes. It enforces interface over type, completely bans any, and replaces enums with dictionary maps and as const assertions. Source files follow an organized layout: exported components come first, followed by subcomponents, helpers, static values, and type declarations.

Functions are kept concise, with a strict limit of 20 lines and early returns to avoid nested branching. The prompt instructs the agent to apply the RORO pattern, taking and returning structured objects. Arrow functions handle simple operations under 3 lines, while named functions run heavier logic.

Because the rules outlaw TypeScript enums, running this in an existing codebase will prompt the agent to refactor enums into maps. All public exports and methods must include JSDoc comments.

What it helps with

  • eliminate any types across the TypeScript codebase
  • refactor long functions into single-purpose blocks under 20 lines
  • replace TypeScript enums with maps and as const definitions
  • apply the RORO pattern and early returns to reduce nesting

Example prompts for the agent

  • Refactor this module to follow typescript rules: remove enums and any types
  • Write an auth handler using the RORO pattern and guard clauses
  • Structure this component file with interfaces, subcomponents, and JSDoc

How to install typescript

1Skills CLI (Vercel)

npx skills add Mindrally/skills --skill typescript -a claude-code

2Manually: put the files in place

~/.claude/skills/typescript/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/typescript/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about typescript

How to install typescript in Claude Code?

Run npx skills add Mindrally/skills --skill typescript -a claude-code. The skill will be placed in ~/.claude/skills/typescript/SKILL.md.

What does the typescript skill do?

It instructs your AI assistant to produce functional TypeScript without classes. It requires interfaces instead of type aliases, bans any, and enforces functions under 20 lines.

How does this skill handle enums?

It explicitly avoids standard TypeScript enums. The prompt directs the agent to replace them with maps and literal values marked with as const.

Source text

SKILL.md · Apache-2.0
---
name: typescript
description: Expert in TypeScript development with best practices for type safety and clean code
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# TypeScript

You are an expert in TypeScript development with deep knowledge of type safety and modern JavaScript patterns.

## Core Principles

### Code Style & Structure
- Write concise, technical TypeScript with accurate examples
- Use functional and declarative programming patterns; avoid classes
- Prefer iteration and modularization over code duplication
- Use descriptive variable names with auxiliary verbs (e.g., `isLoading`, `hasError`)
- Structure files: exported component, subcomponents, helpers, static content, types

### Naming Conventions
- Use PascalCase for classes, types, and interfaces
- Use camelCase for variables, functions, and methods
- Use kebab-case for file and directory names
- Use UPPERCASE for environment variables and constants
- Prefix functions with verbs; use boolean prefixes like `is`, `has`, `can`

## TypeScript Usage

- Use TypeScript for all code; prefer interfaces over types
- Avoid `any` type; create precise type definitions
- Use functional components with TypeScript interfaces
- Avoid enums; use maps instead
- Use `readonly` for immutable properties
- Use `as const` for literal values

## Functions & Methods

- Write short functions with single purpose (less than 20 lines)
- Use arrow functions for simple operations (less than 3 lines)
- Use named functions for complex logic
- Implement early returns to avoid nested blocks
- Use default parameters instead of null/undefined checks
- Apply the RORO pattern: "Receive an Object, Return an Object"

## Data & Classes

- Encapsulate data in composite types
- Prefer immutability where possible
- Follow SOLID principles
- Prefer composition over inheritance
- Keep classes under 200 lines with fewer than 10 public methods

## Error Handling

- Use exceptions for unexpected errors
- Implement proper error logging with context
- Create custom error types for consistency
- Use guard clauses for preconditions
- Catch exceptions only to fix expected problems or add context

## Documentation

- Use JSDoc for public classes and methods
- Document all exports clearly
- Provide usage examples when appropriate
- Keep documentation concise and accurate

© Mindrally · Apache-2.0 · Mindrally/skills

Similar skills

All skills for Programming languages →

typescript by other authors comes first.

typescript gentleman-programming A skill that hands your agent a fixed set of strict TypeScript rules: const objects instead of union types, flat interfaces, no any. Useful when AI writes the code and you want one style. CX Codex +1 496installs typescript PyModel A skill with 44 rules on types, tsconfig and async code. Useful when your agent edits compiler config or untangles heavy generics. CX Codex +1 520installs typescript alinaqi Tells the agent how to write and check TypeScript: strict tsconfig, ESLint config, Jest tests and a layered project layout. Kicks in on .ts and .tsx files. CX Codex +1 313installs typescript-clean-code bmad-labs A skill for reviewing and refactoring TypeScript: code smell catalogs, four detection layers, and step-by-step workflows. CX Codex +1 628installs typescript-docs giuseppe-trisciuoglio Creates TypeScript documentation with JSDoc, TypeDoc, and ADRs. Use it when documenting APIs, architecture choices, or framework-specific code. CX Codex +1 4,200installs jsdoc-typescript-docs patricio0312rev A skill that writes JSDoc comments across a TypeScript codebase and builds docs from them with TypeDoc. Handy when functions have piled up without descriptions. CX Codex +1 547installs typescript-variables mkosir Applies TypeScript variable conventions: const assertions, enum replacement with literal types, unions over boolean flags, null vs undefined distinction. CX Codex +1 3,800installs typescript-discriminated-unions mkosir Guides coding agents to apply discriminated unions in TypeScript, eliminating invalid states and enabling exhaustiveness checks. CX Codex +1 3,800installs experience-lwc-typescript-migrate forcedotcom Converts an existing JavaScript Lightning Web Component to TypeScript: a typed .ts plus a .d.ts that exposes only the @api surface. CX Codex +1 2,300installs

From the same set168

ui-design Gives the agent a checklist for interfaces: accessibility, responsive layout, performance. Useful when it writes or reviews frontend code. CX Codex +1 981installs internationalization-i18n This skill gives the agent a rulebook for internationalization: translations, locale-aware dates and numbers, RTL layout. Useful when an app ships in more than one language. CX Codex +1 978installs java A skill that tells the agent how to write Java: layered structure, Spring Boot 3.x, JUnit and Mockito tests. Useful when a Java codebase needs one consistent style. CX Codex +1 966installs zustand-state-management Enforces Zustand store best practices in React and TypeScript apps, covering store slices, SSR, and testing. It helps eliminate selector re-renders and hydration bugs. CX Codex +1 959installs python-uv Makes the agent manage Python packages through uv only, no pip or poetry. Useful when the project already runs on uv or when environments keep drifting apart. CX Codex +1 956installs pixi-js A skill that steers your coding agent toward performant Pixi.js games in TypeScript, with mobile and rendering advice baked in. CX Codex +1 948installs deep-learning Gives your agent a rulebook for neural network work: layer design, optimizers, mixed precision, memory. Useful when you write or refactor model code. CX Codex +1 946installs react This skill gives your agent a fixed React style: hooks, Server Components, Tailwind, TypeScript. Useful when several people or agents touch the same codebase. CX Codex +1 944installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor