1---
2name: website
3description: Build fast, accessible, and SEO-friendly websites with modern best practices.
4metadata:
5 source: https://skillmd.com/skills/modbender/website
6 clawdbot:
7 emoji: 🌐
8 os:
9 - linux
10 - darwin
11 - win32
12---
13
14# Website Development Rules
15
16## Performance
17- Images are the #1 cause of slow sites — use WebP/AVIF, lazy-load below-the-fold, and set explicit width/height to prevent layout shift
18- Render-blocking CSS delays first paint — inline critical CSS in `<head>`, defer the rest
19- Third-party scripts (analytics, chat widgets) often add 500ms+ — load them with `async` or `defer`, audit regularly
20- Fonts cause invisible text flash (FOIT) — use `font-display: swap` and preload critical fonts
21- Measure with Lighthouse in incognito mode — extensions skew results
22
23## Mobile First
24- Start CSS with mobile styles, add complexity with `min-width` media queries — easier to scale up than strip down
25- Touch targets need 44x44px minimum — fingers are imprecise, small buttons frustrate users
26- Test on real devices, not just browser DevTools — throttling simulation misses real-world jank
27- Horizontal scroll is a critical bug — test every page at 320px width minimum
28- `viewport` meta tag is required: `<meta name="viewport" content="width=device-width, initial-scale=1">`
29
30## Accessibility
31- Every `<img>` needs `alt` text — empty `alt=""` for decorative images, descriptive text for meaningful ones
32- Color contrast ratio 4.5:1 minimum for body text — use WebAIM contrast checker
33- Form inputs must have associated `<label>` elements — placeholders alone are not accessible
34- Keyboard navigation must work — test every interactive element with Tab key
35- Screen readers announce heading hierarchy — use H1-H6 in logical order, never skip levels
36
37## HTML Structure
38- One `<h1>` per page only — it's the page title, not a styling tool
39- Use semantic elements: `<nav>`, `<main>`, `<article>`, `<aside>`, `<footer>` — they communicate structure to browsers and assistive tech
40- `<button>` for actions, `<a>` for navigation — don't use divs with click handlers
41- External links should have `rel="noopener"` — prevents security vulnerability with `target="_blank"`
42- Validate HTML — broken markup causes unpredictable rendering across browsers
43
44## CSS Patterns
45- Avoid `!important` — it breaks cascade and makes debugging painful. Fix specificity instead
46- Use relative units (`rem`, `em`, `%`) over fixed `px` for text — respects user font size preferences
47- CSS custom properties (variables) reduce repetition — define colors and spacing once, use everywhere
48- Flexbox for 1D layouts, Grid for 2D — don't force one to do the other's job
49- Test without CSS loading — content should still be readable in plain HTML
50
51## Common Mistakes
52- Missing favicon causes 404 spam in server logs — always include one, even a simple PNG
53- Not setting `<html lang="en">` breaks screen reader pronunciation
54- Hardcoded `http://` links break on HTTPS sites — use protocol-relative `//` or always `https://`
55- Assuming JavaScript is available — core content should work without JS (progressive enhancement)
56- Forgetting print styles — add `@media print` for pages users might print (receipts, articles)
57
58## Before Launch
59- Test all forms actually submit — broken contact forms lose leads silently
60- Check 404 page exists and is helpful — default server 404 looks unprofessional
61- Verify social sharing previews with Open Graph tags — test in Facebook/Twitter debuggers
62- Submit sitemap to Google Search Console — speeds up indexing
63- Set up uptime monitoring — know when your site goes down before users tell you