skills/frontend-conventions/SKILL.md
Define and enforce consistent coding standards across HTML, CSS, and JavaScript. Always use this skill when naming a new class, variable, component, or file; setting up a new project's conventions; choosing a class prefix for a new CSS category; deciding on modifier API names (sizes, shades, hierarchy, breakpoints); or reviewing code for formatting and naming consistency. If you're about to invent a prefix, abbreviation, or modifier name without checking the conventions first, use this skill.
npx skillsauth add mikemai2awesome/agent-skills frontend-conventionsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A shared system of rules for naming, formatting, and structuring code across HTML, CSS, and JavaScript. Consistency here is what makes a codebase feel like it was written by one person, regardless of team size.
| Setting | Value | | -------------------------- | ------ | | Indentation | spaces | | Tab size | 2 | | Translate tabs to spaces | Yes | | Trim trailing whitespace | Yes | | New line at end of file | Yes |
| File type | Quote style |
| --------- | ----------- |
| .html | "double" |
| .css | 'single' |
| .js | 'single' |
| .json | "double" |
| .yml | none in general; 'single' when forcing a string or using special characters; "double" when parsing escape codes |
| What you're naming | Case style |
| ------------------------------ | ---------------------------------------------- |
| HTML attributes and values | dash-case |
| CSS custom property | --dash-case |
| JavaScript variable / function | camelCase |
| JavaScript class | PascalCase |
| File names | dash-case.extension |
All CSS classes are prefixed by category so their purpose is immediately visible in HTML.
| Category | Prefix |
| --------------- | ------ |
| Component | c- |
| Utility | u- |
| JavaScript hook | js- |
js- classes are never styled — they exist solely as selectors for JavaScript behavior.
When working within a named project or library, prefix everything with a project namespace to prevent collisions:
| Scope | Namespace |
| ----------------- | --------- |
| Global/custom property | --namespace-property-name |
| Scoped/component property | --prefix-namespace-block-property |
Examples:
/* Global token */
var(--mmn-color-bg-primary)
/* Scoped to a component */
var(--c-mmn-card-border-radius)
| Type | Pattern | Example |
| ---- | ------- | ------- |
| HTML custom element | <namespace-element-name> | <mmn-card> |
| HTML data attribute | data-namespace-attribute | data-mmn-uuid="rng1928" |
| CSS selector | class="prefix-namespace-block__element--modifier" | class="c-mmn-card__media--video" |
| JS selector | class="js-namespace-target" | class="js-mmn-card-for-ab-test" |
Only use abbreviations from this list — everything else is spelled out in full.
| Full word | Abbreviation |
| -------------- | ------------ |
| Image | img |
| Background | bg |
| Minimum | min |
| Maximum | max |
| Call to action | cta |
| Column | col |
| Column span | colspan |
| Row span | rowspan |
Use these standardized modifier names so any developer can predict class names without checking documentation.
2xs · xs · sm · md · lg · xl · 2xl
<!-- The 2xl heading component -->
<h1 class="c-mmn-heading--2xl">...</h1>
xxlight · xlight · light · medium · dark · xdark · xxdark
<!-- The xdark magenta utility color -->
<span class="u-mmn-color-magenta-xdark">...</span>
primary · secondary · tertiary
<!-- The primary button component -->
<button class="c-mmn-button--primary" type="button">...</button>
Apply a utility or modifier at a specific breakpoint using @from- and @until- suffixes:
| Syntax | Meaning |
| ------ | ------- |
| behavior@from-[breakpoint] | Apply from this breakpoint and up |
| behavior@until-[breakpoint] | Apply below this breakpoint |
<!-- Full width from the sm breakpoint and beyond -->
<div class="u-mmn-full-width@from-sm">...</div>
<!-- Full width below the sm breakpoint only -->
<div class="u-mmn-full-width@until-sm">...</div>
Write CSS properties in this order within every rule. Grouping by concern (display → position → size → space → typography → border → background → advanced) makes rules easier to scan and diff.
.selector {
content;
/* Display */
display;
grid;
grid-*;
flex;
flex-*;
justify-*;
align-*;
place-*;
order;
box-sizing;
appearance;
visibility;
opacity;
/* Position */
position;
inset;
inset-block;
inset-block-start;
inset-block-end;
inset-inline;
inset-inline-start;
inset-inline-end;
float;
clear;
transform;
z-index;
/* Size */
inline-size;
min-inline-size;
max-inline-size;
block-size;
min-block-size;
max-block-size;
overflow;
overflow-block;
overflow-inline;
/* Space */
margin;
margin-block;
margin-block-start;
margin-block-end;
margin-inline;
margin-inline-start;
margin-inline-end;
padding;
padding-block;
padding-block-start;
padding-block-end;
padding-inline;
padding-inline-start;
padding-inline-end;
/* Typography */
font;
font-family;
font-style;
font-size;
font-weight;
font-feature-settings;
font-variant;
line-height;
list-style;
color;
text-align;
text-decoration;
text-transform;
text-wrap;
letter-spacing;
vertical-align;
cursor;
pointer-events;
user-select;
/* Border */
border;
border-radius;
border-width;
border-style;
border-color;
border-image;
box-shadow;
outline;
/* Background */
background;
background-color;
background-image;
background-position;
background-repeat;
background-size;
backdrop-filter;
/* Advanced */
filter;
will-change;
transition;
animation;
}
development
Implement accessibility in iOS apps using Swift, UIKit, and SwiftUI. Use this skill whenever working on any iOS development task that involves: making UI elements accessible to VoiceOver or other assistive technologies, adding or reviewing accessibility labels/hints/traits/actions/values, supporting Dynamic Type or text scaling, respecting Reduce Motion or reduced transparency preferences, adapting to Dark Mode or increased contrast, building accessible forms and inputs, announcing dynamic content changes, managing focus programmatically, customizing accessibility focus order, supporting external keyboard navigation, or auditing iOS code for accessibility issues. Trigger even when the user only says "SwiftUI" or "UIKit" without mentioning "accessibility" explicitly — if they're building custom controls, modals, forms, lists, or animated views, this skill applies.
development
Write minimal, efficient CSS for small or minimalist projects by trusting the browser instead of fighting it. Only use this skill for personal sites, prototypes, simple landing pages, or projects intentionally kept lean — if the project has multiple developers, a component library, a design token system, or more than a handful of CSS files, a more comprehensive CSS approach is needed. If you're about to write a CSS reset, declare a base font-size on :root, set default colors on body, use px for spacing, or reach for physical margin/padding properties, this skill will stop you.
development
Write scalable, well-architected CSS using design tokens, cascade layers, and modern organization patterns. Use this skill as the default for any real project — if it has more than a handful of CSS files, multiple components, a team, a design system, or any kind of token or theming setup, this is the right skill.
development
Create web interfaces with an authentic early-2010s aesthetic. Use this skill when the user wants a 2010s-era, Web 2.0, or retro corporate web look — gradient headers, glossy buttons, skeuomorphic icons, horizontal band layouts, and drop shadows from circa 2010–2014.