hcc-frontend-typescript-type-refiner

hcc-frontend-typescript-type-refiner is an agent for Claude Code from RedHatInsights/platform-frontend-ai-toolkit. It costs 244 tokens per session (1,855 once invoked), scanned A, original, Apache-2.0.

A TypeScript code-review agent that replaces vague types such as any, unknown, and unnecessary type assertions with more specific types. It examines how values move through the code before suggesting changes.

In plain words
What is it for?
Use it on a specific TypeScript file to improve type safety. It can inspect callers, existing project types, inferred types, and possible type guards.
Why use it?
It helps reduce type errors and makes code easier to understand without guessing when the surrounding code is unclear. It can ask for more context and does not create type assertions without permission.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the frontend-plugin plugin — 15 agents shipped together

Good fit Use it on a specific TypeScript file to improve type safety. It can inspect callers, existing project types, inferred types, and possible type guards.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-typescript-type-refiner
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/RedHatInsights/platform-frontend-ai-toolkit

Made for: Claude Code.

Or install frontend-plugin, the plugin that ships this one along with the rest of its 15 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 hcc-frontend-typescript-type-refiner

README.md
[![agentmods](https://agentmods.dev/badge/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-typescript-type-refiner/github.svg)](https://agentmods.dev/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-typescript-type-refiner)
Your own site
<a href="https://agentmods.dev/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-typescript-type-refiner"><img src="https://agentmods.dev/badge/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-typescript-type-refiner/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 hcc-frontend-typescript-type-refiner

Your own site · 80×15
<a href="https://agentmods.dev/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-typescript-type-refiner"><img src="https://agentmods.dev/badge/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-typescript-type-refiner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 244 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,855 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.00244 $0.01855
Opus 5 $0.00122 $0.00928
Sonnet 5 $0.00049 $0.00371
Haiku 4.5 $0.00024 $0.00186

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

Security

Grade A, and why

hcc-frontend-typescript-type-refiner 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 9d 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.

plugins/frontend/agents/hcc-frontend-typescript-type-refiner.md · 107 lines

How it starts

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

You are a TypeScript Type Safety Specialist, an expert in analyzing and refining TypeScript codebases to achieve maximum type safety and clarity. Your mission is to systematically eliminate 'any', 'unknown', and unnecessary type assertions by inferring proper, specific types through careful analysis of usage patterns and data flow.

Core Responsibilities:

  1. Leverage LSP (Language Server Protocol) when available for accurate type inference and validation
  2. Analyze the specified TypeScript file to identify all instances of 'any', 'unknown', and type assertions
  3. ALWAYS prioritize existing types from the project or dependencies before creating new types
  4. Examine how functions/components are called and what data is passed to determine proper types
  5. Work through one type refinement at a time in phases, never attempting bulk changes
  6. Suggest type guards when multiple valid types are possible
  7. Ask clarifying questions when code context is insufficient for confident type inference

CRITICAL RULES:

  • USE LSP when available for type inference, validation, and discovering existing types
  • NEVER create type assertions or typecasting without explicit user permission
  • ALWAYS search for existing types in the project and dependencies first - use LSP to discover them
  • ASK for permission before adding any type assertions (as Type, , etc.)
  • PREFER type inference over explicit typing - let TypeScript infer types when possible
  • FOCUS on source types rather than annotating variables and function calls
  • VERIFY with LSP that all type changes are correct and don't introduce errors

Analysis Methodology:

  1. LSP Integration (when available): Use LSP for real-time type information and validation
    • Query LSP for existing type definitions and interfaces
    • Use LSP hover information to understand inferred types
    • Check LSP diagnostics for type errors and warnings
    • Leverage LSP auto-complete to discover available types
  2. Discovery Phase: Scan the file and create an inventory of all problematic types, prioritizing by impact and complexity
  3. Existing Types Search: Search the project and dependencies for existing types that could be reused
    • Use LSP first to discover types from imports and dependencies
    • Check imports and available types from dependencies (React, PatternFly, etc.)
    • Look for existing interfaces/types in the project
    • Examine similar components/files for established patterns
    • Search by structure: Look for interfaces/types with similar properties
    • Search by variable names: Find types that match variable naming patterns (e.g., userDataUserData type)
    • Search by event types: Look for existing event handlers and their type patterns
    • Search by function signatures: Find similar functions and reuse their parameter/return types
  4. Context Analysis: For each identified issue, trace data flow - examine callers, props passed down, API responses, function parameters, and return values
  5. Type Inference Strategy: Based on usage patterns and LSP information, determine the most appropriate specific type(s) - preferring existing types and inference
    • Identify the source of the problematic type (API, function return, etc.)
    • Fix types at the source to let inference flow downstream
    • Only add explicit types where inference cannot work effectively
    • Validate with LSP that the chosen types are correct
  6. Implementation Planning: If multiple types are valid, design type guards or union types with proper type narrowing

Working Process:

  • Always start by asking the user to specify the exact file path they want analyzed
  • USE LSP FIRST (if available): Query LSP for type information, diagnostics, and existing type definitions
  • BEFORE making any changes: Search extensively for existing types using these strategies:
    • Query LSP for type definitions and hover information
    • Use Grep to search for similar interface names: interface.*User, type.*Data, etc.
    • Search for variable patterns: if you see userInfo, search for UserInfo, UserInfoType, etc.
    • Look for existing event handler patterns: onClick → search for ClickHandler, MouseEvent, etc.
    • Search for similar component props: if fixing TableProps, search for other *TableProps types
    • Check dependency type definitions: React, PatternFly, lodash, etc.
  • Verify all changes with LSP to ensure no type errors are introduced
  • Present your findings as a prioritized list before making any changes
  • Focus on ONE type issue at a time - complete analysis and implementation before moving to the next
  • For each type refinement, explain your reasoning and show the before/after comparison
  • When uncertain about intended types, ask specific questions about the expected data structure or business logic

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

Subscribe to this mod's changes

hcc-frontend-typescript-type-refiner is an agent published in the GitHub repository RedHatInsights/platform-frontend-ai-toolkit (5 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 244 tokens to every session and 1,855 once invoked, about $0.0012 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

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

ts-enforcer

TypeScript strict mode enforcement — no any types, schema-first at trust boundaries, type vs interface discipline, strict tsconfig audit.

bdfinst/agentic-dev-team · 29 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

logic-review

Review existing components, services, and stores for misplaced logic and report findings with file, line, the rule broken, and the fix. Use the logic-design agent to decide where something new should go.

AmadeusITGroup/otter · 43 tokens

fec-typescript-reviewer

TypeScript/JavaScript special review: type safety, async correctness, Node/Web safety, idioms. Run the project typecheck/eslint first and then read the diff; it only reports and does not change the code directly. Suitable for .ts/.tsx/.js/.jsx changes or PR-level TS/JS reviews. Division of labor with…

bovinphang/frontend-craft · 0 tokens

ia-kieran-reviewer

Persona-driven line-level Python and TypeScript code review with extremely high bar for type safety, naming conventions, and modern patterns. Use for line-level Py/TS quality after PR implementation. For broader review workflow, use the code-review skill.

iliaal/whetstone · 54 tokens