litejs-style
Use when writing or modifying JavaScript, CSS, or commit messages in LiteJS projects — enforces non-standard conventions like no-semicolons, comma-first declarations, and same-level switch/case
What this skill does
# LiteJS Style Guide
Coding conventions for LiteJS projects. These diverge from standard JS/CSS defaults — follow them exactly.
## JavaScript
### No Semicolons
Do NOT add semicolons at end of lines. Use a semicolon ONLY before `[`, `(` or `/` at the beginning of a line:
```javascript
var arr = [1, 2]
;[3, 4].forEach(fn)
;(function() {})()
```
### Comma-First Declarations
Uninitialized variables first on one line, then comma-first for initialized:
```javascript
var foo, bar
, MAX_AGE = 120
, baz = "baz"
, quux = 123
```
### Leading Dot for Chains
```javascript
person
.be("confused")
.do("makeup")
```
### Switch/Case Same Level
```javascript
switch (sex) {
case "male":
person.wear("bow tie")
break
default:
person.be("confused")
}
```
### Functions
- Prefer declarations over expressions: `function a() {}` not `var a = function() {}`
- Don't use `that` for outer `this` — use lowercased constructor name: `var person = this`
- Pass scope instead of binding: `arr.map(fn, scope)` not `arr.map(fn.bind(scope))`
- Accept optional scope argument in functions with callbacks
### Naming
| Convention | Use |
|---|---|
| `lowerCamelCase` | methods, variables |
| `UpperCamelCase` | constructors |
| `CAPITAL_SNAKE_CASE` | symbolic constants |
| `_prefix` | private methods/properties |
### Spacing
- One space before `{`, after `;` in for loops, around binary operators `1 + 2`
- No space between unary operator and variable: `i++`
- Braces on same line as statement
## General
- Tabs for indentation, spaces for alignment within a line
- Max 80 character lines (don't break greppable strings like log messages)
- Double quotes; single only to avoid escaping
- UNIX newlines, newline at end of file
- No trailing whitespace, no indented empty lines
- Hyphens instead of spaces in file/directory names
## CSS
- One selector per line, one rule per line
- SUIT CSS naming: `[<namespace>-]<ComponentName>[-descendentName][--modifierName]`
- `.is-` modifiers only combined with a component (`.Btn.is-error`, never `.is-error` alone)
- No ID selectors, no preprocessor, no media queries
- Align vendor-prefixed properties with spaces
- Shorthand properties where possible
```css
.Icon {
width: 16px;
height: 16px;
-webkit-transition: all 4s ease;
-moz-transition: all 4s ease;
transition: all 4s ease;
}
.Icon--person { background-position: -16px 0 ; }
.Icon--files { background-position: 0 -16px; }
```
## Commits
Format: `scope: Capitalized summary up to 50 chars`
- Imperative present tense: Add, Fix, Update, Remove, Refactor, Document, Test
- Optional scope narrows area: build, ci, docs, style, test, ui/form
- `! ` prefix for breaking changes: `! Rewrite public api`
- No period at end of subject
- One commit = one thing
- Fix bug = write regression test
## Common AI Mistakes
| AI default | Correct LiteJS style |
|---|---|
| `var x = 1;` | `var x = 1` (no semicolon) |
| `var x = 1, y = 2` | Comma-first (see above) |
| ` case "a":` indented | `case "a":` same level as switch |
| `.bind(this)` | Pass scope argument |
| `var that = this` | `var person = this` (constructor name) |
| `const fn = () => {}` | `function fn() {}` (declaration) |
| `'single quotes'` | `"double quotes"` |
| Semicolons everywhere | Only before `[`, `(`, `/` at line start |
Related in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4→v5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.