agentleFS
carloss765carloss765/agent-skills/.claude/skills/javascript-extension/SKILL.md

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
  1. Distinctive:

    Use this skill when:

    line 11
  2. Distinctive:

    ES6+ First: Always use modern JavaScript syntax (let/const, arrow functions, destructuring, template literals).

    line 20
  3. Distinctive:

    Const by Default: Use const for variables that won't be reassigned.

    line 21
  4. Distinctive:

    Arrow Functions: Prefer arrow functions for callbacks and function expressions.

    line 22
  5. Distinctive:

    Template Literals: Use template literals for string interpolation instead of concatenation.

    line 23
  6. Distinctive:

    Destructuring: Use destructuring for object and array extraction to improve readability.

    line 24
  7. Very specific:

    Module System: Use ES6 modules (import/export) for code organization.

    line 29
  8. Very specific:

    Naming Conventions: Use camelCase for variables and functions, PascalCase for classes and constructors, UPPER_CASE for constants.

    line 32
  9. Distinctive:

    Avoid Global Scope: Never pollute global scope.

    line 33
  10. Distinctive:

    Async/Await Over Promises: Prefer async/await for cleaner asynchronous code.

    line 37
  11. Distinctive:

    Error Handling: Always use try/catch with async/await.

    line 38
  12. Distinctive:

    Promise.all for Parallel: Use Promise.all() for concurrent independent operations.

    line 39
  13. Distinctive:

    Default Parameters: Use default parameter syntax instead of manual checks.

    line 46
  14. Distinctive:

    Rest Parameters: Use rest parameters (...args) instead of arguments object.

    line 47
  15. Distinctive:

    Return Early: Use guard clauses and early returns to reduce nesting.

    line 48
  16. Distinctive:

    Object Shorthand: Use property shorthand and computed property names.

    line 53
  17. Distinctive:

    Array Methods: Use map, filter, reduce, find, some, every instead of loops when appropriate.

    line 54
  18. Distinctive:

    Immutability: Avoid mutating objects and arrays.

    line 55
  19. Distinctive:

    Optional Chaining: Use optional chaining (?.) to safely access nested properties.

    line 56
  20. Distinctive:

    Nullish Coalescing: Use ?? operator for default values (distinct from ||).

    line 57
  21. Distinctive:

    Don't Swallow Errors: Always handle or propagate errors.

    line 64
  22. Distinctive:

    Debounce/Throttle: Use debouncing and throttling for event handlers and expensive operations.

    line 70
  23. Distinctive:

    Console Methods: Use console.table, console.group, console.time for better debugging.

    line 93
  24. Distinctive:

    Debugger Statement: Use debugger keyword strategically for breakpoints.

    line 94
  25. Distinctive:

    Type Checking: Consider using JSDoc comments or TypeScript for type safety.

    line 95
  26. Distinctive:

    Before submitting JavaScript code, verify:

    line 100

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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)

Download now (ZIP)

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.