typescript-refactor-expert

typescript-refactor-expert is an agent for Claude Code from giuseppe-trisciuoglio/developer-kit. It costs 63 tokens per session (3,764 once invoked), scanned A, original, MIT.

A TypeScript and JavaScript refactoring specialist. Refactoring means changing the internal structure of code to improve readability and maintenance without changing what it does.

In plain words
What is it for?
Use it to improve project files after adding features or when code has become difficult to maintain. It checks clean-code and SOLID design principles, modern JavaScript syntax, architecture, and related tests.
Why use it?
It helps remove duplicated or dead code, simplify complex conditions, improve names and types, and preserve existing behaviour. It also verifies changes with tests.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter; mentions CLAUDE.md; positional $N argument.

Part of the developer-kit-typescript plugin — 25 skills, 3 commands, 13 agents shipped together

Good fit Use it to improve project files after adding features or when code has become difficult to maintain. It checks clean-code and SOLID design principles, modern JavaScript syntax, architecture, and related tests.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/giuseppe-trisciuoglio/developer-kit/typescript-refactor-expert
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.

Clone the repo
git clone --depth 1 https://github.com/giuseppe-trisciuoglio/developer-kit

Made for: Claude Code.

Or install developer-kit-typescript, the plugin that ships this one along with the rest of its 25 skills, 3 commands, 13 agents.

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-refactor-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/giuseppe-trisciuoglio/developer-kit/typescript-refactor-expert/github.svg)](https://agentmods.dev/agents/giuseppe-trisciuoglio/developer-kit/typescript-refactor-expert)
Your own site
<a href="https://agentmods.dev/agents/giuseppe-trisciuoglio/developer-kit/typescript-refactor-expert"><img src="https://agentmods.dev/badge/agents/giuseppe-trisciuoglio/developer-kit/typescript-refactor-expert/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-refactor-expert

Your own site · 80×15
<a href="https://agentmods.dev/agents/giuseppe-trisciuoglio/developer-kit/typescript-refactor-expert"><img src="https://agentmods.dev/badge/agents/giuseppe-trisciuoglio/developer-kit/typescript-refactor-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,764 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.00063 $0.03764
Opus 5 $0.00032 $0.01882
Sonnet 5 $0.00013 $0.00753
Haiku 4.5 $0.00006 $0.00376

Measured today against content hash b69cdb1fd5c8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

typescript-refactor-expert 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 today.

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.

plugins/developer-kit-typescript/agents/typescript-refactor-expert.md · 573 lines

How it starts

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

You are an expert TypeScript and modern JavaScript code refactoring specialist focused on improving code quality, maintainability, and readability while preserving functionality.

When invoked:

  1. Check for project-specific standards in CLAUDE.md (takes precedence)
  2. Analyze target files for code smells and improvement opportunities
  3. Apply refactoring patterns incrementally with testing verification
  4. Ensure TypeScript best practices and modern JavaScript/ES features
  5. Verify changes with comprehensive testing

Refactoring Checklist

  • TypeScript Best Practices: Proper typing, type inference, utility types, avoiding any, strict mode compliance
  • Modern JavaScript: ES2020+ features, async/await, optional chaining, nullish coalescing, destructuring
  • Clean Code: Guard clauses, meaningful names, single responsibility, self-documenting code
  • SOLID Principles: SRP, OCP, LSP, ISP, DIP adherence with TypeScript interfaces
  • Architecture: Feature-based organization, DDD patterns, repository pattern, hexagonal architecture
  • Code Smells: Dead code removal, magic numbers extraction, complex conditionals simplification
  • Testing: Maintain test coverage, update tests when refactoring, proper mocking
  • Performance: Efficient array methods, proper async patterns, memory management

Key Refactoring Patterns

1. TypeScript-Specific Refactorings

Type Safety Improvements

Convert unsafe types to proper TypeScript types:

// Before
function processUser(user: any) {
  return user.name.toUpperCase();
}

// After
interface User {
  id: string;
  name: string;
  email: string;
}

function processUser(user: User): string {
  return user.name.toUpperCase();
}
Union Types vs Enums

Prefer union types over enums for better tree-shaking:

// Before
enum Status {
  Pending = 'PENDING',
  Approved = 'APPROVED',
  Rejected = 'REJECTED'
}

// After
type Status = 'pending' | 'approved' | 'rejected';

const STATUS_LABELS: Record<Status, string> = {
  pending: 'Pending Review',
  approved: 'Approved',
  rejected: 'Rejected'
};

Read the full file on GitHub · 573 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. today First seen · 573 lines · 63 tokens per session scan A b69cdb1fd5c8

Subscribe to this mod's changes

typescript-refactor-expert is an agent published in the GitHub repository giuseppe-trisciuoglio/developer-kit (343 stars, last pushed today), licensed MIT. It adds 63 tokens to every session and 3,764 once invoked, about $0.0003 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-09-10.

Related

Other agents, from other repositories

agent-sdk-verifier-ts

Use this agent to verify that a TypeScript Agent SDK application is properly configured, follows SDK best practices and documentation recommendations, and is ready for deployment or testing. This agent should be invoked after a TypeScript Agent SDK app has been created or modified.

anthropics/claude-plugins-official · 56 tokens

angular-reviewer

Angular 22 and TypeScript code review specialist — Signals, Signal Forms (stable), standalone components, RxJS, performance, zoneless change detection, httpResource.

TheBeardedBearSAS/claude-craft · 36 tokens

cli-developer

CLI and terminal tool development specialist for Commander.js applications, plugin architectures, terminal UX with chalk, and integration testing with node:test.

pjt222/agent-almanac · 29 tokens

mcp-developer

MCP server development specialist that analyzes codebases to identify tool-exposure opportunities and scaffolds Model Context Protocol servers.

pjt222/agent-almanac · 27 tokens

ts-reviewer

Reviews TypeScript/JavaScript diffs read-only on source and returns a findings table: correctness, type-safety, XSS/injection, any leakage. Writes only its report, to a caller-named path outside the repo. - Use after a TypeScript or JavaScript change lands, before it merges. Spawn one per diff.

uwuclxdy/agenticat · 74 tokens

typescript-expert

Use this agent as a distinguished TypeScript/React/Next.js language authority and domain expert for peer-review-level code review. This agent NEVER writes implementation code — it reviews, critiques, and recommends with language-specific depth that generalist agents miss. Covers type system mastery, React 19+…

asiflow/claude-nexus-hyper-agent-team · 465 tokens