Avoid Inline JavaScript

•
73k
•

Enforces web development best practices by migrating inline scripts to external files to improve security, performance, and maintainability.

This skill empowers Claude to identify and remediate anti-patterns related to inline JavaScript within web applications. It systematically audits source code for embedded scripts and HTML event handlers, providing guidance on refactoring them into modular, external JavaScript files. By implementing this skill, developers can ensure their projects comply with Content Security Policy (CSP) standards, leverage browser caching more effectively, and maintain a clean separation of concerns between markup and logic. It is particularly useful during code reviews or when modernizing legacy codebases.

主要功能

01Automates the transition to modern DOM event listener patterns
0272,925 GitHub stars
03Refactors embedded script tags into external, cacheable JavaScript files
04Detects inline event handlers like onclick, onmouseover, and others
05Ensures compliance with Content Security Policy (CSP) requirements
06Identifies critical above-the-fold exceptions for performance optimization

使用场景

01Optimizing frontend projects for better browser caching and faster load times
02Automating code reviews to flag inline scripts and event handlers
03Refactoring legacy web applications to improve security and performance