hoangnguyen0403/agent-skills-standard-javascript best practices
Idiomatic JavaScript patterns and conventions for maintainable code.
This is a copy. The original lives at hoangnguyen0403/javascript best practices.
npx skills add https://github.com/HoangNguyen0403/agent-skills-standard --skill JavaScript Best Practices
Conventions and patterns for writing maintainable JavaScript.
camelCase (vars/funcs), PascalCase (classes), UPPER_SNAKE (constants).Error objects only. Handle all async errors.index.js for exports.const.// Constants
const STATUS = { OK: 200, ERROR: 500 };
// Errors
class APIError extends Error {
constructor(msg, code) {
super(msg);
this.code = code;
}
}
// Async + JDoc
/** @throws {APIError} */
export async function getData(id) {
if (!id) throw new APIError('Missing ID', 400);
const res = await fetch(`/api/${id}`);
if (!res.ok) throw new APIError('Failed', res.status);
return res.json();
}
For module patterns and project structure:
See references/REFERENCE.md.
language | tooling
Take hoangnguyen0403/agent-skills-standard-javascript best practices from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
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.