# Viem integration

> Viem integration is an open-source agent skill for developer tools. Guides an agent through reading chain data and sending transactions with viem. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/Uniswap/uniswap-ai/tree/main/packages/plugins/uniswap-viem/skills/viem-integration
- **Repository:** https://github.com/uniswap/uniswap-ai
- **GitHub stars:** 236
- **License:** MIT
- **Skill name:** viem-integration
- **Collection:** https://github.com/Uniswap/uniswap-ai
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill gives an AI coding agent working knowledge of viem, a TypeScript library for talking to EVM blockchains. It explains which client to build for a Node.js script versus a React or Next.js frontend, and when to reach for wagmi hooks instead. It covers public and wallet clients, http, webSocket and custom transports, and how chains are imported from viem/chains.

The instructions set safety rules for generated code: addresses are validated with isAddress, private keys are read from environment variables rather than hardcoded, RPC URLs must use https or wss, and contract writes are simulated before they are sent. Reference files cover client setup, reading data, writing transactions, accounts and keys, ABI and multicall patterns, and wagmi React usage.

The skill expects a TypeScript or JavaScript project where viem can be installed with npm. It also lists a related Uniswap trading plugin for swap-specific work.

## When your agent uses it

> Integrate EVM blockchains using viem. Use when user says "read blockchain data", "send transaction", "interact with smart contract", "connect to Ethereum", "use viem", "use wagmi", "wallet integration", "viem setup", or mentions blockchain/EVM development with TypeScript.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/Uniswap/uniswap-ai/tree/HEAD/packages/plugins/uniswap-viem/skills/viem-integration)
- [Asks for: Read, Write, Edit, Glob, Grep, Bash(npm:*), Bash(npx:*), WebFetch…](https://github.com/Uniswap/uniswap-ai/blob/HEAD/packages/plugins/uniswap-viem/skills/viem-integration/SKILL.md)
- [License: MIT](https://github.com/Uniswap/uniswap-ai/tree/HEAD/packages/plugins/uniswap-viem/skills/viem-integration)

## Features

- **Client and transport selection:** Explains when to use public clients, wallet clients, and http, webSocket or custom transports.
- **Contract read and write patterns:** Shows how to read contract state, simulate calls, and send contract writes with confirmation.
- **Input validation rules:** Sets checks for addresses, chain IDs, private keys and RPC URLs before code is generated.
- **Wagmi React guidance:** Points to wagmi hooks for React and Next.js frontends that need wallet integration.
- **Unit and address utilities:** Covers converting ether and token units, checksumming addresses and computing keccak256 hashes.
- **Typed error handling:** Shows how to catch viem's contract execution and insufficient funds errors.

## Good for

- Read an ERC-20 token balance from Ethereum mainnet
- Send ETH from a script using a private key in an environment variable
- Call a smart contract's read function from a Node.js backend
- Add wallet connect and transaction hooks to a Next.js app
- Subscribe to contract events over a websocket connection

## Install

### Claude Code

This skill ships in the `uniswap-viem` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add Uniswap/uniswap-ai
/plugin install uniswap-viem@uniswap-ai
```

Or copy only this skill to `~/.claude/skills/viem-integration`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/viem-integration &&
cp -R "$tmp/packages/plugins/uniswap-viem/skills/viem-integration" ~/.claude/skills/viem-integration &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/viem-integration` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/viem-integration` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/viem-integration &&
cp -R "$tmp/packages/plugins/uniswap-viem/skills/viem-integration" ~/.agents/skills/viem-integration &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/viem-integration` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/viem-integration` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/viem-integration &&
cp -R "$tmp/packages/plugins/uniswap-viem/skills/viem-integration" ~/.cursor/skills/viem-integration &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/viem-integration` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/Uniswap/uniswap-ai.git --path packages/plugins/uniswap-viem/skills/viem-integration
```

Or copy the folder to `~/.gemini/skills/viem-integration` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/viem-integration`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/viem-integration &&
cp -R "$tmp/packages/plugins/uniswap-viem/skills/viem-integration" ~/.copilot/skills/viem-integration &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/viem-integration` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/Uniswap/uniswap-ai.git
```

Then copy `uniswap-ai/packages/plugins/uniswap-viem/skills/viem-integration` into your agent's skills folder as `viem-integration`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Which clients does Viem integration need?

It is built around viem and includes wagmi guidance for React apps, installed with npm.

### Does Viem integration handle private keys?

It instructs the agent to read private keys from process.env.PRIVATE_KEY with runtime validation and never to hardcode them.

### Does Viem integration run any scripts?

No scripts are bundled; it provides instructions and code examples only.

### How do I install Viem integration in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/viem-integration to use it in all your projects, or to .claude/skills/viem-integration in one project. Or install the uniswap-viem plugin, which includes it: /plugin marketplace add Uniswap/uniswap-ai, then /plugin install uniswap-viem@uniswap-ai.

### Does Viem integration 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 Viem integration?

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 Viem integration?

The closest alternatives to Viem integration are V4 SDK integration, V development, React frontend, Lp integration and Vitest skill.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [V4 SDK integration](https://ai-powered.com/skills/v4-sdk-integration): V4 SDK integration is an open-source agent skill for developer tools.
- [V development](https://ai-powered.com/skills/v-development): V development is an open-source agent skill for developer tools.
- [React frontend](https://ai-powered.com/skills/react-frontend): React frontend is an open-source agent skill for developer tools.
- [Lp integration](https://ai-powered.com/skills/lp-integration): Lp integration is an open-source agent skill for developer tools.
- [Vitest skill](https://ai-powered.com/skills/vitest-skill): Vitest skill is an open-source agent skill for developer tools.
- [Vue](https://ai-powered.com/skills/vue): Vue is an open-source agent skill for developer tools.
- [Vike](https://ai-powered.com/skills/vike): Vike is an open-source agent skill for developer tools.
- [Frontend engineering edho ferdian](https://ai-powered.com/skills/frontend-engineering-edho-ferdian): Frontend engineering edho ferdian is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/viem-integration
