typescript-best-practices

typescript-best-practices is a skill for Claude Code from Taoidle/plan-cascade. It costs 34 tokens per session (566 once invoked), scanned A, original, MIT.

A set of guidelines for writing and reviewing TypeScript and Node.js code. TypeScript adds checks to JavaScript, while Node.js runs JavaScript outside a web browser.

In plain words
What is it for?
Use it when building or reviewing TypeScript services, APIs, and Node.js projects, including type definitions, requests, cancellation, and tests.
Why use it?
It helps catch type mistakes and handle asynchronous operations and errors consistently.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the plan-cascade plugin — 7 skills, 33 commands shipped together

Good fit Use it when building or reviewing TypeScript services, APIs, and Node.js projects, including type definitions, requests, cancellation, and tests.

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

Made for: Claude Code.

Or install plan-cascade, the plugin that ships this one along with the rest of its 7 skills, 33 commands.

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-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/taoidle/plan-cascade/typescript/github.svg)](https://agentmods.dev/skills/taoidle/plan-cascade/typescript)
Your own site
<a href="https://agentmods.dev/skills/taoidle/plan-cascade/typescript"><img src="https://agentmods.dev/badge/skills/taoidle/plan-cascade/typescript/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-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/taoidle/plan-cascade/typescript"><img src="https://agentmods.dev/badge/skills/taoidle/plan-cascade/typescript.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 566 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.00034 $0.00566
Opus 5.5 $0.00014 $0.00226
Sonnet 5.5 $0.00007 $0.00113
Haiku 4.5 $0.00003 $0.00057

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

Security

Grade A, and why

typescript-best-practices 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.

builtin-skills/typescript/SKILL.md · 98 lines

What it actually says

TypeScript Best Practices

Code Style

Rule Guideline
Formatter Prettier
Linter ESLint + @typescript-eslint
Strict mode strict: true in tsconfig

Type Safety

Rule Guideline
Avoid any Use unknown + narrowing
Type guards Custom predicates
Discriminated unions For variants
type Result<T> = { success: true; data: T } | { success: false; error: Error };

function isUser(v: unknown): v is User {
  return typeof v === 'object' && v !== null && 'id' in v;
}

Error Handling

class ApiError extends Error {
  constructor(message: string, public status: number) {
    super(message);
    this.name = 'ApiError';
  }
}

async function fetchUser(id: string): Promise<User> {
  const res = await fetch(`/api/users/${id}`);
  if (!res.ok) throw new ApiError('Failed', res.status);
  return res.json();
}

Project Structure

src/{index.ts, types/, services/, utils/}
tests/
package.json, tsconfig.json

Async Patterns

Pattern Usage
Promise.all Parallel operations
AbortController Cancellation
const [user, settings] = await Promise.all([fetchUser(id), fetchSettings(id)]);

Anti-Patterns

Avoid Use Instead
as assertions Type guards
! non-null ?. and ??
any unknown + narrowing
// Bad: data as User, user!.name
// Good:
if (isUser(data)) { /* data is User */ }
const name = user?.name ?? 'Unknown';

Testing (Vitest)

describe('Service', () => {
  it('should create', async () => {
    const mock = { save: vi.fn().mockResolvedValue({ id: '1' }) };
    const result = await new Service(mock).create({ name: 'Test' });
    expect(result.id).toBe('1');
  });
});
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 · 98 lines · 34 tokens per session scan A 0a823606f706

Subscribe to this mod's changes

typescript-best-practices is a skill published in the GitHub repository Taoidle/plan-cascade (133 stars, last pushed 7mo ago), licensed MIT. It adds 34 tokens to every session and 566 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-08-30.

Related

Other skills, from other repositories

node-backend

Node.js backend development patterns for Express, NestJS, Fastify, and Hono. Use when implementing APIs, authentication, middleware, services, and server-side logic with Node.js and TypeScript. Provides project structure, code patterns, and best practices.

shahtuyakov/claude-setup · 55 tokens

dev-team-node

Coordinates Node.js/TypeScript development (Next.js, NestJS, Vite, Express) with a team of specialized agents and inline quality gates. Use for multi-step Node.js tasks that need decomposition and multi-agent coordination.

biggora/dev-team · 49 tokens

nest-best-practices

NestJS framework best practices and production patterns. Use whenever working with NestJS — creating modules, controllers, services, DTOs, guards, interceptors, pipes, middleware, or building REST/GraphQL/microservice APIs. Also use when setting up authentication, authorization, validation, queues, health checks…

biggora/dev-team · 129 tokens

typescript-expert

TypeScript language expertise covering the type system, generics, utility types, advanced type patterns, and project configuration. Use this skill whenever writing, reviewing, or refactoring TypeScript code, designing type-safe APIs, working with complex generics, debugging type errors, configuring tsconfig.json…

biggora/dev-team · 146 tokens

nodejs-stack

This skill should be used when working with Node.js, TypeScript, or JavaScript projects, including frameworks like Next.js, NestJS, Express, Fastify, and Vite.

biggora/dev-team · 41 tokens

api-errors

McpError constructor, JsonRpcErrorCode reference, and error handling patterns for @cyanheads/mcp-ts-core. Use when looking up error codes, understanding where errors should be thrown vs. caught, or using ErrorHandler.tryCatch in services.

cyanheads/shift-mcp-server · 54 tokens