feat: add react-named-effects skill#213
Open
dnh33 wants to merge 3 commits intovercel-labs:mainfrom
Open
Conversation
Teach agents to use named function expressions in useEffect, useCallback, and useMemo instead of anonymous arrows. Named effects improve stack traces, make component data flow scannable, and act as a diagnostic — effects that resist clean naming have structural problems worth fixing. Follows react-view-transitions pattern: - SKILL.md router with core pattern and quick reference - references/diagnostics.md for anti-pattern detection - references/conventions.md for naming vocabulary and tooling - AGENTS.md compiled full guide - metadata.json and README.md per repo conventions Complements existing react-best-practices rules (derived-state-no-effect, move-effect-to-event, split-combined-hooks) by providing the naming discipline that naturally surfaces when those rules should apply. Based on: https://neciudan.dev/name-your-effects
- Fix syncWidthAndApplyTheme example: show full body with both concerns and correct dependency array [user?.preferences?.theme] - Add standard preamble to AGENTS.md matching repo convention - Note AGENTS.md is compiled from source files (prevent drift) - Add reset/clear and track/observe to SKILL.md quick reference table (examples used these verbs but table didn't include them) - Add name and license fields to metadata.json - Regenerate zip
- Add typeof window check in useWindowWidth useState initializer (SSR/Node.js would throw on bare window.innerWidth access) - Remove name and license fields from metadata.json to match existing skill schema (composition-patterns, react-best-practices) - Regenerate zip
|
@dnh33 is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a react-named-effects skill that teaches agents to replace anonymous arrows in
useEffect(anduseCallback/useMemo) with named function expressions.Structure follows the
react-view-transitionspattern:SKILL.md— core pattern, when to apply, quick reference (~80 lines)references/diagnostics.md— anti-pattern detection, split/elimination signalsreferences/conventions.md— naming vocabulary, cleanup functions, custom hooks, ESLint enforcement, technical notesAGENTS.md— compiled full guidemetadata.json+README.mdper repo conventionsComplements existing
react-best-practicesrules (rerender-derived-state-no-effect,rerender-move-effect-to-event,rerender-split-combined-hooks) without overlap — no existing skill or rule covers naming conventions for hook callbacks.Why This Matters
Named effects give agents three things:
at connectToWebSocket @ file:14instead ofat (anonymous) @ file:14Based On
Technical accuracy
The skill is precise about what naming does and doesn't do:
Test plan