Agent skill

Typescript Expert

by remix-run in remix-run/remix

Write, refactor, or review TypeScript code with strict, precise, maintainable types and without unnecessary any, type assertions, or type suppressions.

MITAuto-check passedDevelopment

Install Typescript Expert

skills CLI
$ npx skills add remix-run/remix --skill typescript-expert -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install remix-run/remix typescript-expert --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/remix-run/remix.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/typescript-expert .claude/skills/typescript-expert && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
typescript-expert
GitHub stars
33k
Token cost
~3.4k tokens
SKILL.md length
1,706 words
Files
2
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

Write, refactor, or review TypeScript code with strict, precise, maintainable types and without unnecessary any, type assertions, or type suppressions.

  • Works in 6 steps: Read the nearest tsconfig.json, package… → Model the runtime contract first:… → Use TypeScript to make invalid states… → …
  • Discriminated unions
  • SKILL.md covers Overview, Workflow, Repo Rules and Package Structure, plus 9 more sections
  • Calls pnpm

What it does

Typescript Expert is an agent skill from remix-run/remix. Write, refactor, or review TypeScript code with strict, precise, maintainable types and without unnecessary any, type assertions, or type suppressions. Use when working on .ts or .tsx files, public APIs, generics, discriminated unions, type guards, tsconfig/module settings, declaration-facing code, or any change where TypeScript type quality affects correctness in the Remix repo.

Its SKILL.md is about 3.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It sits in Development, covering Type safety and React components. It works with TypeScript and pnpm. The repository describes itself as: The fully-stacked web framework. The licence is MIT.

When your agent uses it

  • Discriminated unions
  • Tsconfig/module settings
  • Declaration-facing code
  • Any change where TypeScript type quality affects correctness in the Remix repo

Example prompts

  • “/typescript-expert”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Read the nearest tsconfig.json, package package.json, and relevant existing source before choosing types.
  2. Model the runtime contract first: inputs, outputs, failure modes, ownership boundaries, and public API shape.
  3. Use TypeScript to make invalid states hard to represent, but keep the implementation readable JavaScript.
  4. Validate unknown external data at the boundary; do not pretend unvalidated data already matches an internal type.
  5. When adding or changing tests, use the write-tests skill for runner, fixture, assertion, dependency, and validation conventions.
  6. Run the narrowest meaningful validation command before finishing: package typecheck/test for package changes, pnpm run typecheck:changed…

What it can do on your machine

Read from SKILL.md and the folder at commit ef2c594. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • typescriptlang.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Typescript Expert loads about 3.4k tokens when it runs. Until then it costs about 102 tokens; SKILL.md has 1,706 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~102
When it runs · the whole SKILL.md, loaded when a task matches
~3.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from remix-run/remix at commit ef2c594, republished under its MIT licence (© remix-run). 1,706 words, ~3,368 tokens.

Download SKILL.mdSave it as .claude/skills/typescript-expert/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
typescript-expert
description
Write, refactor, or review TypeScript code with strict, precise, maintainable types and without unnecessary `any`, type assertions, or type suppressions. Use when working on `.ts` or `.tsx` files, public APIs, generics, discriminated unions, type guards, tsconfig/module settings, declaration-facing code, or any change where TypeScript type quality affects correctness in the Remix repo.

TypeScript Expert

Overview

Use this skill to write TypeScript that is simple at runtime and precise at compile time. Prefer local repo conventions first, then apply the official TypeScript guidance summarized here.

Workflow

  1. Read the nearest tsconfig.json, package package.json, and relevant existing source before choosing types.
  2. Model the runtime contract first: inputs, outputs, failure modes, ownership boundaries, and public API shape.
  3. Use TypeScript to make invalid states hard to represent, but keep the implementation readable JavaScript.
  4. Validate unknown external data at the boundary; do not pretend unvalidated data already matches an internal type.
  5. When adding or changing tests, use the write-tests skill for runner, fixture, assertion, dependency, and validation conventions.
  6. Run the narrowest meaningful validation command before finishing: package typecheck/test for package changes, pnpm run typecheck:changed and pnpm run test:changed for broader changes, and pnpm run lint when practical.

Repo Rules

  • Use import type { X } and export type { X } for type-only symbols.
  • Include .ts extensions in relative imports and exports, matching this repo's allowImportingTsExtensions / rewriteRelativeImportExtensions setup.
  • Follow public API boundaries: each package export maps to a top-level src/*.ts; src/lib is implementation-only.
  • Do not re-export APIs or types from another package. Import from the package that owns the symbol.
  • Prefer Web APIs and standards-aligned primitives over Node-specific APIs when either works.
  • Use repo style: let for locals, module-scope const, regular functions by default, arrows for callbacks, object method shorthand, native class fields, and #private.
  • Use descriptive lowercase generic names in this repo, such as source, pattern, or method, instead of single-letter names unless local code already uses that convention.

Package Structure

  • Keep public barrels honest: top-level src/*.ts export files should re-export each public symbol directly from the module where it is defined, not through a src/lib pass-through barrel.
  • Treat src/lib files as implementation owners. Split implementation by responsibility, but do not add thin re-export wrappers or indirect ownership inside src/lib.
  • Export only APIs that a package consumer should rely on. Do not expose internal factories, data tables, or helper types just because they are useful across implementation modules.
  • When moving functionality between modules, move the owning types with it or re-export them only from the package-level public entry point. Avoid making an implementation module look like a public API aggregator.
  • Prefer internal factories or closures for configuration that should not leak into helper signatures. Public-facing helpers should not require callers to thread implementation booleans or mode flags through repeated calls.
  • If a helper name implies a stronger semantic contract than the implementation provides, either narrow the name or keep it private until a package actually needs it. For example, terminal display width is different from code point length.
  • Share constants from a single owning module when separate modules must agree on protocol values, escape sequences, sentinels, or discriminants. Avoid duplicating magic strings that can drift.
  • Keep module dependency graphs one-way. When splitting modules, choose clear ownership so lower-level modules do not import from higher-level consumers, even for type-only imports.
  • After public API changes, check the package barrel, README examples, tests, and change files together so documentation and exports match the actual supported surface.
  • When test code changes, apply the write-tests skill rather than encoding detailed test-runner policy here.

API Documentation

  • When adding or tightening public JSDoc, use the write-api-docs skill; it owns detailed JSDoc style, ESLint expectations, and API-docs workflow.
  • Treat JSDoc as part of the public type contract. It should document behavior, defaults, units, and edge cases that TypeScript cannot express, not repeat type syntax.
  • Use names and docs that do not over-promise. If an API only counts code points, do not describe it as terminal display width; if a helper is not ready as a supported contract, keep it internal.
  • Keep package metadata, README examples, JSDoc, tests, and change files aligned with the same public API surface.

Type Design

  • Let inference work for local variables and callback parameters when the initializer or context is obvious.
  • Add explicit return types on exported functions, public methods, overloaded implementations, recursive functions, and functions where the return type is part of the contract.
  • Use unknown for values that must be inspected before use. Avoid any; it disables useful type checking and spreads unsafety through every value it touches.
  • Use primitive types string, number, boolean, symbol, and object; do not use boxed types like String, Number, Boolean, Symbol, or Object.
  • Prefer interface for new public object shapes and option objects. Prefer type for unions, tuples, mapped types, conditional types, and aliases over non-object shapes.
  • Represent states with discriminated unions when behavior depends on a mode, status, kind, or variant. Use exhaustive checks when adding or changing variants.
  • For app, demo, and test code that runs through remix/node-tsx, do not require erasableSyntaxOnly; the runtime intentionally supports TypeScript syntax that needs transformation.
  • Use satisfies when an object literal must conform to a broader type while preserving narrow property inference.
  • Use as const for literal tables, discriminants, and tuples that should remain narrow and readonly. Do not use it to paper over mutable data flow.

Avoid Type Holes

  • Do not fix TypeScript errors by adding any, as SomeType, !, @ts-ignore, or @ts-expect-error. First improve the type model, add control-flow narrowing, validate unknown input, or change the API shape.
  • Treat explicit any as a last resort for migration or broken third-party types only. Prefer unknown at boundaries and narrow it before use.
  • Do not put any in public APIs unless the API truly accepts and safely handles every JavaScript value. In almost all new code, unknown, a generic, or a union is a better contract.
  • Avoid type assertions as routine casting. A TypeScript assertion is erased at runtime; it does not parse, validate, convert, or make an unsafe value safe.
  • Use an assertion only when there is a real proof TypeScript cannot express, such as a checked DOM query, a validated schema result, or an external library invariant. Keep the assertion as close as possible to that proof.
  • When adapting bad external types, isolate the unsafe assertion in one small helper with a precise return type. Do not let any leak through the rest of the package.
  • Prefer reusable type guards or assertion functions over repeated casts when the same runtime check appears more than once.
  • Avoid double assertions like value as unknown as Target; if one is unavoidable, wrap it at the boundary and document the invariant.
  • Before accepting a cast, ask whether satisfies, as const, an explicit return type, a discriminated union, a generic constraint, or a local variable with a narrower type would express the intent without disabling checking.
Show full SKILL.md (617 more words)Show less

Null, Optional, And Indexed Values

  • Keep strictNullChecks discipline: handle null and undefined before using a value.
  • Prefer explicit value !== undefined, value !== null, or value != null checks over broad truthiness when '', 0, false, or empty arrays are valid values.
  • Treat property?: T as an absent-property model. If the key is always present but the value can be missing, write property: T | undefined.
  • When indexing arrays, tuples, maps, records, or URL/search params, account for missing values before using the result.
  • Use non-null assertions (!) only when a nearby invariant proves the value exists and the code cannot express that proof cleanly. Keep the assertion local.

Functions And APIs

  • Prefer a union parameter over overloads when the implementation and return type are the same for each accepted input shape.
  • Use overloads for genuinely different call signatures. Put the most specific overloads first and the most general overload last.
  • Do not make callback parameters optional unless the implementation may actually call the callback without that argument.
  • Use () => void for callbacks whose return value is ignored.
  • Avoid Function; write the callable shape, for example (request: Request) => Response | Promise<Response>.
  • Avoid boolean flag parameters when they create multiple behavioral modes. Prefer named option objects or discriminated unions.
  • Keep public option objects extensible and documented when changing public APIs.

Generics

  • Introduce a type parameter only when it relates at least two positions, such as input-to-output, key-to-object, item-to-collection, or callback-to-value.
  • Use as few type parameters as possible. Remove parameters that do not change the resulting type.
  • Prefer the type parameter itself over a constrained container when that improves inference.
  • Add constraints only for capabilities the implementation actually uses, such as extends { length: number } or extends keyof source.
  • Prefer inferred type arguments for callers. Require explicit type arguments only when inference cannot represent the intended contract.
  • Do not create generic types that ignore their type parameter.

Boundaries And Assertions

  • Parse and narrow untrusted inputs before converting them into internal types: JSON, request bodies, headers, environment values, dynamic route params, filesystem data, and third-party responses.
  • Keep type assertions close to the runtime proof. Prefer a small type guard or assertion function when the proof is reusable.
  • Avoid double assertions like value as unknown as Target unless adapting an external type hole; isolate them and explain the invariant if the reason is not obvious.
  • Do not silence type errors with @ts-ignore or @ts-expect-error unless a test or upstream compatibility case requires it. Include the concrete reason.

Review Checklist

  • Does the type model match real runtime behavior, including errors and absent values?
  • Did the change preserve package export boundaries and type ownership?
  • Are type-only imports and .ts extensions correct?
  • Do package-level exports point directly at the owning modules where symbols are defined?
  • Did the change avoid turning src/lib modules into pass-through barrels or accidental public API aggregators?
  • Is every exported helper/type something consumers should depend on now, not just an implementation convenience?
  • Are public JSDoc comments written from the consumer's point of view, documenting semantics instead of repeating types?
  • Do package metadata, README examples, JSDoc, and tests describe the same public API surface?
  • Are any, assertions, non-null assertions, and suppressions absent? If not, is each one isolated, proved by nearby runtime logic, and impossible to express with safer TypeScript?
  • Are generics necessary, minimal, and inference-friendly?
  • Are unions narrowed explicitly enough that each branch is safe?
  • If this changes public API, are tests, JSDoc, README examples, and change files handled by the relevant repo skills?

Official Sources

© remix-run, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/typescript-expert of remix-run/remix.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit ef2c594

Compare with similar skills

Typescript Expert next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Typescript Expert compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Typescript Expert this skillremix-run/remix33k—~3.4kAutomated safety check: PassMIT
Typescripttahabasri/snippets170—~968Automated safety check: PassMIT
TypeScript Monorepo Conventionspierrecomputer/pierre6.2k—~450Automated safety check: PassApache-2.0
Removing Typescript SuppressionsComfy-Org/ComfyUI_frontend2.1k—~1.6kAutomated safety check: PassGPL-3.0
Types Enforce TStimmo001/system-bridge356—~689Automated safety check: PassApache-2.0
Typescript CoderLeoYeAI/openclaw-master-skills2.2k—~5.8kAutomated safety check: PassMIT

Similar skills

  • Typescript

    tahabasri/snippets

    LobeHub TypeScript style and type-safety guide. An agent skill from tahabasri/snippets.

    170 GitHub stars~968 tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • TypeScript Monorepo Conventions

    pierrecomputer/pierre

    Conventions for adding packages and apps to a TypeScript monorepo: project references, moon tasks, workspace dependencies and published package exports.

    6.2k GitHub stars~450 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Removing Typescript Suppressions

    Comfy-Org/ComfyUI_frontend

    Replaces @ts-expect-error and @ts-ignore directives with minimal type-safe fixes.

    2.1k GitHub stars~1.6k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Types Enforce TS

    timmo001/system-bridge

    TypeScript type-safety guidance. An agent skill from timmo001/system-bridge.

    356 GitHub stars~689 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Typescript Coder

    LeoYeAI/openclaw-master-skills

    Expert 10x engineer with extensive knowledge of TypeScript fundamentals, migration strategies, and best practices.

    2.2k GitHub stars~5.8k tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • Moves logic out of Astro frontmatter into tested helper modules under shared/lib, with rules for naming, typing, deterministic demo data and sibling test files.

    42k GitHub stars~1.2k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from remix-run/remix

All 19 skills in this repo
  • Supersede PR

    remix-run/remix

    Safely replace one GitHub pull request with another. An agent skill from remix-run/remix.

    33k GitHub stars~456 tokensUpdated yesterday
    Auto-check passed
  • Add Package

    remix-run/remix

    Create or align a package in the Remix monorepo to match existing package conventions.

    33k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Author UI Primitives

    remix-run/remix

    Build idiomatic headless primitives in packages/ui for Remix.

    33k GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Fix Issue

    remix-run/remix

    Fix a reported issue in Remix from a GitHub issue. An agent skill from remix-run/remix.

    33k GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • Make Demo

    remix-run/remix

    Create or revise demos in the Remix repository. An agent skill from remix-run/remix.

    33k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • Make PR

    remix-run/remix

    Create GitHub pull requests with clear, reviewer-friendly descriptions.

    33k GitHub stars~847 tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Typescript Expert

What does Typescript Expert do?

Write, refactor, or review TypeScript code with strict, precise, maintainable types and without unnecessary any, type assertions, or type suppressions. Typescript Expert is an agent skill from remix-run/remix. Write, refactor, or review TypeScript code with strict, precise, maintainable types and without unnecessary any, type assertions, or type suppressions.

When should I use Typescript Expert?

Typescript Expert fits situations like: discriminated unions; tsconfig/module settings; declaration-facing code; any change where TypeScript type quality affects correctness in the Remix repo.

How do I install Typescript Expert in Claude Code?

Run `npx skills add remix-run/remix --skill typescript-expert -a claude-code`. Or copy the skill folder (.agents/skills/typescript-expert in remix-run/remix) into .claude/skills/typescript-expert in your project. Claude Code loads it when a task matches its description.

How do I install Typescript Expert in Codex?

Run `npx skills add remix-run/remix --skill typescript-expert -a codex`. Or copy the skill folder (.agents/skills/typescript-expert in remix-run/remix) into .agents/skills/typescript-expert in your project. Codex loads it when a task matches its description.

Can I use Typescript Expert in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add remix-run/remix --skill typescript-expert -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/typescript-expert, .gemini/skills/typescript-expert, .github/skills/typescript-expert and .opencode/skills/typescript-expert in your project.

What does Typescript Expert need to run?

Going by SKILL.md and its folder, Typescript Expert needs the command-line tools its instructions call (pnpm).

Does Typescript Expert access the network?

SKILL.md names 1 domain. As links in the text: typescriptlang.org. This is read from the text; nothing was executed.

Is Typescript Expert safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Typescript Expert use?

Typescript Expert is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Typescript Expert use?

About 3.4k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Typescript Expert?

Skills that share tags, products or a category with Typescript Expert: Typescript (tahabasri/snippets, 170 stars), TypeScript Monorepo Conventions (pierrecomputer/pierre, 6.2k stars), Removing Typescript Suppressions (Comfy-Org/ComfyUI_frontend, 2.1k stars) and Types Enforce TS (timmo001/system-bridge, 356 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Typescript Expert?

remix-run (a GitHub organization) maintains it in remix-run/remix, which has 33,397 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 8, 2026.

Source: remix-run/remix on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.