
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.
$ npx -y skills add sergiodxa/agent-skills --skill frontend-js-best-practices --agent claude-codeInstalls into .claude/skills of the current project.
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.
Reference these guidelines when:
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 };
}
Prefer function declarations over arrow functions for named functions.
Sponsors