Agent skill

Contain Audit

by Comfy-Org in Comfy-Org/ComfyUI_frontend

Detect DOM elements where CSS contain:layout+style would improve rendering performance.

GPL-3.0Auto-check passedTesting & QA

Install Contain Audit

skills CLI
$ npx skills add Comfy-Org/ComfyUI_frontend --skill contain-audit -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Comfy-Org/ComfyUI_frontend contain-audit --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Comfy-Org/ComfyUI_frontend.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/contain-audit .claude/skills/contain-audit && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
contain-audit
GitHub stars
2.1k
Token cost
~1.2k tokens
SKILL.md length
431 words
Files
1
Skills in repo
22
Repo updated
First seen
Licence
GPL-3.0

At a glance

Detect DOM elements where CSS contain:layout+style would improve rendering performance.

  • Works in 6 steps: Loads a large workflow (245 nodes) in a… → Walks the DOM tree and scores every… → For each high-scoring candidate, applies… → …
  • Tasks that involve Browser testing
  • SKILL.md covers What It Does, When to Use, How to Run and How to Read Results, plus 4 more sections
  • Calls pnpm

What it does

Contain Audit is an agent skill from Comfy-Org/ComfyUI_frontend. Detect DOM elements where CSS contain:layout+style would improve rendering performance. Runs a Playwright-based audit on a large workflow, scores candidates by subtree size and sizing constraints, measures performance impact, and generates a ranked report.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Browser testing. It works with Playwright. The repository describes itself as: Official front-end implementation of ComfyUI. The licence is GPL-3.0.

When your agent uses it

  • Tasks that involve Browser testing

Example prompts

  • “/contain-audit”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Loads a large workflow (245 nodes) in a real browser
  2. Walks the DOM tree and scores every element as a containment candidate
  3. For each high-scoring candidate, applies contain: layout style via JavaScript
  4. Measures rendering performance (style recalcs, layouts, task duration) before and after
  5. Takes before/after screenshots to detect visual breakage
  6. Generates a ranked report with actionable recommendations

What it can do on your machine

Read from SKILL.md and the folder at commit f9be289. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Contain Audit loads about 1.2k tokens when it runs. Until then it costs about 68 tokens; SKILL.md has 431 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~68
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Comfy-Org/ComfyUI_frontend at commit f9be289, republished under its GPL-3.0 licence (© Comfy-Org). 431 words, ~1,195 tokens.

Download SKILL.mdSave it as .claude/skills/contain-audit/SKILL.md (or your agent's skills folder).
name
contain-audit
description
Detect DOM elements where CSS contain:layout+style would improve rendering performance. Runs a Playwright-based audit on a large workflow, scores candidates by subtree size and sizing constraints, measures performance impact, and generates a ranked report.

CSS Containment Audit

Automatically finds DOM elements where adding contain: layout style would reduce browser recalculation overhead.

What It Does

  1. Loads a large workflow (245 nodes) in a real browser
  2. Walks the DOM tree and scores every element as a containment candidate
  3. For each high-scoring candidate, applies contain: layout style via JavaScript
  4. Measures rendering performance (style recalcs, layouts, task duration) before and after
  5. Takes before/after screenshots to detect visual breakage
  6. Generates a ranked report with actionable recommendations

When to Use

  • After adding new Vue components to the node rendering pipeline
  • When investigating rendering performance on large workflows
  • Before and after refactoring node DOM structure
  • As part of periodic performance audits

How to Run

bash
# Start the dev server first
pnpm dev &

# Run the audit (uses the @audit tag, not included in normal CI runs)
pnpm exec playwright test browser_tests/tests/containAudit.spec.ts --project=audit

# View the HTML report
pnpm exec playwright show-report

How to Read Results

The audit outputs a table to the console:

text
CSS Containment Audit Results
=======================================================
Rank | Selector                        | Subtree | Score | DRecalcs | DLayouts | Visual
  1  | [data-testid="node-inner-wrap"] |     18  |  72   |    -34%  |    -12%  |   OK
  2  | .node-body                      |     12  |  48   |     -8%  |     -3%  |   OK
  3  | .node-header                    |      4  |  16   |     +1%  |      0%  |   OK
  • Subtree: Number of descendant elements (higher = more to skip)
  • Score: Composite heuristic score (subtree size x sizing constraint bonus)
  • DRecalcs / DLayouts: Change in style recalcs / layout counts vs baseline (negative = improvement)
  • Visual: OK if no pixel change, DIFF if screenshot differs (may include subpixel noise — verify manually)

Candidate Scoring

An element is a good containment candidate when:

  1. Large subtree -- many descendants that the browser can skip recalculating
  2. Externally constrained size -- width/height determined by CSS variables, flex, or explicit values (not by content)
  3. No existing containment -- contain is not already applied
  4. Not a leaf -- has at least a few child elements

Elements that should NOT get containment:

  • Elements whose children overflow visually beyond bounds (e.g., absolute-positioned overlays with negative inset)
  • Elements whose height is determined by content and affects sibling layout
  • Very small subtrees (overhead of containment context outweighs benefit)
Show full SKILL.md (157 more words)Show less

Limitations

  • Cannot fully guarantee contain safety -- visual review of screenshots is required
  • Performance measurements have natural variance; run multiple times for confidence
  • Only tests idle and pan scenarios; widget interactions may differ
  • The audit modifies styles at runtime via JS, which doesn't account for Tailwind purging or build-time optimizations

Example PR

#9946 — fix: add CSS contain:layout contain:style to node inner wrapper

This PR added contain-layout contain-style to the node inner wrapper div in LGraphNode.vue. The audit tool would have flagged this element as a high-scoring candidate because:

  • Large subtree (18+ descendants: header, slots, widgets, content, badges)
  • Externally constrained size (w-(--node-width), flex-1 — dimensions set by CSS variables and flex parent)
  • Natural isolation boundary between frequently-changing content (widgets) and infrequently-changing overlays (selection outlines, borders)

The actual change was a single line: adding 'contain-layout contain-style' to the inner wrapper's class list at src/renderer/extensions/vueNodes/components/LGraphNode.vue:79.

Reference

ResourcePath
Audit testbrowser_tests/tests/containAudit.spec.ts
PerformanceHelperbrowser_tests/fixtures/helpers/PerformanceHelper.ts
Perf testsbrowser_tests/tests/performance.spec.ts
Large workflowbrowser_tests/assets/large-graph-workflow.json
Example PRhttps://github.com/Comfy-Org/ComfyUI_frontend/pull/9946

© Comfy-Org, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/contain-audit of Comfy-Org/ComfyUI_frontend.

Open the folder on GitHubat commit f9be289

Compare with similar skills

Contain Audit next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Contain Audit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Contain Audit this skillComfy-Org/ComfyUI_frontend2.1k—~1.2kAutomated safety check: PassGPL-3.0
Web Application Testinganthropics/skills180k51 repos~966Automated safety check: PassApache-2.0
Chrome Tracelayoutit/polycss761—~2kAutomated safety check: PassMIT
Learn Dogfooddebs-obrien/playwright-movies-app103—~1kAutomated safety check: NotesMIT
Handsontable Visual Testinghandsontable/handsontable22k—~2.3kAutomated safety check: PassCustom licence
UI Reviewjvm-skills/jvm-skills140—~545Automated safety check: PassApache-2.0

Similar skills

  • Web Application Testing

    anthropics/skills

    Official

    Tests local web applications with Python Playwright scripts, checking frontend behavior, capturing screenshots and reading browser console logs.

    180k GitHub starsUsed in 51 repos~966 tokens
    Testing & QAAuto-check passed
  • Chrome Trace

    layoutit/polycss

    Capture and analyze Chrome/Chromium performance traces with Playwright around a concrete browser interaction.

    761 GitHub stars~2k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Learn Dogfood

    debs-obrien/playwright-movies-app

    Dogfood the learn/ course like a new user: docs site walk, fresh clone setup, then Practice and shell steps from each module.

    103 GitHub stars~1k tokensUpdated 8 days ago
    Testing & QAAuto-check: notes
  • Handsontable Visual Testing

    handsontable/handsontable

    Guide to Playwright visual regression tests in Handsontable: when a screenshot is justified, the tablePage fixture, naming, reg-suit comparison and demo routes.

    22k GitHub stars~2.3k tokensUpdated today
    Testing & QAAuto-check passed
  • UI Review

    jvm-skills/jvm-skills

    Verify UI/UX by running Playwright tests and reviewing screenshots.

    140 GitHub stars~545 tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Playwright Verifier

    Community-Access/accessibility-agents

    Internal helper: re-run targeted scans to confirm a fix works at runtime.

    423 GitHub stars~1.1k tokensUpdated 16 days ago
    Testing & QAAuto-check passed

More from Comfy-Org/ComfyUI_frontend

All 22 skills in this repo
  • Adding Deprecation Warnings

    Comfy-Org/ComfyUI_frontend

    Adds deprecation warnings for renamed or removed properties/APIs.

    2.1k GitHub stars~775 tokensUpdated today
    Auto-check passed
  • Agent Integration Replay

    Comfy-Org/ComfyUI_frontend

    Replay recorded agent conversations as Playwright tests against the real chat panel and canvas.

    2.1k GitHub stars~805 tokensUpdated today
    Auto-check: notes
  • Codegen Transform

    Comfy-Org/ComfyUI_frontend

    Transforms raw Playwright codegen output into ComfyUI convention-compliant tests.

    2.1k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Comment Sicko

    Comfy-Org/ComfyUI_frontend

    Dispatches the comment-sicko subagent to hunt gratuitous comments in a PR/diff, triages its raw findings, and posts a polite, professional writeup.

    2.1k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Hardening Flaky E2E Tests

    Comfy-Org/ComfyUI_frontend

    Diagnoses and fixes flaky Playwright e2e tests by replacing race-prone patterns with retry-safe alternatives.

    2.1k GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Perf Fix With Proof

    Comfy-Org/ComfyUI_frontend

    Ships performance fixes with CI-proven improvement using stacked PRs.

    2.1k GitHub stars~1.6k tokensUpdated today
    Auto-check passed

Works with

Questions about Contain Audit

What does Contain Audit do?

Detect DOM elements where CSS contain:layout+style would improve rendering performance. Contain Audit is an agent skill from Comfy-Org/ComfyUI_frontend. Detect DOM elements where CSS contain:layout+style would improve rendering performance.

When should I use Contain Audit?

Contain Audit fits situations like: tasks that involve Browser testing.

How do I install Contain Audit in Claude Code?

Run `npx skills add Comfy-Org/ComfyUI_frontend --skill contain-audit -a claude-code`. Or copy the skill folder (.claude/skills/contain-audit in Comfy-Org/ComfyUI_frontend) into .claude/skills/contain-audit in your project. Claude Code loads it when a task matches its description.

How do I install Contain Audit in Codex?

Run `npx skills add Comfy-Org/ComfyUI_frontend --skill contain-audit -a codex`. Or copy the skill folder (.claude/skills/contain-audit in Comfy-Org/ComfyUI_frontend) into .agents/skills/contain-audit in your project. Codex loads it when a task matches its description.

Can I use Contain Audit in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Comfy-Org/ComfyUI_frontend --skill contain-audit -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/contain-audit, .gemini/skills/contain-audit, .github/skills/contain-audit and .opencode/skills/contain-audit in your project.

What does Contain Audit need to run?

Going by SKILL.md and its folder, Contain Audit needs the command-line tools its instructions call (pnpm).

Does Contain Audit access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Contain Audit safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Contain Audit use?

Contain Audit is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Contain Audit use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Contain Audit?

Skills that share tags, products or a category with Contain Audit: Web Application Testing (anthropics/skills, 180k stars), Chrome Trace (layoutit/polycss, 761 stars), Learn Dogfood (debs-obrien/playwright-movies-app, 103 stars) and Handsontable Visual Testing (handsontable/handsontable, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Contain Audit?

Comfy-Org (a GitHub organization) maintains it in Comfy-Org/ComfyUI_frontend, which has 2,056 GitHub stars. The repository holds 22 skills in this directory. The repository was last updated on October 9, 2026.

Source: Comfy-Org/ComfyUI_frontend on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.