Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when reviewing scripts, client components, bundles, or runtime behavior related to Use event delegation for dynamic content. Inspect both source code and the browser execution path so fixes target the real bottleneck or bug.
.claude/skills/thedaviddias-event-delegation/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 46% | 0% |
| case-17 | ✓→✓ | = Same ✓ | -9% | 0% |
| case-06 | ✓→✓ | = Same ✓ | 18% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 22% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 78% | 0% |
Adding hundreds of individual event listeners for list items or table rows consumes significant memory and creates performance overhead. Dynamic content (items loaded via AJAX or rendered after user actions) won't have event listeners unless you re-attach them after each update — event delegation solves both problems at once.
Find any code in this file that attaches the same event handler to multiple elements in a loop. Suggest event delegation as an alternative.
Refactor these per-element event listeners to use event delegation on the common parent container.
Explain event delegation, how event bubbling enables it, and when to use closest() vs target.
Review scripts, client components, and browser execution paths related to Use event delegation for dynamic content. Flag exact imports, event handlers, runtime side effects, or blocking operations that violate the rule, and state how the change should be verified in the browser.
For full implementation details, code examples, and framework-specific guidance, see references/rule.md.
Rule page: https://frontendchecklist.io/en/rules/javascript/event-delegation
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-17 | pass→pass | 9,954 | 6,640 | -33% | 1 | 1 | 0% | 1,697 | 1,543 | -9% | 0 | 0 | — |
case-06 | pass→pass | 9,235 | 9,022 | -2% | 1 | 1 | 0% | 1,728 | 2,039 | +18% | 0 | 0 | — |
case-01 | pass→pass | 9,495 | 10,043 | +6% | 1 | 1 | 0% | 1,780 | 2,163 | +22% | 0 | 0 | — |
case-02 | pass→pass | 6,309 | 9,364 | +48% | 1 | 1 | 0% | 1,161 | 2,063 | +78% | 0 | 0 | — |
case-03 | pass→pass | 11,207 | 11,745 | +5% | 1 | 1 | 0% | 2,066 | 2,523 | +22% | 0 | 0 | — |
case-04 | pass→pass | 13,864 | 11,783 | -15% | 1 | 1 | 0% | 2,489 | 2,390 | -4% | 0 | 0 | — |
case-05 | pass→pass | 8,088 | 8,724 | +8% | 1 | 1 | 0% | 1,306 | 1,927 | +48% | 0 | 0 | — |
case-07 | fail→pass | 6,856 | 9,013 | +31% | 1 | 1 | 0% | 1,352 | 1,974 | +46% | 0 | 0 | — |
case-08 | pass→pass | 8,695 | 5,049 | -42% | 1 | 1 | 0% | 1,689 | 1,271 | -25% | 0 | 0 | — |
case-09 | pass→pass | 14,733 | 13,523 | -8% | 1 | 1 | 0% | 2,781 | 2,791 | +0% | 0 | 0 | — |
case-10 | pass→pass | 7,760 | 9,943 | +28% | 1 | 1 | 0% | 1,491 | 2,105 | +41% | 0 | 0 | — |
case-11 | pass→pass | 5,957 | 6,024 | +1% | 1 | 1 | 0% | 1,109 | 1,445 | +30% | 0 | 0 | — |
case-12 | pass→pass | 7,737 | 8,097 | +5% | 1 | 1 | 0% | 1,428 | 1,794 | +26% | 0 | 0 | — |
case-13 | pass→pass | 8,841 | 6,935 | -22% | 1 | 1 | 0% | 1,650 | 1,715 | +4% | 0 | 0 | — |
case-14 | pass→pass | 11,005 | 7,822 | -29% | 1 | 1 | 0% | 2,153 | 1,762 | -18% | 0 | 0 | — |
case-15 | pass→pass | 9,836 | 9,986 | +2% | 1 | 1 | 0% | 1,840 | 2,280 | +24% | 0 | 0 | — |
case-16 | pass→pass | 5,723 | 7,932 | +39% | 1 | 1 | 0% | 1,093 | 1,874 | +71% | 0 | 0 | — |
case-18 | pass→pass | 9,184 | 8,589 | -6% | 1 | 1 | 0% | 1,699 | 1,980 | +17% | 0 | 0 | — |
case-19 | pass→pass | 7,580 | 6,973 | -8% | 1 | 1 | 0% | 1,379 | 1,533 | +11% | 0 | 0 | — |
case-20 | pass→pass | 6,269 | 4,597 | -27% | 1 | 1 | 0% | 1,200 | 1,159 | -3% | 0 | 0 | — |
case-21 | pass→pass | 6,122 | 6,014 | -2% | 1 | 1 | 0% | 1,221 | 1,412 | +16% | 0 | 0 | — |
case-22 | pass→pass | 17,643 | 11,306 | -36% | 1 | 1 | 0% | 3,529 | 2,499 | -29% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +5 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.