type-safety

type-safety is an agent for Claude Code, Cursor from jamesjfoong/github-pr-review-mcp. It costs 27 tokens per session (346 once invoked), scanned A, original, MIT.

An agent for checking type safety and TypeScript usage when changing features, data types, or type-related errors.

In plain words
What is it for?
Use it to check tool parameter schemas, explicit interfaces and types, safe handling of optional values, exports, and appropriate use of unknown instead of any.
Why use it?
It helps prevent invalid values, missing definitions, and weak typing from spreading through the codebase.

Agent for Claude CodeCursor

Written for Cursor and Claude Code: installed under .cursor/, but also a Claude Code subagent (agents/*.md).

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/jamesjfoong/github-pr-review-mcp/type-safety
Clone the repo
git clone --depth 1 https://github.com/jamesjfoong/github-pr-review-mcp

Made for: Claude Code, Cursor.

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 type-safety

README.md
[![agentmods](https://agentmods.dev/badge/agents/jamesjfoong/github-pr-review-mcp/type-safety.svg)](https://agentmods.dev/agents/jamesjfoong/github-pr-review-mcp/type-safety)
Your own site
<a href="https://agentmods.dev/agents/jamesjfoong/github-pr-review-mcp/type-safety"><img src="https://agentmods.dev/badge/agents/jamesjfoong/github-pr-review-mcp/type-safety.svg" alt="Measured on agentmods" height="20"></a>
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 346 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.1 $0.00027 $0.00346
Opus 5 $0.00014 $0.00173
Sonnet 5 $0.00005 $0.00069
Haiku 4.5 $0.00003 $0.00035

Measured 5d ago against content hash 5d206fec897b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

type-safety 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 5d 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.

.cursor/agents/type-safety.md · 56 lines

What it actually says

Type Safety Agent

Purpose: Ensures type safety and proper TypeScript usage throughout the codebase.

Responsibilities

  • Verify all tool parameters have Zod schemas
  • Prefer explicit interface or type definitions over z.infer<typeof Schema>
  • Check for proper type definitions (no any unless necessary)
  • Use ? for optional properties (don't use | null | undefined)
  • Use optional chaining (?.) when accessing values
  • Verify all exports have proper types

When to Use

When adding new features, modifying types, or fixing type errors.

Key Rules

  • All parameters must have Zod schemas in src/types.ts
  • Use explicit type definitions alongside Zod schemas
  • Avoid any - use unknown if type is truly unknown
  • Prefer ? over | undefined for optional fields
  • Use | null when external APIs can return null
  • Strong typing: Always use explicit, strong types

Examples

// CORRECT - Explicit type definition with Zod schema
export const PRParamsSchema = z.object({
  owner: z.string(),
  repo: z.string(),
  prNumber: z.number(),
});

export interface PRParams {
  owner: string;
  repo: string;
  prNumber: number;
}

// CORRECT - Use optional property
interface GoodType {
  value?: string;
}

// CORRECT - Use optional chaining when accessing
const result = obj?.value ?? "default";
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. 5d ago First seen · 56 lines · 27 tokens per session scan A 5d206fec897b

Subscribe to this mod's changes

type-safety is an agent published in the GitHub repository jamesjfoong/github-pr-review-mcp (1 stars, last pushed 6mo ago), licensed MIT. It adds 27 tokens to every session and 346 once invoked, about $0.0001 per session on Opus 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 agents, from other repositories

language-reviewer-subagent

Multi-language code review — Python, TypeScript/JavaScript, Go, Rust, Java: idioms, type safety, concurrency, error handling, security, and framework-specific checks (FastAPI, React/Next.js, Spring Boot, Tokio).

darellchua2/opencode-config-template · 50 tokens

Typescript Pro

Expert TypeScript developer specializing in advanced type system usage, full-stack development, and build optimization. Masters type-safe patterns for both frontend and backend with emphasis on developer experience and runtime safety.

TheSethRose/Copilot-Skills · 41 tokens

Next.js Expert

Expert Next.js 16 developer specializing in App Router, Server Components, Cache Components, Turbopack, and modern React patterns with TypeScript.

github/awesome-copilot · 33 tokens

project-structure

Airbroke uses the Next.js App Router. Most feature code lives under app, components, lib, prisma, and tests.

icoretech/airbroke · 0 tokens

effect-architecture-reviewer

Reviews TypeScript system architecture to determine whether Effect (effect-ts) should be used, where it applies, and to what extent. Use when reviewing implementation plans, evaluating proposed architectures, or providing guidance to downstream implementation agents.

bengous/claude-code-plugins · 50 tokens

mainframe-typescript-backend-engineer

Use for server-side TypeScript work in Node.js applications: NestJS, Express, Fastify, Next.js server code, PostgreSQL access, Prisma, TypeORM, Drizzle, authentication, HTTP contracts, background jobs, realtime gateways, storage, resilience, and backend tests. Not for Python services, substantial client-only React UI…

CATWILLgh/MAINFRAME · 83 tokens