/frontend:code-stylefrom frontend
Enforces code style rules across languages: variable naming, brace style, HTML data attributes, markup forms, locale formatting, and CSS nesting. Auto-invokes when editing code or naming variables.
Ships in frontend. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
REQUIRED SUB-SKILLS:
.svelte, .svelte.ts, .svelte.js), invoke svelte-5:code-style-svelte. If the svelte-5 plugin isn't installed, stop and ask the user to install it.<style> blocks, inline style attributes, style: directives), invoke frontend:code-style-css.Single-line if without braces is OK only when the entire statement fits on one line:
// OK — fits on one line. But then we need an empty line after the statement, except there is another if, then we need an empty line after the last if.
if (x) doThing();
//OK
if (x) doThing();
if (y) doThingY();
if (z) doThingZ();
let x = 1
//NOT OK
if (x) doThing();
let x = 1
// NOT OK — body wraps to the next line, needs braces
if (x)
doThing();
// Correct
if (x) {
doThing();
}
Always use key-value syntax. Never use bare/boolean data attributes.
<!-- BAD -->
<div data-active></div>
<!-- GOOD -->
<div data-active="true"></div>
<button> activates on Enter and Space, an <a href> on Enter only. Use <button> for actions and <a href> for navigation to a real URL; only a non-semantic element with a role needs its own key handler.name, the matching type (email, tel, url, number) and inputmode, and turn off spellcheck on emails, codes and usernames (spellcheck="false").autocomplete token (name, email, tel, street-address, one-time-code), which WCAG 1.3.5 requires. Use autocomplete="off" only on a field that must never be autofilled.<label>, so the whole row is a single hit target with no dead zone.beforeunload on plain pages, beforeNavigate on SvelteKit (svelte-5:code-style-svelte).user-scalable=no or maximum-scale=1. Match <meta name="theme-color"> to the page background.inert on the content that isn't a drop target, not on the dragged element (text selection: frontend:code-style-css).Intl.DateTimeFormat and Intl.NumberFormat. Detect the language from Accept-Language or navigator.languages, not the IP. Mark brand names, code and identifiers with translate="no".Use semantic, human-readable names. The name should say what the thing IS, not save keystrokes.
| Don't | Do |
|---|---|
ctx | context |
c, cb | callback |
obj | object or something more specific |
val | value |
tmp | temporary or something more specific |
res | result or response |
el | element |
Exceptions: Loop variables (i, j) and lambda params where meaning is obvious from context ((item) => item.id) are fine.
Functions are verbs. Past-participle nouns (mountedPopup) lie about lifecycle, wrong for a factory that mounts lazily. Use createComponentPopup.
Conventions: createX/buildX (factory), getX (sync read), loadX/fetchX (async), isX/hasX (predicate), toX (transform), attachX/detachX (lifecycle), onX/handleX (event).
One word, not two: toggle already means open-if-closed/close-if-open. Don't write toggleOrShow. Same for closeAndReset, getOrCreate.
Plural follows the work: if a function grows to handle N where it handled 1, rename. detachPopup that now detaches info + context popups is detachPopups.
type over interfaceUse type for object shapes. Never use interface unless extending a third-party interface.
// BAD
interface Milestone {
date: string
label: string
}
// GOOD
type Milestone = {
date: string
label: string
}
Private class members (fields and methods) should be prefixed with #, never private. # is enforced at runtime; private is compile-time only.
Always nest CSS with &. Never write flat selectors as separate rules.
/* BAD — flat selectors */
.parent .child { ... }
.parent:hover { ... }
/* GOOD — nested with & */
.parent {
& .child { ... }
&:hover { ... }
&[data-active="true"] { ... }
}
This applies to all CSS, component styles, global stylesheets, everywhere. For the full nesting workflow (specificity analysis, block ordering, stylelint compliance), use frontend:css-nesting.
frontend:editing: File editing discipline, refactoring safety.frontend:comments: Which comments survive, comment format, protected comments.svelte-5:code-style-svelte: Svelte-specific style rules (component docs, reactivity patterns).frontend:css-nesting: Full CSS nesting workflow with specificity analysis and stylelint compliance.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
13 skills in this plugin
/code-style-cssUse when editing CSS, SCSS, or style blocks in .svelte files. Covers CSS-specific code style rules. Auto-invoke when writing or modifying styles./commentsComment rules for every language: which comments survive, format, protected comments, placement, TODOs. Use when writing, editing, moving or deleting comments, docstrings or TODOs. Auto-invoke when editing code files./css-nestingConvert flat CSS to nested & syntax while satisfying stylelint's no-descending-specificity and no-duplicate-selectors rules. Use when nesting selectors, refactoring flat CSS to &, or fixing stylelint specificity/duplicate errors after nesting./css-subgridUse when building card grids, tile layouts, or repeated components where inner content (icons, titles, prices, buttons) must align across siblings. Also use when seeing misaligned card content at different text lengths./editingFile editing discipline: correct types, safe refactors, Svelte file rules, config overrides, markdown lint, visual refactors. Requires frontend:code-style and frontend:comments. Auto-invoke when editing code files./js-configUse when editing ESLint, Prettier, Stylelint, PostCSS, or Svelte config files. Use when adding or removing linting plugins, resolving formatter conflicts, auditing JS/TS toolchain configuration, or deciding whether a config package is needed.npx claudepluginhub fubits1/svelte-skills --plugin frontendOther plugins' skills for the same job