fix-unused-imports

Detect and fix TypeScript unused imports and variables during tsc checks.

2|1|Updated Dec 10, 2025
One-click install
npx skills add https://github.com/inernoro/prd_agent --skill fix-unused-imports
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fix-unused-imports
Source: https://github.com/inernoro/prd_agent/tree/main/.claude/skills/fix-unused-imports
Command: npx skills add https://github.com/inernoro/prd_agent --skill fix-unused-imports

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automatically detect and fix TypeScript unused imports/variables errors (TS6133). Use when encountering "declared but its value is never read" errors during tsc, build, or CI checks.

Core Features & Use Cases

  • Identify the error message and extract the file path, line number, and unused identifier.
  • Read the file around the error to determine the best fix.
  • Decide fix strategy: remove the entire unused import, prune from multi-import lists, or handle unused variables.
  • Apply the fix and verify by re-running the original command.

Quick Start

Run the tool to automatically remove the unused import or variable and re-check the TypeScript compilation.

Frequently Asked Questions about fix-unused-imports

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

FAQPage Schema
How do I fix TS6133 errors for unused imports during a TypeScript build?

Fix TS6133 errors by identifying the flagged file and line, reading the surrounding code, removing the unused import or variable, and re-running the TypeScript build to verify the compilation passes.

What is the best way to remove unused TypeScript variables when tsc --noEmit fails?

Remove unused TypeScript variables by parsing the tsc --noEmit failure logs, extracting the unused identifier, pruning it from the code, and re-running the original command to verify the compilation passes.

Can I automatically clean up unused imports in a TypeScript CI check?

Yes, you can clean up unused imports during a TypeScript CI check by detecting the TS6133 failure, applying a targeted fix to remove or prune the unused declaration, and validating the result.

How does an automated unused import fix handle multi-import statements?

It handles multi-import statements by reading the code around the error and pruning the specific unused identifier from the import list rather than removing the entire statement.

Do I need to manually verify TypeScript code after removing unused imports?

You do not need to manually verify TypeScript code after removing unused imports if the fix process re-runs the original tsc, build, or CI command to automatically confirm the compilation succeeds.