typescript

typescript is a skill for Claude Code, Codex from medy-gribkov/arcana. It costs 41 tokens per session (1,054 once invoked), scanned A, original, Apache-2.0.

A guide to writing safer TypeScript code with strict types, generics, reusable utility types, and common patterns.

In plain words
What is it for?
Use it when designing TypeScript functions, objects, unions, asynchronous code, or type-safe APIs.
Why use it?
It helps prevent unclear data shapes, unsafe values, and other mistakes that can pass unnoticed until runtime.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when designing TypeScript functions, objects, unions, asynchronous code, or type-safe APIs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/medy-gribkov/arcana/typescript
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.

Any agent
npx skills add medy-gribkov/arcana --skill typescript
Clone the repo
git clone --depth 1 https://github.com/medy-gribkov/arcana

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin typescript/plugin install typescript after adding the marketplace above.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for typescript

README.md
[![agentmods](https://agentmods.dev/badge/skills/medy-gribkov/arcana/typescript/github.svg)](https://agentmods.dev/skills/medy-gribkov/arcana/typescript)
Your own site
<a href="https://agentmods.dev/skills/medy-gribkov/arcana/typescript"><img src="https://agentmods.dev/badge/skills/medy-gribkov/arcana/typescript/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for typescript

Your own site · 80×15
<a href="https://agentmods.dev/skills/medy-gribkov/arcana/typescript"><img src="https://agentmods.dev/badge/skills/medy-gribkov/arcana/typescript.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,054 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original 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.1 $0.00041 $0.01054
Opus 5 $0.00020 $0.00527
Sonnet 5 $0.00008 $0.00211
Haiku 4.5 $0.00004 $0.00105

Measured 9d ago against content hash 265b57249691, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

typescript 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 9d 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.

skills/typescript/SKILL.md · 192 lines

How it starts

The opening of the file, as written. The whole thing — 192 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Types and Type Safety

BAD: Using any defeats the type system.

function processData(data: any) {
  return data.value.toUpperCase();
}

GOOD: Define explicit types or use generics.

interface DataWithValue {
  value: string;
}

function processData(data: DataWithValue): string {
  return data.value.toUpperCase();
}

When TypeScript Can Infer

BAD: Redundant type annotations.

const count: number = 42;
const name: string = 'Alice';

GOOD: Let TypeScript infer.

const count = 42;       // inferred as number
const name = 'Alice';   // inferred as string

Record vs Object

BAD: Using object or {}. These allow any object.

GOOD: Use Record<PropertyKey, unknown> for arbitrary objects.

function logData(data: Record<PropertyKey, unknown>) {
  console.log(data);
}

Interfaces vs Types

GOOD: Use interface for object shapes. Use type for unions, intersections, and primitives.

// Object shapes: interface
interface User {
  id: number;
  name: string;
}

// Unions: type
type Status = 'pending' | 'approved' | 'rejected';

// Intersections: type
type AdminUser = User & { role: 'admin' };

Generics Constraints

BAD: Unconstrained generics allow any type.

function getProperty<T>(obj: T, key: string) {
  return obj[key];  // Error: key is not guaranteed to exist on T
}

GOOD: Constrain generics with extends.

function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
  return obj[key];
}

const user = { id: 1, name: 'Alice' };
const name = getProperty(user, 'name');  // Type: string

Multiple Constraints

function findById<T extends Identifiable & Named>(
  items: T[],
  id: number
): T | undefined {
  return items.find(item => item.id === id);
}

Default Generic Types

function createArray<T = string>(length: number, value: T): T[] {
  return Array(length).fill(value);
}

Read the full file on GitHub · 192 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 192 lines · 41 tokens per session scan A 265b57249691

Subscribe to this mod's changes

typescript is a skill published in the GitHub repository medy-gribkov/arcana (1 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 41 tokens to every session and 1,054 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-09-03.