
Spatie Javascript
- 344 installs
- 88 repo stars
- Updated April 27, 2026
- spatie/guidelines-skills
spatie-javascript is a Claude Code skill that applies Spatie's JavaScript and TypeScript coding standards to variable declarations, comparisons, functions, destructuring, and Prettier configuration during create, edit, r
About
spatie-javascript is an MIT-licensed guidelines skill from Spatie's guidelines-skills repository that keeps JavaScript and TypeScript code aligned with Spatie's house style. It activates when creating, editing, reviewing, refactoring, or formatting code in .js, .ts, .jsx, .tsx, or .vue files, covering variable declarations, comparisons, functions, destructuring, and Prettier setup. Developers reach for spatie-javascript when contributing to Spatie-backed Laravel or JavaScript projects, onboarding teams onto shared conventions, or running agent-assisted code review before pull requests. The skill functions as a living style guide rather than a linter binary, helping agents propose diffs that match Spatie readability norms. Use it alongside framework-specific skills when consistency across a monorepo matters more than framework defaults alone. Author metadata lists Spatie as maintainer with conventions aimed at readable, uniform JS and TS across application frontends.
- spatie-javascript
- AI & Agent Building
- AI-coding skill
Spatie Javascript by the numbers
- 344 all-time installs (skills.sh)
- +14 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #2,153 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/spatie/guidelines-skills --skill spatie-javascriptAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 344 |
|---|---|
| repo stars | ★ 88 |
| Last updated | April 27, 2026 |
| Repository | spatie/guidelines-skills ↗ |
How do you apply Spatie JavaScript coding standards?
Helps with ai & agent building tasks.
Who is it for?
Developers working on Spatie-style JavaScript or TypeScript codebases who want agent-enforced naming, comparison, and formatting conventions across JS, TS, JSX, TSX, and Vue files.
Skip if: Teams standardized on Airbnb or Google style guides who do not follow Spatie JavaScript conventions or Prettier rules.
When should I use this skill?
Trigger when editing or reviewing .js, .ts, .jsx, .tsx, or .vue files, or when configuring Prettier to match Spatie JavaScript guidelines.
What you get
Refactored JavaScript or TypeScript diffs and Prettier configuration aligned with Spatie variable, function, and destructuring conventions.
- style-aligned code diffs
- prettier configuration
By the numbers
- Applies standards across five file extensions: .js, .ts, .jsx, .tsx, and .vue
Files
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.vuefiles. - 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
constoverlet. Only useletwhen 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
functionkeyword 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
thiscontext (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
Related skills
How it compares
Use spatie-javascript for Spatie house style; pick framework-specific skills when Nuxt or React architecture patterns matter more than formatting rules.
FAQ
Which file types does spatie-javascript cover?
spatie-javascript applies to JavaScript and TypeScript work in .js, .ts, .jsx, .tsx, and .vue files. It also guides Prettier configuration so formatting matches Spatie conventions during create, edit, review, or refactor tasks.
What coding areas does spatie-javascript standardize?
spatie-javascript standardizes variable declarations, comparisons, functions, destructuring, and Prettier setup according to Spatie's published JavaScript guidelines. Agents use it to keep diffs readable and consistent across frontend codebases.