Xpersona
J

JavaScript

CLAWHUB · Unverified

Use this skill for JavaScript implementation, refactoring, debugging, or review when you need strong Java-style OOP conventions, ES2025+ standard features, t... Skill: JavaScript Owner: ju8z Summary: Use this skill for JavaScript implementation, refactoring, debugging, or review when you need strong Java-style OOP conventions, ES2025+ standard features, t... Tags: latest:1.0.2 Version history: v1.0.2 | 2026-03-26T19:37:31.063Z | user Small changes to description and optimization. v1.0.1 | 2026-03-26T17:27:29.140Z | user - Added new rules file: ui-controllers.md, outlining be

62
Rank
84
Safety
1.0k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s176fmbhbnxg6ncd727a4c4nzh83jbkz:javascript-oop
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-ju8z-javascript-oop/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

44,500 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: JavaScript OOP
description: >
  Use this skill for JavaScript implementation, refactoring, debugging, or review when
  you need strong Java-style OOP conventions, ES2025+ standard features, targeted rule
  files, and explicit controller, service, repository, policy, use-case, and port
  boundaries.
---

# 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:
   - [References](rules/references.md)
   - [Variables](rules/variables.md)
   - [Functions](rules/functions.md)
   - [Modules](rules/modules.md)
   - [Naming Conventions](rules/naming-conventions.md)
   - [SOLID and Structure](rules/solid-and-structure.md)
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

- [Strings](rules/strings.md)
- [Comments](rules/comments.md)
- [Formatting](rules/formatting.md)
- [Control Flow](rules/control-flow.md)
- [Hoisting](rules/hoisting.md)

### Objects, arrays, and data shape

- [Objects](rules/objects.md)
- [Destructuring](rules/destructuring.md)
- [Accessors](rules/accessors.md)
- [Collections](rules/collections.md)

### Functions, classes, and modules

- [Arrow Functions](rules/arrow-functions.md)
- [Classes and Constructors](rules/classes-and-constructors.md)
- [Events](rules/events.md)
- [Standard Library](rules/standard-library.md)
- [UI Controllers](rules/ui-controllers.md)

### Equali

_meta.json

{
  "ownerId": "kn75tzsdn0h9n1hk2mvt3fm4jn83jqg1",
  "slug": "javascript-oop",
  "version": "1.0.2",
  "publishedAt": 1774553851063
}

rules/accessors.md

# Accessors

- Hide mutable state behind `#private` fields when encapsulation removes boilerplate.
- Prefer intent methods over generic getters and setters.
- Avoid trivial getter/setter pairs that only mirror storage.
- Use accessors for computed, side-effect-free views.
- Keep validation and invariants inside the type.

## Example

```js
class InvoiceDraft {

    #status = "NEW";

    markSubmitted() {
        if (this.#status !== "NEW") {
          throw new Error("Only new drafts can be submitted");
        }
        
        this.#status = "SUBMITTED";
    }

    get isSubmitted() {
        return this.#status === "SUBMITTED";
    }
}
```

## End Check

- Verify callers cannot bypass invariants.
- Verify accessors expose views, not hidden mutations.
- Verify behavior methods replace trivial property mutation APIs.

rules/arrow-functions.md

# Arrow Functions

- Use arrows for callbacks and short local functions.
- Keep parentheses around parameters.
- Use implicit returns only for one expression.
- Do not use arrows for methods that need dynamic `this`.

## Example

```js
const invoiceIds = invoices
    .map((invoice) => invoice.id)
    .filter((invoiceId) => invoiceId !== null);
```

## End Check

- Verify arrows stay local, not stateful methods.
- Verify long bodies use explicit `return`.

rules/async.md

# Async

- Prefer `async` and `await` for readable flows.
- Use `Promise.try()` at sync-or-async boundaries when a call may throw or return a
  promise.
- Use `Array.fromAsync()` for async iterables inside service or repository flows; use
  `Promise.all()` for known parallel tasks.
- Await, return, or intentionally detach every promise.
- Avoid `new Promise(async () => {})` and `forEach(async () => {})`.
- Treat top-level `await` as module-load coordination, not a default.

## Example

```js
async function loadInvoiceSummaries(invoiceRepository) {
    const invoiceIds = await Array.fromAsync(
        invoiceRepository.streamPendingInvoices(),
        (invoiceSummaryDto) => invoiceSummaryDto.invoiceId,
    );

    return Promise.try(() => invoiceRepository.loadMany(invoiceIds));
}
```

## End Check

- Verify `Promise.try()` wraps boundary calls, not ordinary async code.
- Verify `Array.fromAsync()` is used for async iteration, not parallel batching.
- Verify async helpers live inside service or repository workflows.
- Verify every promise is awaited, returned, or intentionally detached.

Sponsored

Ads related to JavaScript and adjacent AI workflows.