typescript-test-writing

typescript-test-writing is a skill for Claude Code, Codex from vybestack/llxprt-code. It costs 66 tokens per session (1,767 once invoked), scanned A, original, Apache-2.0.

A guide for writing TypeScript tests in the llxprt-code repository. TDD, or test-driven development, means writing a failing test before the code that makes it pass.

In plain words
What is it for?
Use it when adding or changing tests, including choosing Bun's test tools, structuring fixtures, handling mocks, and following the repository's strict TypeScript rules.
Why use it?
It prevents inconsistent test styles, weak tests, and code written without a verified expected behavior.

Skill for Claude CodeCodex

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

Good fit Use it when adding or changing tests, including choosing Bun's test tools, structuring fixtures, handling mocks, and following the repository's strict TypeScript rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vybestack/llxprt-code/typescript-test-writing
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 vybestack/llxprt-code --skill typescript-test-writing
Clone the repo
git clone --depth 1 https://github.com/vybestack/llxprt-code

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 typescript-test-writing

README.md
[![agentmods](https://agentmods.dev/badge/skills/vybestack/llxprt-code/typescript-test-writing/github.svg)](https://agentmods.dev/skills/vybestack/llxprt-code/typescript-test-writing)
Your own site
<a href="https://agentmods.dev/skills/vybestack/llxprt-code/typescript-test-writing"><img src="https://agentmods.dev/badge/skills/vybestack/llxprt-code/typescript-test-writing/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-test-writing

Your own site · 80×15
<a href="https://agentmods.dev/skills/vybestack/llxprt-code/typescript-test-writing"><img src="https://agentmods.dev/badge/skills/vybestack/llxprt-code/typescript-test-writing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,767 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.00066 $0.01767
Opus 5.5 $0.00026 $0.00707
Sonnet 5.5 $0.00013 $0.00353
Haiku 4.5 $0.00007 $0.00177

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

Security

Grade A, and why

typescript-test-writing 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 1mo 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.

.llxprt/skills/typescript-test-writing/SKILL.md · 174 lines

How it starts

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

Writing TypeScript Tests in llxprt-code

Distilled from dev-docs/RULES.md. When in doubt, read RULES.md in full — it is the source of truth for development guidelines.

Core principle: TDD is mandatory

Every line of production code must be written in response to a failing test. No exceptions.

Red-Green-Refactor, followed strictly:

  1. RED: Write a failing test for the next small behavior.
  2. GREEN: Write ONLY enough code to make the test pass.
  3. REFACTOR: Only if it improves clarity.
  4. COMMIT: Feature + tests together; refactoring separately.

Stack rules (non-negotiable)

  • Bun + bun:test ONLY. Never create Vitest or Node test suites, and never add new .js files — everything is TypeScript run with bun.

  • TypeScript strict mode: no any (use unknown with type guards), no type assertions (use type predicates), explicit return types.

  • Import pattern (bun:test re-exports vi, mock, and Mock):

    import {
      describe,
      it,
      expect,
      beforeEach,
      afterEach,
      vi,
      type Mock,
    } from 'bun:test';
    
  • Prefer immutable data in tests and fixtures ({ ...cart, items: [...cart.items, item] }); never mutate shared fixtures between tests.

Test behavior, not implementation

✅ Test:

  • Public API behavior
  • Input → Output transformations
  • Edge cases and error conditions
  • Integration between units
  • Schema validation

❌ Never test:

  • Implementation details
  • Private methods
  • Third-party libraries
  • Mock interactions

❌ Never enshrine bugs as specification: do not write a passing test that asserts incorrect behavior, even if that is what the code currently does. If you discover a bug while writing tests: (1) file an issue or ask the user, (2) write a failing test that asserts the CORRECT behavior, (3) fix the production code so the test passes. A suite that encodes bugs as passing tests is worse than no tests — it actively prevents future fixes.

Test structure

  • describe: feature/component name.
  • it: specific behavior in plain English.
  • Arrange-Act-Assert: clear sections; one behavior per test.
  • DRY setup: never copy-paste identical beforeEach/afterEach boilerplate (e.g. temp-dir creation, cleanup) across describe blocks. Extract a shared helper that wires the lifecycle hooks (e.g. a useTempDir() helper that registers beforeEach/afterEach internally and returns a lazy accessor). Repeating 5+ lines of identical setup in N describe blocks is a maintenance hazard; one line of shared setup per describe block is the target.

Read the full file on GitHub · 174 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. 1mo ago First seen · 174 lines · 66 tokens per session scan A 7a946a2997e1

Subscribe to this mod's changes

typescript-test-writing is a skill published in the GitHub repository vybestack/llxprt-code (702 stars, last pushed today), licensed Apache-2.0. It adds 66 tokens to every session and 1,767 once invoked, about $0.0003 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-08-30.