mcpbeat

JavaScript Language Patterns

hoangnguyen0403/javascript language patterns

Modern JavaScript (ES2022+) patterns for clean, maintainable code.

1k tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
536
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/HoangNguyen0403/agent-skills-standard --skill JavaScript Language Patterns

What comes with it

2 585 bytes besides the instruction
references/REFERENCE.md

The instruction itself

7 sections, as written by the author

JavaScript Language Patterns

Priority: P0 (CRITICAL)

Modern JavaScript standards for clean, maintainable code.

Implementation Guidelines

  • Variables: const default. let if needed. No var.
  • Functions: Arrows for callbacks. Declarations for top-level.
  • Async: async/await + try/catch.
  • Objects: Destructuring, Spread ..., Optional Chain ?., Nullish ??.
  • Strings: Template literals ${}.
  • Arrays: map, filter, reduce. No loops.
  • Modules: ESM import/export. Export only what is necessary.
  • Classes: Use #private fields for true privacy.

Anti-Patterns

  • No var: Block scope only.
  • No ==: Strict ===.
  • No new Object(): Use literals {}.
  • No Callbacks: Promisify everything.
  • No Mutation: Immutability first.

Code

// Modern Syntax
const [x, ...rest] = items;
const name = user?.profile?.name ?? 'Guest';

// Async
async function getUser(id) {
  try {
    const res = await fetch(`/api/${id}`);
    return res.json();
  } catch (err) {
    console.error(err);
    throw err;
  }
}

// Class + Private
class Service {
  #key;
  constructor(k) {
    this.#key = k;
  }
}

Reference & Examples

For advanced patterns and functional programming:

See references/REFERENCE.md.

best-practices | tooling

How to use it

Copy the folder

Take hoangnguyen0403/javascript language patterns from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.