Reactuse
Version 1.0.16
Siberiacancode
September 2026
This repository contains Reactuse guidance for agents and LLMs. It is optimized for automated code generation, refactoring, and consistency in React and Next.js projects.
Abstract
Reactuse is a TypeScript-first hook library with SSR compatibility and tree-shaking optimization. This repository documents hooks and helper utilities for agents and LLMs, with clear usage guidance and practical examples to keep React and Next.js code consistent.
Sections
The rules are organized into the following sections (as in _sections.md):
- Helpers
- Elements
- Async
- Lifecycle
- Browser
- Utilities
- State
- User
- Sensors
- Time
- Debug
The upstream Humor category is intentionally blocked for this skill and should not be added to the supported hook set.
Structure
rules/- Individual rule files (one per hook/helper)_sections.md- Section metadata (titles, impacts, descriptions)_template.md- Template for creating new rulesuseSomething.md- Individual rule files
metadata.json- Document metadata (version, organization, abstract)AGENTS.md- Compiled output (generated)test-cases.json- Test cases for LLM evaluation (generated)
Getting Started
Install dependencies:
pnpm installBuild AGENTS.md from rules:
pnpm buildValidate rule files:
pnpm validateExtract test cases:
pnpm extract-tests
Creating a New Rule
- Copy
rules/_template.mdtorules/useSomething.md - Set
name,category, andusagein the frontmatter - Follow the template structure (Usage, Example, Use cases, Notes, Type Declarations)
- Ensure you have clear examples with explanations
- Run
pnpm buildto regenerate AGENTS.md and test-cases.json
Rule File Structure
Each rule file should follow this structure:
---
name: useSomething
category: State
usage: high | medium | low
---
## useSomething
A short, one-line description of what the hook does.
## Usage
Describe the basic import and minimal usage example. Show destructured return values even if the hook returns a full object.
## Example
Provide a concise component example that demonstrates a real UI use case.
## Use cases
List 2-4 practical UI scenarios where the hook is useful.
## Notes
List important caveats and edge cases.
## Type Declarations
Summarize key public types and the main function signature.File Naming Convention
- Files starting with
_are special (excluded from build) - Rule files:
useSomething.md(e.g.,use-hover.md) - Section is inferred from the
categoryfrontmatter - Rules are sorted alphabetically by name within each section
Scripts
pnpm build- Compile rules into AGENTS.mdpnpm validate- Validate all rule filespnpm extract-tests- Extract test cases for LLM evaluationpnpm dev- Build and validate
Contributing
When adding or modifying rules:
- Use a clear hook/helper filename (
useSomething.md) - Follow the
_template.mdstructure - Include clear examples with explanations
- Run
pnpm buildto regenerate AGENTS.md and test-cases.json - Rules are automatically sorted by name - no need to manage numbers!
Acknowledgments
Inspired by public React hook libraries and community best practices.