bench-virtual-rule

Mirrors preset virtual rule selectors into bench/config.ts so benchmarks exercise them.

611|63|Updated Sep 26, 2017
One-click install
npx skills add https://github.com/markuplint/markuplint --skill bench-virtual-rule
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bench-virtual-rule
Source: https://github.com/markuplint/markuplint/tree/main/.claude/skills/bench-virtual-rule
Command: npx skills add https://github.com/markuplint/markuplint --skill bench-virtual-rule

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When a new virtual rule (selectors under nodeRules) is added to a preset like preset.html-standard.jsonc, the benchmark does not automatically pick it up because bench/config.ts curates rules explicitly instead of extending the preset. The result is that fixtures the new rule should catch stay stuck at nu-only, making it look like a markuplint coverage gap when the rule already exists.

Core Features & Use Cases

  • Preset-to-bench mirroring: Guides copying selectors from a preset's nodeRules[] into bench/config.ts with a comment naming the source preset rule.
  • Verification workflow: Runs yarn bench:update:ml and checks that target fixtures flip from nu-only to match-error.
  • Selector correctness guidance: Documents caveats for ASCII case-insensitive attribute name matching, the i flag applying only to attribute values, and sibling selector (~) directionality requiring both a ~ b and b ~ a for coexistence constraints.
  • Use Case: A maintainer adds a disallowed-element selector to preset.html-standard.jsonc but the nu fixtures remain nu-only; this Skill walks them through mirroring the selector into bench/config.ts and verifying the benchmark now exercises the rule.

Quick Start

Mirror the new preset virtual rule selectors into bench/config.ts, run yarn bench:update:ml, and confirm the target fixtures flip from nu-only to match-error.

Frequently Asked Questions about bench-virtual-rule

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does a new markuplint preset rule not fire on the benchmark?

The benchmark config does not extend the html-standard preset; bench/config.ts curates rules explicitly. Any new nodeRules entry in a preset is invisible to the benchmark until the same selectors are mirrored into bench/config.ts.

How do I mirror a preset virtual rule into the markuplint bench config?

Copy the selectors from the preset's nodeRules into bench/config.ts nodeRules with a comment naming the source preset rule, then run yarn bench:update:ml. Verify the target fixtures flip from nu-only to match-error.

Why does my CSS attribute selector not match uppercase HTML attributes?

HTML attribute names are matched ASCII case-insensitively, so [charset] matches <meta CHARSET>. Use lowercase names to match HTML's normative form; the i flag only applies to attribute values, not names.

Why does a sibling selector rule only fire in one source order?

The sibling combinator (~) only matches elements after the anchor. Coexistence-style constraints need both directions, a ~ b and b ~ a, so the rule fires regardless of which element appears first in the source.

What should I do when a preset rule has no nu-validator equivalent?

Skip mirroring it into bench/config.ts and add a 'not mirrored' comment with the reason to the preset rule's JSDoc. This records that the omission was a conscious decision for the next maintainer.