javascript-pro by jeffallan/claude-skills
npx skills add https://github.com/jeffallan/claude-skills --skill javascript-propackage.json、模块系统、Node 版本、浏览器目标;确认 .js/.mjs/.cjs 约定eslint --fix);如果检查失败,修复所有报告的问题并在继续之前重新运行。使用 DevTools 或 --inspect 检查内存泄漏,验证打包大小;如果发现泄漏,在继续之前解决它们广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
根据上下文加载详细指导:
| 主题 | 参考 | 加载时机 |
|---|---|---|
| 现代语法 | references/modern-syntax.md | ES2023+ 特性、可选链、私有字段 |
| 异步模式 | references/async-patterns.md | Promise、async/await、错误处理、事件循环 |
| 模块 | references/modules.md | ESM 与 CJS、动态导入、package.json 导出 |
| 浏览器 API | references/browser-apis.md | Fetch、Web Workers、Storage、IntersectionObserver |
| Node 核心 | references/node-essentials.md | fs/promises、流、EventEmitter、工作线程 |
X | null 或 X | undefined 模式?.) 和空值合并 (??)import/export)var (始终使用 const 或 let)// ✅ 正确 — 始终显式处理异步错误
async function fetchUser(id) {
try {
const response = await fetch(`/api/users/${id}`);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return await response.json();
} catch (err) {
console.error("fetchUser failed:", err);
return null;
}
}
// ❌ 不正确 — 未处理的拒绝,没有空值保护
async function fetchUser(id) {
const response = await fetch(`/api/users/${id}`);
return response.json();
}
// ✅ 正确
const city = user?.address?.city ?? "Unknown";
// ❌ 不正确 — 如果 address 是 undefined 会抛出错误
const city = user.address.city || "Unknown";
// ✅ 正确 — 命名导出,库不要仅使用默认导出
// utils/math.mjs
export const add = (a, b) => a + b;
export const multiply = (a, b) => a * b;
// consumer.mjs
import { add } from "./utils/math.mjs";
// ❌ 不正确 — 将 require() 与 ESM 混用
const { add } = require("./utils/math.mjs");
// ✅ 正确
const MAX_RETRIES = 3;
let attempts = 0;
// ❌ 不正确
var MAX_RETRIES = 3;
var attempts = 0;
实现 JavaScript 功能时,请提供:
1.1K
7.2K
Jan 20, 2026
opencode975
gemini-cli955
codex925
github-copilot891
cursor833
amp820
package.json, module system, Node version, browser targets; confirm .js/.mjs/.cjs conventionseslint --fix); if linter fails, fix all reported issues and re-run before proceeding. Check for memory leaks with DevTools or --inspect, verify bundle size; if leaks are found, resolve them before continuingLoad detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Modern Syntax | references/modern-syntax.md | ES2023+ features, optional chaining, private fields |
| Async Patterns | references/async-patterns.md | Promises, async/await, error handling, event loop |
| Modules | references/modules.md | ESM vs CJS, dynamic imports, package.json exports |
| Browser APIs | references/browser-apis.md | Fetch, Web Workers, Storage, IntersectionObserver |
| Node Essentials | references/node-essentials.md |
X | null or X | undefined patterns?.) and nullish coalescing (??)import/export) for new projectsvar (always use const or let)// ✅ Correct — always handle async errors explicitly
async function fetchUser(id) {
try {
const response = await fetch(`/api/users/${id}`);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return await response.json();
} catch (err) {
console.error("fetchUser failed:", err);
return null;
}
}
// ❌ Incorrect — unhandled rejection, no null guard
async function fetchUser(id) {
const response = await fetch(`/api/users/${id}`);
return response.json();
}
// ✅ Correct
const city = user?.address?.city ?? "Unknown";
// ❌ Incorrect — throws if address is undefined
const city = user.address.city || "Unknown";
// ✅ Correct — named exports, no default-only exports for libraries
// utils/math.mjs
export const add = (a, b) => a + b;
export const multiply = (a, b) => a * b;
// consumer.mjs
import { add } from "./utils/math.mjs";
// ❌ Incorrect — mixing require() with ESM
const { add } = require("./utils/math.mjs");
// ✅ Correct
const MAX_RETRIES = 3;
let attempts = 0;
// ❌ Incorrect
var MAX_RETRIES = 3;
var attempts = 0;
When implementing JavaScript features, provide:
Weekly Installs
1.1K
Repository
GitHub Stars
7.2K
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode975
gemini-cli955
codex925
github-copilot891
cursor833
amp820
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装
| fs/promises, streams, EventEmitter, worker threads |