openreachtech/hora-skills-ort-core/hoc-classes-notations

Claude Code and agent skill by openreachtech/hora-skills-ort-core

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Convention for the order members are written in a class body. Use when arranging or reviewing member order. What a class may hold belongs to the class design principles convention; this covers only writing order.

Install

npx vskill@latest install openreachtech/hora-skills-ort-core/hoc-classes-notations

SKILL.md

Classes: Notations

Collects the conventions for how a class definition is written in source. Design-level judgments — what a class may hold — are governed by /hoc-classes-principles, and the native features it must not use by /hoc-prohibit-native-features; this skill establishes only the way it is written.

Placement order of members

Write a class body in the following order.

  1. static fields
  2. constructor
  3. The factory methods (.create() → .createAsync())
  4. static inflator methods
  5. static getters
  6. static methods
  7. instance getters
  8. instance methods

Item 3 means the class's own factory methods that are published as API: .create() comes immediately after the constructor, and .createAsync(), where it is defined, immediately after .create(). How a factory method is defined belongs to /hoc-methods, and the definition and naming of the inflator methods in item 4 to /hoc-classes-inflators.

Why static fields go at the top
  • This follows the Java convention.
  • The order is arranged to mirror the order in which memory is secured. static fields are secured and

initialized at class-definition time, and an instance's properties are secured afterwards in the constructor. Matching the source order to that order makes the order of allocation readable by simply reading the source from top to bottom.

  • The conditions for using static fields, and what belongs in them (accumulating associations, pools, and caches in static + WeakMap, etc.), are governed by /hoc-classes-principles; that static #X is not used, by /hoc-prohibit-native-features.
Order among getters

Within the getter categories (5 and 7), use the following order.

  1. Getters that return a fixed value. Among them, place the ones denoted by ~Ctor (static getters for delegation) first.
  2. The rest (getters that compute the value they return).
  3. List abstract getters last, together.

The naming of ~Ctor is governed by /hoc-wire-dependencies.

Order among methods

Within the method categories (6 and 8), the order is the order of appearance in an outline that writes out the nesting structure of calls. Immediately after a method, place the methods that it calls (depth-first, first appearance). Members belonging to another category (getters and the like), and anything that is not an own member of the class (methods of a delegate or of a dependency class), are left out of this enumeration.

For instance methods, the call outline of the private methods takes priority. Therefore abstract members are not collected and placed at the end; they go at their first-appearance position in the outline.

The outline never reaches across the placement order above. The blocks are settled first, and the outline only ever orders the members inside one of them. A member does not leave its block because something in another block calls it earlier.

The factory methods are where that pull is strongest, and where giving in to it is the plainest mistake. A caller asks other members before it asks .createAsync() — whether the class applies, what it should be built from — so a strict reading of the outline would place those ahead of it. It does not, because item 3 is not a position the outline earned: how a class is constructed is part of its structure rather than of its call flow, which is why the factory methods are a block of their own directly under the constructor. Ordering them by who calls them first reads the local sequence and loses what the block was marking.

An outline example for a Sample class.

// --- Static Methods ---
- .create()
- constructor
- .createAsync()
- .buildAlpha()
- .generateBeta()
- .createAlphaClient()
- .create()
- .buildAlpha()
- .get:AlphaCtor
- .generateBeta()
- .buildGamma()
- .buildGamma()
- .get:delta
- .createAlphaClient()
- AlphaClient.create()
// --- Instance Methods ---
- #buildAlpha()
- #generateBeta()
- .get:beta
- #defineDelta()
- #generateBeta()
- #normalizeBeta()
- #defineGamma()
- .get:gamma
- #defineGamma()
- #alphaClient.saveDelta()
- #defineDelta()
- #alphaClient.loadDelta()

The class that corresponds to the outline above. Member bodies are folded into { ... } and arguments into (...), written on a single line.

javascript
export default class Sample extends BaseSample {
// static field
static pool = new WeakMap()
constructor (...) { ... }
// factory methods
static create (...) { ... }
static async createAsync (...) { ... }
// static inflator method
static as (...) { ... }
// static getters
static get AlphaCtor () { ... }
static get beta () { ... }
static get gamma () { ... }
/** @abstract */
static get delta () { throw new Error('...') }
// static methods
static buildAlpha (...) { ... }
static generateBeta (...) { ... }
static buildGamma (...) { ... }
static createAlphaClient (...) { ... }
// instance getters
get Ctor () { ... }
// instance methods
buildAlpha (...) { ... }
generateBeta (...) { ... }
/** @abstract */
normalizeBeta (...) { throw new Error('...') }
defineGamma (...) { ... }
defineDelta (...) { ... }
}
What the order does not determine

For whatever this skill's order does not determine, use the order in which they are written from the top within the class. When enumerating or documenting members, follow that same order.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
17
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/openreachtech/hora-skills-ort-core/hoc-classes-notations/badge)](https://verified-skill.com/skills/openreachtech/hora-skills-ort-core/hoc-classes-notations)

Something wrong with this skill or its page? Tell us.