types-refactor-specialist

Refactor duplicate and inline TypeScript types using extends, Pick, and Omit.

3|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/gwpjp/Web3-Claude --skill types-refactor-specialist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: types-refactor-specialist
Source: https://github.com/gwpjp/Web3-Claude/tree/main/.claude/skills/types-refactor-specialist
Command: npx skills add https://github.com/gwpjp/Web3-Claude --skill types-refactor-specialist

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Types Refactor Specialist identifies duplicate and inline TypeScript definitions, unifies them for reuse, and extracts inline types into a centralized src/types/ library to improve consistency and maintainability.

Core Features & Use Cases

  • Unify duplicate type definitions using extends, Pick, and Omit to minimize surface area and improve reuse.
  • Extract inline types into src/types/ to create a stable, centralized type library.
  • Generate a structured refactoring report and update type-index.json to reflect changes in the codebase.

Quick Start

After project setup, run the skill to scan common type locations (src/types/, src/components/, src/hooks/, src/pages/) and apply recommended refactorings, followed by a final report.

Frequently Asked Questions about types-refactor-specialist

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor duplicate TypeScript types across a codebase?

To refactor duplicate TypeScript types, scan common locations like src/components and src/hooks to identify redundancies, unify definitions using extends, Pick, and Omit, and extract them into a centralized src/types/ library to reduce surface area and improve reuse.

What is the best way to extract inline TypeScript types into a shared library?

The best way to extract inline TypeScript types is to move them into a centralized src/types/ directory, which creates a stable type library. This process updates the type-index.json to reflect changes and improves maintainability in collaborative projects.

How do I unify duplicate type definitions using extends, Pick, and Omit?

Unify duplicate type definitions by applying TypeScript utility types like extends, Pick, and Omit to minimize surface area. This approach composes shared base types rather than duplicating properties, improving code reuse across the project.

Can I automatically scan src/components and src/hooks for inline type definitions?

Yes, you can automatically scan src/components, src/hooks, src/pages, and src/types for inline type definitions. The tool targets these common locations to identify and extract inline types, applying recommended refactorings to reduce redundancy.

How do I verify TypeScript refactoring changes with yarn typecheck and yarn build?

Verify TypeScript refactoring changes by running yarn typecheck, yarn lint, yarn prettier, and yarn build. These commands enforce code quality and compilation checks to ensure the extracted and unified types do not break the existing codebase.