Why Use This
This skill provides specialized capabilities for HoangNguyen0403's codebase.
Use Cases
- Developing new features in the HoangNguyen0403 repository
- Refactoring existing code to follow HoangNguyen0403 standards
- Understanding and working with HoangNguyen0403's codebase structure
Install Guide
2 steps - 1
- 2
Install inside Ananke
Click Install Skill, paste the link below, then press Install.
https://github.com/HoangNguyen0403/agent-skills-standard/tree/develop/skills/javascript/best-practices
Skill Snapshot
Auto scan of skill assets. Informational only.
Valid SKILL.md
Checks against SKILL.md specification
Source & Community
Updated At Jan 18, 2026, 04:24 AM
Skill Stats
SKILL.md 65 Lines
Total Files 1
Total Size 0 B
License NOASSERTION
---
name: JavaScript Best Practices
description: Idiomatic JavaScript patterns and conventions for maintainable code.
metadata:
labels: [javascript, best-practices, conventions, code-quality]
triggers:
files: ['**/*.js', '**/*.mjs']
keywords: [module, import, export, error, validation]
---
# JavaScript Best Practices
## **Priority: P1 (OPERATIONAL)**
Conventions and patterns for writing maintainable JavaScript.
## Implementation Guidelines
- **Naming**: `camelCase` (vars/funcs), `PascalCase` (classes), `UPPER_SNAKE` (constants).
- **Errors**: Throw `Error` objects only. Handle all async errors.
- **Comments**: JSDoc for APIs. Explain "why" not "what".
- **Files**: One entity per file. `index.js` for exports.
- **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
```javascript
// 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();
}
```
## Reference & Examples
For module patterns and project structure:
See [references/REFERENCE.md](references/REFERENCE.md).
## Related Topics
language | tooling