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).

Good fit Use it when designing or restructuring an npm library, deciding what to export, or planning how its package files and runtime support should work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/samplexbro/agentsmesh/ts-library-architecture
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 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/github.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/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 ts-library-architecture

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.5 $0.00013 $0.00300
Sonnet 5.5 $0.00006 $0.00150
Haiku 4.5 $0.00003 $0.00075

Measured 2mo ago against content hash d306afd2b422, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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. 2mo 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 (31 stars, last pushed 2d ago), licensed MIT. It adds 32 tokens to every session and 751 once invoked, about $0.0001 per session on Opus 5.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

ts-library-architecture compared with skills from other repositories

ts-library-architecture next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ts-library-architecturesampleXbro/agentsmeshSkill312d agoMITA32Claude Code, Codex
ultracitehaydenbleasel/ultraciteSkill3.4ktodayMITA179Claude Code, Codex
dd-code-generationDataDog/pupSkill1.0ktodayApache-2.0A16Claude Code
type-safetyidavidov13/agentic-playwrightSkill31212d agoMITA80Claude Code, Codex
refactor-valuesidavidov13/agentic-playwrightSkill31212d agoMITA55Claude Code, Codex
wallet-cliBofAI/skillsSkill1684d agoMITA92Codex
create-custom-widgetmendixlabs/mxcliSkill145yesterdayApache-2.0A50Claude Code