Agent skill
code-review-js
JavaScript-specific code review guidelines focusing on functional patterns and modern APIs
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/code-review-js
SKILL.md
JavaScript Code Review
Includes all guidelines from code-review skill, plus JavaScript-specific rules.
Prefer Functional Over OO
The reviewer SHOULD:
- Prefer pure functions and data transforms over classes when state is not required.
- Encourage small, composable utilities instead of deep inheritance trees.
The reviewer MUST:
- Flag new classes that only wrap stateless helpers or act as namespaces.
Acceptable:
const formatUser = (user) => `${user.firstName} ${user.lastName}`;
Discouraged:
class UserFormatter {
format(user) {
return `${user.firstName} ${user.lastName}`;
}
}
Use switch for Enum-like Values
The reviewer MUST:
- Flag
if/else ifchains that branch on the same enum-like value when aswitchis clearer.
Preferred:
switch (status) {
case "idle":
return renderIdle();
case "running":
return renderRunning();
case "failed":
return renderFailed();
default:
return assertNever(status);
}
Discouraged:
if (status === "idle") return renderIdle();
if (status === "running") return renderRunning();
if (status === "failed") return renderFailed();
Avoid Duplicated Code
The reviewer MUST:
- Flag duplicated logic and suggest extracting helpers or shared utilities.
The reviewer SHOULD:
- Prefer a single source of truth for calculations and formatting.
Use Modern JavaScript APIs When Available
The reviewer SHOULD:
- Prefer modern APIs like
Object.hasOwn,Array.prototype.at,flatMap,replaceAll,URL,AbortController, andPromise.anywhen they improve clarity. - Confirm runtime targets or polyfills before requiring newer APIs.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?