ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 3/5

build-hook

Build a Uniswap V4 hook. Use when user wants to create a custom V4 hook contract. Generates Solidity code, Foundry tests, mines CREATE2 address for hook flags, and produces deployment scripts. Handles the full hook development lifecycle.

Why use this skill?

Use the build-hook skill to generate Uniswap V4 hook contracts, Foundry tests, and deployment scripts automatically. Simplify your DeFi development lifecycle.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/wpank/build-hook
Or

What This Skill Does

The build-hook skill provides an end-to-end development lifecycle management for Uniswap V4 hook developers. It serves as a sophisticated interface to the hook-builder sub-agent, which is specifically trained in V4 architecture and Solidity best practices. Upon activation, the skill parses high-level requirements—such as custom fee structures, order types, or oracle integrations—and translates them into functional, production-ready code. It handles the complex engineering tasks of selecting the correct hook flag bitmasks, generating robust Foundry unit/integration tests, and automating the address generation process using CREATE2 to satisfy pool key requirements. This eliminates the boilerplate and manual errors typically associated with hook deployment and security auditing, providing a seamless workflow from concept to implementation.

Installation

To integrate this capability into your OpenClaw environment, execute the following command in your terminal:

clawhub install openclaw/skills/skills/wpank/build-hook

Ensure your local Foundry environment is initialized, as the skill relies on standard Foundry project structures (e.g., src/, test/, and script/ directories) to write its generated artifacts.

Use Cases

This skill is ideal for DeFi developers and researchers looking to prototype or productionize Uniswap V4 extensions. Common use cases include: implementing custom dynamic fee tiers based on market volatility, creating on-chain limit order mechanisms that trigger during specific swap events, building TWAMM (Time-Weighted Average Market Maker) modules to mitigate sandwich attacks, or integrating external oracle price feeds (e.g., Chainlink or Pyth) to restrict swap conditions. It is also highly effective for teams requiring rapid iteration of experimental AMM logic.

Example Prompts

  1. "Build a V4 hook that implements a dynamic fee mechanism which increases transaction costs during high volatility periods."
  2. "I need a TWAMM hook for Uniswap V4 that handles long-term orders over multiple blocks; please include comprehensive gas usage tests."
  3. "Create a custom limit order hook for V4, ensuring that the necessary callbacks are set and the address is pre-mined using CREATE2."

Tips & Limitations

When using this skill, be as specific as possible regarding your constraints; providing gas budget requirements early in the prompt allows the sub-agent to optimize the implementation logic. Always verify generated code with a formal security audit before deploying to mainnet, as hooks have broad permissions over PoolManager state. Note that the skill creates files directly in your directory; ensure you have a clean git state before running the generation to easily compare the outputs.

Metadata

Author@wpank
Stars919
Views2
Updated2026-02-12
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-wpank-build-hook": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#solidity#defi#smart-contracts#uniswap#blockchain
Safety Score: 3/5

Flags: file-write, file-read, code-execution