typescript-conventions

typescript-conventions is a skill for Claude Code from andr-ca/agentharness. It costs 43 tokens per session (886 once invoked), scanned A, original, MIT.

A set of conventions for writing and reviewing TypeScript and JavaScript, covering names, types, imports, private fields, missing values, asynchronous code, and module structure.

In plain words
What is it for?
Use it when creating, reviewing, or refactoring TypeScript or JavaScript code, including React code with the relevant additional conventions.
Why use it?
It helps keep code consistent and makes common language-specific mistakes easier to spot.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it when creating, reviewing, or refactoring TypeScript or JavaScript code, including React code with the relevant additional conventions.

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

Made for: Claude Code.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/andr-ca/agentharness/typescript-conventions"><img src="https://agentmods.dev/badge/skills/andr-ca/agentharness/typescript-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 886 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.
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.00043 $0.00886
Opus 5.5 $0.00017 $0.00354
Sonnet 5.5 $0.00009 $0.00177
Haiku 4.5 $0.00004 $0.00089

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

Security

Grade A, and why

typescript-conventions 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.

.claude/skills/typescript-conventions/SKILL.md · 110 lines

How it starts

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

TypeScript Conventions

This file is self-contained for day-to-day use. Deeper reference (needs the full harness checkout): languages/typescript/CONVENTIONS.md (full examples including generics and import grouping) and frameworks/react/CONVENTIONS.md (React/JSX-specific additions).

Naming

  • camelCase — functions, variables, method names. PascalCase — classes, interfaces, type aliases, enum names. UPPER_SNAKE_CASE — module-level constants.
  • Enum members: PascalCase.
  • Generic type params: T/U for simple one-liners; descriptive names (TEntity, TResponse) for complex or nested generics.

Imports & module structure

Group: external packages → internal modules → type-only imports. Separate each group with a blank line. Prefer import type for type-only imports (helps tools that strip types without full parsing).

import fs from 'fs';
import express from 'express';

import { UserRepository } from './repositories/UserRepository';

import type { User } from './types';

Private members: # over _prefix

Prefer native # private fields (ES2022+/TS 3.8+) in new code — real runtime privacy, not a convention that's still readable via ["_name"]. Don't rewrite working _prefix code on sight; it's not deprecated.

class TokenStore {
  #tokens: Map<string, string> = new Map();   // true runtime privacy
  #rotate(): void { /* ... */ }
}

Null vs. Undefined

Pick based on what absence means, then apply it consistently:

  • undefined (via ?) — "not provided / not yet set."
  • null — an explicit "no value" the code sets deliberately (nullable column, "user cleared this field").
  • Do not mix both for the same kind of absence in one module.

Pitfalls to catch in review

// WRONG: async function catches error, logs it, then resolves — hides failure
async function save(data: Data): Promise<void> {
  try {
    await db.write(data);
  } catch (err) {
    logger.error('save failed', err);
    // caller sees a successful promise despite the failure
  }
}

// RIGHT: rethrow after logging so the caller can handle the failure
async function save(data: Data): Promise<void> {
  try {
    await db.write(data);
  } catch (err) {
    logger.error('save failed', err);
    throw err;  // caller knows this failed
  }
}

// Type-cast escape hatch silences the compiler, not the bug
const result = someValue as SomeType;  // risky without a runtime check
// Prefer a type guard:
function isSomeType(v: unknown): v is SomeType { /* ... */ }

// Non-null assertion hides null/undefined bugs
const name = user!.profile!.name;   // crashes at runtime if null
// RIGHT: optional chaining + fallback
const name = user?.profile?.name ?? 'Unknown';

Read the full file on GitHub · 110 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 · 110 lines · 43 tokens per session scan A c042e576389f

Subscribe to this mod's changes

typescript-conventions is a skill published in the GitHub repository andr-ca/agentharness (1 stars, last pushed 2d ago), licensed MIT. It adds 43 tokens to every session and 886 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-31.

Related

Other skills, from other repositories

phaser-pixi-2d-games

Use when building a 2D web game with Phaser (3.x/4.x) or PixiJS 8 in TypeScript - framework vs renderer, Phaser scenes/game objects/arcade physics/groups as pools/scale manager/loader, scene shutdown cleanup, PixiJS 8 async init, Assets bundles, ticker units and destroy, and keeping rules in plain TS modules.

makifbaysal/tasktrooper · 86 tokens

node-typescript-security-pitfalls

Use when reviewing Node.js or TypeScript server code - Express/Fastify/Nest handlers, Next.js server actions and route handlers, childprocess, ORM raw queries, prototype pollution, template engines, JWT and outbound HTTP clients.

makifbaysal/tasktrooper · 53 tokens

node-typescript-service

Use when building or extending a TypeScript service on Node.js - Fastify, NestJS, Express or Hono, runtime validation at the boundary, strict types, the repository's ORM and migrations, async error handling, graceful shutdown.

makifbaysal/tasktrooper · 51 tokens

react-typescript-patterns

Use when writing React + TypeScript components - functional components, explicit typed props, derived state over effects, and no any/unsafe casts.

makifbaysal/tasktrooper · 33 tokens

architecture-audit

Systematic architecture audit and refactoring methodology for Rust + TypeScript codebases. Use when performing refactoring, cleanup, unification, code review, dead code removal, module reorganization, or tech debt elimination. Ensures no naming confusion, semantic overloading, hidden defaults, duplicate logic, or…

org2AI/ORG2 · 70 tokens

supermux-core

Use when building an app, script, bot or service in TypeScript that drives Claude Code, Codex, Cursor, OpenCode, Grok Build or Antigravity through the @supermux/core library.

UstaLabs/supermux · 46 tokens