> For the complete documentation index, see [llms.txt](https://gotts.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gotts.gitbook.io/docs/skills/skills/07-skills-development.md).

# Development Skills

> **Directory**: `packages/safe/skills/` | **Prerequisites**: [02-architecture.md](/docs/skills/skills/02-architecture.md)
>
> Skills for V4 hook building, integration design, and auditing.

***

## Development Skills

These skills help developers build on top of Uniswap.

***

#### E1. `build-hook`

**Purpose:** Design and build a Uniswap V4 hook. Generates Solidity code, Foundry tests, and deployment scripts.

**MCP Tools Used:** `get_supported_chains` (via hook-builder). Primarily code generation, minimal on-chain reads.

**Slash Command:** `/build-hook`

**Frontmatter:**

```yaml
---
description: >-
  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.
allowed-tools: >-
  Read, Write, Edit, Glob, Grep,
  Bash(forge:*), Bash(npm:*), Bash(git:*),
  Task(subagent_type:hook-builder),
  mcp__uniswap__get_supported_chains
model: opus
---
```

**Activation Triggers:**

* "Build a V4 hook"
* "Create a limit order hook"
* "Dynamic fee hook"
* "TWAMM hook"
* "Custom hook for V4"

**Parameters Extracted:**

| Parameter     | Required | Example                                 |
| ------------- | -------- | --------------------------------------- |
| `behavior`    | Yes      | "limit orders", "dynamic fees", "TWAMM" |
| `callbacks`   | No       | Specific callbacks if known             |
| `constraints` | No       | Gas budget, specific requirements       |

**Workflow:**

```
1. DELEGATE TO HOOK-BUILDER
   - Agent designs hook architecture
   - Determines required callbacks and flags
   - Generates Solidity contract
   - Generates Foundry tests
   - Mines CREATE2 address
   - Produces deployment script

2. FORMAT RESULT
   - Hook contract file (written to project)
   - Test file (written to project)
   - Deployment script (written to project)
   - Architecture explanation
   - Gas estimates per callback
   - Next steps for deployment
```

***

#### E2. `design-hook`

**Purpose:** Design a V4 hook architecture without generating code. For planning and architecture review.

**Slash Command:** `/design-hook`

**Frontmatter:**

```yaml
---
description: >-
  Design a Uniswap V4 hook architecture without code generation. Use when user
  wants to plan a hook, understand which callbacks to use, or review an
  architecture before building. Returns a design document, not code.
allowed-tools: >-
  Read, Glob, Grep,
  Task(subagent_type:hook-builder),
  mcp__uniswap__get_supported_chains
model: opus
---
```

**Activation Triggers:**

* "Design a hook for..."
* "What callbacks do I need for..."
* "Hook architecture for..."
* "Plan a V4 hook"

**Workflow:** Delegates to `hook-builder` with design-only mode (no code generation).

***

#### E3. `design-integration`

**Purpose:** Design a Uniswap integration architecture for any project. Recommends integration methods, SDKs, patterns, and produces a blueprint.

**Slash Command:** `/design-integration`

**Frontmatter:**

```yaml
---
description: >-
  Design a Uniswap integration architecture. Use when user is building a
  project that needs to integrate Uniswap and wants recommendations on
  integration method (Trading API vs SDK vs direct contract), architecture
  patterns, required dependencies, and security considerations.
allowed-tools: >-
  Read, Write, Edit, Glob, Grep,
  Task(subagent_type:integration-architect),
  mcp__uniswap__get_supported_chains
model: opus
---
```

**Activation Triggers:**

* "Help me integrate Uniswap"
* "Design a swap integration"
* "Architecture for a DEX aggregator"
* "How to build an arbitrage bot"
* "Uniswap integration plan"

**Parameters Extracted:**

| Parameter       | Required | Example                                   |
| --------------- | -------- | ----------------------------------------- |
| `projectType`   | Yes      | "DeFi dashboard", "arb bot", "wallet app" |
| `functionality` | Yes      | "swap", "LP", "both", "custom"            |
| `environment`   | No       | "frontend", "backend", "smart contract"   |
| `chains`        | No       | Single or multi-chain                     |

**Workflow:**

```
1. DELEGATE TO INTEGRATION-ARCHITECT
   - Agent understands project, recommends integration method
   - Designs architecture, identifies dependencies
   - Performs security review

2. FORMAT RESULT
   - Integration method recommendation with rationale
   - Architecture diagram (text-based)
   - Component specifications
   - Dependency list with versions
   - Security considerations
   - Implementation order
```

***

#### E4. `audit-integration`

**Purpose:** Review an existing Uniswap integration for correctness, security, and best practices.

**Slash Command:** `/audit-integration`

**Frontmatter:**

```yaml
---
description: >-
  Audit an existing Uniswap integration. Use when user wants a review of their
  Uniswap integration code for correctness, security vulnerabilities, and
  adherence to best practices. Checks for common pitfalls like stale quotes,
  missing approvals, and incorrect slippage handling.
allowed-tools: >-
  Read, Glob, Grep,
  Task(subagent_type:integration-architect)
model: opus
---
```

**Activation Triggers:**

* "Review my Uniswap integration"
* "Audit this swap code"
* "Is my integration correct?"
* "Check for vulnerabilities in my Uniswap code"

**Workflow:** Delegates to `integration-architect` in audit mode. Reads existing code and produces a review report.

***

#### E5. `test-hook`

**Purpose:** Deploy a V4 hook to the local testnet and run automated test scenarios to validate its behavior. Rapid iteration loop: modify hook, re-deploy, re-test.

**MCP Tools Used:** `setup_local_testnet`, `deploy_mock_pool`, `execute_swap`, `add_liquidity`, `remove_liquidity`, `collect_fees` (via hook-builder)

**Slash Command:** `/test-hook`

**Frontmatter:**

```yaml
---
description: >-
  Test a Uniswap V4 hook on a local testnet. Deploys the hook, creates a pool
  with the hook attached, runs automated test scenarios (swaps, LP, fee
  collection, edge cases), and shows the hook's effect on each operation.
  Requires a running local testnet (setup-local-testnet).
allowed-tools: >-
  Read, Glob, Grep, Bash,
  Task(subagent_type:hook-builder),
  mcp__uniswap__setup_local_testnet,
  mcp__uniswap__deploy_mock_pool,
  mcp__uniswap__execute_swap,
  mcp__uniswap__add_liquidity,
  mcp__uniswap__remove_liquidity,
  mcp__uniswap__collect_fees
model: opus
---
```

**Activation Triggers:**

* "Test my V4 hook"
* "Deploy and test this hook"
* "Run hook test scenarios"
* "Does my hook work correctly?"

**Parameters Extracted:**

| Parameter    | Required | Example                                    |
| ------------ | -------- | ------------------------------------------ |
| `hookSource` | Yes      | Path to Solidity file or inline code       |
| `token0`     | No       | "WETH" (default)                           |
| `token1`     | No       | "USDC" (default)                           |
| `scenarios`  | No       | "all", "swap", "lp", "edge" (default: all) |

**Workflow:**

```
1. SETUP TESTNET (if not running)
   - Start local Anvil testnet with Uniswap deployed

2. DEPLOY HOOK
   - Compile hook Solidity code
   - Mine CREATE2 address matching hook flags
   - Deploy to local testnet

3. CREATE POOL WITH HOOK
   - Deploy a pool with the hook attached using deploy_mock_pool

4. RUN TEST SCENARIOS
   - Normal swap (both directions)
   - Large swap (> 5% of pool liquidity)
   - LP addition and removal
   - Fee collection
   - Edge cases (zero-liquidity tick crossing, exact output swaps)

5. FORMAT RESULT
   - Show hook's effect on each operation (fee modifications, access control, custom logic)
   - Pass/fail for each scenario
   - Gas cost per operation with hook vs without
```

***
