No Use Effect
mattiacerutti/supernova
Enforce the no-useEffect rule when writing or reviewing React code.
Custom hook and composable patterns — naming, composition, stable return shapes, lifecycle cleanup, and testing strategies.
$ npx skills add TheSoftwareHouse/copilot-collections --skill tsh-writing-hooks -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install TheSoftwareHouse/copilot-collections tsh-writing-hooks --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/TheSoftwareHouse/copilot-collections.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/tsh-writing-hooks .claude/skills/tsh-writing-hooks && rm -rf skills-srcUse ~/.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/
Install the "tsh-writing-hooks" agent skill from https://github.com/TheSoftwareHouse/copilot-collections/tree/main/.github/skills/tsh-writing-hooks into .claude/skills/tsh-writing-hooks/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tsh-writing-hooks", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/TheSoftwareHouse/copilot-collections/tree/main/.github/skills/tsh-writing-hooksType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add TheSoftwareHouse/copilot-collections --skill tsh-writing-hooks -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install TheSoftwareHouse/copilot-collections tsh-writing-hooks --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TheSoftwareHouse/copilot-collections.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.github/skills/tsh-writing-hooks .agents/skills/tsh-writing-hooks && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "tsh-writing-hooks" agent skill from https://github.com/TheSoftwareHouse/copilot-collections/tree/main/.github/skills/tsh-writing-hooks into .agents/skills/tsh-writing-hooks/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tsh-writing-hooks", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add TheSoftwareHouse/copilot-collections --skill tsh-writing-hooks -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install TheSoftwareHouse/copilot-collections tsh-writing-hooks --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TheSoftwareHouse/copilot-collections.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.github/skills/tsh-writing-hooks .cursor/skills/tsh-writing-hooks && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "tsh-writing-hooks" agent skill from https://github.com/TheSoftwareHouse/copilot-collections/tree/main/.github/skills/tsh-writing-hooks into .cursor/skills/tsh-writing-hooks/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tsh-writing-hooks", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/TheSoftwareHouse/copilot-collections.git --path .github/skills/tsh-writing-hooks--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add TheSoftwareHouse/copilot-collections --skill tsh-writing-hooks -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install TheSoftwareHouse/copilot-collections tsh-writing-hooks --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TheSoftwareHouse/copilot-collections.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.github/skills/tsh-writing-hooks .gemini/skills/tsh-writing-hooks && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "tsh-writing-hooks" agent skill from https://github.com/TheSoftwareHouse/copilot-collections/tree/main/.github/skills/tsh-writing-hooks into .gemini/skills/tsh-writing-hooks/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tsh-writing-hooks", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install TheSoftwareHouse/copilot-collections tsh-writing-hooksInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add TheSoftwareHouse/copilot-collections --skill tsh-writing-hooks -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/TheSoftwareHouse/copilot-collections.git skills-src && mkdir -p .github/skills && cp -r skills-src/.github/skills/tsh-writing-hooks .github/skills/tsh-writing-hooks && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "tsh-writing-hooks" agent skill from https://github.com/TheSoftwareHouse/copilot-collections/tree/main/.github/skills/tsh-writing-hooks into .github/skills/tsh-writing-hooks/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tsh-writing-hooks", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add TheSoftwareHouse/copilot-collections --skill tsh-writing-hooks -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install TheSoftwareHouse/copilot-collections tsh-writing-hooks --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TheSoftwareHouse/copilot-collections.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.github/skills/tsh-writing-hooks .opencode/skills/tsh-writing-hooks && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "tsh-writing-hooks" agent skill from https://github.com/TheSoftwareHouse/copilot-collections/tree/main/.github/skills/tsh-writing-hooks into .opencode/skills/tsh-writing-hooks/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tsh-writing-hooks", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
tsh-writing-hooksCustom hook and composable patterns — naming, composition, stable return shapes, lifecycle cleanup, and testing strategies.
Tsh Writing Hooks is an agent skill from TheSoftwareHouse/copilot-collections. Custom hook and composable patterns — naming, composition, stable return shapes, lifecycle cleanup, and testing strategies. Use when writing reusable logic units (React hooks, Vue composables), refactoring logic into hooks, debugging hook behavior, or reviewing hook implementations.
Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/react-patterns.md`).
It sits in Development, covering React components, Test strategy and Hooks and plugins. It works with React and Vue.js. The repository describes itself as: Opinionated AI-enabled workflows for product engineering. The licence is MIT.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 2fbe51e. It shows what the files ask for, not the result of running them.
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.
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.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Tsh Writing Hooks loads about 3k tokens when it runs, and up to ~4.3k if it reads all its reference files. Until then it costs about 75 tokens; SKILL.md has 983 words of instructions outside code blocks.
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.
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.
The full file from TheSoftwareHouse/copilot-collections at commit 2fbe51e, republished under its MIT licence (© TheSoftwareHouse). 983 words, ~2,969 tokens.
.claude/skills/tsh-writing-hooks/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Provides patterns for writing composable, testable custom hooks with stable APIs, proper effect lifecycle management, and clear responsibility boundaries.
This skill uses "hook" to refer to any reusable, composable logic unit — React hooks, Vue composables, or equivalent framework abstractions. Adapt naming conventions and specific APIs to the project's framework.
<principles>
<single-responsibility>
Each hook does one thing. Compose complex behavior by calling multiple hooks, not by adding optional parameters to a single hook. A hook with 5+ configuration options is a sign it needs decomposition.
</single-responsibility>
<stable-api-surface>
Prefer returning an object (rather than a tuple) once the hook returns more than 1–2 values, and keep references stable. Memoize callbacks and derived values using the framework's memoization primitives when consumers may pass them to memoized children. The hook's return shape is its public API — treat it as a contract.
</stable-api-surface>
<cleanup-everything>
Every subscription, timer, event listener, or async operation created in an effect must have a corresponding cleanup. Leaked resources cause memory leaks and stale state bugs that are hard to diagnose.
</cleanup-everything>
</principles>
Use the checklist below and track progress:
Progress:
- [ ] Step 1: Define the hook's contract
- [ ] Step 2: Classify the hook tier
- [ ] Step 3: Implement with lifecycle discipline
- [ ] Step 4: Test the hookStep 1: Define the hook's contract
Define the hook's public API before writing implementation code.
Naming: Follow the project's framework convention for reusable logic units. In React and Vue, the convention is use prefix + descriptive verb or noun. The name reflects behavior, not implementation details.
| Pattern | Example | Use case |
|---|---|---|
use + noun | useDebounce, useMediaQuery | Returns a derived or observed value |
use + verb | useToggle, useFetch | Returns value + action(s) |
use + domain | useAuth, useCart | Domain-specific composition hook |
Good: useLocalStorage — describes what it does.
Bad: useBrowserEffect — describes how it works.
Inputs: Prefer a single options object when the hook accepts 3+ parameters. This makes the API extensible without breaking existing call sites.
// Prefer — single options object
const useDebounce = ({ value, delay, leading }: UseDebounceOptions) => {
// ...
};
// Avoid — positional args are fragile past 2 params
const useDebounce = (value: string, delay: number, leading?: boolean) => {
// ...
};Outputs: Return an object with clear field names. Document what the hook returns and when it triggers effects.
interface UseAsyncReturn<T> {
data: T | undefined;
error: Error | null;
isPending: boolean;
refetch: () => void;
}Step 2: Classify the hook tier
Determine where the hook fits in the dependency hierarchy. This classification constrains what a hook may depend on and prevents circular or inappropriate coupling.
| Tier | Name | Scope | Dependencies | Examples |
|---|---|---|---|---|
| Atom | UI hooks | Local state, DOM events, media queries, keyboard | No remote data. No data-fetching libraries. | useToggle, useMediaQuery, useKeyPress |
| Molecule | Coordination hooks | Compose atom hooks with light coordination logic | Other atom hooks only. No remote data. | useFormField, usePagination |
| Organism | Data hooks | Wrap data-fetching/mutation libraries. Domain logic. | May call UI hooks internally. Interact with server cache. | useUserProfile, useSearchResults |
Rules:
Composability example — molecule hook composing atoms:
// Atom: single-purpose, no data fetching
const useDebounce = (value: string, delay: number) => {
/* ... */
};
const useLocalStorage = <T>(key: string, initial: T) => {
/* ... */
};
// Molecule: composes atoms into a higher-level behavior
const useDebouncedSearch = (storageKey: string) => {
const { value, setValue } = useLocalStorage(storageKey, "");
const debouncedValue = useDebounce(value, 300);
return { query: value, setQuery: setValue, debouncedQuery: debouncedValue };
};Step 3: Implement with lifecycle discipline
Follow these rules during implementation:
Call rules:
Lifecycle cleanup — every effect that creates a resource must clean it up:
| Resource | Setup | Required cleanup |
|---|---|---|
| Timer | setTimeout(cb, delay) | clearTimeout(id) |
| Event listener | addEventListener(event, handler) | removeEventListener(event, handler) |
| Async operation | Cancellable operation with AbortController signal | controller.abort() |
| Subscription | source.subscribe(handler) | subscription.unsubscribe() |
The cleanup must execute when the hook unmounts or when dependencies change. See the framework reference for the exact cleanup syntax.
Error handling:
{ error }).useX hook used outside its Provider) or when integrating with Error Boundaries / Suspense.Conditional execution:
enabled flag to prevent wasteful operations when preconditions are not met.const useUserProfile = ({ userId, enabled = true }: Options) => {
// Skip data fetching when disabled — delegate to data fetching library's enabled/skip option
// Return idle state: { data: undefined, isPending: false, error: null }
};Step 4: Test the hook
Use the framework's hook/composable testing utility. Structure tests around four areas:
For data hooks: wrap the test in required providers (query client, context providers) and mock network responses.
For timer-dependent hooks: use fake timers to control time progression without real delays.
it("cleans up the timer on unmount", () => {
// Enable fake timers (syntax varies by test runner)
// Render the hook using the framework's testing utility
// Unmount
// Advance all pending timers — verify no leaked side effects
// Restore real timers after test
});| Return type | When | Example |
|---|---|---|
| Single value | Hook computes one thing | useDebounce(value, delay) → debouncedValue |
| Object | Multiple related values or actions | { data, error, isPending, refetch } |
| Object (prefer over tuple) | Readability and evolvability matter | { count, increment, decrement, reset } |
Prefer objects over tuples for hooks returning more than one value. Objects are self-documenting, allow consumers to destructure only what they need, and evolve without breaking existing call sites.
| Anti-Pattern | Instead Do |
|---|---|
Tuple return [value, setter] for complex hooks | Object return { value, setValue, reset } |
| Effect with suppressed dependency tracking | Include all deps; restructure if cycle occurs |
| New object/array identity every render | Memoize or lift to module scope |
| Side effects in render phase | Move to lifecycle effect or event handler |
| Swallowing errors silently | Return { error } so consumer can handle |
| One mega-hook with 10 options | Compose from smaller single-purpose hooks |
| Timer without cleanup | Always return () => clearTimeout(id) |
Data hook without enabled flag | Support conditional fetching to avoid waste |
Hook:
- [ ] Name follows framework convention (e.g., `use` prefix), describes behavior (not implementation)
- [ ] Single responsibility — does one thing well
- [ ] Inputs: single options object for 3+ params
- [ ] Output: object with stable references (memoized where framework supports it)
- [ ] All dependency tracking complete — no linting suppression
- [ ] Effects clean up: timers, listeners, subscriptions, abort controllers
- [ ] Errors surfaced via return value, never thrown from render
- [ ] Tested: initial state, transitions, cleanup, error statesThe patterns above are framework-agnostic. For framework-specific hook/composable syntax, load the appropriate reference:
./references/react-patterns.md — useEffect, useMemo, useCallback, dependency arrays, rules of hooks.tsh-implementing-frontend — hooks are used within components; this skill covers component patternstsh-optimizing-frontend — for memoization strategies and performance patterns in hookstsh-reviewing-frontend — for hook-specific code review criteriatsh-implementing-forms — for form-related custom hooks (field state, validation triggers)© TheSoftwareHouse, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file (references) in .github/skills/tsh-writing-hooks of TheSoftwareHouse/copilot-collections.
Open the folder on GitHubat commit 2fbe51e
Tsh Writing Hooks 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Tsh Writing Hooks this skillTheSoftwareHouse/copilot-collections | 284 | — | ~3k | Automated safety check: Pass | MIT | |
| No Use Effectmattiacerutti/supernova | 185 | 2 repos | ~1.7k | Automated safety check: Pass | MIT | |
| React Best Practicesshapeshift/web | 206 | 1 repos | ~2k | Automated safety check: Pass | MIT | |
| Migrate Componentasyncapi/generator | 1.1k | — | ~3k | Automated safety check: Pass | Apache-2.0 | |
| Project Form PatternsAkaraChen/aghub | 272 | — | ~1.1k | Automated safety check: Pass | MIT | |
| React Refactor Tournamentragnar-pwninskjold/tech-snacks | 137 | — | ~1.3k | Automated safety check: Pass | MIT |
mattiacerutti/supernova
Enforce the no-useEffect rule when writing or reviewing React code.
shapeshift/web
Comprehensive React and Next.js performance optimization guide with 40+ rules for eliminating waterfalls, optimizing bundles, and improving rendering.
asyncapi/generator
Promote a duplicated React/JSX template-local component into the shared @asyncapi/generator-components package.
AkaraChen/aghub
Form implementation guidance for the aghub desktop app. An agent skill from AkaraChen/aghub.
ragnar-pwninskjold/tech-snacks
Review React/Next.js code against the real vercel-react-best-practices skill, backlog the performance findings keyed to actual rule ids + impact tiers, rank the most over-subscribed tiers, then fix…
KaimingWan/oh-my-kiro
Enforces coding best practices: deep-read before modify, LSP-first navigation, TDD red-green-refactor, minimal changes, self-review, verification.
TheSoftwareHouse/copilot-collections
Create new skills (SKILL.md) for GitHub Copilot. An agent skill from TheSoftwareHouse/copilot-collections.
TheSoftwareHouse/copilot-collections
Frontend component patterns, composition, design token integration, barrel file organization, error handling, and Figma-to-code workflow.
TheSoftwareHouse/copilot-collections
Build reusable Terraform modules for AWS, Azure, and GCP infrastructure following infrastructure-as-code best practices.
TheSoftwareHouse/copilot-collections
Frontend rendering optimization, code splitting, memoization strategies, bundle size control, asset optimization, and memory management.
TheSoftwareHouse/copilot-collections
Frontend-specific code review criteria, component anti-patterns, hooks quality, rendering correctness, accessibility and performance spot-checks, and module organization issues.
TheSoftwareHouse/copilot-collections
Creates custom instruction files (.instructions.md) for GitHub Copilot in VS Code.
Categories
Custom hook and composable patterns — naming, composition, stable return shapes, lifecycle cleanup, and testing strategies. Tsh Writing Hooks is an agent skill from TheSoftwareHouse/copilot-collections. Custom hook and composable patterns — naming, composition, stable return shapes, lifecycle cleanup, and testing strategies.
Tsh Writing Hooks fits situations like: writing reusable logic units (React hooks; vue composables); refactoring logic into hooks; debugging hook behavior.
Run `npx skills add TheSoftwareHouse/copilot-collections --skill tsh-writing-hooks -a claude-code`. Or copy the skill folder (.github/skills/tsh-writing-hooks in TheSoftwareHouse/copilot-collections) into .claude/skills/tsh-writing-hooks in your project. Claude Code loads it when a task matches its description.
Run `npx skills add TheSoftwareHouse/copilot-collections --skill tsh-writing-hooks -a codex`. Or copy the skill folder (.github/skills/tsh-writing-hooks in TheSoftwareHouse/copilot-collections) into .agents/skills/tsh-writing-hooks in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add TheSoftwareHouse/copilot-collections --skill tsh-writing-hooks -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tsh-writing-hooks, .gemini/skills/tsh-writing-hooks, .github/skills/tsh-writing-hooks and .opencode/skills/tsh-writing-hooks in your project.
SKILL.md names no scripts, command-line tools or credentials: Tsh Writing Hooks is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
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.
Tsh Writing Hooks is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.4k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Tsh Writing Hooks: No Use Effect (mattiacerutti/supernova, 185 stars), React Best Practices (shapeshift/web, 206 stars), Migrate Component (asyncapi/generator, 1.1k stars) and Project Form Patterns (AkaraChen/aghub, 272 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
TheSoftwareHouse (a GitHub organization) maintains it in TheSoftwareHouse/copilot-collections, which has 284 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on October 5, 2026.
Source: TheSoftwareHouse/copilot-collections on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.