agentleFS
sendaifunsendaifun/solana-new/skills/launch/deploy-to-mainnet/SKILL.md

deploy-to-mainnet

Skill178 starsChanged 4 months agoMITView on GitHub

Guide 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.

  • Sends data out

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. About 0 are common, 13 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈13

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If TEL_PROMPTED is no: Before starting the skill workflow, ask the user about telemetry.

    line 26
  2. Distinctive:

    If A: run this bash:

    line 36
  3. Distinctive:

    If B: run this bash:

    line 43
  4. Very specific:

    Check for .superstack/build-context.md.

    line 62
  5. Distinctive:

    Run through references/deployment-checklist.md item by item.

    line 63
  6. Distinctive:

    If deploying a program, follow references/program-upgrade-guide.md.

    line 65
  7. Distinctive:

    Write a deployment report HTML artifact.

    line 66
  8. Very specific:

    Update .superstack/build-context.md with deployment status.

    line 67
  9. Very specific:

    If .superstack/build-context.md exists, check build status and warn if tests aren't passing or devnet hasn't been tested.

    line 71
  10. Distinctive:

    Never block on missing context files: Ask the user directly instead.

    line 75
  11. Distinctive:

    Ask "Have you tested on devnet?" — if no, recommend it but don't refuse to proceed.

    line 76
  12. Distinctive:

    Never deploy with a devnet RPC URL.

    line 77
  13. Distinctive:

    Always check that private keys are not committed to git before deployment.

    line 78
  14. Distinctive:

    Always verify the deployment on-chain after it completes.

    line 79
  15. Distinctive:

    If the project has a program, discuss upgrade authority management before deploying.

    line 80
  16. Distinctive:

    Which RPC for mainnet?: NEVER use public RPC for deployment.

    line 129
  17. Distinctive:

    Upgrade authority: Keep for first 3 months. Transfer to Squads multisig when stable.

    line 130
  18. Very specific:

    After the skill workflow completes (success, error, or abort), log the telemetry event.

    line 137

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Preamble (run first)

_TEL_TIER=$(cat ~/.superstack/config.json 2>/dev/null | grep -o '"telemetryTier": *"[^"]*"' | head -1 | sed 's/.*"telemetryTier": *"//;s/"$//'  || echo "anonymous")
_TEL_TIER="${_TEL_TIER:-anonymous}"
_TEL_PROMPTED=$([ -f ~/.superstack/.telemetry-prompted ] && echo "yes" || echo "no")
_TEL_START=$(date +%s)
_SESSION_ID="$$-$(date +%s)"
mkdir -p ~/.superstack
echo "TELEMETRY: $_TEL_TIER"
echo "TEL_PROMPTED: $_TEL_PROMPTED"
if [ "$_TEL_TIER" != "off" ]; then
_TEL_EVENT='{"skill":"deploy-to-mainnet","phase":"launch","event":"started","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}' 
echo "$_TEL_EVENT" >> ~/.superstack/telemetry.jsonl 2>/dev/null || true
_CONVEX_URL=$(cat ~/.superstack/config.json 2>/dev/null | grep -o '"convexUrl":"[^"]*"' | head -1 | cut -d'"' -f4 || echo "")
[ -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 &
true
fi

If TEL_PROMPTED is no: Before starting the skill workflow, ask the user about telemetry. Use AskUserQuestion:

Help superstack get better! We track which skills get used and how long they take — no code, no file paths, no PII. Change anytime in ~/.superstack/config.json.

Options:

  • A) Sure, help superstack improve (anonymous)
  • B) No thanks

If A: run this bash:

echo '{"telemetryTier":"anonymous"}' > ~/.superstack/config.json
_TEL_TIER="anonymous"
touch ~/.superstack/.telemetry-prompted

If B: run this bash:

echo '{"telemetryTier":"off"}' > ~/.superstack/config.json
_TEL_TIER="off"
touch ~/.superstack/.telemetry-prompted

This only happens once. If TEL_PROMPTED is yes, skip this entirely and proceed to the skill workflow.

Wrong skill? See SKILL_ROUTER.md for all available skills.

Deploy to Mainnet

Overview

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.

Workflow

  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.
  2. Run through references/deployment-checklist.md item by item.
  3. Help configure production RPC using references/rpc-provider-guide.md.
  4. If deploying a program, follow references/program-upgrade-guide.md.
  5. Write a deployment report HTML artifact.
  6. Update .superstack/build-context.md with deployment status.

Prior Context (Optional — never block on this)

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.

Non-Negotiables

  • Never block on missing context files. Ask the user directly instead.
  • Ask "Have you tested on devnet?" — if no, recommend it but don't refuse to proceed.
  • Never deploy with a devnet RPC URL. Verify the endpoint.
  • Always check that private keys are not committed to git before deployment.
  • Always verify the deployment on-chain after it completes.
  • If the project has a program, discuss upgrade authority management before deploying.

Phase Handoff

This skill is Phase 3 (Launch) in the Idea → Build → Launch journey.

Reads: .superstack/build-context.md (from Phase 2) Writes/Updates: .superstack/build-context.md (creates if missing) with:

  • build_status.mainnet_deployed: true
  • build_status.mainnet_program_id: string (if applicable)
  • build_status.deployment_date: ISO timestamp
  • build_status.rpc_provider: string

See ../../../data/specs/phase-handoff.md for the full JSON contract.

Resources

Writing Tone

  • ../tone-guide.md — Default tone for deployment reports and status updates.

references/

  • references/deployment-checklist.md
  • references/rpc-provider-guide.md
  • references/program-upgrade-guide.md

Quick Start

# Full deploy runbook: see ../../data/guides/deploy-runbook.md

# Quick version:
anchor build
solana config set --url "https://mainnet.helius-rpc.com/?api-key=YOUR_KEY"
solana balance  # Need ~5 SOL

# Pre-flight
grep -rn "devnet" src/ app/ --include="*.ts" --include="*.rs" | grep -v test  # Should be 0 results
sha256sum target/deploy/my_program.so  # Save build hash

# Deploy
anchor deploy --provider.cluster mainnet-beta

# Verify
solana program show <PROGRAM_ID>

Decision Points

  • Which RPC for mainnet? NEVER use public RPC for deployment. Helius paid tier minimum.
  • Upgrade authority: Keep for first 3 months. Transfer to Squads multisig when stable. Freeze only when fully audited.
  • Invariant-critical program? If the program protects high-value assets or has non-trivial conservation / authorization / state-machine / CPI-correctness properties, ask whether those invariants are machine-checked before mainnet. Route to the community skill qedgen-formal-verification for spec-driven Lean proofs + Kani + proptests. Testing alone is not sufficient evidence for these property classes.
  • Full checklist: See ../../data/guides/deploy-runbook.md for complete pre-flight + post-deploy verification.
  • Wallet strategy: See ../../data/guides/rpc-wallet-guide.md — dedicated mainnet keypair, never reuse devnet key.

Telemetry (run last)

After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the outcome from the workflow result: success if completed normally, error if it failed, abort if the user interrupted.

Run this bash:

_TEL_END=$(date +%s)
_TEL_DUR=$(( _TEL_END - ${_TEL_START:-$_TEL_END} ))
_TEL_TIER=$(cat ~/.superstack/config.json 2>/dev/null | grep -o '"telemetryTier": *"[^"]*"' | head -1 | sed 's/.*"telemetryTier": *"//;s/"$//' || echo "anonymous")
if [ "$_TEL_TIER" != "off" ]; then
echo '{"skill":"deploy-to-mainnet","phase":"launch","event":"completed","outcome":"OUTCOME","duration_s":"'"$_TEL_DUR"'","session":"'"$_SESSION_ID"'","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","platform":"'$(uname -s)-$(uname -m)'"}' >> ~/.superstack/telemetry.jsonl 2>/dev/null || true
true
fi

Replace OUTCOME with success/error/abort based on the workflow result.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.