agentleFS
thisisAhsanIqbalthisisAhsanIqbal/nextjs-seo-audit/skills/semantic-layout/SKILL.md

semantic-layout

Skill7 starsChanged 10 months agoMITView on GitHub

Validates HTML5 semantic elements, ARIA landmarks, skip navigation, and page structure. Use when auditing semantic HTML, accessibility, or content structure for SEO. For the lang attribute, see the international-seo skill.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check for accessibility skip links: <a href="#main-content">, <a href="#content">, or <a href="#main">

    line 46
  2. Very specific:

    Check for these roles: banner, navigation, main, contentinfo, search

    line 62
  3. Very specific:

    If any found → ⚠️ WARN "Wrap content blocks in <section> or <article>"

    line 74
  4. Very specific:

    If > 3 images not wrapped in <figure> → ⚠️ WARN "Use <figure>/<figcaption>"

    line 77
  5. Very specific:

    If <time> elements found → ✅ PASS

    line 80
  6. Very specific:

    If date patterns found in text but no <time> elements → ⚠️ WARN "Wrap dates in <time datetime=\"...\">"

    line 81
  7. Distinctive:

    If a page uses Web Components or Shadow DOM, semantic elements inside the shadow tree may not be visible — note as limitation

    line 95

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Semantic Layout

Audit the page for proper use of HTML5 semantic elements and accessibility.

Note: The lang attribute check is handled by the international-seo skill. Do not duplicate it here.

1. Required semantic elements

These elements must be present:

ElementMissing =
<header>❌ FAIL
<main>❌ FAIL
<footer>❌ FAIL
<nav>❌ FAIL

Report count if present: ✅ PASS "<tag> element found (N instance(s))"

2. Recommended semantic elements

These elements should be present:

ElementMissing =
<article>⚠️ WARN "Consider using for content structure"
<section>⚠️ WARN
<aside>⚠️ WARN
<figure>⚠️ WARN

3. Skip-navigation link

Check for accessibility skip links: <a href="#main-content">, <a href="#content">, or <a href="#main">

  • Found → ✅ PASS
  • Missing → ⚠️ WARN "Add skip-navigation link for accessibility"

4. Div-soup detection

Count <div> elements vs semantic elements (header, main, footer, nav, article, section, aside, figure):

ConditionStatus
Divs > 0 but zero semantic elements❌ FAIL "Restructure with semantic HTML"
Divs > 5× semantic element count⚠️ WARN "High div-to-semantic ratio"

5. ARIA landmark roles

Check for these roles: banner, navigation, main, contentinfo, search

  • Any found → ✅ PASS — list which roles are present

6. Layout suggestions

Single <main>

  • 0 <main> elements → ⚠️ WARN "Wrap primary content in <main>"
  • Multiple <main> → ⚠️ WARN "Should have only one"

Headings inside semantic containers

  • Count <h2>, <h3>, <h4> that are NOT inside <section>, <article>, <aside>, or <main>
  • If any found → ⚠️ WARN "Wrap content blocks in <section> or <article>"

Images without <figure>

  • If > 3 images not wrapped in <figure> → ⚠️ WARN "Use <figure>/<figcaption>"

Date markup

  • If <time> elements found → ✅ PASS
  • If date patterns found in text but no <time> elements → ⚠️ WARN "Wrap dates in <time datetime=\"...\">"

List elements

  • No <ul> or <ol> found → ⚠️ WARN "Use lists for list-type content (improves featured snippet eligibility)"

Tables without captions

  • Tables missing <caption> → ⚠️ WARN "Add captions for accessibility"

Edge cases

  • Next.js and React apps render into a root <div id="__next"> or <div id="root"> — this does not count as "div-soup"; evaluate the semantic elements inside it
  • Server-rendered HTML may differ from client-rendered HTML — audit the initial SSR output when possible
  • Components rendered inside <template> or <slot> elements are not visible in static HTML — note this limitation
  • Email-style pages (e.g. unsubscribe pages) may legitimately lack <article>, <section>, or <aside> — do not flag as WARN
  • If a page uses Web Components or Shadow DOM, semantic elements inside the shadow tree may not be visible — note as limitation

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.