clean-dom

clean-dom is a cursor rule for Cursor from movahedan/monobun. It costs 0 tokens per session (2,306 once invoked), scanned A, original, MIT.

Coding rules for building well-structured HTML pages, responsive images, forms, CSS, and Tailwind interfaces. It emphasizes semantic HTML, meaning elements whose names describe their purpose, plus accessibility for people using assistive technology.

In plain words
What is it for?
Use it when creating or reviewing web pages and components. It guides choices for elements such as headers, navigation, articles, forms, images, and responsive layouts.
Why use it?
It helps avoid page structures that are difficult for browsers, search engines, screen readers, and future developers to understand. It also reduces unnecessary nesting and common styling mistakes.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/movahedan/monobun/clean-dom
Clone the repo
git clone --depth 1 https://github.com/movahedan/monobun

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for clean-dom

README.md
[![agentmods](https://agentmods.dev/badge/rules/movahedan/monobun/clean-dom.svg)](https://agentmods.dev/rules/movahedan/monobun/clean-dom)
Your own site
<a href="https://agentmods.dev/rules/movahedan/monobun/clean-dom"><img src="https://agentmods.dev/badge/rules/movahedan/monobun/clean-dom.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,306 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02306
Opus 5 $0.00000 $0.01153
Sonnet 5 $0.00000 $0.00461
Haiku 4.5 $0.00000 $0.00231

Measured 5d ago against content hash df2c205b15d6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

clean-dom scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/clean-dom.mdc · 309 lines

How it starts

The opening of the file, as written. The whole thing — 309 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Clean DOM & Styling

Semantic HTML

// ✅ Good - Semantic structure
<header>
  <nav aria-label="Main navigation">
    <ul>
      <li><a href="/">Home</a></li>
    </ul>
  </nav>
</header>

<main>
  <article>
    <h1>Article Title</h1>
    <section>
      <h2>Section Title</h2>
      <p>Content</p>
    </section>
  </article>
</main>

<aside>
  <h2>Related</h2>
</aside>

<footer>
  <p>&copy; 2024</p>
</footer>

// ❌ Bad - Non-semantic nesting
<div className="header">
  <div className="nav">
    <div className="nav-item">Home</div>
  </div>
</div>

Use semantic elements: header, nav, main, article, section, aside, footer, figure, figcaption, time, mark, address

Avoid unnecessary div/span: Only when no semantic element fits

DOM Structure - Anti-Nesting

// ✅ Good - Flat, semantic structure
<article>
  <header>
    <h1>Title</h1>
    <time dateTime="2024-01-01">Jan 1, 2024</time>
  </header>
  <p>Content</p>
</article>

// ❌ Bad - Unnecessary nesting
<article>
  <div className="article-header">
    <div className="header-content">
      <div className="title-wrapper">
        <h1>Title</h1>
      </div>
    </div>
  </div>
</article>

Principles: Prefer semantic elements over wrapper divs, flatten structure, use CSS Grid/Flexbox for layout, group related content with semantic containers

Responsive Images

// ✅ Good - Responsive with srcset
<img
  src="/image.jpg"
  srcSet="/image-320w.jpg 320w, /image-640w.jpg 640w, /image-1280w.jpg 1280w"
  sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw"
  alt="Descriptive alt text"
  loading="lazy"
  width={1280}
  height={720}
/>

// ✅ Good - Picture element for art direction
<picture>
  <source media="(max-width: 640px)" srcSet="/mobile.webp" type="image/webp" />
  <source media="(min-width: 641px)" srcSet="/desktop.webp" type="image/webp" />
  <img src="/fallback.jpg" alt="Descriptive alt text" loading="lazy" width={1280} height={720} />
</picture>

Read the full file on GitHub · 309 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 309 lines · 0 tokens per session scan A df2c205b15d6

Subscribe to this mod's changes

clean-dom is a cursor rule published in the GitHub repository movahedan/monobun (18 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,306 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.