
Frontend Js Best Practices
A solid collection of 17 performance-focused rules for JavaScript and TypeScript that Claude will apply when you're writing or reviewing code. The guidelines cover the usual suspects like preferring Set/Map over array includes, caching expensive lookups, and batching DOM operations, plus some opinionated style choices like function declarations over arrows and named exports only. Each rule includes severity ratings and practical before/after examples. It's designed to trigger automatically when you're working with loops, data structures, or DOM manipulation. Not groundbreaking advice, but having these patterns codified means you won't bikeshed the same optimization questions on every code review.
- skills.sh installs
- 336
- GitHub stars
- 92
- last updated
- Aug 21, 2026
Install
$ npx -y skills add sergiodxa/agent-skills --skill frontend-js-best-practices --agent claude-codeInstalls into .claude/skills of the current project.
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.
Sponsors
Details
- Repository
- github.com/sergiodxa/agent-skills
- Categories
- Frontend Development, Documentation, Code Review & Quality, AI & Agent Building, Debugging
- First seen
- Jun 3, 2026
More from sergiodxa/agent-skills
All 10- Ruby On Rails Best Practices282
- Frontend Async Best Practices225
- Frontend Internationalization Best Practices193
- Frontend Testing Best Practices2.2K
- Owasp Security Check1.7K
- Frontend React Best Practices1.2K
- Frontend Accessibility Best Practices896
- Frontend Tailwind Best Practices465
- Frontend React Router Best Practices402