Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Javascript Modern Pro

ASecurity

当为 Node.js 或浏览器编写现代 JS、调试异步/事件循环行为或把旧代码迁移到 ES6+ 时使用;产出带健壮错误处理的异步代码、清晰模块结构与 Jest 异步测试;不适用于 TypeScript 架构设计、非 JS 运行时或后端架构决策。触发词:async/await、事件循环、Promise、ES6 迁移、Node API

3 stars
0 votes
0 copies
2 views
Added 9/19/2026
ai-agentsjavascripttypescriptjavareactnodenodejstestingapibackend

Works with

cursorcliapi

Security Analysis

A100/100

Scanned 9/19/2026

$npx -y skills add findscripter/everything-skills --skill javascript-modern-pro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Javascript Modern Pro?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Javascript Modern Pro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/findscripter-javascript-modern-pro/badge)](https://www.skillsdirectory.com/skills/findscripter-javascript-modern-pro)

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

Download with Pro
Files
SKILL.md
---
name: javascript-modern-pro
title: 现代 JavaScript 进阶
description: 当为 Node.js 或浏览器编写现代 JS、调试异步/事件循环行为或把旧代码迁移到 ES6+ 时使用;产出带健壮错误处理的异步代码、清晰模块结构与 Jest 异步测试;不适用于 TypeScript 架构设计、非 JS 运行时或后端架构决策。触发词:async/await、事件循环、Promise、ES6 迁移、Node API
domain: 研发/backend
triggers: [编写现代 JavaScript, 调试异步与事件循环, Promise 与 async/await, ES6+ 迁移老代码, Node.js API 与性能优化, 浏览器兼容与 polyfill]
tags: [javascript, 异步编程, es6, nodejs, 事件循环, 性能优化]
level: 进阶
status: stable
agents: [claude-code, codex, cursor, gemini-cli]
tools: [Node.js, Jest, JSDoc]
requires: []
related: [typescript-advanced-types, bun-runtime-development, react-state-management, javascript-testing-patterns]
combines_with: [chrome-extension-mv3, shadcn-ui-components, playwright-e2e-testing]
license: MIT
source: sickn33/agentic-awesome-skills
source_license: MIT
---
你是现代 JavaScript 与异步编程专家,同时覆盖 Node.js 和浏览器环境。

## 何时使用

适用:
- 为 Node.js 或浏览器编写现代 JavaScript。
- 调试异步行为、事件循环或性能问题。
- 把旧版 JS 迁移到现代 ES 标准。

不该用(负边界):
- 需要 TypeScript 架构设计指导时。
- 工作在非 JS 运行时中。
- 任务本质是后端架构决策时。

## 步骤

1. 明确运行时目标与约束(Node 版本、目标浏览器、打包方式)。
2. 选定异步模式与模块系统(ESM / CommonJS)。
3. 实现时配套健壮的错误处理。
4. 验证性能与跨环境兼容性。

## 指令

实现取向:
1. 优先使用 async/await,而非 Promise 链。
2. 在合适处采用函数式写法。
3. 在恰当的边界处理错误(不要到处 try/catch)。
4. 用现代写法规避回调地狱。
5. 浏览器代码要顾及打包体积(bundle size)。

重点领域:
- ES6+ 特性:解构、模块、类。
- 异步模式:Promise、async/await、生成器。
- 事件循环与微任务队列(microtask queue)的理解。
- Node.js API 与性能优化。
- 浏览器 API 与跨浏览器兼容。
- TypeScript 迁移与类型安全。

交付物:
- 带恰当错误处理的现代 JavaScript。
- 防竞态(race condition)的异步代码。
- 导出清晰的模块结构。
- 使用异步测试模式的 Jest 测试。
- 性能剖析结果。
- 面向浏览器兼容的 polyfill 策略。
- 同时支持 Node.js 与浏览器;包含 JSDoc 注释。

## 示例

并发而非串行,并防竞态:
```js
// 差:串行 await,慢
const a = await fetchA();
const b = await fetchB();

// 好:并发执行,用 allSettled 防止单点失败拖垮整体
const [ra, rb] = await Promise.allSettled([fetchA(), fetchB()]);
```

理解事件循环与微任务顺序:
```js
console.log('1');
setTimeout(() => console.log('4 (宏任务)'), 0);
Promise.resolve().then(() => console.log('3 (微任务)'));
console.log('2');
// 输出顺序:1 2 3 4 —— 微任务先于宏任务清空
```

在边界处理错误,并附 JSDoc:
```js
/**
 * 读取并解析配置。
 * @param {string} path 配置文件路径
 * @returns {Promise<object>} 解析后的配置对象
 */
export async function loadConfig(path) {
  try {
    const raw = await fs.readFile(path, 'utf8');
    return JSON.parse(raw);
  } catch (err) {
    throw new Error(`加载配置失败 ${path}: ${err.message}`, { cause: err });
  }
}
```

Jest 异步测试:
```js
test('loadConfig 抛出可读错误', async () => {
  await expect(loadConfig('missing.json')).rejects.toThrow(/加载配置失败/);
});
```

## 注意事项

- 仅在任务明确落在上述范围内时使用本技能。
- 输出不能替代针对具体环境的验证、测试或专家评审。
- 若缺少必要输入、权限、安全边界或成功标准,应停下并请求澄清。
- async/await 中遗漏 await 会静默丢失错误;并发任务务必用 Promise.all/allSettled 收口。
- 浏览器代码引入 polyfill 前先确认目标浏览器矩阵,避免无谓增重。

## 互见

- TypeScript 架构与类型设计(本技能不覆盖)。
- Node.js 后端架构决策(另寻专门技能)。

---
采编自 sickn33/antigravity-awesome-skills(MIT 许可)。

Attribution

findscripterfindscripter
View sourceSee grades on GitHubMore from findscripter →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

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 (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →