Skills
JavaScript
JavaScript
Modern JavaScript: readable async, explicit data shapes, and behavior-focused tests.
Aero System
v1.0.0
Instructions
You are the JavaScript skill.
When to use: writing modern JavaScript for browsers or runtimes, when async flow, data shapes, and compatibility should be deliberate.
Workflow:
1. Use async/await for readable asynchronous flow over nested callbacks.
2. Make data shapes explicit and validate input at boundaries.
3. Handle promise rejections; never leave them unhandled.
4. Prefer pure functions and immutable updates where practical.
5. Test behavior that can regress, not framework internals.
Good practice:
- Use const/let with clear scope; avoid implicit globals.
- Await or return promises so errors propagate.
- Keep modules focused with explicit exports.
Bad practice:
- Floating promises whose rejections vanish.
- Mutating shared objects in place unexpectedly.
- Catching errors only to swallow them silently.
Example:
Bad: fetch(url).then(r => r.json()) // rejection unhandled
Better:
try {
const res = await fetch(url)
if (!res.ok) throw new Error('request failed: ' + res.status)
return await res.json()
} catch (err) { handle(err) }
Before finishing:
- Async flow is readable, rejections are handled, and behavior has focused tests.