Skip to content

Guide · Agent skill

How to use the HTML lang Attribute Checker agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

This is an agent skill that tells an AI agent how to check the language declared on the html element of a web page. It is aimed at front-end developers auditing XHTML or EPUB-style content, and at teams who want screen reader users to hear text in the right language. After reading this guide you will know how to install the skill, how to ask for the check in plain language, and what the agent will report back.

HTML lang Attribute Checkerthedaviddias/Front-End-Checklist · MIT

Quick start

  1. 1Download the ZIP. Download the skill ZIP from this page.
  2. 2Unzip into a skills folder. Unzip it into ~/.claude/skills/ for personal use, or into .claude/skills/ inside a project.
  3. 3Or upload in the Claude apps. In the Claude apps, go to Settings → Capabilities → Skills and upload the skill there.
  4. 4Ask for the check. Ask the agent in plain language to check lang and xml:lang on a named file or page.
  5. 5Review the report. Read the agent's findings on mismatches, BCP 47 validity and whether xml:lang is needed.
  6. 6Apply and verify. Make the agreed change and confirm both attributes match or that xml:lang has been removed for HTML5 pages.

What the skill makes the agent do

When the skill is active, the agent reviews web page markup for one accessibility issue: the page language declared on the <html> element. Screen readers use the lang attribute to choose a voice profile and pronunciation, so a wrong value can make text unintelligible to a blind user.

The agent checks three things. If both lang and xml:lang are present, their values must be identical, including subtags, so en and en-US count as a mismatch. The value must be a valid BCP 47 language tag such as en, en-US, fr or zh-Hant. And on ordinary HTML5 pages served as text/html, xml:lang is unnecessary and the agent suggests removing it.

  • Flags lang and xml:lang values that differ in any way
  • Checks that the language code is a valid BCP 47 tag
  • Suggests removing xml:lang from plain HTML5 pages
  • Keeps both attributes, identical, for XHTML or polyglot documents

Install the skill from the ZIP download

Download the ZIP for this skill from this page. Then choose one of two locations. For a personal install available across your projects, unzip it into ~/.claude/skills/. For a single project, unzip it into that project's .claude/skills/ folder.

If you use the Claude apps instead, you can upload the skill under Settings → Capabilities → Skills.

  • Personal: ~/.claude/skills/
  • Project only: .claude/skills/ inside your project

Trigger the skill with natural requests

You do not need a special command. The skill's description tells the agent when to use it, so ask in plain language about XHTML, polyglot documents, lang or xml:lang. Mention the file or page you want checked.

Good requests name the document and the goal, for example asking the agent to check whether the lang and xml:lang on an XHTML file agree. The skill is most useful when the document is served as application/xhtml+xml or includes both attributes.

  • "Check the lang and xml:lang attributes in chapter1.xhtml."
  • "Audit this EPUB-style page for language declaration problems."
  • "Does this HTML5 page need xml:lang, or only lang?"

Example: fixing a mismatch

Suppose the markup declares different languages on the same element. The skill treats this as a conflict because XML-based processors may use xml:lang while browsers use lang. The fix is to set both to the same valid code that matches the document's primary language.

For a plain HTML5 page, the agent should recommend keeping only lang. For a polyglot document, both attributes stay and must match.

<!-- Incorrect: values differ --> <html lang="en" xml:lang="fr"> <!-- Correct polyglot document: both present and identical --> <html lang="fr" xml:lang="fr"> <!-- Correct HTML5 document: only lang needed --> <html lang="en">

What the skill needs and how it runs

The skill lists no required tools. According to its metadata, it does not run scripts and does not use the network. It works from the markup you give it. The skill's files are SKILL.md, which holds the core instructions, and references/rule.md, which holds fuller examples. The agent reads the reference file when it needs more detail.

  • Requires: nothing listed
  • Runs scripts: no
  • Uses network: no
  • Licence: MIT

Limits and safety notes

The skill is not useful for modern HTML5-only sites, where only lang is needed. It also should not be relied on for pages whose language is unknown or mixed unless the author confirms the primary language, because the skill cannot determine that reliably on its own.

Review any suggested change before applying it, especially the language code, since the agent works from the content it can see.

  • Do not use it to decide the language of mixed-language content without author input
  • Check suggested codes against the actual text

What people use it for

  • Auditing XHTML content before publishing
  • Checking EPUB-style chapters for correct language declarations
  • Reviewing HTML5 pages to confirm only lang is used
  • Catching en versus en-US style mismatches between the two attributes

Frequently asked questions

Do I need to install anything to use this skill?

The skill lists no required tools. Installation means downloading the ZIP from this page and unzipping it into ~/.claude/skills/ or a project's .claude/skills/ folder, or uploading it under Settings → Capabilities → Skills in the Claude apps.

Is this skill free?

The skill is released under the MIT licence, as listed on this page. The source repository is thedaviddias/Front-End-Checklist.

Does the skill run scripts or access the internet?

According to its listing, it runs no scripts and uses no network. It reviews the markup you provide.

Should I use xml:lang on my HTML5 pages?

Usually not. For standard HTML5 documents served as text/html, only lang is required and xml:lang is redundant, so the skill suggests removing it. Keep both, identical, only for XHTML or polyglot documents.

What is a valid language code?

The skill expects a BCP 47 language tag such as en, en-US, fr or zh-Hant. Values like en and en-US are treated as different, so both attributes must match exactly.

Why does a lang mismatch matter for accessibility?

Screen readers use the lang value to pick a voice and pronunciation. If XML processors read a different xml:lang, text may be spoken in the wrong language, which WCAG 2.1 SC 3.1.1 aims to prevent.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you audit XHTML, EPUB-style or polyglot documents and need to confirm that lang and xml:lang agree and are valid. Pick something else for modern HTML5-only sites, where only lang is needed and this skill adds little, or for pages whose primary language you have not confirmed.

Download the skill