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.
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-patternsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/contentful/skill-kit /tmp/skill-kit && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/skill-kit/examples/ts-patterns/skill ~/.gemini/antigravity-cli/skills/ts-patternsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
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
ANo 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 →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.
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.
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.
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.
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.
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.
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.
