openreachtech/hora-skills-ort-core/hoc-classes-ctor
Claude Code and agent skill by openreachtech/hora-skills-ort-core
- community
Checking that the SKILL.md file is still in the repository.
The `Ctor` getter an instance reaches its own class through: how `#get:Ctor` is defined, typed and overridden, why the name is reserved, and why a static member is never reached through `this.constructor` outside it. Use when an instance member refers to a static member or to its own class, or when about to write `this.constructor`. Getters that hold a dependency's class belong to the dependency-wiring convention.
Install
npx vskill@latest install openreachtech/hora-skills-ort-core/hoc-classes-ctorSKILL.md
Classes: Ctor
How an instance reaches its own class. Ctor is the library's word for a class held as a value, and #get:Ctor is the one getter that hands an instance its own.
An instance reaches its class through #get:Ctor
- When an instance method or getter refers to a static member, it goes through `this.Ctor`.
Neither the class name nor this.constructor is written there: for a static member, this.constructor appears in one place only, the body of #get:Ctor.
- Hardcoding the class name fixes the reference to the base class's definition. Going through
the instance's own constructor is what lets a call from an inheriting subclass reach the subclass's own static definition.
this.constructorwritten directly reaches the same class, but its type is too broad for the
checker to know which static members exist. #get:Ctor is where that type is settled, once.
- In the body of
#get:Ctor, type resolution (a type cast) is needed betweenreturnand
this.constructor: cast it to the type of the class in question.
- `#get:Ctor` is an adapter that exists to resolve the type. A native property of the
constructor that needs no type resolution — this.constructor.name above all — is read directly, as the class name in an error message is: ` throw new Error(${this.constructor.name}#normalizeValue() must be inherited) `.
When a derived class has more static members to reference, override #get:Ctor
- When a derived class gains additional "static members referenced from instance members," override and redefine
#get:Ctorin the derived class, resolving the type to the derived class's type.
Do not define a #get:xxxx shortcut for this.Ctor.xxxx
- Do not define a getter (
#get:xxxx) solely to accessthis.Ctor.xxxx(a static member). Write static member access explicitly asthis.Ctor.xxxx. - Reason: inserting such a getter makes it implicit, from the caller's `this.xxxx`, that this is a static-member call.
The name Ctor is reserved
#get:Ctoris reserved as the conventional getter that returnsthis.constructor.- Therefore, do not use the name
Ctoras a member name for any other purpose. Ctoris a getter, so the accessors convention holds for it in full: its body is the cast and
nothing else.
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
- SKILL.md in the repositoryCheckingkit/skills/hoc-classes-ctor/SKILL.md
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
[](https://verified-skill.com/skills/openreachtech/hora-skills-ort-core/hoc-classes-ctor)