{"skills":[{"name":"Review a page heading outline","description":"Find places where the presented section hierarchy and semantic headings diverge, including visual headings missing from the accessibility tree.","content":"# Review a page heading outline\n\nFind places where the presented section hierarchy and semantic headings diverge, including visual headings missing from the accessibility tree.\n\n## When to use this skill\n\n- Someone has a heading list from a browser extension, screen reader or accessibility tree and wants to know whether the structure is right.\n- Section titles are styled as large or bold text and the team is unsure whether they are real headings.\n- An editor has an intended outline for an article and wants it checked against the published heading levels.\n\n## When not to use it\n\n- Judging whether headings are well worded. Whether each heading describes its topic is WCAG 2.4.6 Headings and Labels, an editorial review.\n- Landmarks and page regions such as header, nav, main and footer. Those are a separate structure check.\n\n## What you need\n\n- An ordered outline from the rendered page or document with stable element IDs and semantic heading levels.\n- The intended nesting of sections and any visual section titles implemented solely with styling.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Can you supply the rendered heading list with levels, from the accessibility tree or a headings tool, rather than the templates? Scripts and components can change levels.\n- Which visual titles start real sections, and what nesting did the author intend? Without an intended outline, only missing semantics and skipped levels can be reported.\n- Are some headings in fixed areas such as a sidebar or footer? W3C allows those to keep the same levels on every page.\n\n## Method\n\n1. Take the outline from the rendered page: h1 to h6 elements and any element with role=heading and an aria-level, in reading order. Record each item's id, level and text.\n2. Mark each visual title that starts a real section but has no heading semantics as missing-heading. W3C failure F2 describes this: a change in text presentation conveying structure without the matching markup. Do not count lead paragraphs, pull quotes, slogans or card labels that do not start a section.\n3. Where the author supplied intended levels, compare each heading's level with its target and mark wrong-level for a mismatch.\n4. Otherwise walk the semantic headings in order, ignoring non-headings. Mark skipped-level where a heading goes more than one level deeper than the previous heading, such as h2 followed by h4. Going back up any number of levels, such as h4 followed by h2, correctly closes subsections.\n5. Review fixed page areas such as sidebars and footers apart from the main content outline, since W3C allows them to keep consistent levels across pages.\n6. Give each item at most one finding, in the order missing-heading, wrong-level, skipped-level, and say what level it should be. A skipped level is guidance from W3C's tutorial, not a WCAG failure on its own; a real heading without semantics is a 1.3.1 issue.\n\n## Checks before you deliver\n\n- The default font size of an element does not establish its heading level.\n- Do not mark h4 followed by h2 as a skipped-heading error. Multiple subsections may end at the same transition.\n- role=heading without aria-level does not state the intended level. W3C technique ARIA12 requires role=heading to be paired with aria-level, and prefers native h1 to h6.\n- A heading element used only to make a tagline big adds a false section to heading navigation. H42's test checks both ways: real headings are marked up and non-headings are not.\n- WCAG does not require a single h1 or forbid skipped levels. Report those as good practice and keep failures for real headings without semantics or levels that misrepresent the structure.\n\n## How to present the result\n\nStart with the number of findings and the most serious one. Then show the outline as an indented list with each item's current level, any finding and the level it should have. End with the markup changes to make, such as 'change Preparation from p to h2', ready for the developer or editor.\n\n## Worked example\n\n**Request:** Review one continuous article outline. No explicit target levels supplied.\n\n**Supplied material:**\n\n```text\nH1 sem=h1 title=Replace a handle\nH2 sem=h2 title=Tools\nV1 sem=paragraph title=Preparation; visible section title starts independent section\nH4 sem=h4 title=Remove the old handle\nH5 sem=h2 title=Aftercare\n```\n\n**Answer:** Give Preparation a semantic heading at the rank its section warrants. Check the intended parent of \u201cRemove the old handle\u201d and correct the jump from h2 to h4 if necessary. Aftercare can legitimately return to h2.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nReturn findings as {id,issue} in source order. Apply at most one code per item: missing-heading when a real section heading lacks semantics, wrong-level when a supplied target level disagrees, otherwise skipped-level for a jump deeper than one. Ignore non-headings when comparing successive semantic ranks.\n\n## Sources\n\n- [W3C WAI headings tutorial](https:\/\/www.w3.org\/WAI\/tutorials\/page-structure\/headings\/): Says headings nest by rank, that skipping ranks should be avoided where possible (h2 followed directly by h4), that skipping is fine when closing subsections (h2 after h4), and that fixed page sections such as sidebars may keep consistent ranks across pages.\n- [W3C technique H42: Using h1-h6 to identify headings](https:\/\/www.w3.org\/WAI\/WCAG22\/Techniques\/html\/H42): A sufficient technique for WCAG 2.2 success criterion 1.3.1. Its test checks that heading markup is used for headings at the appropriate level and is not used for content that is not a heading.\n- [W3C failure F2: presentation without markup](https:\/\/www.w3.org\/WAI\/WCAG22\/Techniques\/failures\/F2): Describes failing success criterion 1.3.1 when a change in text appearance conveys meaning, such as a styled section title, without the appropriate semantic markup. This is the basis for the skill's missing-heading finding.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/review-a-heading-outline\n","scope":"contextual","trigger_keywords":["Review a page heading outline","review-a-heading-outline","review a heading outline","Are the headings on this page in a sensible order?","Are the headings on this page in a sensible order","heading hierarchy","heading outline","heading levels"],"is_private":true,"is_active":true,"scripts":[{"name":"review-a-heading-outline-check","description":"Compare a saved JSON answer with a published test. Pass tests\/case-1\/expected.json (or another case) and the path to your answer.","language":"python","filename":"review-a-heading-outline-check.py","content":"from pathlib import Path\nimport runpy\n\nrunpy.run_path(str(Path(__file__).parent \/ 'tests' \/ 'check.py'), run_name='__main__')\n","supporting_files":[{"path":"SKILL.md","content":"---\nname: review-a-heading-outline\ndescription: \"Compare a page's semantic heading levels with its real section structure to find visual titles that are not headings, headings at the wrong level and jumps that skip levels. Use when reviewing heading hierarchy or h1 to h6 structure for screen-reader navigation or WCAG 1.3.1.\"\nlicense: CC-BY-4.0\nmetadata:\n  author: Raq.com\n  version: \"2026-11-22\"\n  homepage: https:\/\/skills.raq.com\/skills\/review-a-heading-outline\n---\n\n# Review a page heading outline\n\nFind places where the presented section hierarchy and semantic headings diverge, including visual headings missing from the accessibility tree.\n\n## When to use this skill\n\n- Someone has a heading list from a browser extension, screen reader or accessibility tree and wants to know whether the structure is right.\n- Section titles are styled as large or bold text and the team is unsure whether they are real headings.\n- An editor has an intended outline for an article and wants it checked against the published heading levels.\n\n## When not to use it\n\n- Judging whether headings are well worded. Whether each heading describes its topic is WCAG 2.4.6 Headings and Labels, an editorial review.\n- Landmarks and page regions such as header, nav, main and footer. Those are a separate structure check.\n\n## What you need\n\n- An ordered outline from the rendered page or document with stable element IDs and semantic heading levels.\n- The intended nesting of sections and any visual section titles implemented solely with styling.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- Can you supply the rendered heading list with levels, from the accessibility tree or a headings tool, rather than the templates? Scripts and components can change levels.\n- Which visual titles start real sections, and what nesting did the author intend? Without an intended outline, only missing semantics and skipped levels can be reported.\n- Are some headings in fixed areas such as a sidebar or footer? W3C allows those to keep the same levels on every page.\n\n## Method\n\n1. Take the outline from the rendered page: h1 to h6 elements and any element with role=heading and an aria-level, in reading order. Record each item's id, level and text.\n2. Mark each visual title that starts a real section but has no heading semantics as missing-heading. W3C failure F2 describes this: a change in text presentation conveying structure without the matching markup. Do not count lead paragraphs, pull quotes, slogans or card labels that do not start a section.\n3. Where the author supplied intended levels, compare each heading's level with its target and mark wrong-level for a mismatch.\n4. Otherwise walk the semantic headings in order, ignoring non-headings. Mark skipped-level where a heading goes more than one level deeper than the previous heading, such as h2 followed by h4. Going back up any number of levels, such as h4 followed by h2, correctly closes subsections.\n5. Review fixed page areas such as sidebars and footers apart from the main content outline, since W3C allows them to keep consistent levels across pages.\n6. Give each item at most one finding, in the order missing-heading, wrong-level, skipped-level, and say what level it should be. A skipped level is guidance from W3C's tutorial, not a WCAG failure on its own; a real heading without semantics is a 1.3.1 issue.\n\n## Checks before you deliver\n\n- The default font size of an element does not establish its heading level.\n- Do not mark h4 followed by h2 as a skipped-heading error. Multiple subsections may end at the same transition.\n- role=heading without aria-level does not state the intended level. W3C technique ARIA12 requires role=heading to be paired with aria-level, and prefers native h1 to h6.\n- A heading element used only to make a tagline big adds a false section to heading navigation. H42's test checks both ways: real headings are marked up and non-headings are not.\n- WCAG does not require a single h1 or forbid skipped levels. Report those as good practice and keep failures for real headings without semantics or levels that misrepresent the structure.\n\n## How to present the result\n\nStart with the number of findings and the most serious one. Then show the outline as an indented list with each item's current level, any finding and the level it should have. End with the markup changes to make, such as 'change Preparation from p to h2', ready for the developer or editor.\n\n## Worked example\n\n**Request:** Review one continuous article outline. No explicit target levels supplied.\n\n**Supplied material:**\n\n```text\nH1 sem=h1 title=Replace a handle\nH2 sem=h2 title=Tools\nV1 sem=paragraph title=Preparation; visible section title starts independent section\nH4 sem=h4 title=Remove the old handle\nH5 sem=h2 title=Aftercare\n```\n\n**Answer:** Give Preparation a semantic heading at the rank its section warrants. Check the intended parent of \u201cRemove the old handle\u201d and correct the jump from h2 to h4 if necessary. Aftercare can legitimately return to h2.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nReturn findings as {id,issue} in source order. Apply at most one code per item: missing-heading when a real section heading lacks semantics, wrong-level when a supplied target level disagrees, otherwise skipped-level for a jump deeper than one. Ignore non-headings when comparing successive semantic ranks.\n\n## Sources\n\n- [W3C WAI headings tutorial](https:\/\/www.w3.org\/WAI\/tutorials\/page-structure\/headings\/): Says headings nest by rank, that skipping ranks should be avoided where possible (h2 followed directly by h4), that skipping is fine when closing subsections (h2 after h4), and that fixed page sections such as sidebars may keep consistent ranks across pages.\n- [W3C technique H42: Using h1-h6 to identify headings](https:\/\/www.w3.org\/WAI\/WCAG22\/Techniques\/html\/H42): A sufficient technique for WCAG 2.2 success criterion 1.3.1. Its test checks that heading markup is used for headings at the appropriate level and is not used for content that is not a heading.\n- [W3C failure F2: presentation without markup](https:\/\/www.w3.org\/WAI\/WCAG22\/Techniques\/failures\/F2): Describes failing success criterion 1.3.1 when a change in text appearance conveys meaning, such as a styled section title, without the appropriate semantic markup. This is the basis for the skill's missing-heading finding.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/review-a-heading-outline\n"},{"path":"LICENSE.txt","content":"Original Raq.com instructions and synthetic examples: CC BY 4.0.\nhttps:\/\/creativecommons.org\/licenses\/by\/4.0\/\nAttribution: Raq.com, https:\/\/skills.raq.com\/skills\/review-a-heading-outline\nReferenced third-party materials retain their own terms.\n"},{"path":"examples\/worked-example.md","content":"# Procedure with a missing section title\n\nReview one continuous article outline. No explicit target levels supplied.\n\n## Supplied material\n\nH1 sem=h1 title=Replace a handle\nH2 sem=h2 title=Tools\nV1 sem=paragraph title=Preparation; visible section title starts independent section\nH4 sem=h4 title=Remove the old handle\nH5 sem=h2 title=Aftercare\n\n## Worked answer\n\nGive Preparation a semantic heading at the rank its section warrants. Check the intended parent of \u201cRemove the old handle\u201d and correct the jump from h2 to h4 if necessary. Aftercare can legitimately return to h2.\n\n## Reasoning\n\nThe styled paragraph is absent from heading navigation. Returning to h2 for Aftercare is legitimate.\n"},{"path":"tests\/check.py","content":"\"\"\"Check a saved agent answer locally with Python 3 (standard library only).\"\"\"\nimport json\nimport math\nimport sys\nfrom pathlib import Path\n\n\ndef compare(expected, actual, path=\"$\", accepted=None):\n    if isinstance(expected, bool) or isinstance(actual, bool):\n        if expected is not actual:\n            yield path\n    elif isinstance(expected, (int, float)) and isinstance(actual, (int, float)):\n        if not math.isclose(expected, actual, rel_tol=0, abs_tol=1e-8):\n            yield path\n    elif isinstance(expected, dict) and isinstance(actual, dict):\n        for key in sorted(set(expected) | set(actual)):\n            if key not in expected or key not in actual:\n                yield f\"{path}.{key}\"\n            elif not any(\n                not list(compare(option, actual[key]))\n                for option in (accepted or {}).get(key, [])\n            ):\n                yield from compare(expected[key], actual[key], f\"{path}.{key}\")\n    elif isinstance(expected, list) and isinstance(actual, list):\n        if len(expected) != len(actual):\n            yield f\"{path} (length)\"\n        for i, (left, right) in enumerate(zip(expected, actual)):\n            yield from compare(left, right, f\"{path}[{i}]\")\n    elif type(expected) != type(actual) or expected != actual:\n        yield path\n\n\ndef main():\n    if len(sys.argv) != 3:\n        raise SystemExit(\"Usage: python3 check.py expected.json answer.json\")\n    try:\n        expected, actual = [json.loads(Path(p).read_text(encoding=\"utf-8\")) for p in sys.argv[1:]]\n        alternatives = Path(sys.argv[1]).with_name(\"accepted.json\")\n        accepted = json.loads(alternatives.read_text(encoding=\"utf-8\")) if alternatives.is_file() else {}\n    except (ValueError, OSError) as error:\n        raise SystemExit(str(error))\n    differences = list(compare(expected, actual, accepted=accepted))\n    if differences:\n        raise SystemExit(\"Different fields: \" + \", \".join(differences))\n    print(\"Pass\")\n\n\nif __name__ == \"__main__\":\n    main()\n"},{"path":"tests\/README.md","content":"Give your agent SKILL.md and one request.txt in a fresh session. Keep the expected answer aside. Save the reply as answer.json, then run this from the tests folder:\n\n    python3 check.py case-1\/expected.json answer.json\n\nEach case also has an explanation. Where accepted.json exists, the checker accepts the alternatives listed there.\n"},{"path":"tests\/case-1\/request.txt","content":"Review one continuous article outline. No explicit target levels supplied.\nReturn only the JSON specified in SKILL.md for this test.\n\nH1 sem=h1 title=Replace a handle\nH2 sem=h2 title=Tools\nV1 sem=paragraph title=Preparation; visible section title starts independent section\nH4 sem=h4 title=Remove the old handle\nH5 sem=h2 title=Aftercare\n"},{"path":"tests\/case-1\/expected.json","content":"{\n    \"findings\": [\n        {\n            \"id\": \"V1\",\n            \"issue\": \"missing-heading\"\n        },\n        {\n            \"id\": \"H4\",\n            \"issue\": \"skipped-level\"\n        }\n    ]\n}\n"},{"path":"tests\/case-1\/explanation.txt","content":"The styled paragraph is absent from heading navigation. Returning to h2 for Aftercare is legitimate.\n"},{"path":"tests\/case-2\/request.txt","content":"Review one article outline. The editor supplied the intended ranks.\nReturn only the JSON specified in SKILL.md for this test.\n\nT1 sem=h1 target=h1 Overview\nT2 sem=h2 target=h2 Travel\nT3 sem=h3 target=h3 By train\nT4 sem=h3 target=h2 Accommodation\n"},{"path":"tests\/case-2\/expected.json","content":"{\n    \"findings\": [\n        {\n            \"id\": \"T4\",\n            \"issue\": \"wrong-level\"\n        }\n    ]\n}\n"},{"path":"tests\/case-2\/explanation.txt","content":"The accommodation section is a peer of Travel, although the current outline presents it as a subsection.\n"}],"is_active":true,"is_approved":false}]}]}