typescript-tests

typescript-tests is a skill for Claude Code, Codex from mkosir/typescript-style-guide. It costs 52 tokens per session (1,157 once invoked), scanned A, original, MIT.

A guide for writing and reviewing tests for TypeScript and TSX code. Tests are checks that code behaves as expected; it covers test structure, mocks, isolated tests, user-interface queries, and snapshots.

In plain words
What is it for?
Use it to design tests, organize them with an arrange-act-assert structure, mock dependencies, test interfaces from a user's perspective, and review snapshots.
Why use it?
It helps catch bugs early and makes code changes safer without making tests unnecessarily difficult to maintain.

Skill for Claude CodeCodex

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

Good fit Use it to design tests, organize them with an arrange-act-assert structure, mock dependencies, test interfaces from a user's perspective, and review snapshots.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mkosir/typescript-style-guide/typescript-tests
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 mkosir/typescript-style-guide --skill typescript-tests
Clone the repo
git clone --depth 1 https://github.com/mkosir/typescript-style-guide

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/mkosir/typescript-style-guide/typescript-tests/github.svg)](https://agentmods.dev/skills/mkosir/typescript-style-guide/typescript-tests)
Your own site
<a href="https://agentmods.dev/skills/mkosir/typescript-style-guide/typescript-tests"><img src="https://agentmods.dev/badge/skills/mkosir/typescript-style-guide/typescript-tests/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-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/mkosir/typescript-style-guide/typescript-tests"><img src="https://agentmods.dev/badge/skills/mkosir/typescript-style-guide/typescript-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,157 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Prompt Injection · line 28
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
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.00052 $0.01157
Opus 5.5 $0.00021 $0.00463
Sonnet 5.5 $0.00010 $0.00231
Haiku 4.5 $0.00005 $0.00116

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

Security

Grade A, and why

typescript-tests 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 3mo 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.

skills/typescript-tests/SKILL.md · 94 lines

How it starts

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

Tests

Apply the TypeScript Style Guide's testing conventions in the context of the current task.

Workflow

  1. Inspect the consuming repository's test runner, libraries, conventions, and configuration.
  2. Let explicit repository conventions take precedence over this opinionated guidance.
  3. Apply, review, or explain only the guidance relevant to the task.
  4. State important tradeoffs when testing strategy depends on risk, scope, or maintenance cost.

Boundaries

  • Keep the test runner, TypeScript, and ESLint responsible for checks they can enforce automatically.
  • Do not add or rewrite unrelated tests merely because this skill is active.

Functions

For detailed function design guidance that supports testability, use typescript-functions when it is available.

Appendix - Tests

What & How To Test

Automated tests help us write better code, make refactoring easier, and catch bugs earlier in the process.
Consider the trade-offs of what and how to test to gain confidence that the application is working as intended, while ensuring that writing and maintaining tests doesn't slow the team down.

✅ Do:

  • Keep tests short, explicit, and pleasant to work with. A test's intent should be immediately visible.
  • Strive to follow the AAA pattern to maintain clean, organized, and understandable unit tests.
    • Arrange - Setup preconditions or the initial state necessary for the test case. Create necessary objects and define input values.
    • Act - Perform the action you want to unit test (invoke a method, triggering an event etc.). Strive for minimal number of actions.
    • Assert - Validate the outcome against expectations. Strive for minimal number of asserts.
      The rule "unit tests should fail for exactly one reason" doesn't always need to apply, but tests with many assertions can indicate a code smell.
  • As mentioned in function conventions, try to keep functions pure and impure ones small and focused.
    This makes them easy to test by passing arguments and observing return values, since we will rarely need to mock dependencies.
  • Strive to write tests based on how a user interacts with your app, meaning test business logic.
    E.g. for a specific user role or permission, given some input, we receive the expected output from the process.
  • Make tests as isolated as possible so they don't depend on execution order and can run independently with their own local storage, session storage, data, cookies etc. Test isolation speeds up the test run, improves reproducibility, makes debugging easier and prevents cascading test failures.
  • Tests should be resilient to changes.
    • Black box testing - Always test only publicly exposed behavior. Don't write fragile tests based on how the implementation works internally.
    • Query HTML elements based on attributes that are unlikely to change. Order of priority must be followed as specified in Testing Library - role, label, placeholder, text contents, display value, alt text, title, test ID.
    • If testing with a database, make sure you control the data. If tests are run against a staging environment, make sure it doesn't change.

Read the full file on GitHub · 94 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. 3mo ago First seen · 94 lines · 52 tokens per session scan A 926ef4f85ad4

Subscribe to this mod's changes

typescript-tests is a skill published in the GitHub repository mkosir/typescript-style-guide (789 stars, last pushed 2mo ago), licensed MIT. It adds 52 tokens to every session and 1,157 once invoked, about $0.0002 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.

Related

typescript-tests compared with skills from other repositories

typescript-tests next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
typescript-testsmkosir/typescript-style-guideSkill7892mo agoMITA52Claude Code, Codex
create-prprisma/ormSkill48ktodayApache-2.0A47Claude Code, Codex
review-implement-phaseprisma/ormSkill48ktodayApache-2.0A38Claude Code
no-bare-castsprisma/ormSkill48ktodayApache-2.0A52Claude Code, Codex
write-architecture-docsprisma/ormSkill48ktodayApache-2.0A55Claude Code, Codex
intelligence-vocabularyCopilotKit/CopilotKitSkill39ktodayMITA79Claude Code
cabloy-mcp-imagecabloy/cabloySkill987yesterdayMITA74Claude Code, Codex