Skip to content
Back to skills

Code Review Js

ASecurity

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

  • 76 stars
  • 0 votes
  • 2 copies
  • 11 views
  • Added February 8, 2026
developmentjavascriptgojavabashcode-reviewapi

Works with

  • api

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill code-review-js --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Review Js?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Code Review Js
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-code-review-js/badge)](https://www.skillsdirectory.com/skills/majiayu000-code-review-js)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: code-review-js
description: JavaScript-specific code review guidelines focusing on functional patterns and modern APIs
category: development
disable-model-invocation: false
user-invocable: true
allowed-tools: Read, Grep, Glob, Bash
---

# 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:
```js
const formatUser = (user) => `${user.firstName} ${user.lastName}`;
```

Discouraged:
```js
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:
```js
switch (status) {
  case "idle":
    return renderIdle();
  case "running":
    return renderRunning();
  case "failed":
    return renderFailed();
  default:
    return assertNever(status);
}
```

Discouraged:
```js
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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…