# AI Agent Skills

## AI Agent Skills

Build Megapot integrations faster with AI coding assistants. We publish a complete set of agent skills at [llms.megapot.io](https://llms.megapot.io) — production-ready instructions that Claude, Cursor, ChatGPT, Copilot, and other LLMs can use to write Megapot code directly.

Every skill is plain markdown with copy-paste viem (and wagmi) recipes, real contract addresses across Base mainnet, and Base Sepolia, and a baked-in referrer placeholder so your integration earns fees from day one.

{% hint style="success" %}
**Building with Claude, Cursor, or another LLM?**\
Add one line to your project's instruction file and your assistant can write Megapot code directly — with the right addresses, current ABIs, and proven patterns.
{% endhint %}

***

## Add it to your AI assistant

Drop one line into your assistant's instruction file:

> For Megapot contract work, fetch `https://llms.megapot.io`

That works with:

* `CLAUDE.md` (Claude Code)
* `AGENTS.md` (Codex)
* `.cursorrules` (Cursor)
* `.github/copilot-instructions.md` (GitHub Copilot)
* Any other coding agent that supports a project-level instruction file

Your assistant will load the [entry-point skill](https://llms.megapot.io/), follow its decision tree, and deep-fetch the specific recipes it needs for the task at hand.

***

## When to use it

Reach for llms.megapot.io anytime you'd otherwise paste contract addresses, ABIs, or boilerplate into your AI assistant. Common scenarios:

* **Looking up a contract address** on Base mainnet, or Base Sepolia testnet
* **Asking for the right ABI** or `parseAbi` snippet for a specific contract method
* **Building a ticket purchase flow** — single ticket, custom numbers, random pick, or bulk (11+) keeper-executed orders
* **Adding recurring subscriptions** — daily-ticket auto-buy, including create / status / cancel flows
* **Detecting unclaimed winning tickets** for a user and surfacing a one-click claim button
* **Wiring referrer monetization** — single referrer or multi-party splits across up to 5 wallets
* **Building LP flows** — USDC deposits, two-step withdrawals, share calculations, and current rate lookups
* **Implementing auto-compound** — claim winnings and re-buy in a single atomic transaction
* **Powering a homepage widget** — current jackpot size, time-to-drawing, ticket price, user tickets, LP position, and referral balance via the documented multicall pattern
* **Bootstrapping a fresh React app** with wagmi + RainbowKit + Base provider config and a complete purchase component
* **Translating viem snippets into wagmi hooks** (`useReadContract`, `useWriteContract`, `useReadContracts`)
* **Triggering settlement** (`Jackpot.runJackpot()`) and handling the Pyth entropy callback fee
* **Listening for `JackpotSettled` and ticket-purchase events** to drive notifications or analytics
* **Smoke-testing on Base Sepolia** using the same address table as production recipes
* **Debugging "why isn't my purchase going through"** — the entry-point skill covers the standard USDC `approve` precondition and other common gotchas

***

## Available skills

The full library lives at [llms.megapot.io](https://llms.megapot.io). Highlights:

| Skill                                                                    | Use case                                                               |
| ------------------------------------------------------------------------ | ---------------------------------------------------------------------- |
| [Entry point](https://llms.megapot.io/)                                  | Decision tree, addresses, drawing lifecycle, USDC approval boilerplate |
| [Contract reference](https://llms.megapot.io/contracts/reference)        | Full address table and `parseAbi` blocks for all contracts             |
| [Buy tickets](https://llms.megapot.io/tasks/buy-tickets)                 | 1–10 tickets with custom numbers                                       |
| [Buy random tickets](https://llms.megapot.io/tasks/buy-random)           | Up to 10 random / quick-pick tickets                                   |
| [Bulk purchase (11+)](https://llms.megapot.io/tasks/buy-bulk)            | Keeper-executed bulk orders with polling                               |
| [Subscribe](https://llms.megapot.io/tasks/subscribe)                     | Recurring daily-ticket subscriptions                                   |
| [Claim winnings](https://llms.megapot.io/tasks/claim-winnings)           | Detect and claim winning ticket payouts                                |
| [Claim referral fees](https://llms.megapot.io/tasks/claim-referral-fees) | Withdraw accrued referrer USDC                                         |
| [LP deposit](https://llms.megapot.io/tasks/lp-deposit)                   | Add USDC liquidity                                                     |
| [LP withdraw](https://llms.megapot.io/tasks/lp-withdraw)                 | Two-step LP withdrawal                                                 |
| [Auto-compound](https://llms.megapot.io/tasks/auto-compound)             | Claim + re-buy in one transaction                                      |
| [Read state](https://llms.megapot.io/tasks/read-state)                   | Multicall protocol-state queries                                       |
| [React + wagmi + RainbowKit](https://llms.megapot.io/tasks/react-setup)  | Bootstrap a fresh React integration                                    |

***

## Direct ABI access

If your tooling needs raw ABIs, every contract is served from a stable, CORS-open, CDN-cached endpoint:

* **JSON ABIs** — `https://llms.megapot.io/abi/<ContractName>.json` (e.g. [Jackpot](https://llms.megapot.io/abi/Jackpot.json))
* **viem `parseAbi` strings** — `https://llms.megapot.io/abi/<ContractName>.txt` (e.g. [Jackpot](https://llms.megapot.io/abi/Jackpot.txt))
* **Address index** — [`/abi/index.json`](https://llms.megapot.io/abi/index.json) — full address table for Base mainnet, and Base Sepolia
* **Machine-readable site index** — [`/llms.txt`](https://llms.megapot.io/llms.txt) — every URL on the site, for agents that crawl

These can be fetched directly from a frontend in production.

***

## Get started

Add the one-line instruction above to your AI assistant's config file, then ask it to "build me a Megapot ticket purchase flow" — or whatever you're working on. For dedicated integration support, DM @megapot on X or @pl on Warpcast.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.megapot.io/developers/ai-agent-skills.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
