htmlhint
HTMLHint for Static HTML in .NET Repositories
Trigger On
- the repo has static HTML files, generated frontend output, or standalone templates under
wwwroot/,dist/, or other web folders - the user asks for HTML structure checks, invalid attribute detection, or basic DOM-quality linting
- the repo wants a narrow HTML gate separate from JS, CSS, and full-site runtime audits
Do Not Use For
- raw
.cshtmlor.razorsource with server-side directives; lint the rendered or published output instead - JavaScript or TypeScript linting; route that to
eslint - runtime performance, accessibility, SEO, or headers; route that to
webhint
Inputs
- the nearest
AGENTS.md package.json.htmlhintrcor equivalent config if present- the real static HTML target: source templates, built output, or deployed URL
Workflow
- Choose the right target first:
- static HTML source files
- generated build output such as
dist/ - a reachable URL when the page is already served
- Prefer repo-local installation and checked-in config for repeatable runs.
- Keep HTMLHint focused on static HTML correctness and lightweight policy.
- Add narrow scripts to
package.json, for example:htmlhint "dist/**/*.html"htmlhint "wwwroot/**/*.html"
- If the repo has templating syntax that confuses the parser, lint the rendered output instead of forcing source templates through the tool.
- Use rule overrides deliberately for real project conventions; do not disable broad classes of checks just to make a noisy first pass green.
- Rerun the publish or frontend build flow if fixes touched generated or packaged HTML sources.
Bootstrap When Missing
- Detect current state:
rg --files -g 'package.json' -g '.htmlhintrc*' -g '*.html'rg -n '"htmlhint"' --glob 'package.json' .
- Prefer a repo-local install:
npm install --save-dev htmlhint
- Add or refine
.htmlhintrconly after confirming the actual target files. - Add repeatable commands to
AGENTS.mdandpackage.json, then verify with:npx htmlhint "dist/**/*.html"npx htmlhint https://example.com
- Return
status: configuredif HTMLHint now owns a clear static-HTML gate, orstatus: improvedif the existing setup was tightened. - Return
status: not_applicablewhen the repo's HTML is primarily server-rendered templates that should be validated after rendering instead.
Handle Failures
- Parser noise on Razor, Blazor, or other server-side template syntax is a target-selection problem; lint built output instead of source templates.
- URL-based checks can fail on auth, SPA routing, or environment drift; verify the served target is reachable and stable before trusting the result.
- 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.
Deliver
- a repeatable static HTML lint gate
- clear targeting rules for source HTML versus rendered output
- checked-in config that matches the repo's actual page structure
Validate
- the lint target contains real static HTML, not unsupported template syntax
- commands are reproducible from repo-local dependencies
- HTMLHint ownership is kept separate from broader site-audit tooling
- fixes were verified on the built or served output that actually ships
Ralph Loop
- Plan: analyze current state, target outcome, constraints, and risks.
- Execute one step and produce a concrete delta.
- Review the result and capture findings.
- Apply fixes in small batches and rerun checks.
- Update the plan after each iteration.
- Repeat until outcomes are acceptable.
- If a dependency is missing, bootstrap it or return
status: not_applicablewith a reason.
Required Result Format
status:complete|clean|improved|configured|not_applicable|blockedplan: concise plan and current stepactions_taken: concrete changes madeverification: commands, checks, or review evidenceremaining: unresolved items ornone
Example Requests
- "Add HTMLHint for the built static site in this repo."
- "Lint the generated HTML before deployment."
- "Why is HTMLHint failing on Razor pages?"
More from managedcode/dotnet-skills
dotnet-entity-framework-core
Design, tune, or review EF Core data access with proper modeling, migrations, query translation, performance, and lifetime management for modern .NET applications.
12dotnet-entity-framework6
Maintain or migrate EF6-based applications with realistic guidance on what to keep, what to modernize, and when EF Core is or is not the right next step. Use when working in an EF6 codebase or planning a data layer migration.
9analyzing-dotnet-performance
>-
8dotnet-aspire
Build, upgrade, and operate .NET Aspire application hosts with current CLI, AppHost, ServiceDefaults, integrations, dashboard, testing, and Azure deployment patterns for distributed apps.
8dotnet-reportgenerator
Use the open-source free `ReportGenerator` tool for turning .NET coverage outputs into HTML, Markdown, Cobertura, badges, and merged reports. Use when raw coverage files are not readable enough for CI or human review.
8dotnet-format
Use the free first-party `dotnet format` CLI for .NET formatting and analyzer fixes. Use when a .NET repo needs formatting commands, `--verify-no-changes` CI checks, or `.editorconfig`-driven code style enforcement.
8