typescript-patterns

A guide to TypeScript coding patterns that make code safer and easier to maintain. It covers ways to narrow values, describe alternatives, check unknown data, and keep types simple.

In plain words
What is it for?
Use it when designing TypeScript types, writing type guards, handling unknown input, modelling alternative cases, or reviewing code for maintainability.
Why use it?
It reduces mistakes caused by uncertain values, overly broad types, and unclear data variants.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/amery2010/open-builder/typescript-patterns
Any agent
npx skills add Amery2010/open-builder --skill typescript-patterns
Clone the repo
git clone --depth 1 https://github.com/Amery2010/open-builder

Made for: Claude Code, Codex.

Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,309 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00040 $0.01309
Opus 5 $0.00020 $0.00655
Sonnet 5 $0.00008 $0.00262
Haiku 4.5 $0.00004 $0.00131

Measured 2d ago against content hash e79f13b2a40a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

typescript-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

public/skills/typescript-patterns/SKILL.md · 155 lines

The source is not reproduced here

Licensed GPL-3.0

The repository is licensed GPL-3.0, which this catalogue does not treat as permission to reproduce the file. Read it at the source.

Read it on GitHub

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 155 lines · 40 tokens per session scan A e79f13b2a40a

Subscribe to this mod's changes

typescript-patterns is a skill published in the GitHub repository Amery2010/open-builder (91 stars, last pushed 5d ago), licensed GPL-3.0. It adds 40 tokens to every session and 1,309 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

mastra

Comprehensive Mastra framework guide. Teaches how to find current documentation, verify API signatures, and build agents and workflows. Covers documentation lookup strategies (embedded docs, remote docs), core concepts (agents vs workflows, tools, memory, RAG), TypeScript requirements, and common patterns. Use this…

Array-Ventures/coworker · 83 tokens

messaging

Send messages to users via WhatsApp and other connected channels. Use when asked to notify someone, send a message, reply to a contact, message a group, or proactively communicate through WhatsApp. Supports text, images, documents, audio, video, and stickers. Also provides group etiquette for observing group…

Array-Ventures/coworker · 82 tokens

agent-squad-typescript

Use when building or modifying a Node.js / TypeScript app that uses the agent-squad npm package — multi-agent orchestration: orchestrator, agents (all built-in types + GroundedAgent), classifier routing (Bedrock / Anthropic / OpenAI), storage (in-memory / DynamoDB / SQL), retrievers (Amazon KB / Dakera), and tools…

2FastLabs/agent-squad · 87 tokens

local-tools

Access local system resources including Calendar on macOS and Windows. Use this skill when you need to manage user's schedule directly on their device.

netease-youdao/LobsterAI · 30 tokens

seedance

Generate AI videos using Volcengine Seedance model. Supports text-to-video (T2V), image-to-video (I2V), and audio-synced video generation. Use this skill when the user wants to create or generate videos.

netease-youdao/LobsterAI · 52 tokens

seedream

Generate AI images using Volcengine Seedream model. Supports text-to-image (T2I), image editing (I2I), multi-image fusion, and web-search-based generation. Use this skill when the user wants to create, generate, or edit images.

netease-youdao/LobsterAI · 56 tokens