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.
npx agentmods add rules/adobecom/express-milo/dom-manipulation-best-practicesgit clone --depth 1 https://github.com/adobecom/express-miloWrote 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.
[](https://agentmods.dev/rules/adobecom/express-milo/dom-manipulation-best-practices)<a href="https://agentmods.dev/rules/adobecom/express-milo/dom-manipulation-best-practices"><img src="https://agentmods.dev/badge/rules/adobecom/express-milo/dom-manipulation-best-practices.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02921 | $0.02921 |
| Opus 5 | $0.01460 | $0.01460 |
| Sonnet 5 | $0.00584 | $0.00584 |
| Haiku 4.5 | $0.00292 | $0.00292 |
Grade A, and why
dom-manipulation-best-practices 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 6d 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.
This is a copy
100% identical to dom-manipulation-best-practices — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 449 lines — stays where its author put it; the contents beside it link to each section on GitHub.
DOM Manipulation Performance Rules - Three-Phase Strategy
APPLY: EVERY QUERY - CRITICAL PERFORMANCE RULE
AEM Performance Principles (REQUIRED)
Based on AEM's performance guidelines:
- Phase E (Eager): Minimal DOM creation for LCP elements only
- Phase L (Lazy): Progressive enhancement of below-fold content
- Phase D (Delayed): Third-party DOM modifications after 3+ second delay
Phase E - LCP Critical DOM Operations (REQUIRED)
Immediate DOM insertion for LCP elements, minimal complexity
// ✅ REQUIRED - Phase E: Simple DOM structure for LCP
const createLCPElement = (content) => {
const isFirstSection = true; // Determining logic for first section
if (isFirstSection) {
// Phase E: Keep DOM structure minimal for LCP
const el = createTag('div', { class: 'hero-content' });
el.textContent = content; // Simple text content first
// Return immediately for LCP
return el;
}
};
// ✅ REQUIRED - Progressive enhancement pattern
const enhanceLCPElement = (element, enhancementData) => {
// Phase L: Add enhancements after LCP
setTimeout(() => {
const enhancedContent = createTag('div', { class: 'enhanced-content' });
enhancedContent.innerHTML = enhancementData;
element.appendChild(enhancedContent);
}, 0);
};
createElement Pattern (REQUIRED)
Always use the standardized createTag pattern from utils.js:
// ✅ CORRECT - Preserves events and performance (all phases)
const el = createTag('div', { class: 'my-class' }, content);
parent.append(el);
// ❌ WRONG - Breaks event listeners and re-parses DOM
parent.innerHTML = '<div class="my-class">content</div>';
Phase-Aware DOM Construction (REQUIRED)
// ✅ REQUIRED - Build DOM progressively by phase
class ComponentBuilder {
constructor(element) {
this.element = element;
this.isFirstSection = element.closest('.section') === document.querySelector('.section');
}
init() {
if (this.isFirstSection) {
// Phase E: Critical structure only
this.buildCriticalDOM();
} else {
// Phase L: Build with intersection observer
this.buildWithLazyLoading();
}
}
buildCriticalDOM() {
// Phase E: Minimal DOM for LCP
const basicStructure = this.createBasicStructure();
this.element.appendChild(basicStructure);
// Queue enhancements for Phase L
this.queueEnhancements();
}
buildWithLazyLoading() {
// Phase L: Full DOM construction with intersection observer
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
this.buildFullDOM();
observer.unobserve(entry.target);
}
});
}, { rootMargin: '200px' });
observer.observe(this.element);
}
createBasicStructure() {
// Simple DOM for LCP - no nested complexity
return createTag('div', { class: 'basic-content' }, this.getBasicContent());
}
buildFullDOM() {
// Phase L: Rich DOM structure
const fullStructure = this.createEnhancedStructure();
this.element.appendChild(fullStructure);
}
}
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.
- 6d ago First seen · 449 lines · 2,921 tokens per session scan A d8aad088f48d
dom-manipulation-best-practices is a cursor rule published in the GitHub repository adobecom/express-milo (6 stars, last pushed 2d ago), licensed Apache-2.0. It adds 2,921 tokens to every session, about $0.0146 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to dom-manipulation-best-practices, differing in 0 lines, and is treated as a copy.
Other cursor rules, from other repositories
pages
Source: docs/agents/pages.md Regenerate: npm run agents:sync -w packages/openbridge-webcomponents -->.
shadcn-tailwind-guide
本规范定义了使用 shadcn/ui 和 Tailwind CSS 开发新组件的标准流程和最佳实践。.
css-render-blocking-diagnosis
Cursor rule "css-render-blocking-diagnosis" from adobecom/da-express-milo, covering css render-blocking diagnosis & resolution, critical learning from 98 pagespeed achievement, primary diagnostic protocol, step 1: css blocking symptom recognition and step 2: css loading sequence audit.
frontend-architecture
Vite + React SPA architecture - directory layout, providers, bundle splitting. Tailwind styling in tailwind.mdc.
web-pages-e2e-test-maintenance
Keep web pages end-to-end coverage current.
tanstack-react-router_routing
TanStack Router: Routing.