
V4 hook generator
Guides an agent to scaffold Uniswap v4 hook contracts via the OpenZeppelin Wizard MCP
V4 hook generator is an open-source agent skill for developer tools. It is available on Claude Code.
- Scripts
- None
- Platforms
- Claude Code
- GitHub stars
- 236
- Last commit
- License
- MIT
- Listing updated
Similar skills
About V4 hook generator
This skill helps an agent pick the right Uniswap v4 hook base type for a goal such as custom swap logic, dynamic fees, MEV protection, limit orders or oracles. It walks through choosing which pool lifecycle callbacks to enable, which utility libraries to include, how shares and access control should be configured, and what numeric inputs apply to certain hook types.
The workflow runs in four stages: gather requirements, select the hook type, assemble a canonical JSON argument, and call the OpenZeppelin Contracts Wizard MCP tool to receive Solidity source. The MCP tool returns code as a string and does not write files, so the agent is expected to save the output to disk and explain the generated constructor and permission sections. The skill also notes manual steps such as mining a deployment salt with HookMiner so the hook address encodes its permission bits.
The skill is a planning and scaffolding guide rather than a code generator on its own. It expects a working MCP connection to the OpenZeppelin Wizard, familiarity with Solidity and Foundry or Hardhat style deployments, and it points users to a companion security skill to run before any deployment.
When your agent uses it
Generate Uniswap v4 hook contracts via OpenZeppelin MCP. Use when building custom swap logic, async swaps, hook-owned liquidity, custom curves, dynamic fees, MEV protection, limit orders, or oracle hooks.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
- Instructions only, no scripts(see the files on GitHub)
- Asks for: Read, Glob, Grep, WebFetch, Bash(see the files on GitHub)
- License: MIT(see the files on GitHub)
From a static check of its 1 file (18 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the uniswap-hooks plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add Uniswap/uniswap-ai
/plugin install uniswap-hooks@uniswap-aiOr copy only this skill to ~/.claude/skills/v4-hook-generator:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/v4-hook-generator &&
cp -R "$tmp/packages/plugins/uniswap-hooks/skills/v4-hook-generator" ~/.claude/skills/v4-hook-generator &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/v4-hook-generator inside it instead.
Copy the skill folder to ~/.agents/skills/v4-hook-generator to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/v4-hook-generator &&
cp -R "$tmp/packages/plugins/uniswap-hooks/skills/v4-hook-generator" ~/.agents/skills/v4-hook-generator &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/v4-hook-generator inside it instead.
Copy the skill folder to ~/.cursor/skills/v4-hook-generator to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/v4-hook-generator &&
cp -R "$tmp/packages/plugins/uniswap-hooks/skills/v4-hook-generator" ~/.cursor/skills/v4-hook-generator &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/v4-hook-generator inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/Uniswap/uniswap-ai.git --path packages/plugins/uniswap-hooks/skills/v4-hook-generatorOr copy the folder to ~/.gemini/skills/v4-hook-generator yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/v4-hook-generator:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/v4-hook-generator &&
cp -R "$tmp/packages/plugins/uniswap-hooks/skills/v4-hook-generator" ~/.copilot/skills/v4-hook-generator &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/v4-hook-generator inside it instead.
Get the folder:
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.gitThen copy uniswap-ai/packages/plugins/uniswap-hooks/skills/v4-hook-generator into your agent's skills folder as v4-hook-generator. Agents that support SKILL.md read one folder per skill.
What it does
- Hook type selection
- Maps a stated goal to one of fourteen Uniswap v4 base hook types with trade-off guidance.
- Permission configuration
- Explains each of the fourteen permission flags, when to enable it and its risk level.
- Utility library choices
- Covers when to include currency settling, safe casting and transient storage helpers.
- Shares and access options
- Compares no share token, ERC20, ERC6909 and ERC1155 plus ownable, roles and managed access.
- MCP call assembly
- Provides the canonical JSON argument structure for the OpenZeppelin Wizard generate_hook tool.
- Deployment address notes
- Describes how permission bits are encoded in the hook address and how to mine a matching salt.
Good for
- Scaffold a Uniswap v4 hook that charges dynamic swap fees
- Create an oracle hook compatible with a v3-style pool interface
- Generate a limit order hook for a Uniswap v4 pool
- Choose which permission flags a MEV protection hook needs
- Produce Solidity for a hook with role-based admin access
V4 hook generator FAQ
What does V4 hook generator need to run?
It calls the OpenZeppelin Contracts Wizard generate_hook MCP tool, so that MCP server must be available. It lists Read, Glob, Grep, WebFetch and Bash as allowed tools.
Does V4 hook generator write the generated contract to my project?
No. The MCP tool returns Solidity as a string, and the agent must write it to disk itself.
What should I run after generating a hook?
The skill tells the agent to apply the v4-security-foundations skill to audit permissions, delta accounting and access control before any deployment.
Why must permissions be set before deployment?
Enabled permissions are encoded as bits in the hook's deployed address, so the address must match at deployment and cannot be changed afterward.
How do I install V4 hook generator in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/v4-hook-generator to use it in all your projects, or to .claude/skills/v4-hook-generator in one project. Or install the uniswap-hooks plugin, which includes it: /plugin marketplace add Uniswap/uniswap-ai, then /plugin install uniswap-hooks@uniswap-ai.
Does V4 hook generator run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use V4 hook generator?
Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.
What are the best alternatives to V4 hook generator?
The closest alternatives to V4 hook generator are V4 security foundations, Permissioned pools deployer, V4 SDK integration, Writing hooks and Permissioned pools configurator.
Where this comes from
- Description: from the skill's own SKILL.md.
More from Uniswap/uniswap-ai

Guides your agent through configuring Uniswap CCA token auction contract parameters
- Open source
- 236 GitHub stars
- Finance and payments

Guides an agent through deploying Uniswap CCA auction contracts via the factory
- Open source
- 236 GitHub stars
- Developer tools

Plans Uniswap liquidity positions and generates pre-filled position deep links
- Open source
- 236 GitHub stars
- Finance and payments

Plans token swaps on Uniswap across chains and builds pre-filled swap links
- Open source
- 236 GitHub stars
- Finance and payments

Security checklists and vulnerability patterns for building Uniswap v4 hooks safely
- Open source
- 236 GitHub stars
- Developer tools

Collects and validates Uniswap v4 permissioned pool parameters into a deploy-ready JSON
- Open source
- 236 GitHub stars
- Developer tools


