agentleFS
JakeLabateJakeLabate/Claude-SEO-Skills/skills/heading-structure-audit/SKILL.md

heading-structure-audit

Skill3 starsChanged 5 months agoMITView on GitHub

Audit a website's heading structure (H1–H6) for SEO and accessibility. Crawls pages to find missing or multiple H1s, skipped heading levels, empty headings, headings that don't start at H1, overly long headings, and duplicate headings. Use when the user asks to audit, analyze, check, or improve heading tags, the H1, the heading hierarchy, document outline, or content structure of a website.

  • Installs packages

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when the user asks to:

    line 12
  2. Distinctive:

    Before starting, confirm with the user:

    line 22
  3. Very specific:

    If a sitemap is available (/sitemap.xml), it is used to get the canonical page list.

    line 33
  4. Very specific:

    Use scripts/extract_headings.py to build a heading inventory:

    line 37
  5. Very specific:

    Use scripts/audit_headings.py to run all audit checks against the inventory:

    line 50
  6. Very specific:

    Write a report following the structure in references/report-template.md:

    line 74
  7. Distinctive:

    Every page should have exactly one H1 that states the page's primary topic

    line 84
  8. Very specific:

    Add an H1 to /pricing: H1: Pricing Plans for Teams of Every Size

    line 91
  9. Very specific:

    If the user wants the report as a .docx (for example, to share with stakeholders or attach to a ticket), save the Markdown report to a file …

    line 99
  10. Very specific:

    If the user wants the raw findings as a spreadsheet (for filtering, sorting, or triage in Sheets or Excel), convert the audit's …

    line 109

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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

Heading Structure Audit

Audit the heading hierarchy (H1–H6) of a website and produce an actionable SEO and accessibility report.

When to use this skill

Use this skill when the user asks to:

  • Audit or analyze the heading tags or heading hierarchy of a website
  • Find pages with missing, empty, or multiple H1s
  • Find broken outlines: skipped heading levels (e.g., H2 jumping to H4) or pages that don't start at H1
  • Identify overly long or duplicated headings
  • Improve content structure, document outline, or accessibility of headings

Inputs to collect

Before starting, confirm with the user:

  1. Site URL or local files: a live site root URL (e.g., https://example.com), a sitemap URL, a list of URLs, or a local folder of HTML files.
  2. Scope: full site, a specific section (e.g., /blog/), or a list of URLs.
  3. Crawl limits: max pages (default 500) for live crawls.
  4. Long-heading threshold: character count above which a heading is "too long" (default 70).

Workflow

Step 1: Gather the page set and extract headings

  • If a sitemap is available (/sitemap.xml), it is used to get the canonical page list.
  • Otherwise, the crawler starts from the homepage following only same-host links.
  • For local HTML folders, all .html files are enumerated.

Use scripts/extract_headings.py to build a heading inventory:

python3 scripts/extract_headings.py https://example.com --max-pages 500 --output heading_inventory.json
# already crawled once (e.g. in a full SEO audit)? skip the crawl and reuse the shared cache:
# python3 scripts/fetch_pages.py https://example.com --output page_cache.json
# python3 scripts/extract_headings.py --from-cache page_cache.json --output heading_inventory.json

For every page the inventory records the <title> and the full list of headings in document order, each with its level (1–6) and trimmed text.

Step 2: Run the audit checks

Use scripts/audit_headings.py to run all audit checks against the inventory:

python3 scripts/audit_headings.py heading_inventory.json --long-heading 70 --output audit_report.json

Step 3: Evaluate the audit checks

Evaluate each check defined in references/audit-checks.md. The core checks are:

CheckSeverity
Missing H1High
No headings at allHigh
Multiple H1sMedium
Skipped heading level (e.g., H2 → H4)Medium
Empty heading elementMedium
First heading is not H1Low
Heading too long (> 70 chars)Low
Duplicate heading text on one pageLow
Title / H1 topical mismatchInformational

Step 4: Produce the report

Write a report following the structure in references/report-template.md:

  1. Summary: pages crawled, headings found, issue counts by severity
  2. Issues: one section per failing check, listing the page, the offending heading(s), and a specific fix
  3. Prioritized action list: ordered by severity and estimated impact

Step 5: Recommend fixes

For each issue, give a concrete, copy-pasteable recommendation. When proposing headings:

  • Every page should have exactly one H1 that states the page's primary topic
  • Headings should form a logical, gap-free outline: H1 → H2 → H3, never skipping a level downward
  • Base every suggested heading on the page's actual content; never invent topics the page does not cover
  • Reserve heading tags for true section titles: do not wrap styling-only text in headings, and do not demote real section titles to <div>s for visual reasons (use CSS instead)

Example recommendations:

  • Add an H1 to /pricing: H1: Pricing Plans for Teams of Every Size
  • /blog/post-1 jumps from H2 to H4 under "Methodology": change the H4 subsections to H3
  • Merge the two H1s on the homepage; demote the tagline H1 to a paragraph and keep the brand-value H1

Optional: export the report

As a Word document (.docx)

If the user wants the report as a .docx (for example, to share with stakeholders or attach to a ticket), save the Markdown report to a file and convert it:

python3 scripts/md_to_docx.py report.md --output report.docx

scripts/md_to_docx.py uses only the Python standard library (no pip install) and renders headings, tables, lists, links, bold/italic, and code blocks. Offer this whenever a user asks for a Word doc, a .docx, or a shareable/downloadable report.

As a CSV of findings (.csv)

If the user wants the raw findings as a spreadsheet (for filtering, sorting, or triage in Sheets or Excel), convert the audit's audit_report.json directly:

python3 scripts/findings_to_csv.py audit_report.json --output findings.csv

scripts/findings_to_csv.py is also standard-library only. It writes one row per finding, with check and severity columns prepended and list fields (e.g. the pages sharing a duplicate value) joined with ; . Unlike the .docx, which reformats the written report, the CSV is a direct dump of the structured findings: offer it whenever a user wants the data itself, a spreadsheet, or to slice findings by check or severity.

Resources

  • scripts/md_to_docx.py: convert the Markdown report into a Word (.docx) document (standard library only)
  • scripts/findings_to_csv.py: flatten the audit findings JSON into a CSV, one row per finding (standard library only)
  • references/audit-checks.md: full definitions, thresholds, and rationale for every audit check
  • references/report-template.md: report output structure
  • scripts/extract_headings.py: crawl a site and build the heading inventory
  • scripts/audit_headings.py: run audit checks against a heading inventory JSON file

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.