ts-library-architecture

ts-library-architecture is a skill for Claude Code, Codex from sampleXbro/agentsmesh. It costs 32 tokens per session (751 once invoked), scanned A, original, MIT.

A guide to designing TypeScript libraries that are published for other developers to install and use. It covers public APIs, package structure, and compatibility across Node.js, bundlers, and sometimes browsers.

In plain words
What is it for?
Use it when designing or restructuring an npm library, deciding what to export, or planning how its package files and runtime support should work.
Why use it?
It helps prevent accidental breaking changes and keeps the package’s behavior predictable as it evolves.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

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

Made for: Claude Code, Codex.

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-architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/samplexbro/agentsmesh/ts-library-architecture.svg)](https://agentmods.dev/skills/samplexbro/agentsmesh/ts-library-architecture)
Your own site
<a href="https://agentmods.dev/skills/samplexbro/agentsmesh/ts-library-architecture"><img src="https://agentmods.dev/badge/skills/samplexbro/agentsmesh/ts-library-architecture.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 751 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.00032 $0.00751
Opus 5 $0.00016 $0.00376
Sonnet 5 $0.00006 $0.00150
Haiku 4.5 $0.00003 $0.00075

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

Security

Grade A, and why

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

.agents/skills/ts-library-architecture/SKILL.md · 98 lines

How it starts

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

Purpose

TS Library Architecture

You are an architecture specialist for TypeScript libraries intended for long-term public distribution.

Goals

  • Preserve a stable and intentional public API.
  • Minimize accidental breaking changes.
  • Keep runtime behavior predictable across Node, bundlers, and optionally browsers.
  • Favor simple packaging and exports over cleverness.
  • Optimize for maintainability, type safety, and semver discipline.

Core principles

  1. Public API is a contract.

    • Treat every exported symbol as part of the product surface.
    • Avoid exporting internal helpers, implementation types, constants, or error internals unless intentionally public.
    • Prefer a small, deliberate index.ts surface.
  2. Packaging must be explicit.

    • Use a clear exports map.
    • Avoid ambiguous deep imports unless intentionally supported.
    • Prefer one well-defined module strategy over hybrid complexity unless there is a strong compatibility reason.
  3. Types are part of the API.

    • Review inferred types for readability and stability.
    • Avoid leaking third-party internal types through public signatures unless strategically intended.
    • Favor named exported types for major contracts.
  4. Runtime compatibility must be documented.

    • State supported Node versions.
    • State whether the package supports browser runtimes, Bun, Deno, or edge runtimes.
    • Avoid hidden assumptions about filesystem, process, streams, or global APIs.
  5. Errors are part of developer experience.

    • Prefer stable error shapes and actionable messages.
    • Do not expose raw internal implementation details unnecessarily.

Architecture checklist

When reviewing or generating architecture, verify:

  • Entry points are minimal and intentional.
  • package.json fields are coherent: name, version, type, main, module, types, exports, files, bin, sideEffects, engines.
  • ESM/CJS support is deliberate rather than accidental.
  • Type declarations are emitted and usable.
  • Tree-shaking is not blocked by unnecessary side effects.
  • Internal modules are not implicitly public.
  • Peer dependencies vs dependencies are correctly classified.
  • The package does not rely on dev-only transitive behavior.
  • API naming is consistent and scalable.

Read the full file on GitHub · 98 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. 2d ago First seen · 98 lines · 32 tokens per session scan A d306afd2b422

Subscribe to this mod's changes

ts-library-architecture is a skill published in the GitHub repository sampleXbro/agentsmesh (24 stars, last pushed yesterday), licensed MIT. It adds 32 tokens to every session and 751 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.

Related

Other skills, from other repositories

ultracite

Ultracite is a zero-config linting and formatting preset for JavaScript/TypeScript projects. Use when: (1) Setting up or initializing Ultracite in a project (ultracite init), (2) Running linting or formatting commands (check, fix, doctor), (3) Writing or reviewing JS/TS code in a project that uses Ultracite — to…

haydenbleasel/ultracite · 142 tokens

microsoft-typescript

TypeScript is a language for application scale JavaScript development. ALWAYS use when editing or working with .ts, .tsx, .mts, .cts files or code importing "typescript". Consult for debugging, best practices, or modifying typescript, TypeScript.

skilld-dev/skilld · 57 tokens

bombshell-dev-clack

ALWAYS use when writing code importing "@clack/prompts". Consult for debugging, best practices, or modifying @clack/prompts, clack/prompts, clack prompts, clack.

skilld-dev/skilld · 46 tokens

jest-unit

Unit testing skill using Jest for TypeScript and JavaScript, covering mocking, spies, snapshots, coverage, async testing, and custom matchers.

PramodDutta/qaskills · 32 tokens

enums

TypeScript enum conventions for the Playwright scaffold — PascalCase enum names, SCREAMINGSNAKECASE members, location rules for app-specific (enums/{area}/) vs shared/utility (enums/util/) constants, and the rules for adding or extending enums. Use when adding a new API endpoint path, UI message, role, storage-state…

idavidov13/agentic-playwright · 148 tokens

refactor-values

Safe refactoring workflow for enum values, enum keys, and static test data in test-data/static/.ts — mandatory impact analysis, cascading updates, and verification. Use BEFORE changing any enum member's string value (ApiEndpoints., Messages., Roles, StorageStatePaths), renaming any enum key, or editing any existing…

idavidov13/agentic-playwright · 125 tokens