Js Code Review
БесплатноБез исполняемых скриптовНе проверенJavaScript and TypeScript code reviewer providing expert analysis on code quality, potential bugs, security vulnerabilities, and modern best practices
от udacity★ 98 звёзд на GitHubОб этом скилле
JavaScript Code Review Skill
Expertise
JavaScript and TypeScript code review with focus on code quality, best practices, potential bugs, and maintainability. Provides expert-level analysis for modern JavaScript/ES6+ codebases.
Capabilities
- Detecting code quality issues and anti-patterns
- Identifying potential bugs and runtime errors
- Reviewing error handling practices
- Analyzing code maintainability and readability
- Checking for security vulnerabilities
- Recommending modern JavaScript best practices
Analysis Criteria
Code Quality Issues
Variable Declarations
- Problem: Using
varinstead oflet/const - Impact: Hoisting bugs, scope confusion
- Fix: Use
constby default,letwhen reassignment needed
Unused Variables
- Problem: Declared but never used
- Impact: Dead code, confusion, larger bundle
- Fix: Remove or use the variable
Console Statements
- Problem:
console.logleft in production code - Impact: Information leakage, performance
- Fix: Remove or use proper logging library
Magic Numbers/Strings
- Problem: Hardcoded values without explanation
- Impact: Maintainability, clarity
- Fix: Extract to named constants
Potential Bugs
Loose Equality
- Problem: Using
==instead of=== - Impact: Type coercion bugs
- Fix: Always use strict equality
===
Missing Error Handling
- Problem: No try/catch for async operations
- Impact: Unhandled promise rejections
- Fix: Add proper error handling
Null/Undefined Access
- Problem: Accessing properties without null checks
- Impact: Runtime errors
- Fix: Use optional chaining
?.or null checks
Array Mutation in Loops
- Problem: Modifying array while iterating
- Impact: Skipped elements, infinite loops
- Fix: Use filter/map or iterate backwards
Security Issues
eval() Usage
- Problem: Executing dynamic code
- Impact: Critical - code injection
- Fix: Remove eval, use safer alternatives
innerHTML Assignment
- Problem: Setting HTML from untrusted sources
- Impact: XSS vulnerabilities
- Fix: Use textContent or sanitize input
Hardcoded Secrets
- Problem: API keys, passwords in code
- Impact: Credential exposure
- Fix: Use environment variables
Best Practices
Arrow Functions
- Prefer arrow functions for callbacks
- Use regular functions for methods needing
this
Destructuring
- Use object/array destructuring for cleaner code
- Avoid excessive nesting
Async/Await
- Prefer async/await over .then() chains
- Handle errors with try/catch
Early Returns
- Return early to reduce nesting
- Avoid else after return
Red Flags (Immediate Attention)
eval()ornew Function()with dynamic inputinnerHTMLwith user-provided content- Credentials or API keys in source code
varin modern codebase- Synchronous XMLHttpRequest
document.write()usage- Missing
awaiton async function calls
Output Format
Return JSON with:
{
"filename": "path/to/file.js",
"issues": [
{
"line": 10,
"severity": "error" | "warning" | "info",
"category": "bug" | "security" | "quality" | "style",
"rule": "no-var",
"message": "Description of the issue",
"suggestion": "How to fix it"
}
],
"summary": {
"errors": 2,
"warnings": 3,
"info": 1
},
"qualityScore": 75,
"recommendations": [
"Top priority improvements"
]
}
Examples
Example 1: Common Issues
Input:
var data = fetchData();
console.log(data);
if (data.status == 'success') {
data.items.forEach(item => {
processItem(item)
})
}
Analysis:
{
"filename": "example.js",
"issues": [
{
"line": 1,
"severity": "warning",
"category": "quality",
"rule": "no-var",
"message": "Use 'const' or 'let' instead of 'var'",
"suggestion": "const data = fetchData();"
},
{
"line": 1,
"severity": "error",
"category": "bug",
"rule": "missing-await",
"message": "fetchData() appears to be async but is not awaited",
"suggestion": "const data = await fetchData();"
},
{
"line": 2,
"severity": "warning",
"category": "quality",
"rule": "no-console",
"message": "Unexpected console statement",
"suggestion": "Remove or use a logging library"
},
{
"line": 3,
"severity": "warning",
"category": "bug",
"rule": "eqeqeq",
"message": "Use '===' instead of '=='",
"suggestion": "if (data.status === 'success')"
},
{
"line": 4,
"severity": "info",
"category": "bug",
"rule": "optional-chaining",
"message": "data.items could be undefined",
"suggestion": "data.items?.forEach(...) or add null check"
}
],
"summary": {
"errors": 1,
"warnings": 3,
"info": 1
},
"qualityScore": 60,
"recommendations": [
"Add await for async fetchData() call",
"Use strict equality checks throughout",
Установить Js Code Review в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Js Code Review?
JavaScript and TypeScript code reviewer providing expert analysis on code quality, potential bugs, security vulnerabilities, and modern best practices
Как установить скилл Js Code Review?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Js Code Review запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic