> ## Documentation Index
> Fetch the complete documentation index at: https://www.helius.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Phantom Skill

> Expert skill for building frontend Solana apps with the Phantom Connect SDK and Helius — wallet integration, transaction signing, token gating, and payments.

The **Phantom** skill makes your AI assistant an expert at building frontend Solana applications. It combines [Phantom Connect SDK](https://phantom.com) — React, React Native, and vanilla JS wallet integration — with Helius infrastructure for transaction submission, fee optimization, asset queries, and real-time updates.

When installed, the AI automatically reads the right reference files and calls the right [MCP tools](https://www.helius.dev/docs/agents/mcp.md) based on what you ask — no manual tool selection needed.

> [!NOTE]
>
> **Claude Code:** `/helius:phantom` (via [plugin](https://www.helius.dev/docs/agents/claude-code-plugin.md)) or auto-invoked (standalone). **Codex:** `$helius-phantom` (auto-discovered from `.agents/skills/`). **API / Cursor / ChatGPT:** Use the pre-built [system prompt variants](https://www.helius.dev/docs/agents/skills/overview.md#using-skills-across-platforms).

## What It Covers

The Phantom skill routes the AI across both Phantom SDKs and Helius tools:

| Domain | Reference Files | MCP Tools Used |
| - | - | - |
| **Wallet Connection — React** | `react-sdk.md` | — |
| **Wallet Connection — Browser** | `browser-sdk.md` | — |
| **Wallet Connection — React Native** | `react-native-sdk.md` | — |
| **Transactions** | `transactions.md`, `helius-sender.md` | `getPriorityFeeEstimate`, `getSenderInfo` |
| **Token Gating** | `token-gating.md`, `helius-das.md` | `getAssetsByOwner`, `searchAssets`, `getAsset` |
| **NFT Minting** | `nft-minting.md`, `helius-sender.md` | `getAsset`, `getPriorityFeeEstimate` |
| **Crypto Payments** | `payments.md`, `helius-enhanced-transactions.md` | `parseTransactions`, `getPriorityFeeEstimate` |
| **Frontend Security** | `frontend-security.md` | — |
| **Portfolio Display** | `helius-das.md`, `helius-wallet-api.md` | `getAssetsByOwner`, `getWalletBalances`, `getTokenBalances` |
| **Real-Time Updates** | `helius-websockets.md` | `transactionSubscribe`, `accountSubscribe` |
| **Transaction History** | `helius-enhanced-transactions.md` | `parseTransactions`, `getTransactionHistory` |
| **Integration Patterns** | `integration-patterns.md` | Multiple (pattern-dependent) |

## Key Rules

The Phantom skill enforces critical patterns that prevent common frontend mistakes:

* **Always use `@phantom/react-sdk`** for React (never `window.phantom.solana` or `@solana/wallet-adapter-react`)
* **Always use `@phantom/browser-sdk`** for vanilla JS and **`@phantom/react-native-sdk`** for React Native
* **Never expose Helius API keys in client code** — only `https://sender.helius-rpc.com/fast` is browser-safe without an API key
* **Proxy everything else through your backend** — never open Helius WebSockets directly from the browser
* **Always submit transactions via Helius Sender** with `skipPreflight: true`, `maxRetries: 0`, and a Jito tip
* **Use `getPriorityFeeEstimate`** MCP tool — never hardcode priority fees

## Composite Patterns

The skill provides five end-to-end reference patterns for complex applications:

1. **Swap UI** — Aggregator → Phantom sign → Helius Sender submit
2. **Portfolio Viewer** — Phantom connection → backend proxy → DAS/Wallet API
3. **Real-time Dashboard** — Phantom connection → server WebSocket → client relay
4. **Token Transfer** — Build VersionedTransaction → Phantom sign → Sender submit
5. **NFT Gallery** — Phantom wallet → backend DAS query → display NFTs

## Prerequisites

This skill requires the [Helius MCP server](https://www.helius.dev/docs/agents/mcp.md). For embedded wallets (Google/Apple sign-in), you also need a [Phantom Portal](https://phantom.com/portal) account with an App ID and allowlisted redirect URLs.

If you install via the [Claude Code plugin](https://www.helius.dev/docs/agents/claude-code-plugin.md), the MCP server starts automatically. For standalone installation, add it manually:

```bash theme={"system"}
claude mcp add helius npx helius-mcp@latest
```

## Standalone Installation

If you want the Phantom skill without the full plugin, install it directly:

**1. Clone the repository**

```bash theme={"system"}
git clone https://github.com/helius-labs/core-ai.git
cd core-ai/helius-skills/helius-phantom
```

**2. Run the install script**

```bash theme={"system"}
./install.sh
```

This installs the skill and its reference files to `~/.claude/skills/helius-phantom/`.

**Options:**

* `./install.sh --project` — install to the current project (`.claude/skills/helius-phantom/`)
* `./install.sh --path /custom/path` — install to a custom directory

**3. Install the Helius MCP server**

```bash theme={"system"}
claude mcp add helius npx helius-mcp@latest
```

**4. Set your API key**

```bash theme={"system"}
export HELIUS_API_KEY=YOUR_API_KEY
```

Or use the `setHeliusApiKey` MCP tool inside Claude Code. If you need a new account, see [Helius CLI](https://www.helius.dev/docs/agents/cli.md) or use the autonomous signup flow via [MCP tools](https://www.helius.dev/docs/agents/mcp.md).

## Example Prompts

Once installed, ask in plain English:

* "Build a swap UI with Phantom wallet"
* "Build a portfolio viewer that shows tokens after connecting Phantom"
* "How do I proxy my Helius API key in Next.js?"
* "Build a real-time dashboard with wallet connection"
* "Add token gating to my React app using Phantom"
* "Build an NFT minting page with Phantom and Metaplex Core"

The AI picks the right tools and reads the right reference files automatically.

## What's Included

The skill installs two components:

* **`SKILL.md`** — Routing logic, rules, and expert context that guide the AI's behavior
* **`prompts/`** — Pre-built system prompt variants (`openai.developer.md`, `claude.system.md`, `full.md`) — see [platform setup](https://www.helius.dev/docs/agents/skills/overview.md#using-skills-across-platforms)
* **`references/`** — 16 deep documentation files:
  * `react-sdk.md` — Phantom React SDK (`@phantom/react-sdk`)
  * `browser-sdk.md` — Phantom Browser SDK (`@phantom/browser-sdk`)
  * `react-native-sdk.md` — Phantom React Native SDK (`@phantom/react-native-sdk`)
  * `transactions.md` — Transaction signing patterns
  * `token-gating.md` — Token-gated access control
  * `nft-minting.md` — NFT minting with Phantom
  * `payments.md` — Crypto payment flows
  * `frontend-security.md` — API key proxying and CORS
  * `integration-patterns.md` — End-to-end composite patterns
  * `helius-das.md` — DAS API reference
  * `helius-sender.md` — Sender reference
  * `helius-priority-fees.md` — Priority fee reference
  * `helius-wallet-api.md` — Wallet API reference
  * `helius-websockets.md` — WebSocket reference
  * `helius-enhanced-transactions.md` — Enhanced Transactions reference
  * `helius-onboarding.md` — Account setup reference

## Learn More

> [card] [Helius MCP](https://www.helius.dev/docs/agents/mcp.md)
>
> The MCP server that powers this skill's tools

> [card] [Claude Code Plugin](https://www.helius.dev/docs/agents/claude-code-plugin.md)
>
> One-click install of MCP + skills

> [card] [Build Skill](https://www.helius.dev/docs/agents/skills/build.md)
>
> General Solana development with Helius

> [card] [GitHub](https://github.com/helius-labs/core-ai)
>
> Source code and issue tracking


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.