Agent skill

No Use Effect

by mattiacerutti in mattiacerutti/supernova

Enforce the no-useEffect rule when writing or reviewing React code.

MITAuto-check passedDevelopment

Install No Use Effect

skills CLI
$ npx skills add mattiacerutti/supernova --skill no-use-effect -a claude-code

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

GitHub CLI
$ gh skill install mattiacerutti/supernova no-use-effect --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/mattiacerutti/supernova.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/no-use-effect .claude/skills/no-use-effect && 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
no-use-effect
GitHub stars
185
Used in
2 other repos
Token cost
~1.7k tokens
SKILL.md length
431 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Enforce the no-useEffect rule when writing or reviewing React code.

  • Works in 3 steps: Identify the useEffect → Apply the Correct Replacement Pattern → Verify
  • Tasks that involve React components
  • SKILL.md covers Quick Reference, When to Use This Skill, Workflow and The Escape Hatch: useMountEffect, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

No Use Effect is an agent skill from mattiacerutti/supernova. Enforce the no-useEffect rule when writing or reviewing React code. ACTIVATE when writing React components, refactoring existing useEffect calls, reviewing PRs with useEffect, or when an agent adds useEffect "just in case." Provides the five replacement patterns and the useMountEffect escape hatch.

Its SKILL.md is about 1.7k 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 Development, covering React components and Refactoring. It works with React. The repository describes itself as: A fast, opinionated development environment for Pi. The licence is MIT.

When your agent uses it

  • Tasks that involve React components
  • Tasks that involve Refactoring

Example prompts

  • “just in case.”
  • “/no-use-effect”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Identify the useEffect
  2. Apply the Correct Replacement Pattern
  3. Verify

What it can do on your machine

Read from SKILL.md and the folder at commit 984f521. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

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

  • Network

    Links to these hosts (documentation or services it may open):

    • react.dev

    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

No Use Effect loads about 1.7k tokens when it runs. Until then it costs about 78 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
~78
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

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 mattiacerutti/supernova at commit 984f521, republished under its MIT licence (© mattiacerutti). 431 words, ~1,731 tokens.

Download SKILL.mdSave it as .claude/skills/no-use-effect/SKILL.md (or your agent's skills folder).
name
no-use-effect
description
Enforce the no-useEffect rule when writing or reviewing React code. ACTIVATE when writing React components, refactoring existing useEffect calls, reviewing PRs with useEffect, or when an agent adds useEffect "just in case." Provides the five replacement patterns and the useMountEffect escape hatch.

No useEffect

Never call useEffect directly. Use derived state, event handlers, data-fetching libraries, or useMountEffect instead.

Quick Reference

Instead of useEffect for...Use
Deriving state from other state/propsInline computation (Rule 1)
Fetching datauseQuery / data-fetching library (Rule 2)
Responding to user actionsEvent handlers (Rule 3)
One-time external sync on mountuseMountEffect (Rule 4)
Resetting state when a prop changeskey prop on parent (Rule 5)

When to Use This Skill

  • Writing new React components
  • Refactoring existing useEffect calls
  • Reviewing PRs that introduce useEffect
  • An agent adds useEffect "just in case"

Workflow

1. Identify the useEffect

Determine what the effect is doing -- deriving state, fetching data, responding to an event, syncing with an external system, or resetting state.

2. Apply the Correct Replacement Pattern

Use the five rules below to pick the right replacement.

3. Verify

Verify that the new code works using existing tools (tests, linting, type checking) and manual testing if necessary.

The Escape Hatch: useMountEffect

For the rare case where you need to sync with an external system on mount:

The implementation wraps useEffect with an empty dependency array to make intent explicit:

typescript
export function useMountEffect(effect: () => void | (() => void)) {
  /* eslint-disable no-restricted-syntax */
  useEffect(effect, []);
}

Replacement Patterns

Rule 1: Derive state, do not sync it

Most effects that set state from other state are unnecessary and add extra renders.

typescript
// BAD: Two render cycles - first stale, then filtered
function ProductList() {
  const [products, setProducts] = useState([]);
  const [filteredProducts, setFilteredProducts] = useState([]);

  useEffect(() => {
    setFilteredProducts(products.filter((p) => p.inStock));
  }, [products]);
}

// GOOD: Compute inline in one render
function ProductList() {
  const [products, setProducts] = useState([]);
  const filteredProducts = products.filter((p) => p.inStock);
}

Smell test: You are about to write useEffect(() => setX(deriveFromY(y)), [y]), or you have state that only mirrors other state or props.

Show full SKILL.md (184 more words)Show less
Rule 2: Use data-fetching libraries

Effect-based fetching creates race conditions and duplicated caching logic.

typescript
// BAD: Race condition risk
function ProductPage({productId}) {
  const [product, setProduct] = useState(null);

  useEffect(() => {
    fetchProduct(productId).then(setProduct);
  }, [productId]);
}

// GOOD: Query library handles cancellation/caching/staleness
function ProductPage({productId}) {
  const {data: product} = useQuery(["product", productId], () => fetchProduct(productId));
}

Smell test: Your effect does fetch(...) and then setState(...), or you are re-implementing caching, retries, cancellation, or stale handling.

Rule 3: Event handlers, not effects

If a user clicks a button, do the work in the handler.

typescript
// BAD: Effect as an action relay
function LikeButton() {
  const [liked, setLiked] = useState(false);

  useEffect(() => {
    if (liked) {
      postLike();
      setLiked(false);
    }
  }, [liked]);

  return <button onClick={() => setLiked(true)}>Like</button>;
}

// GOOD: Direct event-driven action
function LikeButton() {
  return <button onClick={() => postLike()}>Like</button>;
}

Smell test: State is used as a flag so an effect can do the real action, or you are building "set flag -> effect runs -> reset flag" mechanics.

Rule 4: useMountEffect for one-time external sync

Good uses: DOM integration (focus, scroll), third-party widget lifecycles, browser API subscriptions.

typescript
// BAD: Guard inside effect
function VideoPlayer({ isLoading }) {
  useEffect(() => {
    if (!isLoading) playVideo();
  }, [isLoading]);
}

// GOOD: Mount only when preconditions are met
function VideoPlayerWrapper({ isLoading }) {
  if (isLoading) return <LoadingScreen />;
  return <VideoPlayer />;
}

function VideoPlayer() {
  useMountEffect(() => playVideo());
}

Use useMountEffect for stable dependencies (singletons, refs, context values that never change):

typescript
// BAD: useEffect with dependency that never changes
useEffect(() => {
  connectionManager.on("connected", handleConnect);
  return () => connectionManager.off("connected", handleConnect);
}, [connectionManager]); // connectionManager is a singleton from context

// GOOD: useMountEffect for stable dependencies

useMountEffect(() => {
  connectionManager.on("connected", handleConnect);
  return () => connectionManager.off("connected", handleConnect);
});

Smell test: You are synchronizing with an external system, and the behavior is naturally "setup on mount, cleanup on unmount."

Rule 5: Reset with key, not dependency choreography
typescript
// BAD: Effect attempts to emulate remount behavior
function VideoPlayer({ videoId }) {
  useEffect(() => {
    loadVideo(videoId);
  }, [videoId]);
}

// GOOD: key forces clean remount
function VideoPlayer({ videoId }) {
  useMountEffect(() => {
    loadVideo(videoId);
  });
}

function VideoPlayerWrapper({ videoId }) {
  return <VideoPlayer key={videoId} videoId={videoId} />;
}

Smell test: You are writing an effect whose only job is to reset local state when an ID/prop changes, or you want the component to behave like a brand-new instance for each entity.

Component Structure Convention

Computed values come after hooks and local state, never via useEffect:

typescript
export function FeatureComponent({ featureId }: ComponentProps) {
  // Hooks first
  const { data, isLoading } = useQueryFeature(featureId);

  // Local state
  const [isOpen, setIsOpen] = useState(false);

  // Computed values (NOT useEffect + setState)
  const displayName = user?.name ?? 'Unknown';

  // Event handlers
  const handleClick = () => { setIsOpen(true); };

  // Early returns
  if (isLoading) return <Loading />;

  // Render
  return <Flex direction="column" gap="lg">...</Flex>;
}

© mattiacerutti, MIT. 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 .agents/skills/no-use-effect of mattiacerutti/supernova.

Open the folder on GitHubat commit 984f521

Used in 2 other repositories

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in mattiacerutti/supernova, which our catalogue first saw on October 7, 2026.

Compare with similar skills

No Use Effect 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.

No Use Effect compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
No Use Effect this skillmattiacerutti/supernova1852 repos~1.7kAutomated safety check: PassMIT
React Best Practicesshapeshift/web2061 repos~2kAutomated safety check: PassMIT
Migrate Componentasyncapi/generator1.1k—~3kAutomated safety check: PassApache-2.0
Project Form PatternsAkaraChen/aghub272—~1.1kAutomated safety check: PassMIT
React Performanceaffaan-m/ECC276k1 repos~4.5kAutomated safety check: PassMIT
Vercel React Best Practicessanity-io/sanity6.4k129 repos~1.6kAutomated safety check: PassMIT

Similar skills

  • React Best Practices

    shapeshift/web

    Comprehensive React and Next.js performance optimization guide with 40+ rules for eliminating waterfalls, optimizing bundles, and improving rendering.

    206 GitHub starsUsed in 1 repo~2k tokens
    DevelopmentAuto-check passed
  • Migrate Component

    asyncapi/generator

    Promote a duplicated React/JSX template-local component into the shared @asyncapi/generator-components package.

    1.1k GitHub stars~3k tokensUpdated today
    DevelopmentAuto-check passed
  • Project Form Patterns

    AkaraChen/aghub

    Form implementation guidance for the aghub desktop app. An agent skill from AkaraChen/aghub.

    272 GitHub stars~1.1k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • React Performance

    affaan-m/ECC

    React and Next.js performance optimization patterns adapted from Vercel Engineering's React Best Practices (https://github.com/vercel-labs/agent-skills).

    276k GitHub starsUsed in 1 repo~4.5k tokens
    DevelopmentAuto-check passed
  • Official

    React and Next.js performance optimization guidelines from Vercel Engineering.

    6.4k GitHub starsUsed in 129 repos~1.6k tokens
    Frontend & DesignAuto-check passed
  • React Best Practices

    mastra-ai/mastra

    React performance optimization guidelines from Mastra Engineering.

    29k GitHub stars~1.9k tokensUpdated today
    Frontend & DesignAuto-check passed

More from mattiacerutti/supernova

  • Effect TS

    mattiacerutti/supernova

    Write idiomatic Effect v4 TypeScript following official best practices from effect-solutions and the Effect source.

    185 GitHub stars~2.8k tokensUpdated today
    Auto-check passed

Works with

Questions about No Use Effect

What does No Use Effect do?

Enforce the no-useEffect rule when writing or reviewing React code. No Use Effect is an agent skill from mattiacerutti/supernova. Enforce the no-useEffect rule when writing or reviewing React code.

When should I use No Use Effect?

No Use Effect fits situations like: tasks that involve React components; tasks that involve Refactoring.

How do I install No Use Effect in Claude Code?

Run `npx skills add mattiacerutti/supernova --skill no-use-effect -a claude-code`. Or copy the skill folder (.agents/skills/no-use-effect in mattiacerutti/supernova) into .claude/skills/no-use-effect in your project. Claude Code loads it when a task matches its description.

How do I install No Use Effect in Codex?

Run `npx skills add mattiacerutti/supernova --skill no-use-effect -a codex`. Or copy the skill folder (.agents/skills/no-use-effect in mattiacerutti/supernova) into .agents/skills/no-use-effect in your project. Codex loads it when a task matches its description.

Can I use No Use Effect 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 mattiacerutti/supernova --skill no-use-effect -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/no-use-effect, .gemini/skills/no-use-effect, .github/skills/no-use-effect and .opencode/skills/no-use-effect in your project.

What does No Use Effect need to run?

SKILL.md names no scripts, command-line tools or credentials: No Use Effect is instructions for the agent only.

Does No Use Effect access the network?

SKILL.md names 1 domain. As links in the text: react.dev. This is read from the text; nothing was executed.

Is No Use Effect 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 No Use Effect use?

No Use Effect is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does No Use Effect use?

About 1.7k tokens (SKILL.md is roughly 6.9k 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 No Use Effect?

Skills that share tags, products or a category with No Use Effect: React Best Practices (shapeshift/web, 206 stars), Migrate Component (asyncapi/generator, 1.1k stars), Project Form Patterns (AkaraChen/aghub, 272 stars) and React Performance (affaan-m/ECC, 276k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains No Use Effect?

mattiacerutti (a GitHub user) maintains it in mattiacerutti/supernova, which has 185 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 9, 2026.

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