agentsclimarketplace

No use effect skill

Skill CodingCossack/no-use-effect-skill

Reviews React code with useEffect or useLayoutEffect. Replaces effects with derived state, event handlers, query APIs, key resets, useSyncExternalStore, or named hooks. Use when writing components, refactoring effects, or reviewing diffs.From its SKILL.md

Install
npx -y skills add CodingCossack/no-use-effect-skill

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

3.6 KB, 805 tokens by cl100k_base, as published. Nobody here has run it

No useEffect

Default stance: do not add raw useEffect or useLayoutEffect in application components until the cause is classified.

Use this skill when:

  • a diff adds useEffect or useLayoutEffect
  • refactoring existing effects
  • debugging stale state, extra renders, render loops, dependency churn, remount issues, or parent/child sync bugs
  • deciding between render-time derivation, event handlers, data APIs, useSyncExternalStore, key, useMountEffect, or a named hook

Fast triage

  1. Pure derivation from props/state? Compute during render. Use useMemo only for measured expensive work.
  2. Specific user interaction? Put it in the event handler or action. Do not relay through state + effect.
  3. Screen-driven data loading? Use framework loaders, server components, or a query library. If the request is user-triggered, do it in the handler.
  4. Child effect pushing state or fetched data to a parent? Lift state or fetch in the parent instead.
  5. External store with subscribe + current snapshot semantics? Use useSyncExternalStore or the library’s hook.
  6. Whole subtree should reset when identity changes? Remount with key.
  7. Only part of state adjusts on prop change? Derive it during render or redesign the state shape. Do not effect-reset it.
  8. Real external synchronization still remains because the component is on screen? Hide it in a descriptive custom hook. Use useLayoutEffect only for pre-paint layout/scroll work.

Red flags

  • useEffect(() => setX(f(y)), [y])
  • state flag -> effect -> reset flag
  • child effect calling a parent setter
  • fetch in effect followed by local setState
  • chains of effects whose only job is to trigger more state
  • empty [] effect used as “runs once”
  • replacing useEffect with useLayoutEffect to dodge the rule

Working mode

  1. Search for useEffect and useLayoutEffect.
  2. Classify each with rules/01-triage.md.
  3. Rewrite with the smallest matching replacement from rules/02-replacements.md.
  4. If an effect survives, move it into a named hook and validate it with rules/03-allowed-effects.md.
  5. Run the checks in rules/04-enforcement.md.

Non-negotiables

  • If the external system cannot be named explicitly, the effect is probably wrong.
  • useMountEffect is only a thin wrapper around useEffect([]). It does not mean “exactly once” in dev Strict Mode.
  • Raw effects in components are exceptional; surviving ones should usually live behind descriptive hooks.
  • useLayoutEffect is not a loophole. Keep it for pre-paint layout measurement and scroll correction only.

Additional resources

What ships with it: 15 files

36.7 KB alongside SKILL.md, 5 of them executable

agents/

bootstrap/

examples/

reference/

scripts/

Keep looking

Skills are one crate of 326,736. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.