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.
npx skills add Mindrally/skills --skill typescript -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/typescript/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/typescript/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill typescript -a codex2Manually: put the files in place
.agents/skills/typescript/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill typescript -a cursor2Manually: put the files in place
.cursor/skills/typescript/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills typescript2Manually: put the files in place
.github/skills/typescript/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill typescript -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path typescriptManually: put the files in place
.devin/skills/typescript/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill typescript -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.