Hoc constants

From openreachtech/hora-skills-ort-core · View interactive version

Hoc constants is an AI agent skill from the GitHub repository openreachtech/hora-skills-ort-core. Conventions for constants — how they are named and written, and where the files holding them live. Use when declaring a constant or an enum-like object, or when deciding where one belongs. Names of everything else belong to the naming convention.

How to use this skill

Skill file

Constants

Conventions related to defining constants.

Naming

// NG
const maxRetryCount = 3

// OK
const MAX_RETRY_COUNT = 3

Naming of enum-like objects

// NG: plural
const COLORS = {
  RED: 'red',
  GREEN: 'green',
  BLUE: 'blue',
}

// OK: singular
const COLOR = {
  RED: 'red',
  GREEN: 'green',
  BLUE: 'blue',
}

Chopping down

// NG: multiple properties on one line
const COLOR = { RED: 'red', GREEN: 'green', BLUE: 'blue' }

// OK: one property per line
const COLOR = {
  RED: 'red',
  GREEN: 'green',
  BLUE: 'blue',
}

File organization for object-type constants

// OK: COLOR is defined alone in COLOR.js
COLOR.js
  → const COLOR = { ... }

Location

<project-root>/constants/COLOR.js
<project-root>/constants/http/STATUS_CODE.js
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.