Hamburger Cross Icon
Htmlhint Clean
+
HTML Collector

Htmlhint Clean + HTML Collector

Guardrail Collector Beta Devex Build And Ci

Enforce Htmlhint Clean using data collected by HTML Collector. Automatically check devex build and ci standards on every PR.

Guardrail: Ensures HTMLHint reports no errors and fewer warnings than the configured threshold. HTMLHint catches unclosed tags, missing attributes, and accessibility issues in HTML files.
Data Source: Detect HTML, CSS, SCSS, and LESS files, run HTMLHint and Stylelint for code quality analysis. Categorize frontend markup projects and surface lint issues for policy enforcement.

How HTML Collector Powers This Guardrail

The HTML Collector gathers metadata from your languages systems. This data flows into Lunar's Component JSON, where the Htmlhint Clean guardrail evaluates it against your standards.

When enabled, this check runs automatically on every PR and in AI coding workflows, providing real-time enforcement with actionable feedback.

1
HTML Collector Gathers Data Collector
Extracts metadata from code, configs, and tool outputs
2
{ } Component JSON
Data centralized in structured format for evaluation
3
Htmlhint Clean Checks Guardrail
Pass/fail result with actionable feedback in PRs

Quick Start Configuration

Add both the collector and policy to your lunar-config.yml to enable this guardrail.

📄 lunar-config.yml
# Step 1: Enable the HTML Collector
collectors:
  - uses: github://earthly/lunar-lib/collectors/html@v1.0.5
    # with: ...

# Step 2: Enable the HTML/CSS Guardrails
policies:
  - uses: github://earthly/lunar-lib/policies/html@v1.0.5
    include: [htmlhint-clean]
    # with: ...

What HTML Collector Collects

This collector gathers the following data that the Htmlhint Clean guardrail evaluates.

Collector code

project

Scans the repository for HTML and CSS-family files (.html, .css, .scss, .less). Counts files of each type and writes a separate .lang. entry per detected type. Skips gracefully if no matching files are found.

Collector code

htmlhint

Runs HTMLHint on all .html files to catch common issues: unclosed tags, missing attributes, accessibility problems. Writes normalized warnings to .lang.html.lint and raw output to .lang.html.native.htmlhint.

Collector code

stylelint

Runs Stylelint on CSS, SCSS, and LESS files to catch invalid properties, formatting issues, and common mistakes. Writes normalized warnings to .lang.css.lint and raw output to .lang.css.native.stylelint.

Example Data Flow

Here's an example of the data that HTML Collector writes to the Component JSON, which Htmlhint Clean then evaluates.

{ } component.json From HTML Collector
{
  "lang": {
    "html": {
      "file_count": 12,
      "source": { "tool": "html", "integration": "code" },
      "lint": {
        "warnings": [
          {
            "file": "index.html",
            "line": 15,
            "severity": "warning",
            "message": "Tag must be paired, missing: </div>",
            "rule": "tag-pair"
          }
        ],
        "tool": "htmlhint",
        "source": { "tool": "htmlhint", "integration": "code" }
      },
      "native": {
        "htmlhint": {
          "passed": false,
          "error_count": 0,
          "warning_count": 1,
          "source": { "tool": "htmlhint", "integration": "code" }
        }
      }
    },
    "css": {
      "file_count": 8,
      "source": { "tool": "html", "integration": "code" },
      "lint": {
        "warnings": [
          {
            "file": "styles/main.css",
            "line": 42,
            "severity": "error",
            "message": "Unexpected unknown property \"colr\"",
            "rule": "property-no-unknown"
          }
        ],
        "tool": "stylelint",
        "source": { "tool": "stylelint", "integration": "code" }
      },
      "native": {
        "stylelint": {
          "passed": false,
          "error_count": 1,
          "warning_count": 0,
          "source": { "tool": "stylelint", "integration": "code" }
        }
      }
    },
    "scss": {
      "file_count": 3,
      "source": { "tool": "html", "integration": "code" }
    },
    "less": {
      "file_count": 2,
      "source": { "tool": "html", "integration": "code" }
    }
  }
}

Configuration Options

HTML/CSS Guardrails Inputs

Input Required Default Description
max_htmlhint_warnings Optional 0 Maximum allowed HTMLHint warnings (0 = must be clean)
max_stylelint_warnings Optional 0 Maximum allowed Stylelint warnings (0 = must be clean)

Ready to Automate Your Standards?

See how Lunar can turn your AGENTS.md, engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 100+ built-in guardrails.

Works with any process
check AI agent rules & prompt files
check Post-mortem action items
check Security & compliance policies
check Testing & quality requirements
Automate Now
Paste your AGENTS.md or manual process doc and get guardrails in minutes
Book a Demo