typescript-best-practices

typescript-best-practices is a skill for Claude Code, Codex from fideguch/my_pm_tools. It costs 0 tokens per session (1,454 once invoked), scanned A, original, MIT.

A guide to setting up TypeScript projects and writing code that catches more mistakes through type checking. TypeScript is JavaScript with optional checks for the kinds of values code uses.

In plain words
What is it for?
Use it to configure tsconfig.json, add path aliases, enable strict mode gradually, and set up new or migrating Node.js projects.
Why use it?
It provides consistent compiler settings and a gradual path for moving an existing JavaScript project to stricter TypeScript checks.

Skill for Claude CodeCodex

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

Good fit Use it to configure tsconfig.json, add path aliases, enable strict mode gradually, and set up new or migrating Node.js projects.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/fideguch/my_pm_tools/typescript-best-practices.svg)](https://agentmods.dev/skills/fideguch/my_pm_tools/typescript-best-practices)
Your own site
<a href="https://agentmods.dev/skills/fideguch/my_pm_tools/typescript-best-practices"><img src="https://agentmods.dev/badge/skills/fideguch/my_pm_tools/typescript-best-practices.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,454 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.00000 $0.01454
Opus 5 $0.00000 $0.00727
Sonnet 5 $0.00000 $0.00291
Haiku 4.5 $0.00000 $0.00145

Measured 7d ago against content hash aaa916d7375b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-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 7d 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-best-practices/SKILL.md · 230 lines

How it starts

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

TypeScript ベストプラクティス & プロジェクト初期設定スキル

メタデータ

  • トリガー: 「TypeScript設定」「tsconfig設定」「TypeScriptプロジェクト初期設定」「型安全」
  • 前提条件: Node.js プロジェクト

概要

TypeScript プロジェクトの初期設定と型安全なコーディングのベストプラクティスを提供するスキル。 tsconfig.json の最適設定、パス エイリアス、厳格モードの段階的導入をガイドする。


Phase 1: TypeScript 導入判定

1.1 新規プロジェクト

npm install --save-dev typescript @types/node
npx tsc --init

1.2 既存 JavaScript プロジェクトの移行

npm install --save-dev typescript @types/node
# allowJs: true で段階的に移行

Phase 2: tsconfig.json 推奨設定

2.1 厳格モード(推奨)

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "lib": ["ES2022", "DOM", "DOM.Iterable"],

    "strict": true,
    "noUncheckedIndexedAccess": true,
    "noImplicitOverride": true,
    "noPropertyAccessFromIndexSignature": true,
    "exactOptionalPropertyTypes": false,

    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "skipLibCheck": true,
    "isolatedModules": true,
    "resolveJsonModule": true,
    "declaration": true,
    "declarationMap": true,
    "sourceMap": true,

    "outDir": "./dist",
    "rootDir": "./src",
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist", "coverage", "**/*.test.ts"]
}

2.2 フレームワーク別追加設定

Next.js:

{
  "compilerOptions": {
    "jsx": "preserve",
    "incremental": true,
    "plugins": [{ "name": "next" }]
  }
}

React (Vite):

{
  "compilerOptions": {
    "jsx": "react-jsx",
    "moduleResolution": "bundler"
  }
}

Phase 3: 型安全コーディングガイドライン

3.1 避けるべきパターン

// BAD: any の使用
function process(data: any) { ... }

// GOOD: 適切な型定義
interface ProcessInput {
  id: string;
  value: number;
}
function process(data: ProcessInput) { ... }

// BAD: 型アサーション の乱用
const user = response as User;

// GOOD: 型ガードの使用
function isUser(obj: unknown): obj is User {
  return typeof obj === 'object' && obj !== null && 'id' in obj;
}
if (isUser(response)) { ... }

// BAD: Non-null assertion の乱用
const name = user!.name;

// GOOD: オプショナルチェーン + nullish coalescing
const name = user?.name ?? 'Unknown';

Read the full file on GitHub · 230 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. 7d ago First seen · 230 lines · 0 tokens per session scan A aaa916d7375b

Subscribe to this mod's changes

typescript-best-practices is a skill published in the GitHub repository fideguch/my_pm_tools (1 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,454 tokens. 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

add-export

Add a new subpath export to the @cyanheads/mcp-ts-core package. Use when creating a new public API surface that consumers import from a dedicated subpath (e.g., @cyanheads/mcp-ts-core/newutil).

cyanheads/mcp-ts-core · 50 tokens

basic-inline-skill

A minimal instruction-only skill with inline content and the function builder alternative.

agentfront/frontmcp · 19 tokens

typescript-lsp

Search TypeScript SYMBOLS (functions, types, classes) - NOT text. Use Glob to find files, Grep for text search, LSP for symbol search. Provides type-aware results that understand imports, exports, and relationships.

youdotcom-oss/dx-toolkit · 51 tokens

scraperapi-nodejs-sdk

Best-practices reference for the ScraperAPI Node.js / JavaScript SDK (scraperapi-sdk npm package). Consult whenever the user is writing, debugging, or reviewing JavaScript or TypeScript code that calls ScraperAPI. Use when user asks: "scrape a website with Node.js and ScraperAPI", "ScraperAPI JavaScript example", "how…

scraperapi/scraperapi-skills · 187 tokens

typescript-best-practices

TypeScript/Node.js best practices. Use when writing or reviewing TypeScript code. Covers type safety, async patterns, and error handling.

Taoidle/plan-cascade · 34 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/pubmed-mcp-server · 54 tokens