frontend-js-best-practices

Review JavaScript and TypeScript code for performance bottlenecks and best practices.

93|9|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/sergiodxa/agent-skills --skill frontend-js-best-practices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontend-js-best-practices
Source: https://github.com/sergiodxa/agent-skills/tree/main/skills/frontend-js-best-practices
Command: npx skills add https://github.com/sergiodxa/agent-skills --skill frontend-js-best-practices

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write more efficient and performant JavaScript and TypeScript code by providing clear guidelines and best practices.

Core Features & Use Cases

  • Performance Optimization: Offers rules for reducing computation, optimizing data structures, and avoiding common performance pitfalls.
  • Code Quality: Promotes consistent coding styles and best practices for maintainability.
  • Use Case: When refactoring a complex data processing function, consult this Skill to ensure loops are optimized, data structures are appropriate, and DOM manipulations are batched to prevent layout thrashing.

Quick Start

Review the provided JavaScript code for performance bottlenecks and adherence to best practices.

Frequently Asked Questions about frontend-js-best-practices

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

FAQPage Schema
How do I optimize JavaScript code for peak performance and maintainability?

To optimize JavaScript code, apply guidelines for reducing computation, selecting appropriate data structures, and batching DOM manipulations to prevent layout thrashing while enforcing consistent code styles.

What are the best practices for optimizing loops and data structures in TypeScript?

Best practices for optimizing loops and data structures involve enforcing rules to prevent performance bottlenecks, ensuring you use appropriate data structures, and reducing unnecessary computation during complex data processing.

How does batching DOM manipulation improve JavaScript performance?

Batching DOM manipulation improves JavaScript performance by preventing layout thrashing, reducing the frequency of reflows and repaints, and minimizing performance bottlenecks during complex user interface updates.

Can I use these JavaScript best practices to refactor complex data processing functions?

Yes, you can use these JavaScript best practices to refactor complex data processing functions by verifying that loops are optimized, data structures are appropriate, and code readability is improved for long-term maintainability.

Why does my JavaScript code have performance bottlenecks during heavy computations?

JavaScript code has performance bottlenecks during heavy computations due to unoptimized loops, inefficient data structures, and unbatched DOM manipulations that cause layout thrashing and degrade overall execution speed.

What's the best way to enforce code quality and consistent styles in TypeScript?

The best way to enforce code quality and consistent styles in TypeScript is by applying guidelines that promote maintainability, improve readability, and prevent common performance pitfalls across the codebase.