> ## 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

> Build frontend Solana applications with Phantom Connect SDK and Helius infrastructure. Covers React, React Native, and browser SDK integration, transaction signing, token gating, NFT minting, payments, and secure frontend architecture.

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](/agents/mcp) based on what you ask — no manual tool selection needed.

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

## 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](/agents/mcp). 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](/agents/claude-code-plugin), 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:

<Steps>
  <Step title="Clone the repository">
    ```bash theme={"system"}
    git clone https://github.com/helius-labs/core-ai.git
    cd core-ai/helius-skills/helius-phantom
    ```
  </Step>

  <Step title="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
  </Step>

  <Step title="Install the Helius MCP server">
    ```bash theme={"system"}
    claude mcp add helius npx helius-mcp@latest
    ```
  </Step>

  <Step title="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](/agents/cli) or use the autonomous signup flow via [MCP tools](/agents/mcp).
  </Step>
</Steps>

## 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](/agents/skills/overview#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

<CardGroup cols={2}>
  <Card title="Helius MCP" icon="plug" href="/agents/mcp">
    The MCP server that powers this skill's tools
  </Card>

  <Card title="Claude Code Plugin" icon="puzzle-piece" href="/agents/claude-code-plugin">
    One-click install of MCP + skills
  </Card>

  <Card title="Build Skill" icon="hammer" href="/agents/skills/build">
    General Solana development with Helius
  </Card>

  <Card title="GitHub" icon="github" href="https://github.com/helius-labs/core-ai">
    Source code and issue tracking
  </Card>
</CardGroup>
