Agent-skills-standard javascript-best-practices
Idiomatic JavaScript patterns and conventions for maintainable code. Use when writing or refactoring JavaScript following idiomatic patterns and conventions. (triggers: **/*.js, **/*.mjs, module, import, export, error, validation)
install
source · Clone the upstream repo
git clone https://github.com/HoangNguyen0403/agent-skills-standard
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/HoangNguyen0403/agent-skills-standard "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/javascript/javascript-best-practices" ~/.claude/skills/hoangnguyen0403-agent-skills-standard-javascript-best-practices-0c9333 && rm -rf "$T"
manifest:
skills/javascript/javascript-best-practices/SKILL.mdsource content
JavaScript Best Practices
Priority: P1 (OPERATIONAL)
Implementation Guidelines
- Naming:
(vars/funcs),camelCase
(classes),PascalCase
(constants).UPPER_SNAKE - Errors: Throw
objects only. Handle all async errors.Error - Comments: JSDoc for APIs. Explain "why" not "what".
- Files: One entity per file.
for exports.index.js - Modules: Named exports only. Order: Ext -> Int -> Rel.
Anti-Patterns
- No Globals: Encapsulate state.
- No Magic Numbers: Use
.const - No Nesting: Guard clauses/early returns.
- No Defaults: Use named exports.
- No Side Effects: Keep functions pure.
Code & Reference
See references/REFERENCE.md for constants, custom errors, async patterns, and module structure examples.
Related Topics
language | tooling