Install any skill in seconds. Free to start, no credit card required.
Get Started Free →langfuse/refactor-react-effects
Refactor avoidable React useEffect usage in Langfuse frontend code.
Passed 15 of 21 test cases with the skill, and 14 of 21 without it.
3 fixed15 passed either way5 still failing2 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
In `ResizableChart.tsx`, we use a `ResizeObserver` inside `useEffect` to update container dimensions state whenever the parent DOM element resizes, with `observer.disconnect()` in the cleanup function. Should this effect be removed as redundant or retained?
| Checked | Without skill | With skill |
|---|---|---|
| Classifies ResizeObserver as a valid external system integration. | Missed | Passed |
| Includes cleanup logic calling disconnect on unmount. | Passed | Passed |
The instructions your model reads when the skill loads.
Do not add useEffect by default. Use it only to synchronize a component with
a concrete system outside React. If there is no external system, remove the
effect.
Before adding or retaining an effect, answer all of these questions:
If the first question has no concrete answer, do not use an effect.
web/AGENTS.md and the nearest package guidance before changing web
code.../frontend-large-feature-architecture/SKILL.md.references/refactoring-patterns.md
before implementing a refactor.Apply these rules in order:
useState initializer.key to remount for a new entity
only when discarding the old local draft is intended. Use an explicit user
action for refresh/reset when drafts must not be overwritten silently.test cases passed, vs 14 / 21 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.