agentleFS
rcdelfinrcdelfin/agentkit/skills/software-development/spatie-javascript/SKILL.md

spatie-javascript

Skill2 starsChanged 3 months agoMITView on GitHub

Use when writing, editing, reviewing, or formatting JavaScript, TypeScript, Vue, Prettier, or ESLint code using Spatie conventions.

2 other projects use a version of this, 2 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Prefer const over let. Only use let when a variable will be reassigned.

    line 34
  2. Distinctive:

    Don't abbreviate variable names in multi-line functions.

    line 40
  3. Very specific:

    Always use === (strict equality).

    line 55
  4. Distinctive:

    If unsure of the type, cast it first:

    line 56
  5. Very specific:

    Use the function keyword for named functions to clearly signal it's a function.

    line 70
  6. Distinctive:

    Use for terse, single-line operations.

    line 74
  7. Distinctive:

    Use for anonymous callbacks.

    line 75
  8. Distinctive:

    Use in higher-order functions when it improves readability.

    line 76
  9. Very specific:

    Don't use arrow functions when you need this context (e.g., jQuery event handlers).

    line 77
  10. Distinctive:

    Use shorthand method syntax:

    line 81
  11. Distinctive:

    Prefer destructuring over manual property/index access:

    line 101

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Spatie JavaScript Guidelines

Overview

Apply Spatie's JavaScript coding standards to keep JS/TS code consistent and readable.

When to Activate

  • Activate this skill for any JavaScript or TypeScript coding work.
  • Activate this skill when working on .js, .ts, .jsx, .tsx, or .vue files.
  • Activate this skill when configuring Prettier or ESLint for a project.

Scope

  • In scope: JavaScript, TypeScript, Vue single-file components, Prettier/ESLint configuration.
  • Out of scope: PHP, Laravel, CSS-only files, server configuration.

Prettier Configuration

  • Indentation: 4 spaces (via .editorconfig, not Prettier default of 2)
  • Print width: 120 characters (not Prettier default of 80)
  • Quote style: single quotes

Variable Declarations

  • Prefer const over let. Only use let when a variable will be reassigned.
  • Never use var.
  • Reassigning object properties is fine with const — the reference is not reassigned.

Variable Names

  • Don't abbreviate variable names in multi-line functions. Use full, descriptive names.
  • Exception: single-line arrow functions where context is obvious.
// Good — full names in multi-line functions
function saveUserSession(userSession) {
    // ...
}

// Acceptable — short name in single-line arrow
userSessions.forEach(s => saveUserSession(s));

Comparisons

  • Always use === (strict equality). Never use ==.
  • If unsure of the type, cast it first:
const number = parseInt(input);

if (number === 5) {
    // ...
}

Functions

Function Declarations

  • Use the function keyword for named functions to clearly signal it's a function.

Arrow Functions

  • Use for terse, single-line operations.
  • Use for anonymous callbacks.
  • Use in higher-order functions when it improves readability.
  • Don't use arrow functions when you need this context (e.g., jQuery event handlers).

Object Methods

  • Use shorthand method syntax:
// Good
const obj = {
    handleClick(event) {
        // ...
    },
};

// Avoid
const obj = {
    handleClick: function(event) {
        // ...
    },
};

Destructuring

  • Prefer destructuring over manual property/index access:
// Good
const [hours, minutes] = '12:00'.split(':');

// Good — configuration objects with defaults
function createUser({ name, email, role = 'member' }) {
    // ...
}

// Avoid
const parts = '12:00'.split(':');
const hours = parts[0];
const minutes = parts[1];

Source: https://spatie.be/guidelines/javascript

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.