Back to skills
SKILL.md
082 Claude 0c6d92ae
ASecurityThis plugin provides AI-powered, security-first assistance for creating Uniswap v4 hooks. It helps developers design, implement, and test custom hooks for the Uniswap V4 protocol with a strong emphasis on security best practices.
- 9 stars
- 0 votes
- 0 copies
- 0 views
- Added October 11, 2026
Security analysis
100/100npx -y skills add tools-only/X-Skills --skill 082-claude_0c6d92ae --agent claude-codeAre you the author of 082 Claude 0c6d92ae?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tools-only-082-claude-0c6d92ae)# CLAUDE.md - uniswap-hooks Plugin
## Overview
This plugin provides AI-powered, security-first assistance for creating Uniswap v4 hooks. It helps developers design, implement, and test custom hooks for the Uniswap V4 protocol with a strong emphasis on security best practices.
## Plugin Components
### Skills (./skills/)
- **v4-security-foundations**: Security-first guide for v4 hook development (NoOp attacks, delta accounting, access control, audit checklists)
## Uniswap v4 Hooks Architecture
Hooks are smart contracts that can intercept and modify pool actions at specific points:
### Hook Callbacks
| Callback | When Called | Use Case |
| ----------------------- | --------------------- | ------------------------- |
| `beforeInitialize` | Before pool creation | Validate pool parameters |
| `afterInitialize` | After pool creation | Set up hook state |
| `beforeAddLiquidity` | Before LP deposit | Custom fee logic |
| `afterAddLiquidity` | After LP deposit | Update rewards |
| `beforeRemoveLiquidity` | Before LP withdrawal | Lock periods |
| `afterRemoveLiquidity` | After LP withdrawal | Distribute rewards |
| `beforeSwap` | Before swap execution | Price oracles, routing |
| `afterSwap` | After swap execution | MEV protection, analytics |
| `beforeDonate` | Before donation | Access control |
| `afterDonate` | After donation | Track donations |
### Hook Flags
Hooks declare which callbacks they implement via flags:
```solidity
function getHookPermissions() public pure override returns (Hooks.Permissions memory) {
return Hooks.Permissions({
beforeInitialize: false,
afterInitialize: true,
beforeAddLiquidity: false,
afterAddLiquidity: false,
beforeRemoveLiquidity: false,
afterRemoveLiquidity: false,
beforeSwap: true,
afterSwap: true,
beforeDonate: false,
afterDonate: false,
beforeSwapReturnDelta: false,
afterSwapReturnDelta: false,
afterAddLiquidityReturnDelta: false,
afterRemoveLiquidityReturnDelta: false
});
}
```
## Development Guidelines
### Hook Address Requirements
v4 hooks must have specific address patterns where the last 14 bits encode which callbacks are enabled. Use the hook miner to find valid addresses.
### State Management
- Use transient storage for temporary data within a transaction
- Consider gas costs when storing persistent state
- Leverage PoolManager's singleton pattern
### Security Considerations
- Validate all inputs in hook callbacks
- Be aware of reentrancy risks
- Consider MEV implications of hook logic
- Test edge cases with extreme tick ranges
## File Structure
```text
uniswap-hooks/
├── .claude-plugin/
│ └── plugin.json
├── skills/
│ └── v4-security-foundations/
│ ├── SKILL.md
│ └── references/
│ ├── audit-checklist.md
│ ├── base-hook-template.md
│ └── vulnerabilities-catalog.md
├── project.json
├── package.json
├── CLAUDE.md
└── README.md
```
## Related Resources
- [Uniswap v4 Core](https://github.com/Uniswap/v4-core)
- [v4 Periphery](https://github.com/Uniswap/v4-periphery)
- [Hook Examples](https://github.com/Uniswap/v4-periphery/tree/main/src/lens)
Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.