Skip to content
Back to skills

Language

ASecurity

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

  • 549 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added June 6, 2026
developmentjavascriptjavaapi

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned June 6, 2026

npx -y skills add HoangNguyen0403/agent-skills-standard --skill language --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Language?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Language
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hoangnguyen0403-language/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-language)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: JavaScript Language Patterns
description: Modern JavaScript (ES2022+) patterns for clean, maintainable code.
metadata:
  labels: [javascript, language, es6, modern-js]
  triggers:
    files: ['**/*.js', '**/*.mjs', '**/*.cjs']
    keywords:
      [const, let, arrow, async, await, promise, destructuring, spread, class]
---

# 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

```javascript
// 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](references/REFERENCE.md).

## Related Topics

best-practices | tooling

Files in this skill

  • SKILL.md1.7 KB
  • references/REFERENCE.md2.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.