1---2name: dotnet-htmlhint3description: Use HTMLHint in .NET repositories that ship static HTML output or standalone frontend templates. Use when a repo needs a focused CLI lint gate for DOM structure, invalid attributes, and basic HTML correctness checks on static pages.4---56# HTMLHint for Static HTML in .NET Repositories78## Trigger On910- the repo has static HTML files, generated frontend output, or standalone templates under `wwwroot/`, `dist/`, or other web folders11- the user asks for HTML structure checks, invalid attribute detection, or basic DOM-quality linting12- the repo wants a narrow HTML gate separate from JS, CSS, and full-site runtime audits1314## Do Not Use For1516- raw `.cshtml` or `.razor` source with server-side directives; lint the rendered or published output instead17- JavaScript or TypeScript linting; route that to `dotnet-eslint`18- runtime performance, accessibility, SEO, or headers; route that to `dotnet-webhint`1920## Inputs2122- the nearest `AGENTS.md`23- `package.json`24- `.htmlhintrc` or equivalent config if present25- the real static HTML target: source templates, built output, or deployed URL2627## Workflow28291. Choose the right target first:30 - static HTML source files31 - generated build output such as `dist/`32 - a reachable URL when the page is already served332. Prefer repo-local installation and checked-in config for repeatable runs.343. Keep HTMLHint focused on static HTML correctness and lightweight policy.354. Add narrow scripts to `package.json`, for example:36 - `htmlhint "dist/**/*.html"`37 - `htmlhint "wwwroot/**/*.html"`385. If the repo has templating syntax that confuses the parser, lint the rendered output instead of forcing source templates through the tool.396. Use rule overrides deliberately for real project conventions; do not disable broad classes of checks just to make a noisy first pass green.407. Rerun the publish or frontend build flow if fixes touched generated or packaged HTML sources.4142## Bootstrap When Missing43441. Detect current state:45 - `rg --files -g 'package.json' -g '.htmlhintrc*' -g '*.html'`46 - `rg -n '"htmlhint"' --glob 'package.json' .`472. Prefer a repo-local install:48 - `npm install --save-dev htmlhint`493. Add or refine `.htmlhintrc` only after confirming the actual target files.504. Add repeatable commands to `AGENTS.md` and `package.json`, then verify with:51 - `npx htmlhint "dist/**/*.html"`52 - `npx htmlhint https://example.com`535. Return `status: configured` if HTMLHint now owns a clear static-HTML gate, or `status: improved` if the existing setup was tightened.546. Return `status: not_applicable` when the repo's HTML is primarily server-rendered templates that should be validated after rendering instead.5556## Handle Failures5758- Parser noise on Razor, Blazor, or other server-side template syntax is a target-selection problem; lint built output instead of source templates.59- URL-based checks can fail on auth, SPA routing, or environment drift; verify the served target is reachable and stable before trusting the result.60- Large volumes of trivial attribute warnings usually mean the config was copied from another stack and needs to be adapted to the repo's real HTML conventions.6162## Deliver6364- a repeatable static HTML lint gate65- clear targeting rules for source HTML versus rendered output66- checked-in config that matches the repo's actual page structure6768## Validate6970- the lint target contains real static HTML, not unsupported template syntax71- commands are reproducible from repo-local dependencies72- HTMLHint ownership is kept separate from broader site-audit tooling73- fixes were verified on the built or served output that actually ships7475## Ralph Loop76771. Plan: analyze current state, target outcome, constraints, and risks.782. Execute one step and produce a concrete delta.793. Review the result and capture findings.804. Apply fixes in small batches and rerun checks.815. Update the plan after each iteration.826. Repeat until outcomes are acceptable.837. If a dependency is missing, bootstrap it or return `status: not_applicable` with a reason.8485### Required Result Format8687- `status`: `complete` | `clean` | `improved` | `configured` | `not_applicable` | `blocked`88- `plan`: concise plan and current step89- `actions_taken`: concrete changes made90- `verification`: commands, checks, or review evidence91- `remaining`: unresolved items or `none`9293## Example Requests9495- "Add HTMLHint for the built static site in this repo."96- "Lint the generated HTML before deployment."97- "Why is HTMLHint failing on Razor pages?"