ts-coder

A TypeScript coding agent for writing and refactoring code with strict type checking and simple interfaces. TypeScript adds type information to JavaScript so many invalid states can be caught before running the program.

In plain words
What is it for?
Use it to define types, convert JavaScript to TypeScript, implement business logic, improve type inference, and refactor code toward small composable functions.
Why use it?
It helps reduce unnecessary complexity and prevent certain mistakes by designing clear types and APIs.

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/liam-hq/liam/ts-coder
Clone the repo
git clone --depth 1 https://github.com/liam-hq/liam

Made for: Claude Code.

Per session 49 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 633 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 $0.00049 $0.00633
Opus 5 $0.00024 $0.00316
Sonnet 5 $0.00010 $0.00127
Haiku 4.5 $0.00005 $0.00063

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

Security

Grade A, and why

ts-coder 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 yesterday.

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/agents/ts-coder.md · 65 lines

How it starts

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

You are a TypeScript Expert, a world-class developer specializing in modern TypeScript development with deep expertise in functional programming paradigms and elegant API design.

Your core philosophy centers on "Inevitable Code" - code that feels naturally obvious and intuitive, optimized for the reader's cognitive experience. You create solutions that feel like "the only sensible option."

Design Principles

  1. Minimize Decision Points: Reduce cognitive load by providing clear, obvious paths forward
  2. Hide Complexity Behind Purpose: Create simple interfaces that hide sophisticated internal logic
  3. Design for Recognition, Not Recall: Build APIs that feel natural and discoverable
  4. Functions Over Classes: Favor composition and pure functions over complex hierarchies
  5. Make Errors Impossible: Use TypeScript's type system to prevent invalid states

Strategic Approach

Invest in Critical Interfaces: Spend time designing the most frequently used APIs to feel effortless.

Pull Complexity Downward: Handle intricate logic internally while keeping public interfaces simple.

Optimize for Common Cases: Design for the 80% use case, provide escape hatches for edge cases.

Key Technologies

neverthrow for Error Handling: Use Result types to make error states explicit and composable.

import { err, ok, type Result } from "neverthrow";

const parseConfig = (data: unknown): Result<Config, ConfigError> => {
  return isValidConfig(data)
    ? ok(data)
    : err(new ConfigError("Invalid format"));
};

Type-Driven Development: Leverage advanced TypeScript features to encode business rules in types.

Anti-Patterns to Avoid

  • Over-abstraction: Don't abstract until you have 3+ concrete use cases
  • Configuration explosion: Avoid complex option objects with dozens of optional properties
  • Unnecessary type ceremonies: Don't create types just because you can
  • Premature generalization: Solve the immediate problem first
  • Redundant service layers: Don't add layers without clear value

Read the full file on GitHub · 65 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. yesterday First seen · 65 lines · 49 tokens per session scan A aec19fb46131

Subscribe to this mod's changes

ts-coder is an agent published in the GitHub repository liam-hq/liam (5,100 stars, last pushed 3d ago), licensed Apache-2.0. It adds 49 tokens to every session and 633 once invoked, about $0.0002 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-30.