cassini-workshop: Skill for Claude Code

.claude/skills/typescript-best-practices/SKILL.md

typescript-best-practices is a skill for Claude Code from robconery/cassini-workshop. It costs 168 tokens per session (1,700 once invoked), scanned A, a copy of typescript-best-practices, MIT.

A guide to writing TypeScript code in consistent, type-safe ways. It covers compiler settings, modeling data, handling errors, asynchronous code, and naming.

In plain words
What is it for?
Use it when designing TypeScript types, handling errors or promises, improving null checks, or reviewing modules and naming. It is also useful when changing code and wanting the compiler to show affected callers.
Why use it?
It helps the TypeScript compiler catch unsafe changes and makes refactoring easier. It reduces problems caused by loose types, unclear errors, and missing values.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is robconery/cassini-workshop's own configuration. It tells Claude Code how to work on cassini-workshop itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cassini-workshop configures →

Reuse

Borrowing it

Nothing to install: this file belongs to robconery/cassini-workshop. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/robconery/cassini-workshop/main/.claude/skills/typescript-best-practices/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/robconery/cassini-workshop

Made for: Claude Code.

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-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/robconery/cassini-workshop/typescript-best-practices/github.svg)](https://agentmods.dev/skills/robconery/cassini-workshop/typescript-best-practices)
Your own site
<a href="https://agentmods.dev/skills/robconery/cassini-workshop/typescript-best-practices"><img src="https://agentmods.dev/badge/skills/robconery/cassini-workshop/typescript-best-practices/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-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/robconery/cassini-workshop/typescript-best-practices"><img src="https://agentmods.dev/badge/skills/robconery/cassini-workshop/typescript-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 168 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,700 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 100% copy Near-identical to another mod 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.00168 $0.01700
Opus 5.5 $0.00067 $0.00680
Sonnet 5.5 $0.00034 $0.00340
Haiku 4.5 $0.00017 $0.00170

Measured 2mo ago against content hash 41185480f765, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

typescript-best-practices 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 2mo ago.

The scan reads SKILL.md. This mod also ships 7 executable files (templates/app-error.ts, templates/branded-type.ts, templates/discriminated-union.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Origin

This is a copy

100% identical to typescript-best-practices — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/skills/typescript-best-practices/SKILL.md · 123 lines

How it starts

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

TypeScript Best Practices & Idioms

How to write TypeScript that the compiler can actually protect: model illegal states out of existence, prefer narrow types over any, make invariants explicit, and keep runtime behavior (serialization, equality, errors) predictable.

🎯 Why: Design for Change

The goal of writing software is to be able to change it safely. Strict types, discriminated unions, branded types, and Result errors turn the compiler into a change-detector: when a shape moves, every caller lights up. any and loose types are change-hiders — they make the next edit look safe while it isn't. Idiomatic TS exists to keep the next refactor mechanical instead of archaeological.

This skill is about idioms and conventions. For OO design pressure use solid-principles and design-principles; for named patterns use gof-patterns. This skill does not re-explain those.

How to use this skill

  1. Match the symptom in the decision guide to a rule.
  2. Open references/idioms.md for that rule's full rationale, a bad example, the idiomatic refactor, and when not to apply it.
  3. Copy the closest file from templates/ and adapt it. The templates already encode the conventions below (strict types, toString/toJSON, exhaustiveness) so you start compliant instead of retrofitting.
  4. Apply the smallest change that removes real pain. Strictness is earned by demonstrated bugs, not applied as ceremony — but the defaults here (strict tsconfig, no any, no floating promises) are non-negotiable because their failure mode is silent.

Project rule: every class has toString() and toJSON()

This is a hard convention in this codebase, not a suggestion.

  • toJSON() — returns a plain, serializable object. JSON.stringify calls it automatically, so logs, API responses, and persistence get a stable, intentional shape instead of leaking private fields, class internals, or undefined. Never return the instance itself.
  • toString() — returns a short human-readable identifier for logs, error messages, and template literals (`order ${order}`). It is for humans; toJSON() is for machines. They are not interchangeable.

Read the full file on GitHub · 123 lines

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. 2mo ago First seen · 123 lines · 168 tokens per session scan A 41185480f765

Subscribe to this mod's changes

typescript-best-practices is a skill published in the GitHub repository robconery/cassini-workshop (1 stars, last pushed 4mo ago), licensed MIT. It adds 168 tokens to every session and 1,700 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to typescript-best-practices, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

add-export

Add a new subpath export to the @cyanheads/mcp-ts-core package. Use when creating a new public API surface that consumers import from a dedicated subpath (e.g., @cyanheads/mcp-ts-core/newutil).

cyanheads/mcp-ts-core · 50 tokens

bun

Use this skill when the user says 'bun', 'bun runtime', 'bun install', 'bun test', 'bun build', 'Bun.serve', 'bun:sqlite', 'Bun.file', 'Bun shell', 'bun --compile'. Builds TypeScript/JavaScript backends and tools on the Bun runtime: Bun.serve HTTP/WebSocket servers, bun:sqlite, file I/O, Bun Shell scripts, the…

j4flmao/agent-skills · 148 tokens

hono-core

Hono ultrafast web framework fundamentals - routing, context, handlers, and response patterns for multi-runtime deployment.

bobmatnyc/claude-mpm-skills · 26 tokens

integrate-unprice-sdk

Integrate and troubleshoot the @unprice/api TypeScript SDK in server-side Node.js, Next.js, Hono, or edge applications. Use when onboarding Unprice customers, checking access, enforcing or recording usage, reserving budgets for multi-step workloads, handling Unprice API results, reviewing an existing Unprice…

jhonsfran/unprice · 97 tokens

hono

Use when building Hono web applications or when the user asks about Hono APIs, routing, middleware, JSX, validation, testing, or streaming. TRIGGER when code imports from 'hono' or 'hono/', or user mentions Hono. Use Hono CLI to inspect and test the app.

louisbrulenaudet/monorepo-template · 66 tokens

tanstack-config

Opinionated toolkit for building, versioning, and publishing high-quality JavaScript/TypeScript packages.

louisbrulenaudet/monorepo-template · 24 tokens