$npx -y skills add sendaifun/solana-new --skill deploy-to-mainnetGuide a Solana project from devnet to mainnet production deployment. Use when a user says "deploy to mainnet", "go to production", "deployment checklist", "prepare for launch", "mainnet deployment", or "ship it". Reads build-context.md from a prior build phase if available.
| 1 | ## Preamble (run first) |
| 2 | |
| 3 | ```bash |
| 4 | _TEL_TIER=$(cat ~/.superstack/config.json 2>/dev/null | grep -o '"telemetryTier": *"[^"]*"' | head -1 | sed 's/.*"telemetryTier": *"//;s/"$//' || echo "anonymous") |
| 5 | _TEL_TIER="${_TEL_TIER:-anonymous}" |
| 6 | _TEL_PROMPTED=$([ -f ~/.superstack/.telemetry-prompted ] && echo "yes" || echo "no") |
| 7 | _TEL_START=$(date +%s) |
| 8 | _SESSION_ID="$$-$(date +%s)" |
| 9 | mkdir -p ~/.superstack |
| 10 | echo "TELEMETRY: $_TEL_TIER" |
| 11 | echo "TEL_PROMPTED: $_TEL_PROMPTED" |
| 12 | if [ "$_TEL_TIER" != "off" ]; then |
| 13 | _TEL_EVENT='{"skill":"deploy-to-mainnet","phase":"launch","event":"started","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}' |
| 14 | echo "$_TEL_EVENT" >> ~/.superstack/telemetry.jsonl 2>/dev/null || true |
| 15 | _CONVEX_URL=$(cat ~/.superstack/config.json 2>/dev/null | grep -o '"convexUrl":"[^"]*"' | head -1 | cut -d'"' -f4 || echo "") |
| 16 | [ -n "$_CONVEX_URL" ] && curl -s -X POST "$_CONVEX_URL/api/mutation" -H "Content-Type: application/json" -d '{"path":"telemetry:track","args":{"skill":"deploy-to-mainnet","phase":"launch","status":"success","version":"0.2.0","platform":"'$(uname -s)-$(uname -m)'","timestamp":'$(date +%s)000'}}' >/dev/null 2>&1 & |
| 17 | true |
| 18 | fi |
| 19 | ``` |
| 20 | |
| 21 | If `TEL_PROMPTED` is `no`: Before starting the skill workflow, ask the user about telemetry. |
| 22 | Use AskUserQuestion: |
| 23 | |
| 24 | > Help superstack get better! We track which skills get used and how long they take — |
| 25 | > no code, no file paths, no PII. Change anytime in `~/.superstack/config.json`. |
| 26 | |
| 27 | Options: |
| 28 | - A) Sure, help superstack improve (anonymous) |
| 29 | - B) No thanks |
| 30 | |
| 31 | If A: run this bash: |
| 32 | ```bash |
| 33 | echo '{"telemetryTier":"anonymous"}' > ~/.superstack/config.json |
| 34 | _TEL_TIER="anonymous" |
| 35 | touch ~/.superstack/.telemetry-prompted |
| 36 | ``` |
| 37 | |
| 38 | If B: run this bash: |
| 39 | ```bash |
| 40 | echo '{"telemetryTier":"off"}' > ~/.superstack/config.json |
| 41 | _TEL_TIER="off" |
| 42 | touch ~/.superstack/.telemetry-prompted |
| 43 | ``` |
| 44 | |
| 45 | This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely and proceed to the skill workflow. |
| 46 | |
| 47 | > **Wrong skill?** See [SKILL_ROUTER.md](../../SKILL_ROUTER.md) for all available skills. |
| 48 | |
| 49 | # Deploy to Mainnet |
| 50 | |
| 51 | ## Overview |
| 52 | |
| 53 | Take a devnet-tested Solana project and prepare it for mainnet deployment. Run through a structured pre-flight checklist, configure production infrastructure, and execute the deployment with proper verification. |
| 54 | |
| 55 | ## Workflow |
| 56 | |
| 57 | 1. Check for `.superstack/build-context.md`. If found, verify the build status (tests passing, devnet deployed). If not, ask the user about their current state. |
| 58 | 2. Run through [references/deployment-checklist.md](references/deployment-checklist.md) item by item. |
| 59 | 3. Help configure production RPC using [references/rpc-provider-guide.md](references/rpc-provider-guide.md). |
| 60 | 4. If deploying a program, follow [references/program-upgrade-guide.md](references/program-upgrade-guide.md). |
| 61 | 5. Write a deployment report HTML artifact. |
| 62 | 6. Update `.superstack/build-context.md` with deployment status. |
| 63 | |
| 64 | ## Prior Context (Optional — never block on this) |
| 65 | |
| 66 | If `.superstack/build-context.md` exists, check build status and warn if tests aren't passing or devnet hasn't been tested. If it doesn't exist, **proceed immediately** — ask the user: "Have you tested on devnet?" and go from there. |
| 67 | |
| 68 | ## Non-Negotiables |
| 69 | |
| 70 | - **Never block on missing context files.** Ask the user directly instead. |
| 71 | - Ask "Have you tested on devnet?" — if no, recommend it but don't refuse to proceed. |
| 72 | - Never deploy with a devnet RPC URL. Verify the endpoint. |
| 73 | - Always check that private keys are not committed to git before deployment. |
| 74 | - Always verify the deployment on-chain after it completes. |
| 75 | - If the project has a program, discuss upgrade authority management before deploying. |
| 76 | |
| 77 | ## Phase Handoff |
| 78 | |
| 79 | This skill is **Phase 3 (Launch)** in the Idea → Build → Launch journey. |
| 80 | |
| 81 | **Reads**: `.superstack/build-context.md` (from Phase 2) |
| 82 | **Writes/Updates**: `.superstack/build-context.md` (creates if missing) with: |
| 83 | - `build_status.mainnet_deployed`: true |
| 84 | - `build_status.mainnet_program_id`: string (if applicable) |
| 85 | - `build_status.deployment_date`: ISO timestamp |
| 86 | - `build_status.rpc_provider`: string |
| 87 | |
| 88 | See `../../../data/specs/phase-handoff.md` for the full JSON contract. |
| 89 | |
| 90 | ## Resources |
| 91 | |
| 92 | ### Writing Tone |
| 93 | - [../tone-guide.md](../tone-guide.md) — Default tone for deployment reports and status updates. |
| 94 | |
| 95 | ### references/ |
| 96 | |
| 97 | - [references/deployment-checklist.md](references/deployment-checklist.md) |
| 98 | - [references/rpc-provider-guide.md](references/rpc-provider-guide.md) |
| 99 | - [references/program-upgrade-guide.md](references/program-upgrade-guide.md) |
| 100 | |
| 101 | ## Quick Start |
| 102 | |
| 103 | ```bash |
| 104 | # Full deploy runbook: see ../../data/guides/deploy-runbook.md |
| 105 | |
| 106 | # Quick version: |
| 107 | anchor build |
| 108 | solana config set --url "https://mainnet.helius-rpc.com/?api-key=YOUR_KEY" |
| 109 | solana balance # Need ~5 S |