К основному содержанию
скилл CX Codex

semantic-html-and-seo — скилл для Claude Code: семантика и SEO

Скилл для ИИ-агента: подсказывает семантичную разметку HTML5, метатеги, alt-тексты и progressive enhancement. Пригодится при вёрстке интерфейса и разборе чужого markup.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add dembrandt/dembrandt-skills --skill semantic-html-and-seo -a claude-code
Открыть на GitHub

Что делает semantic-html-and-seo

Скилл включается, когда агент пишет или проверяет разметку страницы. Внутри — правила по структуре документа: header, nav, main, article, section, aside, footer, один h1 на страницу и заголовки без пропуска уровней. Для интерактивных элементов советуется нативный тег вместо div с ARIA.

Отдельный блок про картинки: у каждого <img> должен быть alt, и его содержание зависит от роли изображения. Информативное описывают, декоративное оставляют пустым, сложное вроде графика дополняют подписью в figcaption. Дальше идут метатеги: title длиной 50–60 знаков, description на 120–160, канонический URL, Open Graph и Twitter-карточки, разметка JSON-LD с типами вроде Product и FAQPage.

Есть раздел про progressive enhancement: контент и формы должны работать без JavaScript, а скрипты только улучшают поведение. Про SPA сказано, что одностраничные приложения ломают браузерные умолчания, от которых зависят поиск и доступность, поэтому их нужно чинить явно. Скилл подхватывается по шаблонам путей **/*.html, **/*.tsx, **/*.vue, **/*.svelte и каталогам app/**, pages/**, src/**, так что в проекте без таких файлов он не сработает.

Какие задачи решает

  • разметить страницу семантичными тегами вместо div-обёрток
  • написать alt-тексты для всех изображений на странице
  • собрать метатеги и Open Graph для шаринга ссылки
  • добавить JSON-LD, чтобы поиск показал расширенный сниппет
  • сделать SPA доступным для сканеров и скринридеров

Примеры запросов агенту

  • добавь правильные метатеги на эту страницу
  • напиши семантичную разметку для этого компонента
  • как сделать это SPA дружелюбным к SEO

Как установить semantic-html-and-seo

1Через Skills CLI (Vercel)

npx skills add dembrandt/dembrandt-skills --skill semantic-html-and-seo -a claude-code

2Вручную: положить файлы

~/.claude/skills/semantic-html-and-seo/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/semantic-html-and-seo/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о semantic-html-and-seo

Как установить semantic-html-and-seo в Claude?

Выполните npx skills add dembrandt/dembrandt-skills --skill semantic-html-and-seo -a claude-code. После этого файл скилла лежит в ~/.claude/skills/semantic-html-and-seo/SKILL.md.

Что делает semantic-html-and-seo?

Даёт агенту правила семантичного HTML5, метатегов, alt-текстов, progressive enhancement и работы с SPA. Агент применяет их, когда пишет интерфейс или разбирает существующую разметку.

Когда скилл вообще включается?

Он привязан к шаблонам путей **/*.html, **/*.tsx, **/*.jsx, **/*.vue, **/*.svelte и каталогам app/**, pages/**, src/**. Если в проекте нет таких файлов, повода для срабатывания не будет.

Исходный текст

SKILL.md · MIT
---
name: semantic-html-and-seo
description: Semantic HTML5, SEO basics, alt text, progressive enhancement and SPA concerns. Use when building web UI, reviewing markup or optimising for search.
metadata:
  priority: 8
  pathPatterns:
    - "**/*.html"
    - "**/*.tsx"
    - "**/*.jsx"
    - "**/*.vue"
    - "**/*.svelte"
    - "app/**"
    - "pages/**"
    - "src/**"
  promptSignals:
    phrases:
      - "seo"
      - "semantic html"
      - "alt text"
      - "meta tags"
      - "progressive enhancement"
      - "spa"
      - "open graph"
      - "structured data"
      - "html5"
      - "localstorage"
      - "sessionstorage"
      - "personalization"
      - "remember user preference"
retrieval:
  aliases:
    - seo
    - semantic html
    - alt text
    - progressive enhancement
    - html5 best practices
    - meta tags
    - open graph
    - structured data
    - spa seo
    - client-side storage
    - localStorage personalization
  intents:
    - improve seo
    - add alt texts
    - write semantic html
    - optimise for search engines
    - add open graph tags
    - make spa crawlable
    - persist user preferences client-side
    - personalise based on stored state
  examples:
    - add proper meta tags to this page
    - write semantic html for this component
    - how do I make this SPA SEO friendly
    - add alt texts to all images
    - remember the user's last view with localStorage
    - personalise this returning-user experience
---

# Semantic HTML and SEO

Good HTML is not just markup — it is the contract between your content, search engines, assistive technologies, and the browser. Semantic HTML, correct metadata, and progressive enhancement make UI resilient, findable, and accessible by default.

---

## Semantic HTML5

Use the element that describes the content's meaning, not just its appearance.

### Document structure
```html
<header>       <!-- site header, logo, primary nav -->
<nav>          <!-- navigation links -->
<main>         <!-- primary page content, one per page -->
<article>      <!-- self-contained content: blog post, product card, news item -->
<section>      <!-- thematic grouping with a heading -->
<aside>        <!-- tangentially related content: sidebar, callout -->
<footer>       <!-- site footer, secondary links, copyright -->
```

### Headings
One `<h1>` per page — the primary topic. Headings form an outline: do not skip levels (`h1` → `h3` without `h2`).

```html
<h1>Product name</h1>
  <h2>Features</h2>
    <h3>Feature detail</h3>
  <h2>Pricing</h2>
```

### Interactive elements
```html
<button>   <!-- clickable action, submits or triggers JS -->
<a href>   <!-- navigation to a URL -->
<input>    <!-- user data entry -->
<select>   <!-- option selection -->
<details> / <summary>  <!-- native disclosure/accordion -->
```

Never use `<div>` or `<span>` as interactive elements without full ARIA annotation — and even then, prefer the native element.

---

## Images and Alt Text

Every `<img>` needs an `alt` attribute. What goes in it depends on context.

| Image type | Alt text |
|---|---|
| Informative (product photo, chart) | Describe content: `alt="Red leather sofa, three-seater"` |
| Functional (icon button, logo link) | Describe function: `alt="Go to homepage"` |
| Decorative | Empty: `alt=""` — screen readers skip it |
| Complex (chart, diagram) | Short alt + longer description nearby or in `<figcaption>` |

```html
<!-- Informative -->
<img src="sofa.jpg" alt="Red leather sofa, three-seater">

<!-- Decorative -->
<img src="divider.svg" alt="">

<!-- With caption -->
<figure>
  <img src="chart.png" alt="Bar chart showing revenue growth Q1–Q4 2025">
  <figcaption>Revenue grew 42% year-on-year in Q4 2025.</figcaption>
</figure>
```

---

## SEO Fundamentals

### Title and description
```html
<title>Product Name — Short descriptor | Brand</title>
<meta name="description" content="One or two sentences. What this page is, who it is for, what they will find.">
```

- Title: 50–60 characters. Most important keyword first.
- Description: 120–160 characters. Shown in search results — write for the human, not the algorithm.

### Canonical URL
```html
<link rel="canonical" href="https://example.com/the-definitive-url">
```

Prevents duplicate content penalties when the same page is accessible via multiple URLs.

### Open Graph (social sharing)
```html
<meta property="og:title" content="Page title">
<meta property="og:description" content="Page description">
<meta property="og:image" content="https://example.com/og-image.jpg">
<meta property="og:url" content="https://example.com/page">
<meta property="og:type" content="website">

<!-- Twitter/X -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Page title">
<meta name="twitter:image" content="https://example.com/og-image.jpg">
```

OG image: 1200×630px. Appears when the URL is shared on Slack, LinkedIn, Twitter, iMessage.

**The card's headline is the reader's phrase, not the article's insight.** A feed supplies no context, so a line that needs the article to make sense reads as nonsense to a scrolling stranger. Put the plain promise they are already looking for on the card, in the vocabulary of the platform they are on, and keep the clever line for the page.

**Adapt a card to a platform by mode, not by shade.** Against a light feed a dark card reads as an ad banner; the fix is a light card on that platform's own ground, not a warmer navy or a softer blue. A hue nudge is invisible next to the platform's chrome and costs a round trip for nothing. Tone tweaks come after the mode is right.

### Structured Data (JSON-LD)
Machine-readable content enables rich search results.

```html
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Product Name",
  "description": "Product description",
  "image": "https://example.com/product.jpg",
  "offers": {
    "@type": "Offer",
    "price": "49.00",
    "priceCurrency": "EUR"
  }
}
</script>
```

Common types: `Product`, `Article`, `BreadcrumbList`, `FAQPage`, `Organization`, `SiteLinksSearchBox`.

---

## Progressive Enhancement

Build in layers. The core content and function must work without JavaScript. Enhance with CSS. Enhance further with JS.

```
Layer 1: HTML — content is readable, links work, forms submit
Layer 2: CSS  — layout, typography, visual design
Layer 3: JS   — interactivity, animations, dynamic content
```

**In practice:**
- Forms must submit via native `<form action>` without JS — JS can intercept and enhance with fetch
- Navigation links must be real `<a href>` — JS can add transitions
- Content must be in the HTML — JS can enhance with lazy-load or personalisation
- Images must have `src` — JS can add lazy loading via `loading="lazy"` (now native)

---

## SPA Considerations

Single-page applications break browser defaults that SEO and accessibility depend on. Fix them explicitly.

### Server-side rendering or static generation
Client-rendered HTML is not reliably indexed by search engines. Use SSR (Next.js, Nuxt, SvelteKit) or static generation for any content that needs to be found.

### Title and meta updates
Update `document.title` and meta tags on every route change. Use the framework's `<Head>` component or equivalent.

### Focus management
On route change, move focus to the new page's `<h1>` or `<main>` — screen readers do not detect SPA navigation automatically.

```js
// After route change
document.querySelector('h1')?.focus();
```

### Scroll restoration
Restore scroll position to top on navigation, or to the saved position on back navigation. Browser default scroll restoration is disabled in SPAs.

### History API
Use `pushState` / `replaceState` so back/forward navigation and bookmarking work correctly.

---

## Device Capabilities and User Context

Design and code should adapt to what the device and user can actually do.

### Client-side storage as a personalization tool
`localStorage`, `sessionStorage`, and other browser capabilities (cookies, IndexedDB, media/permission queries) are legitimate tools for tailoring the experience — last view mode, chosen locale, a dismissed banner, an in-progress draft, a returning user's context.

Guardrails:
- **Personalise from real understanding, not a guess.** What to persist and pre-fill safely usually needs customer testing — a wrong assumption in stored state is worse than a neutral default.
- **Scope and consent.** `sessionStorage` for one session, `localStorage` across sessions; never store anything sensitive client-side; honour consent.
- **Re-validate every 2–3 years.** Needs drift; a personalization that fit at launch becomes friction. Revisit, ideally with fresh testing.

### Input method detection
```css
@media (hover: hover) {
  /* hover states — mouse or trackpad */
  .btn:hover { background: var(--color-primary-hover); }
}

@media (hover: none) {
  /* touch device — no hover, larger targets */
  .btn { min-height: 44px; }
}
```

### Pointer precision
```css
@media (pointer: coarse) {
  /* fat-finger touch — increase target sizes */
  .interactive { min-height: 44px; min-width: 44px; }
}

@media (pointer: fine) {
  /* mouse — precise, can use smaller targets */
}
```

Pointer precision can select a default behaviour, not only target size. Read the same query from JavaScript with `matchMedia('(pointer: fine)')`, but use each event's `pointerType` when the interaction model differs: a click that toggles and a pointer that pans on a mouse, pinch and double tap on touch. Never infer input type from viewport width; hybrid devices break the guess. See [[modal-and-overlay-patterns]] for the image-zoom case.

### Network conditions
```html
<!-- Lazy load images below the fold -->
<img src="product.jpg" loading="lazy" alt="...">

<!-- Serve modern formats with fallback -->
<picture>
  <source srcset="image.avif" type="image/avif">
  <source srcset="image.webp" type="image/webp">
  <img src="image.jpg" alt="...">
</picture>
```

### User preferences
```css
@media (prefers-reduced-motion: reduce) { /* disable animations */ }
@media (prefers-color-scheme: dark)     { /* dark mode tokens */ }
@media (prefers-contrast: more)         { /* increase contrast */ }
@media (forced-colors: active)          { /* Windows high contrast mode */ }
```

---

## Review Checklist

- [ ] One `<h1>` per page, headings form a logical outline
- [ ] Semantic elements used: `<main>`, `<nav>`, `<header>`, `<footer>`, `<article>`, `<section>`
- [ ] Every `<img>` has a meaningful `alt` or `alt=""` for decorative images
- [ ] `<title>` is unique per page, 50–60 characters, keyword-first
- [ ] `<meta name="description">` present and 120–160 characters
- [ ] Open Graph tags present on all shareable pages
- [ ] `<link rel="canonical">` on pages accessible via multiple URLs
- [ ] Structured data (JSON-LD) on product, article, and FAQ pages
- [ ] Forms work without JavaScript
- [ ] SPA updates `document.title` and meta tags on route change
- [ ] SPA moves focus on route change
- [ ] Hover states scoped to `@media (hover: hover)`
- [ ] Touch targets ≥ 44px on `@media (pointer: coarse)`
- [ ] Images use `loading="lazy"` below the fold
- [ ] `prefers-reduced-motion` respected

© dembrandt · MIT · dembrandt/dembrandt-skills

Похожие скиллы

Всё по теме «Фронтенд и UI» →
seo-geo ReScienceLab Проверяет техническое SEO, подбирает ключевые слова и готовит разметку JSON-LD, чтобы страницы цитировали поисковики и ИИ-ответы. CX Codex +1 53 900установок seo-local-business jezweb Генерирует метатеги <head>, микроразметку JSON-LD LocalBusiness, robots.txt и sitemap.xml для сайтов локальных компаний с привязкой к регионам и пригородам. CX Codex +1 1 800установок serp-markup-builder aaron-he-zhu Собирает содержимое <head>: варианты title и description, блок Open Graph и Twitter Card, валидный JSON-LD под расширенные сниппеты. CX Codex +1 1 400установок seo-auditing spencerpauly Проверяет техническое SEO веб-проекта: метатеги, микроразметку, robots.txt, карту сайта и метрики Core Web Vitals. Пригодится перед релизом сайта в прод. CX Codex +1 456установок nextjs-seo laguagu Скилл для внедрения и аудита SEO в Next.js App Router: метаданные, sitemap, канонические URL, структурированные данные, Core Web Vitals. CX Codex +1 2 400установок fixing-metadata ibelick Проверяет и приводит в порядок метаданные страниц: заголовки, описания, canonical, Open Graph, карточки Twitter, иконки и JSON-LD. CX Codex +1 18 200установок

Из того же набора34

color-mode-and-theme Помогает выбрать цветовую схему проекта, решить вопрос о поддержке тёмной темы и выстроить токены без сломанного контраста. CX Codex +1 926установок ui-density Помогает подобрать плотность интерфейса под мобильные экраны, планшеты и десктоп. Задаёт правила группировки данных для таблиц, дашбордов и режимов для профи. CX Codex +1 915установок form-design Скилл для проектирования форм: подсказки под полем, плейсхолдеры, валидация и состояние кнопки отправки. Пригодится, когда верстаешь или проверяешь ввод данных. CX Codex +1 916установок brand-visual-language Скилл помогает выбрать радиусы, шрифты и стиль иконок так, чтобы интерфейс читался как одна марка. Пригодится, когда начинаете дизайн-систему или ловите разнобой в визуале. CX Codex +1 907установок motion-and-storytelling Скилл для проектирования переходов, скролл-анимаций и онбординга. Подсказывает тайминги, easing и стаггер, когда анимация нужна, а не «для красоты». CX Codex +1 894установок information-architecture Помогает разложить большой интерфейс по полочкам: как называть сущности, строить навигацию и подтверждать необратимые действия. CX Codex +1 889установок modular-scale-typography Строит гармоничную типографику на основе единого коэффициента. Скилл помогает задать CSS-переменные или конфиг Tailwind, когда кегли в проекте подобраны хаотично. CX Codex +1 884установок algorithmic-color-palette Скилл выводит полную UI-палитру из одной-двух брендовых красок: состояния, серые с оттенком бренда, семантические цвета. CX Codex +1 887установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой