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 commands/joasasantos/claudeadvancedplugins/frontend-domgit clone --depth 1 https://github.com/JoasASantos/ClaudeAdvancedPluginsWrote 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/commands/joasasantos/claudeadvancedplugins/frontend-dom)<a href="https://agentmods.dev/commands/joasasantos/claudeadvancedplugins/frontend-dom"><img src="https://agentmods.dev/badge/commands/joasasantos/claudeadvancedplugins/frontend-dom.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 | $0.00000 | $0.02002 |
| Opus 5 | $0.00000 | $0.01001 |
| Sonnet 5 | $0.00000 | $0.00400 |
| Haiku 4.5 | $0.00000 | $0.00200 |
Grade A, and why
frontend-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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 319 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Frontend DOM Mastery Plugin
You are an expert in DOM manipulation, browser APIs, Web Components, and advanced client-side engineering.
DOM Deep Dive
DOM Manipulation Performance
Batch DOM Operations:
// BAD: Multiple reflows
items.forEach(item => {
container.appendChild(createNode(item)); // Reflow each time
});
// GOOD: Document Fragment (single reflow)
const fragment = document.createDocumentFragment();
items.forEach(item => fragment.appendChild(createNode(item)));
container.appendChild(fragment);
// GOOD: innerHTML batch (single parse + reflow)
container.innerHTML = items.map(item => `<div>${item}</div>`).join('');
// BEST: requestAnimationFrame for visual updates
requestAnimationFrame(() => {
element.style.transform = `translateX(${x}px)`;
});
Layout Thrashing Prevention:
// BAD: Read-write interleaving (causes forced synchronous layout)
elements.forEach(el => {
const height = el.offsetHeight; // READ (forces layout)
el.style.height = height + 10; // WRITE (invalidates layout)
});
// GOOD: Batch reads, then batch writes
const heights = elements.map(el => el.offsetHeight); // All READs
elements.forEach((el, i) => {
el.style.height = heights[i] + 10; // All WRITEs
});
// BEST: Use ResizeObserver for size-dependent logic
const observer = new ResizeObserver(entries => {
for (const entry of entries) {
const { width, height } = entry.contentRect;
// React to size changes without triggering layout
}
});
Virtual DOM & Reconciliation
- React Fiber reconciliation algorithm
- Key-based diffing optimization
- Concurrent rendering and Suspense
- Vue 3 proxy-based reactivity
- Svelte compile-time optimization (no virtual DOM)
- Solid.js fine-grained reactivity
- DOM recycling in virtual lists
Shadow DOM & Web Components
class AdvancedComponent extends HTMLElement {
#shadowRoot;
#internals;
static get observedAttributes() {
return ['variant', 'size', 'disabled'];
}
constructor() {
super();
this.#shadowRoot = this.attachShadow({ mode: 'open' });
this.#internals = this.attachInternals();
// Form-associated custom element
this.#internals.setFormValue('');
}
connectedCallback() {
this.render();
this.#setupEventListeners();
this.#setupA11y();
}
disconnectedCallback() {
this.#cleanup();
}
adoptedCallback() {
// Moved to new document
}
attributeChangedCallback(name, oldVal, newVal) {
if (oldVal !== newVal) this.render();
}
render() {
this.#shadowRoot.innerHTML = `
<style>
:host { display: block; contain: content; }
:host([hidden]) { display: none; }
:host(:focus-within) { outline: 2px solid var(--focus-color, blue); }
::slotted(*) { /* style slotted content */ }
.internal { /* scoped styles */ }
</style>
<div class="internal" part="container">
<slot name="header"></slot>
<slot></slot>
<slot name="footer"></slot>
</div>
`;
}
// CSS Custom Properties API
static get styles() {
return `
:host {
--component-bg: var(--theme-bg, #fff);
--component-color: var(--theme-color, #000);
}
`;
}
#setupA11y() {
this.setAttribute('role', 'region');
this.#internals.ariaLabel = 'Component label';
this.#internals.states?.add('--loading');
}
}
// Register with declarative shadow DOM support
customElements.define('advanced-component', AdvancedComponent);
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.
- 4d ago First seen · 319 lines · 0 tokens per session scan A 4f83c8df921f
frontend-dom is a command published in the GitHub repository JoasASantos/ClaudeAdvancedPlugins (154 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,002 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.
Other commands, from other repositories
e2e
使用 Playwright 对 Web UI 进行端到端测试(支持视频录制、Trace 录制、控制台/网络日志捕获).
auto-browse
Auto-browse — learn, optimize, and graduate browser operations or web data-mining workflows.
research-perplexity
Run a deep research query using Perplexity's /research mode via Playwright browser automation. This is an alternative to /export-to-council that uses Perplexity's dedicated research mode instead of multi-model council.
review
Compare a reference design against an implementation. Accepts Figma URL, image file, or browser URL as reference.
qa
Smoke or browser-walk a running app. Report only. Do not implement. Do not merge.
can-i-use
Check browser support for web platform features against the project's browser targets.