# TagCheck > A checker for HTML pages: finds semantic and accessibility mistakes (missing alt text and labels, empty buttons and links, fake buttons, skipped headings, duplicate ids, references to missing ids) and classes or attributes the Tag family (TagBrush.css, TagAction) doesn't document. With `--browser` it also renders the page to check text contrast in light and dark mode and sideways scrolling on phones. Made for AI agents and CI: write a page, run TagCheck, fix what it reports, repeat until clean. ## Run it ```sh npx @kovirlabs/tagcheck page.html # files or folders npx @kovirlabs/tagcheck site/ --json # machine-readable report npx @kovirlabs/tagcheck page.html --browser # also contrast and phone overflow (needs Playwright) ``` Exit code 0 means clean, 1 means problems to fix, 2 means bad usage. `--strict` also fails on warnings. `--ignore=rule-a,rule-b` skips rules. `--rules` lists every rule. ## The loop for agents 1. Write the page. 2. Run `npx @kovirlabs/tagcheck page.html --json` (add `--browser` if Playwright is installed). 3. For each problem, fix the HTML at `line` and `column` as the `message` says. Do not silence rules with `--ignore` unless the user asks. 4. Run it again until `errors` is 0. The JSON report: `{ "tool": "tagcheck", "version": "…", "browser": true, "errors": 2, "warnings": 1, "files": [{ "file": "page.html", "problems": [{ "line": 12, "column": 3, "level": "error", "rule": "missing-alt", "message": " needs alt text (alt=\"\" if it's decorative)" }] }] }`. `browser` says whether the `--browser` checks ran. Browser problems have `line` and `column` set to null. Offline, the TagBrush.css and TagAction CDN files are served from the copies installed next to TagCheck, if any. ## Rules Errors: - `missing-lang`: `` needs `lang="en"` (or the page's language). - `multiple-main`: only one visible `
`. - `missing-alt`: every `` needs `alt`; use `alt=""` for decoration. - `unlabeled-field`: every input, select, and textarea needs a `