ts-library

ts-library is a skill for Gemini CLI from watt-mind/coach. It costs 51 tokens per session (524 once invoked), scanned A, original, Apache-2.0.

A guide for building TypeScript libraries: reusable code packages that other projects can install. It covers setup, package exports, builds, API design, types, tests, releases, and continuous integration.

In plain words
What is it for?
Use it when starting or maintaining a TypeScript library, including one organized as a monorepo (a repository containing several related packages). It also helps with type-safe APIs, Vitest tests, build tools, releases, and CI workflows.
Why use it?
It helps avoid piecing together library configuration and publishing practices from scattered sources. It also explains how to make a package work with both CommonJS and modern ES modules.

Skill for Gemini CLI

Written for Gemini CLI: installed under .gemini/.

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/watt-mind/coach/ts-library
Any agent
npx skills add watt-mind/coach --skill ts-library
Clone the repo
git clone --depth 1 https://github.com/watt-mind/coach

Made for: Gemini CLI.

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 ts-library

README.md
[![agentmods](https://agentmods.dev/badge/skills/watt-mind/coach/ts-library.svg)](https://agentmods.dev/skills/watt-mind/coach/ts-library)
Your own site
<a href="https://agentmods.dev/skills/watt-mind/coach/ts-library"><img src="https://agentmods.dev/badge/skills/watt-mind/coach/ts-library.svg" alt="Measured on agentmods" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 524 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00051 $0.00524
Opus 5 $0.00026 $0.00262
Sonnet 5 $0.00010 $0.00105
Haiku 4.5 $0.00005 $0.00052

Measured 5d ago against content hash c37d392efd51, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

ts-library 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 5d 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.

.gemini/skills/ts-library/SKILL.md · 48 lines

How it starts

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

TypeScript Library Development

Patterns for authoring high-quality TypeScript libraries, extracted from studying unocss, shiki, unplugin, vite, vitest, vueuse, zod, trpc, drizzle-orm, and more.

When to Use

  • Starting a new TypeScript library (single or monorepo)
  • Setting up package.json exports for dual CJS/ESM
  • Configuring tsconfig for library development
  • Choosing build tools (tsdown, unbuild)
  • Designing type-safe APIs (builder, factory, plugin patterns)
  • Writing advanced TypeScript types
  • Setting up vitest for library testing
  • Configuring release workflow and CI

For Nuxt module development: use nuxt-modules skill

Quick Reference

Working on... Load file
New project setup references/project-setup.md
Package exports references/package-exports.md
tsconfig options references/typescript-config.md
Build configuration references/build-tooling.md
API design patterns references/api-design.md
Type inference tricks references/type-patterns.md
Testing setup references/testing.md
Release workflow references/release.md
CI/CD setup references/ci-workflows.md

Key Principles

  • ESM-first: "type": "module" with .mjs outputs
  • Dual format: always support both CJS and ESM consumers
  • moduleResolution: "Bundler" for modern TypeScript
  • tsdown for most builds, unbuild for complex cases
  • Smart defaults: detect environment, don't force config
  • Tree-shakeable: lazy getters, proper sideEffects: false

Read the full file on GitHub · 48 lines

Files

What ships with it

9 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. 5d ago First seen · 48 lines · 51 tokens per session scan A c37d392efd51

Subscribe to this mod's changes

ts-library is a skill published in the GitHub repository watt-mind/coach (83 stars, last pushed 4d ago), licensed Apache-2.0. It adds 51 tokens to every session and 524 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

openclaw

Use when setting up a multi-channel personal AI assistant gateway bridging chat platforms (Telegram, Discord, WhatsApp, WeChat) with LLM backends. OpenClaw: multi-channel AI assistant gateway for unified personal AI access.

znlgis/opengis-skills · 50 tokens

design-principles

Read this guideline when writing or reviewing TypeScript code, naming symbols, refactoring, deciding between type vs interface, or working with schemas, mappers, or converters.

pablo-albaladejo/kaiord · 39 tokens

lint-js

Lint JS/TS code only. Use before opening a PR when only JavaScript or TypeScript files were changed (no Rust).

denoland/deno · 29 tokens

no-bare-casts

Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.

prisma/orm · 52 tokens

aws-sst-development

SST v4 (Ion) expert for managing AWS resources as code with the Pulumi-backed framework. Use when writing or editing sst.config.ts, building infra/ modules (sst.aws.Function/Bucket/Dynamo/Cron/Service/Router, sst.Secret, sst.Linkable, raw aws. Pulumi resources), wiring resource links,...

sickn33/agentic-awesome-skills · 75 tokens

league-akari-shard-development

Use when creating, extending, refactoring, splitting, or reviewing League Akari main or renderer shards, including shard file organization, controller/loader/executor/handler boundaries, naming conventions, renderer TSX usage, platform guards, and public contract compatibility.

LeagueAkari/LeagueAkari · 58 tokens