Frontend Js Best Practices
JavaScript and TypeScript performance and style rules covering loops, data structures, caching, and DOM access.
- CCM score
- 52 of 100
- skills.sh installs
- 341
- GitHub stars
- 92
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers 17 rules for reducing unnecessary computation, optimizing data structures, and keeping consistent conventions
- Includes patterns for Set/Map lookups, hoisted RegExp, cached property access, and batched DOM reads and writes
- Enforces no default exports, no
astype casts in favor of Zod or type guards, andtoSorted()oversort() - Designed for writing, reviewing, or refactoring JS/TS code in hot paths and general optimization work
Install
$ npx -y skills add sergiodxa/agent-skills --skill frontend-js-best-practices -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
JavaScript Best Practices
Performance optimization and code style patterns for JavaScript and TypeScript code. Contains 17 rules focused on reducing unnecessary computation, optimizing data structures, and maintaining consistent conventions.
When to Apply
Reference these guidelines when:
- Writing loops or array operations
- Working with data structures (Map, Set, arrays)
- Manipulating the DOM directly
- Caching values or function results
- Optimizing hot code paths
- Declaring variables or functions
Rules Summary
const-let-usage (MEDIUM) — @rules/const-let-usage.md
Use const at module level, let inside functions.
// Module level: const with UPPER_SNAKE_CASE for primitives
const MAX_RETRIES = 3;
const userCache = new Map<string, User>();
// Inside functions: always let
function process(items: Item[]) {
let total = 0;
let result = [];
for (let item of items) {
total += item.price;
}
return { total, result };
}
function-declarations (MEDIUM) — @rules/function-declarations.md
Prefer function declarations over arrow functions for named functions.
Details
- Repository
- github.com/sergiodxa/agent-skills
- Categories
- Frontend & UI Code, Code Review & Quality
- First seen
- Jun 3, 2026
Questions
What does the frontend-js-best-practices skill do?
It gives Claude 17 rules for JavaScript and TypeScript performance and code style, covering loops, Map and Set lookups, caching, DOM batching and variable declarations. The rules cut unnecessary computation and keep code conventions consistent. Claude applies them when writing, reviewing or refactoring code.
How do I install frontend-js-best-practices?
Run npx -y skills add sergiodxa/agent-skills --skill frontend-js-best-practices -y in your project. The command adds this skill from the sergiodxa/agent-skills repository. After that, Claude can follow its JavaScript performance rules in that project.
Which other skills lead the Frontend & UI Code category?
Frontend & UI Code includes vercel-react-best-practices, web-design-guidelines, design-taste-frontend, vercel-composition-patterns and lark-apps. This skill focuses on JavaScript and TypeScript performance patterns rather than React, design or UI composition. It suits code-level optimization work.
When should I use this skill while coding?
Use it when writing loops, array operations, DOM manipulation or caching logic in JavaScript or TypeScript. It also helps when you refactor hot code paths or review code for optimal patterns. The skill triggers on these tasks automatically.
More from sergiodxa/agent-skills
All 10- Ruby On Rails Best Practices285
- Frontend Async Best Practices228
- Frontend Internationalization Best Practices196
- Frontend Testing Best Practices2.3K
- Owasp Security Check1.8K
- Frontend React Best Practices1.2K
- Frontend Accessibility Best Practices940
- Frontend Tailwind Best Practices474
- Frontend React Router Best Practices406
Similar to Frontend Js Best Practices
More Frontend & UI Codefrontend-react-best-practicessergiodxa/agent-skills1.2K installsReact performance rules and composition patterns covering re-renders, bundle size, and hydration pitfalls.
js-performance-patternspatternsdev/skills736 installsJavaScript runtime performance patterns for hot paths, covering lookups, DOM batching, caching, and loop structure.
react-best-practicesmastra-ai/mastra2.9K installsAuthoritative React performance guide routing 27 rules across nine prioritized categories for writing and reviewing components.
vercel-react-best-practicesvercel-labs/agent-skills947.9K installsPerformance guide of 70 React and Next.js rules, ordered by impact from waterfalls to advanced patterns.
react-performanceaffaan-m/ecc8.8K installsPerformance patterns for React and Next.js, organized into eight priority categories with rules for reviews and refactors.
r3f-best-practicesemalorenzo/three-agent-skills1.9K installsComprehensive React Three Fiber and Poimandres ecosystem best practices, prioritized by performance impact.