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

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.

Conventions for class constructors. Constructor parameters must not have default values.

Install

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

SKILL.md

Classes: Constructor

Conventions related to class constructors.

Do not assign default values to parameters

  • Do not assign default values to constructor parameters.
  • The constructor's whole responsibility is to hold what its parameters receive. Each one is

assigned to the property of the same name, and no value is decided here.

  • Deciding a value the caller did not supply belongs to the factory methods, `static create

(...)` first among them. A default the constructor does not apply is applied there.

javascript
// NG: assigning a default value to a parameter
constructor ({
delimiter = ',',
}) {
this.delimiter = delimiter
}
// OK: no default value
constructor ({
delimiter,
}) {
this.delimiter = delimiter
}

Separate what goes up to the base from what this class keeps

Where a constructor hands part of its parameters to the base class and keeps the rest, a blank line divides the two in the parameter list. The reader then sees, without following super(), which of the properties this class is responsible for.

javascript
constructor ({
ErrorCtor,
maxDocumentDepth,
}) {
super({
ErrorCtor,
})
this.maxDocumentDepth = maxDocumentDepth
}
  • The factory methods repeat the same division, in their own parameter list and in the

new this({ ... }) they assemble. A class states the split in one shape wherever the list appears, so a reader meeting .create() first learns the same thing.

  • A call that hands over the whole list carries no division: super({ ErrorCtor })

lists only the base's share, and nothing is separated inside it.

  • The JSDoc above it does not repeat the division. A JSDoc block has no blank line to

divide with, and the *-only line that stands in for one is spent between the description and the first tag — see the JSDoc convention. The type literal stays a flat list of the same properties.

  • Tests do not repeat it either. A test assembling the constructor's argument is

building a value, not declaring what the class is made of, so the argument object it writes carries no blank line.

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

7-day trend score
0

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-constructor/badge)](https://verified-skill.com/skills/openreachtech/hora-skills-ort-core/hoc-classes-constructor)

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