Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

ts-patterns

Skill by contentful

Provides TypeScript reference notes on generics, discriminated unions, builder patterns and error handling. Aimed at developers writing TypeScript who need a quick refresher.

  • Score 60
  • 71 stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install ts-patterns

Built from the published package, never by AI.

git clone --depth 1 https://github.com/contentful/skill-kit /tmp/skill-kit && mkdir -p ~/.claude/skills && cp -r /tmp/skill-kit/examples/ts-patterns/skill ~/.claude/skills/ts-patterns

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install ts-patterns in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

ts-patterns is an agent skill that gives an AI assistant on-demand reference material on TypeScript patterns and idioms. It covers four topics: generics, including constraints, conditional types, mapped types and infer; discriminated unions with literal discriminants; the builder pattern with type accumulation; and error handling with Result types, custom errors and exhaustive matching.

When MCP tools for the skill are available, the assistant calls the topics and topic tools and presents the content to the user. Otherwise it runs the bundled scripts/run command with a topic name as a fallback. The skill is aimed at developers writing TypeScript who need a quick refresher. Its file path pattern is set to any .ts file, and it accepts an optional topic argument.

Written from the project's SKILL.md and checked against it.

What it can do

  • topicsLists the available TypeScript reference topics.
  • topicRetrieves the content of a named TypeScript reference topic.
  • genericsCheat sheet covering constraints, conditional types, mapped types and infer.
  • discriminated-unionsExplains type narrowing with literal discriminants.
  • builder-patternExplains fluent APIs with type accumulation.
  • error-handlingCovers Result types, custom errors and exhaustive matching.

What you need

  • MCP tools for this skill (preferred)
  • Bash access to run scripts/run (CLI fallback)

Try asking

  • Give me a quick refresher on TypeScript generics and constraints
  • Explain discriminated unions in TypeScript with a short example
  • Show me the builder pattern with type accumulation in TypeScript

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: examples/ts-patterns/skill/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

Allowed tools: Bash(scripts/run *) Read mcp__ts-patterns__topic mcp__ts-patterns__topics

Alternatives to ts-patterns

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

ts-patterns: common questions

What TypeScript topics does ts-patterns cover?

The skill covers generics, discriminated unions, the builder pattern and error handling. Each topic is a reference entry the assistant can retrieve on request.

Does ts-patterns need MCP to work?

No. MCP tools are the preferred route, but the source also describes a CLI fallback that runs the bundled scripts/run command.

Which files does ts-patterns apply to?

The skill's paths setting is **/*.ts, so it is meant for TypeScript files.

How do I install ts-patterns?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is ts-patterns free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is ts-patterns safe to use?

It scores 60 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to ts-patterns?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

ts-patterns Install

Add to stack

Loading.