JavaScript ES modules (.mjs) with KISS, modern OOP, and ESM conventions. Use when writing or editing .mjs files, ES module import/export code, or Node.js scripts with ES module syntax.
설치
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
JavaScript ES modules (.mjs) with KISS, modern OOP, and ESM conventions. Use when writing or editing .mjs files, ES module import/export code, or Node.js scripts with ES module syntax.
Javascript Mjs
Keep It Simple (KISS)
Do NOT overengineer. Simple functions > complex class hierarchies.
One file = one responsibility. If a file exceeds 200 lines, split it.
Avoid unnecessary abstractions (no factories for a single implementation).
Prefer plain objects and functions over classes when state is simple.
OOP When Appropriate
Preferre classes over function based huge single scripts. Instantiate a root controller which will then instantiate and manage all other classes (eg /includes/js/Main.mjs, /includes/js/NavHandler.mjs). Main.mjs should be a singleton.
Anything that is re-usable that could be classed as a utility place in a utils dir in the /includes/js/utils folder
Single responsibility per class - a class should do ONE thing well.
Favor composition over inheritance - pass dependencies in, don't extend.
Private fields: use #privateField syntax, not _convention.
Code Conventions
Use const by default, let when reassignment is needed. Never var.
Arrow functions for callbacks, named functions for top-level logic.
async/await over raw promises. Always handle rejections.
Destructure parameters: function({name, age}) over function(obj).
Use template literals (backticks) for string building.
Module Rules
One export default per module for the main export.
Named exports for utilities and helpers.
Import order: node built-ins → npm packages → local modules.
No side effects at import time - exports should be pure.