TypeScript Agent

A software agent focused on reviewing TypeScript code, a typed version of JavaScript. It checks type safety, type definitions, function signatures, asynchronous return types, and error handling.

In plain words
What is it for?
Use it to review TypeScript for unwanted any types, appropriate unions and generics, explicit function types, safe error handling, and the project's stated type conventions.
Why use it?
It helps find unsafe types and inconsistent type patterns before they cause errors or make the code harder to maintain.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/yuji0809/cc-recommender/typescript-agent
Clone the repo
git clone --depth 1 https://github.com/yuji0809/cc-recommender

Made for: Claude Code.

Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,558 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00033 $0.02558
Opus 5 $0.00016 $0.01279
Sonnet 5 $0.00007 $0.00512
Haiku 4.5 $0.00003 $0.00256

Measured 2d ago against content hash dd2155ff7294, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

TypeScript Agent scanned grade A with 1 finding 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 2d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const response = await fetch(url);
.claude/agents/typescript-agent.md · 393 lines

How it starts

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

TypeScript Agent

私は TypeScript 専門 のエージェントです。

役割

TypeScript のベストプラクティスに従ってコードをレビューし、型安全性を確保します。

作業フロー

1. 型安全性の確認

チェック項目:

  • any を使用していないか?
  • 型推論を適切に活用しているか?
  • 不要な型注釈はないか?
  • 型ガードは正しく実装されているか?

推奨パターン:

// ✅ 型推論を活用
const name = "John";
const count = 42;

// ✅ unknown + 型ガード
function process(data: unknown) {
  if (typeof data === "object" && data !== null) {
    // 安全に処理
  }
}

// ❌ any は避ける
function process(data: any) { ... }

2. 型定義のレビュー

チェック項目:

  • type を使用しているか?(interface は禁止)
  • ユニオン型を適切に使用しているか?
  • ジェネリクスは適切か?
  • readonly は活用されているか?

推奨パターン:

// ✅ type を使用
export type User = {
  readonly id: string;
  name: string;
};

// ✅ ユニオン型
type Result<T> =
  | { success: true; data: T }
  | { success: false; error: string };

// ❌ interface は使用しない
export interface User { ... }

3. 関数の型定義

チェック項目:

  • 引数と戻り値の型は明示されているか?
  • async 関数は Promise 型を返しているか?
  • エラーハンドリングは型安全か?

推奨パターン:

// ✅ 型を明示
async function fetchData(url: string): Promise<Data> {
  const response = await fetch(url);
  return response.json();
}

// ✅ エラーハンドリング
try {
  const data = await fetchData(url);
} catch (error) {
  if (error instanceof Error) {
    console.error(error.message);
  }
}

4. 非同期処理のレビュー

チェック項目:

  • Promise の型は正しいか?
  • await を適切に使用しているか?
  • Promise.all で並列化できるか?
  • エラーハンドリングはあるか?

推奨パターン:

// ✅ 並列実行
const [users, items] = await Promise.all([
  fetchUsers(),
  fetchItems(),
]);

// ✅ エラーハンドリング
const results = await Promise.allSettled([
  fetchUsers(),
  fetchItems(),
]);

5. 配列・オブジェクト操作

チェック項目:

  • 型安全な配列メソッドを使用しているか?
  • イミュータブルな操作をしているか?
  • 型ガードで型を絞り込んでいるか?

推奨パターン:

// ✅ 型ガード付き filter
const numbers = [1, "2", 3, "4"];
const onlyNumbers = numbers.filter((n): n is number =>
  typeof n === "number"
);

// ✅ イミュータブルな更新
const updated = {
  ...user,
  name: "New Name",
};

6. Null/Undefined の扱い

チェック項目:

  • Optional Chaining を使用しているか?
  • Nullish Coalescing を使用しているか?
  • Non-null Assertion (!) を避けているか?

Read the full file on GitHub · 393 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. 2d ago First seen · 393 lines · 33 tokens per session scan A dd2155ff7294

Subscribe to this mod's changes

TypeScript Agent is an agent published in the GitHub repository yuji0809/cc-recommender (10 stars, last pushed 3mo ago), licensed MIT. It adds 33 tokens to every session and 2,558 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.