clean-code-js

Review JavaScript and TypeScript code for minimal behavior-preserving refactoring.

1|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/wnz99/claude-skills --skill clean-code-js
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code-js
Source: https://github.com/wnz99/claude-skills/tree/main/skills/clean-code-js
Command: npx skills add https://github.com/wnz99/claude-skills --skill clean-code-js

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you make JavaScript and TypeScript code easier to read, safer to change, and more consistent with the surrounding codebase when the task is specifically about cleanup, maintainability, naming, function design, error handling, or reducing accidental complexity.

Core Features & Use Cases

  • Targeted Refactoring Guidance: Improve a specific smell with the smallest useful change instead of rewriting code broadly.
  • Review-Oriented Cleanup: Provide maintainability findings for JS/TS code reviews, especially when correctness is already acceptable but clarity is weak.
  • Behavior-Preserving Improvements: Support clearer naming, flatter control flow, tighter types, and cleaner error contracts while preserving existing behavior.
  • Use Case: A developer inherits a tangled TypeScript function with deep nesting and unclear names, and uses this Skill to identify the actual smell, choose a minimal refactor, and verify the result against repo conventions.

Quick Start

Use the clean-code-js skill to review this JavaScript or TypeScript file and suggest the smallest behavior-preserving refactor that improves clarity.

Frequently Asked Questions about clean-code-js

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

FAQPage Schema
How do I refactor JavaScript code to improve readability without changing behavior?

Refactor JavaScript for readability by applying minimal, behavior-preserving changes to naming, function boundaries, and control flow. Target specific code smells with the smallest useful change rather than rewriting broadly, ensuring existing functionality remains intact.

What is the best way to review TypeScript code for maintainability?

Review TypeScript for maintainability by checking naming clarity, function boundaries, error handling, and accidental complexity. Focus on providing review-oriented cleanup suggestions when correctness is acceptable but clarity is weak, keeping changes aligned with repo conventions.

How do I clean up a deeply nested TypeScript function?

Clean up a deeply nested TypeScript function by flattening control flow and tightening types. Identify the actual smell, choose a minimal refactor that simplifies the call site, and verify the result against local repo conventions.

Can I use this approach for broad JavaScript rewrites?

This approach is not intended for broad JavaScript rewrites. It focuses on targeted refactoring, applying the smallest useful change to improve clarity and maintainability while strictly preserving existing behavior and adhering to repo-local conventions.

Does this refactoring method work for both JavaScript and TypeScript?

Yes, this refactoring method works for both JavaScript and TypeScript. It applies to naming, function boundaries, error handling, control flow, and accidental complexity in local JS/TS changes, ensuring behavior preservation and simpler call sites.