javascript-development
Skill1 starsChanged 10 months agoISCView on GitHub
Best practices and guidelines for writing clean, modern, and maintainable JavaScript code. Use when working with .js files, Node.js applications, or frontend JavaScript development.
We split this skill into the rules it gives an agent
26 rules. About 0 are common, 24 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈24
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Use this skill when:
- Distinctive: line 20
ES6+ First: Always use modern JavaScript syntax (let/const, arrow functions, destructuring, template literals).
- Distinctive: line 21
Const by Default: Use const for variables that won't be reassigned.
- Distinctive: line 22
Arrow Functions: Prefer arrow functions for callbacks and function expressions.
- Distinctive: line 23
Template Literals: Use template literals for string interpolation instead of concatenation.
- Distinctive: line 24
Destructuring: Use destructuring for object and array extraction to improve readability.
- Very specific: line 29
Module System: Use ES6 modules (import/export) for code organization.
- Very specific: line 32
Naming Conventions: Use camelCase for variables and functions, PascalCase for classes and constructors, UPPER_CASE for constants.
- Distinctive: line 33
Avoid Global Scope: Never pollute global scope.
- Distinctive: line 37
Async/Await Over Promises: Prefer async/await for cleaner asynchronous code.
- Distinctive: line 38
Error Handling: Always use try/catch with async/await.
- Distinctive: line 39
Promise.all for Parallel: Use Promise.all() for concurrent independent operations.
- Distinctive: line 46
Default Parameters: Use default parameter syntax instead of manual checks.
- Distinctive: line 47
Rest Parameters: Use rest parameters (...args) instead of arguments object.
- Distinctive: line 48
Return Early: Use guard clauses and early returns to reduce nesting.
- Distinctive: line 53
Object Shorthand: Use property shorthand and computed property names.
- Distinctive: line 54
Array Methods: Use map, filter, reduce, find, some, every instead of loops when appropriate.
- Distinctive: line 55
Immutability: Avoid mutating objects and arrays.
- Distinctive: line 56
Optional Chaining: Use optional chaining (?.) to safely access nested properties.
- Distinctive: line 57
Nullish Coalescing: Use ?? operator for default values (distinct from ||).
- Distinctive: line 64
Don't Swallow Errors: Always handle or propagate errors.
- Distinctive: line 70
Debounce/Throttle: Use debouncing and throttling for event handlers and expensive operations.
- Distinctive: line 93
Console Methods: Use console.table, console.group, console.time for better debugging.
- Distinctive: line 94
Debugger Statement: Use debugger keyword strategically for breakpoints.
- Distinctive: line 95
Type Checking: Consider using JSDoc comments or TypeScript for type safety.
- Distinctive: line 100
Before submitting JavaScript code, verify:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
JavaScript Development Skills
When to Use This Skill
Use this skill when:
- Writing or refactoring JavaScript code (.js files)
- Developing Node.js applications or server-side JavaScript
- Creating frontend JavaScript applications
- Working with modern ES6+ features
- Debugging JavaScript code or performance issues
I. Modern JavaScript Principles
- ES6+ First: Always use modern JavaScript syntax (let/const, arrow functions, destructuring, template literals).
- Const by Default: Use const for variables that won't be reassigned. Use let only when reassignment is necessary. Avoid var entirely.
- Arrow Functions: Prefer arrow functions for callbacks and function expressions. Use traditional functions for methods and when this binding matters.
- Template Literals: Use template literals for string interpolation instead of concatenation.
- Destructuring: Use destructuring for object and array extraction to improve readability.
- Spread/Rest Operators: Leverage spread (...) for array/object copying and rest parameters.
II. Code Structure & Organization
- Module System: Use ES6 modules (import/export) for code organization. Avoid CommonJS except in Node.js contexts where required.
- Single Responsibility: Each function should do one thing well. Keep functions small (ideally under 20 lines).
- File Organization: Group related functions in modules. Export only what's necessary.
- Naming Conventions: Use camelCase for variables and functions, PascalCase for classes and constructors, UPPER_CASE for constants.
- Avoid Global Scope: Never pollute global scope. Use modules, IIFEs, or block scope to encapsulate code.
III. Asynchronous Programming
- Async/Await Over Promises: Prefer async/await for cleaner asynchronous code. Use .then() chains sparingly.
- Error Handling: Always use try/catch with async/await. Handle promise rejections explicitly.
- Promise.all for Parallel: Use Promise.all() for concurrent independent operations.
- Avoid Callback Hell: Convert callback-based APIs to promises or use promisify utilities.
- Handle Race Conditions: Be mindful of timing issues in async operations.
IV. Functions & Methods
- Pure Functions: Strive for pure functions that don't mutate inputs or cause side effects.
- Default Parameters: Use default parameter syntax instead of manual checks.
- Rest Parameters: Use rest parameters (...args) instead of arguments object.
- Return Early: Use guard clauses and early returns to reduce nesting.
- Method Chaining: Design APIs that support method chaining when appropriate.
V. Objects & Arrays
- Object Shorthand: Use property shorthand and computed property names.
- Array Methods: Use map, filter, reduce, find, some, every instead of loops when appropriate.
- Immutability: Avoid mutating objects and arrays. Use spread operator or methods that return new instances.
- Optional Chaining: Use optional chaining (?.) to safely access nested properties.
- Nullish Coalescing: Use ?? operator for default values (distinct from ||).
VI. Error Handling
- Custom Error Classes: Extend Error class for domain-specific errors.
- Meaningful Error Messages: Provide context and actionable information in error messages.
- Fail Fast: Validate inputs early and throw errors for invalid states.
- Don't Swallow Errors: Always handle or propagate errors. Never use empty catch blocks.
- Error Boundaries: In frontend apps, implement error boundaries to prevent full app crashes.
VII. Performance Considerations
- Avoid Premature Optimization: Focus on clean code first. Optimize only when measured bottlenecks exist.
- Debounce/Throttle: Use debouncing and throttling for event handlers and expensive operations.
- Lazy Loading: Load modules and resources on demand when appropriate.
- Memoization: Cache expensive computation results when applicable.
- Efficient Loops: Be mindful of loop complexity. Avoid nested loops with large datasets.
VIII. Common Patterns & Anti-Patterns
Good Patterns:
- Factory functions for object creation
- Module pattern for encapsulation
- Observer pattern for event handling
- Composition over inheritance
Anti-Patterns to Avoid:
- Modifying prototypes of built-in objects
- Using == instead of === (always use strict equality)
- Excessive use of this (prefer functional approaches)
- Deeply nested callbacks or promise chains
- Magic numbers and strings (use named constants)
IX. Testing & Debugging
- Write Testable Code: Functions with clear inputs/outputs are easier to test.
- Console Methods: Use console.table, console.group, console.time for better debugging.
- Debugger Statement: Use debugger keyword strategically for breakpoints.
- Type Checking: Consider using JSDoc comments or TypeScript for type safety.
- Validation: Validate function inputs, especially in public APIs.
X. Best Practices Checklist
Before submitting JavaScript code, verify:
- No var declarations (use const/let)
- Consistent naming conventions applied
- No unused variables or imports
- Error handling implemented for async operations
- No console.log statements in production code
- Functions are pure when possible
- Code is properly modularized
- Comments explain "why" not "what"
- No magic numbers or strings
- Semicolons used consistently (or intentionally omitted)
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- PracticalSwan/agent-skills★ 22same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- ai-development-assistantSkill
- angular-developmentSkill
- bun-package-managerSkill
- css-developmentSkill
- go-developmentSkill
- html-developmentSkill
- npm-package-managerSkill
- pnpm-package-managerSkill
- python-developmentSkill
- react-developmentSkill
- rust-developmentSkill
- typescript-developmentSkill
- vue-developmentSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

