← 返回
未分类 中文

JavaScript

Use this skill for JavaScript implementation, refactoring, debugging, or review when you need strong Java-style OOP conventions, ES2025+ standard features, t...
在需要强Java风格面向对象约定、ES2025+标准特性等场景下,使用此技能进行JavaScript实现、重构、调试或审查。
ju8z ju8z 来源
未分类 clawhub v1.0.2 1 版本 100000 Key: 无需
★ 1
Stars
📥 484
下载
💾 20
安装
1
版本
#latest

概述

JavaScript Skill

Scope

Use this skill for JavaScript or Node/browser code changes and reviews.

Precedence

  • Follow explicit user instructions first.
  • Follow repository conventions, formatter, linter, and AGENTS.md before generic

defaults in these rules.

  • Use the rule files as focused guidance and review checklists, not as a reason to fight

established local patterns.

ES2025+ Baseline

  • Assume a modern runtime such as Node 22+ or evergreen engines.
  • Prefer standardized Stage 4 ECMAScript features only.
  • Prefer newer standard helpers when they reduce boilerplate.
  • Treat 2026-finished APIs as conditional on target runtime support.
  • Do not default to Stage 3 syntax such as using, await using, or decorators.

Java-Style OOP Baseline

  • Treat classes as the default home for stateful business behavior.
  • Limit free functions to small pure transforms, validators, calculators, and mappers.
  • Treat controllers, services, repositories, policies, use cases, ports, and

specifications as first-class architectural concepts.

  • Treat stateful browser behavior as interface-layer controller code rather than loose

script modules.

  • Prefer parameter objects, #private fields, and explicit value objects over ad hoc

argument lists and mutable shapes.

  • Prefer intent methods, domain errors, and stable event payload DTOs over generic

property mutation.

  • Keep composition-root wiring explicit and centralized, with dependencies flowing

inward.

Operating Model

  1. Start with this file.
  2. Load the baseline rules for almost every task:
  3. Load only the rule groups that match the task.
  4. Use each file's local Example and End Check, then finish with the global

checklist at the bottom of this file.

Rule Map

Syntax and formatting

Objects, arrays, and data shape

Functions, classes, and modules

Equality, conversion, and modern syntax

Async and failure handling

Task-Based Loading

Load these additional files when the task has these traits:

  • Data reshaping or DTO work: objects, destructuring, collections,

value-semantics.

  • Domain and service design or refactors: classes-and-constructors, functions,

accessors, modules, error-handling, naming-conventions,

solid-and-structure.

  • Browser widgets, DOM bindings, and event-driven UI controllers: ui-controllers,

classes-and-constructors, modules, naming-conventions, comments.

  • Async flows, I/O, retries, timers, concurrency, or background work: async,

error-handling, standard-library.

  • Nullability, defaults, parsing, regex, or binary conversion: value-semantics,

standard-library.

  • Formatting, documentation, or readability cleanup: formatting, strings,

comments, control-flow.

  • Code review: start from the changed lines, then load only the rules implicated by the

diff plus the end-check categories below.

Important Distinctions

  • value-semantics.md owns equality, conversions, defaults, truthiness, and optional

chaining.

  • async.md owns Promise.try(), Array.fromAsync(), and async flow rules.
  • collections.md owns iterator helpers, Set algebra, copy depth, and change-by-copy

collections inside service and repository workflows.

  • classes-and-constructors.md owns encapsulation, constructor discipline, and factory

guidance.

  • ui-controllers.md owns DOM lifecycle, event binding, teardown, and interface-layer

controller guidance.

  • functions.md owns parameter-object APIs and the boundary between tiny pure helpers

and named service or use-case methods.

  • objects.md owns value-object and DTO boundary guidance.
  • error-handling.md owns domain-error policy.
  • standard-library.md owns concrete ES2025+ helper APIs such as RegExp.escape(),

Error.isError(), and binary conversion helpers inside object-oriented designs.

  • solid-and-structure.md is the only file that names SRP, OCP, LSP, ISP, DIP, and the

composition-root and application layering model.

End Check

  • Verify repository conventions override generic defaults when they differ.
  • Verify chosen ES2025+ features are standardized and fit target runtime support.
  • Verify behavior lives on objects, services, use cases, or controllers rather than

scattered utilities.

  • Verify naming, encapsulation, module boundaries, value objects, and DTO boundaries stay

explicit.

  • Verify ports, adapters, and layer placement are clear.
  • Verify browser controllers keep lifecycle, DOM boundaries, and cleanup explicit.
  • Verify async work, error handling, and collection mutation choices are intentional.
  • Verify comments and formatting remain consistent and low-noise.

版本历史

共 1 个版本

  • v1.0.2 当前
    2026-03-31 03:03 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,860
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 75 📥 182,411
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 681 📥 329,322