# ahooks

Reference skill for the ahooks React library: provides recipes, TypeScript patterns, and guidance for over 76 custom hooks.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 1 install · ★ 15 repo stars
- Author: whinc
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/whinc/my-claude-plugins/tree/HEAD/plugins/ahooks/skills/ahooks/SKILL.md
- Updated: 2026-01-21
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/ahooks

## What it does

This skill supplies your coding assistant with deep knowledge of the ahooks ecosystem. It details hook signatures and implementation patterns across 9 categories, covering state management (`useSetState`, `useBoolean`), component lifecycle, browser APIs, storage, and debounced events.

The tool shines when designing complex UI workflows. It explains how to structure server requests with polling or caching via `useRequest`, connect table pagination, or sync component state with browser storage.

Your project must have the actual `ahooks` package installed in `node_modules` for generated imports to run without errors.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add whinc/my-claude-plugins --skill ahooks -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/ahooks/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/ahooks/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add whinc/my-claude-plugins --skill ahooks -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/ahooks/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add whinc/my-claude-plugins --skill ahooks -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/ahooks/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install whinc/my-claude-plugins plugins/ahooks/skills/ahooks
```

2. **Manually: put the files in place**
- File: `.github/skills/ahooks/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add whinc/my-claude-plugins --skill ahooks -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/whinc/my-claude-plugins --path plugins/ahooks/skills/ahooks
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/ahooks/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add whinc/my-claude-plugins --skill ahooks -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/whinc/my-claude-plugins/tree/HEAD/plugins/ahooks/skills/ahooks/SKILL.md

## When to use it
- configure API queries with pagination, retry logic, and caching using `useRequest`
- migrate bulky component state from standard `useState` to `useSetState` or `useToggle`
- optimize heavy re-renders and rapid input events using `useDebounce` or `useThrottle`
- handle DOM events, scroll metrics, and interval timers without manual cleanup boilerplate

## Example prompts
- Show how to set up server pagination and result caching with `useRequest`.
- Refactor this complex form state from `useState` to `useSetState`.
- How do I debounce an input search field using `useDebounce`?

## Similar
- [tools](https://affpapa.org/en/nevibecode/skills/tools.md) — skill · 6600 installs
- [bencium-impact-designer](https://affpapa.org/en/nevibecode/skills/bencium-impact-designer.md) — skill · 6100 installs
- [framer-motion](https://affpapa.org/en/nevibecode/skills/framer-motion.md) — skill · 3100 installs
- [web-development](https://affpapa.org/en/nevibecode/skills/web-development.md) — skill · 1800 installs
- [virtual-lists](https://affpapa.org/en/nevibecode/skills/virtual-lists.md) — skill · 1700 installs
- [compound-pattern](https://affpapa.org/en/nevibecode/skills/compound-pattern.md) — skill · 1100 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
