OpenParable
Skip to content
← Back to skills

Code Review JS

Testing & Quality
code-review-js

Code Review JS is an Agent Skill for testing & quality published in the majiayu000/claude-skill-registry repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

JavaScript-specific code review guidelines focusing on functional patterns and modern APIs

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/majiayu000/claude-skill-registry/blob/HEAD/skills/data/code-review-js/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/code-review-js, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

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 if chains that branch on the same enum-like value when a switch is 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, and Promise.any when they improve clarity.
  • Confirm runtime targets or polyfills before requiring newer APIs.